Commit Graph

15405 Commits

Author SHA1 Message Date
fschneider@google.com 4d1182d43d Migrate {Closure,Instance,Static}Call to use location-based code generation templates.
Calls that have all arguments pushed on the stack can share a common location-summary.
For the (non-optimizing) flow-graph compiler this means:
1. Nothing to do for the inputs.
2. The result is in fixed register RAX.
Review URL: https://chromiumcodereview.appspot.com//10407077

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7833 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-22 00:01:15 +00:00
fschneider@google.com a2e40a1dae Avoid redundant pop/push before Throw/ReThrow in the flow-graph compiler.
Since the runtime call expects its arguments on the stack, we
can just push them in the same way we do in other places.

The current code already assumes that the arguments are pushed in
the correct order.
Review URL: https://chromiumcodereview.appspot.com//10408048

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7831 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-21 23:19:55 +00:00
regis@google.com 8f45ccddc1 Add flag to measure impact of type check elimination.
Review URL: https://chromiumcodereview.appspot.com//10407074

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7826 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-21 22:21:12 +00:00
asiva@google.com 2a25dbda09 Fix some dart api functions to use the proper unwrap patterns.
Review URL: https://chromiumcodereview.appspot.com//10411038

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7824 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-21 21:41:49 +00:00
regis@google.com b3c4682a81 Remove compile-time error for unresolved factory names (issue 3079).
Add test.
Review URL: https://chromiumcodereview.appspot.com//10332276

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7822 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-21 20:42:34 +00:00
vegorov@google.com 7f95f43a76 Introduce locations based code generation.
Instructions and computations switched to the new code generation scheme should implement two virtual functions:

- locs() should return pointer to a LocationSummary object, that specifies location constraints for the instruction/computation.

- EmitNativeCode() should emit instructions/computations native code using locations provided through LocationSummary object attached to the instruction.

For converted functions instruction pattern should be removed from the FlowGraphCompiler visitor. It will not be used as long as instruction/computation returns non-NULL from locs().

Review URL: https://chromiumcodereview.appspot.com//10382234

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7818 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-21 19:51:17 +00:00
fschneider@google.com 13c3beec30 Make saving and restoring of the context around closure calls explicit.
This is a first step to refactor the codegen-templates to be reused
between optimizing and non-optimizing backend.

The context is now explicitly saved in a temporary local variable and
not passed as an argument to the ClosureCall instruction anymore.
Review URL: https://chromiumcodereview.appspot.com//10409043

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7811 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-21 17:59:02 +00:00
srdjan@google.com a8ff0d8bbd Hopefully fixing Windows warnings: fix array member initialization of EmbeddedArray.
Review URL: https://chromiumcodereview.appspot.com//10392182

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7808 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-21 17:37:03 +00:00
floitsch@google.com cc15d26cf7 Reapply "Add support for timezone offset and timezone name."
This reapplies commit 7800.

Review URL: https://chromiumcodereview.appspot.com//10417009

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7805 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-21 16:11:20 +00:00
floitsch@google.com 77ade89e4a Revert "Add support for timezone offset and timezone name."
This reverts commit 7803.

Review URL: https://chromiumcodereview.appspot.com//10416008

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7804 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-21 15:13:46 +00:00
floitsch@google.com 618c649c33 Reapply "Add support for timezone offset and timezone name."
This reapplies commit 7800.
Original CL: https://chromiumcodereview.appspot.com/10383218/

Don't write *foo += x.

Review URL: https://chromiumcodereview.appspot.com//10413031

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7803 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-21 15:07:11 +00:00
floitsch@google.com 5b99866ecd Revert "Add support for timezone offset and timezone name."
This reverts commit 7801..

Review URL: https://chromiumcodereview.appspot.com//10399106

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7802 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-21 14:40:27 +00:00
floitsch@google.com 36d9c69461 Add support for timezone offset and timezone name.
Review URL: https://chromiumcodereview.appspot.com//10383218

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7801 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-21 14:36:43 +00:00
sgjesse@google.com 2571ceeca8 Make standalone Dart VM run on Windows XP
Use the function WSAAddressToString for converting an IP address to a string
instead of inet_ntop. WSAAddressToString is available on Windows XP.

R=ager@google.com

BUG=dart:2559
TEST=tests\standalone\io\socket_info_test.dart

Review URL: https://chromiumcodereview.appspot.com//10409051

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7797 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-21 13:31:01 +00:00
ager@google.com 4883bce0ae Remove reference to onError from file API docs.
onError was removed when transitioning to futures.

R=sgjesse@google.com
BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com//10387212

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7792 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-21 11:00:05 +00:00
ager@google.com a47410bbed Reland: Add more API fuzzing and fix the issues encountered.
Only change from original code review is the closing of files
opened in the test.

- Fixed integer checks in a couple of places.
- Added closed checks to async operations.

More changes like this coming but I'm splitting the work up to not
make the review too large.

R=sgjesse@google.com
BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com//10414021

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7790 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-21 10:52:01 +00:00
regis@google.com 6fb0a9b281 Default parameter values are now allowed in interface methods and in abstract
methods, but not in function type aliases.
Made a negative test positive.
Disabled erroneous co19 tests (new co19 issue 123).
Review URL: https://chromiumcodereview.appspot.com//10392175

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7782 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-18 23:59:59 +00:00
asiva@google.com c483079e45 Remove the special stub code region as we don't need it anymore. With the new frame layout convention we can find the first dart frame quickly.
Review URL: https://chromiumcodereview.appspot.com//10409038

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7778 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-18 23:28:34 +00:00
asiva@google.com 88ca1a6cac Remove script source from the snapshot in order to reduce the size and to make the image size smaller. When the source for a script is needed we regenerate the source (a close approximation).
The size of the core isolate snapshot (corelibs, builtin, io etc.) prior to
this change is 1438238 bytes and after the change it is 769026 bytes.
The CorelibIsolateStartup times goes from 5389 microseconds to 4843 microseconds.
Review URL: https://chromiumcodereview.appspot.com//10414005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7774 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-18 22:27:06 +00:00
srdjan@google.com d016f51e9c Start porting fast typechecks to x64.
Review URL: https://chromiumcodereview.appspot.com//10407018

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7760 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-18 20:10:29 +00:00
gram@google.com 45d0e6e824 URI encoder/decoder - copied from other repo. This is the same code already reviewed but the other repo is not allowing me to commit so trying again.
See  Issue 10310080: Added uriEncode/uriEncodeComponent/uriDecode/uriDecodeComponent functions.
Review URL: https://chromiumcodereview.appspot.com//10399077

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7758 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-18 18:39:18 +00:00
turnidge@google.com 76d4586dea Revert my last change.
Review URL: https://chromiumcodereview.appspot.com//10332257

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7757 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-18 18:35:04 +00:00
turnidge@google.com 6a8c82db83 Implement spawnUri from dart:isolate. This function allows us to
launch an isolate running a different script.  Finally.

Reviewers: This isn't as hard to review as it looks.  Dive right in!

Siggi: Take a look at my test status file changes and make sure I'm
excluding the right stuff.

Much of the churn in the CL comes from moving ownership of the
import_map.  It used to be set per-library and is now set per-isolate.
This caused a lot of superficial diffs.

DART EMBEDDING API CHANGES:

- Dart_IsolateCreateCallback now takes a script_uri and main argument
  instead of a name_prefix argument.  The script_uri argument allows
  the callback to launch different scripts.  The main argument is used
  in creating the isolate debug name.

- Dart_CreateIsolate now takes script_uri and main arguments.  These
  are used to build the isolate's debug name.

- Dart_LibraryTagHandler, Dart_LoadScript, and Dart_LoadLibrary no
  longer take an import_map.

- Added Dart_SetImportMap.

- Added Dart_RootLibrary to provide access to the root library for the
  current isolate.

OTHER STUFF

Add a couple of tests for spawnUri -- the existing tests assume that
scripts end in a .js suffix which isn't going to work out for us.

Changed how the debug name for isolates get built a bit.

Refactored bin/main.cc a bit.  Fixed some problems with error handling
while creating isolates.

Minor refactoring in builtin.dart to always pass is_windows rather
than relying on it being squirreled away.
Review URL: https://chromiumcodereview.appspot.com//10386107

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7756 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-18 18:22:10 +00:00
regis@google.com f5076a5857 Reapply this reverted change:
Implement updated method overriding rules (issue 2943).
Review URL: https://chromiumcodereview.appspot.com//10387186

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7749 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-18 16:19:39 +00:00
hausner@google.com 6fece3e398 Fix tests in language suite: eliminate String +
The language suite runs clean without String + after this change.

string_concat_test.dart is obsolete, removed.
Review URL: https://chromiumcodereview.appspot.com//10383238

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7745 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-18 15:33:05 +00:00
fschneider@google.com 055ba590a4 Add IR printing into a supplied buffer and formatted comments on x64.
This change refactors printing function for instructions
so that they can be used for different purposes like
printing to stdout (what FlowGraphPrinter currently does),
creating code comments for the disassembler, or in the future
dumping the IR into a file.

I added an abstract interface to iterate over the inputs
 of an computation: InputCount and InputAt. This is only
 an intermediate step likely to change in the future. For
 that I had to bring back the [] operator for zero-operand
 instructions.
Review URL: https://chromiumcodereview.appspot.com//10407031

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7731 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-18 01:04:56 +00:00
regis@google.com 599ab6e3ca Revert r7729 until Dartium fixes its method override errors.
Review URL: https://chromiumcodereview.appspot.com//10399080

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7730 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-18 01:04:34 +00:00
regis@google.com 2b00b92ab9 Implement updated method overriding rules (issue 2943).
Add language test.
Review URL: https://chromiumcodereview.appspot.com//10388189

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7729 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-18 00:28:57 +00:00
cshapiro@google.com 36f57531ec Reject high- and low-surrogates in escaped code points.
BUG=3097

Review URL: https://chromiumcodereview.appspot.com//10388179

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7725 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-17 22:57:00 +00:00
vegorov@google.com f999f30052 Extend assembler with ability to produce comments for the generated code.
Extend x64 disassembler with ability to decode and output recorded comments.

Example output (currently comments are emitted only by flow graph compiler at block/instruction boundaries, once instruction printing is refactored and supports printing into buffer simple "instruction" comment will be replaced with the actual IL construct):

        ;; B0
        ;; B1
        ;; instruction
0x007f0fff812525 00000055 49 bb 21 00 b4 04 10  mov    $0x7f1004b40021,%r11
0x007f0fff81252c 0000005c 7f 00 00
0x007f0fff81252f 0000005f 41 53                 push   %r11

R=srdjan@google.com

Review URL: https://chromiumcodereview.appspot.com//10407019

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7723 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-17 21:56:16 +00:00
hausner@google.com 0bad95eaaa Revert 7718
Review URL: https://chromiumcodereview.appspot.com//10377188

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7721 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-17 21:25:20 +00:00
hausner@google.com 757219f9ec Disallow string plus operator
This is a test to see what (if anything) breaks on the buildbot when
the + operator on String is removed.

Will revert if necessary.

TBR=iposva
Review URL: https://chromiumcodereview.appspot.com//10408013

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7718 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-17 21:14:33 +00:00
regis@google.com 1f233e677e Address a few TODOs related to type propagation.
Review URL: https://chromiumcodereview.appspot.com//10407026

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7716 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-17 18:47:45 +00:00
regis@google.com f3aca487fe First shot at static type propagation and type test elimination.
Review URL: https://chromiumcodereview.appspot.com//10399051

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7708 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-16 23:21:24 +00:00
fschneider@google.com 81e36bbb1c Remove an unused input operand from ExtractConstructorInstantiator.
The second input is discarded, so we don't need to pass it as input to
the computation. The explicit pop in the code generator is replaced by 
LoadValue.  This is a small step in refactoring the flowgraph-based code 
generator to be shared between multiple backends.
Review URL: https://chromiumcodereview.appspot.com//10391171

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7705 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-16 22:48:49 +00:00
srdjan@google.com eec14e4d2e Applied my comment to Kevin's CL (it did not go through in the first place).
Review URL: https://chromiumcodereview.appspot.com//10332200

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7697 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-16 17:32:20 +00:00
kmillikin@google.com e4030da968 Compute assigned variables and dominance frontiers.
During basic block discovery, compute assigned variables in each
block.  After computing immediate dominators, compute dominance
frontiers.  Both of these will be used for SSA construction.

R=fschneider@google.com,srdjan@google.com
BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com//10377104

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7685 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-16 13:28:02 +00:00
ager@google.com 330aa1ab66 Revert "Add more API fuzzing and fix the issues encountered."
I know what is wrong but don't have the time to fix it right now.
I open a lot of files that are not closed and therefore the directory
cannot be deleted on Windows. Will fix ASAP.

R=sgjesse@google.com
BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com//10398053

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7684 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-16 13:02:48 +00:00
ager@google.com ceb6a9b621 Add more API fuzzing and fix the issues encountered.
- Fixed integer checks in a couple of places.
- Added closed checks to async operations.

More changes like this coming but I'm splitting the work up to not
make the review too large.

R=sgjesse@google.com
BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com//10382194

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7683 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-16 12:52:10 +00:00
kmillikin@google.com 75e43da991 Add a global graph entry.
Ensure all blocks including exception handlers are reachable from the
entry.

R=srdjan@google.com
BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com//10399026

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7681 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-16 12:10:02 +00:00
ajohnsen@google.com 657f789b1d Correctly handle the case of a 126 bytes long message, in WebSocket frame encoding.
BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com//10388159

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7678 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-16 08:43:08 +00:00
asiva@google.com c71a8cc1ee Change dart frame and stub frame layout to include the PC of the code executing on the frame. The stack frame layout is as follows:
ret PC
  saved EBP                          <== EBP
  PC (used to locate RawInstruction) <== ESP
Review URL: https://chromiumcodereview.appspot.com//10375059

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7675 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-16 00:47:05 +00:00
srdjan@google.com f1587852f7 Move code for accessing captured variables into the IL.
Review URL: https://chromiumcodereview.appspot.com//10398046

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7674 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-16 00:35:33 +00:00
efortuna@google.com b81f7a7402 Un revert the revert
Review URL: https://chromiumcodereview.appspot.com//10386152

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7672 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-15 22:28:10 +00:00
efortuna@google.com 01b3e58e08 reverting 7668??
Not clear why this claused widespread breakage. Investigating.
Review URL: https://chromiumcodereview.appspot.com//10388154

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7671 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-15 22:21:25 +00:00
asiva@google.com 76a3cf8bb6 Fix issue with stack layout assumption going wrong when a dart function has optional parameters and the number of arguments passed in is incorrect. A call to NoSuchMethodFunction stub is made but the area reserved for the copied arguments/locals is not removed. This results in the NoSuchMethodFunction stub accessing arguments from the wrong location on the stack.
Review URL: https://chromiumcodereview.appspot.com//10383147

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7669 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-15 21:52:29 +00:00
fschneider@google.com c47128bd66 Replace long sequences of popq with a Drop(int) macro instruction.
This is for now only done on x64.
Review URL: https://chromiumcodereview.appspot.com//10383189

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7668 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-15 21:41:25 +00:00
cshapiro@google.com c99bbc8a87 Make dart_api.h C compatible.
BUG=3024

Review URL: https://chromiumcodereview.appspot.com//10381123

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7666 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-15 20:03:05 +00:00
turnidge@google.com 6448b9af52 Dart_IsSame -> Dart_IdentityEquals.
Use return value for the equality result.  Made function more
efficient by avoiding a DARTSCOPE.
Review URL: https://chromiumcodereview.appspot.com//10196003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7664 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-15 18:34:58 +00:00
hausner@google.com aecd8bc4f9 Add a check to JSON code
Addressing Anton's review comment. Also removing a leftover
debugging printf.

TBR=antonm
Review URL: https://chromiumcodereview.appspot.com//10391139

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7659 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-15 16:05:40 +00:00