Commit Graph

1263 Commits

Author SHA1 Message Date
Srdjan Mitrovic dd5410209f Added {Zone}GrowableHandlePtrArray types: simplifies code, makes code safer
BUG=
R=regis@google.com

Review URL: https://codereview.chromium.org//1312833009 .
2015-08-31 09:24:00 -07:00
Srdjan Mitrovic d732b68b8c oneee# Enter a description of the change.
Collect interfaces without GrowableObjectArray

Concat to symbol without temporary String creation

BUG=
R=koda@google.com

Review URL: https://codereview.chromium.org//1311693003 .
2015-08-28 08:24:17 -07:00
Regis Crelier e6225bee44 Improve async code in VM by not unnecessarily capturing parameters of async and
sync closures, thereby avoiding copy of parameters on entry.
Remove variable aliases in local scopes now that another mechanism detects
use-before-define cases. Keep aliases only for captured variables of outer
functions thereby speeding up scope lookups for all Dart code (not just async).
The next step will be to try to reduce the number of captured variables in
async code.

R=hausner@google.com

Review URL: https://codereview.chromium.org//1317213003 .
2015-08-27 16:49:07 -07:00
Srdjan Mitrovic f857c1ba8e Remove more GrowableObjectArray usage in parser
Allocate appropriate data structures in old space from beginning

BUG=
R=koda@google.com

Review URL: https://codereview.chromium.org//1316373002 .
2015-08-27 13:46:32 -07:00
Matthias Hausner 62e9d05668 Introduce per-isolate cache for compile time constants
Compile-time constant values are maintained in a cache, keyed
by script and token position. When the same code is compiled
again later, e.g. by the optimizing compiler, the value is
found in the cache and does not need to be computed again.

In this version, the key is a string concatenated from the
script url and the token position. That’s probably more overhead
than we want.

Added two compiler stat counters for number of cached constants
and number of cache hits. Running dart2js to compile a hello world
program results in about 1400 cached values and 85 cache hits.

BUG=
R=srdjan@google.com

Review URL: https://codereview.chromium.org//1308073005 .
2015-08-26 16:17:20 -07:00
Regis Crelier a799659bcf Use correct scope to lookup saved async context variable.
Stop inserting aliases in all intermediary scopes for explicitly captured
variables.
Use proper lookup function in async code to access async completer variable.
Add asserts verifying async variables existence.

R=hausner@google.com

Review URL: https://codereview.chromium.org//1314993002 .
2015-08-25 15:46:17 -07:00
Srdjan Mitrovic 5985718945 Clean up default parameter computation in parser
BUG=
R=hausner@google.com

Review URL: https://codereview.chromium.org//1316763002 .
2015-08-25 14:54:48 -07:00
Srdjan Mitrovic 304dc3486f Make default_parameter_values a ZoneGrowableArray instead of an array in new space
BUG=
R=hausner@google.com

Review URL: https://codereview.chromium.org//1307943008 .
2015-08-24 17:22:44 -07:00
Regis Crelier 8b825b3f73 Simplify and improve canonicalization of signature types.
R=srdjan@google.com

Review URL: https://codereview.chromium.org//1311773006 .
2015-08-24 14:53:33 -07:00
Srdjan Mitrovic fcea0077cc Minor cleanup in preparation for removal of allocation in new space, and removal of an 'optimization'
BUG=
R=hausner@google.com

Review URL: https://codereview.chromium.org//1310383002 .
2015-08-24 13:40:32 -07:00
Regis Crelier 26031ab6b0 Avoid numerous type allocations by caching the canonical type of a class, which
is used as the receiver type for non-static methods of this class, be it a
generic, non-generic, or signature class.

R=srdjan@google.com

Review URL: https://codereview.chromium.org//1309613002 .
2015-08-21 13:37:07 -07:00
Srdjan Mitrovic 2b6219fd5a Addressed review comments from previous CLs; adding more Symbols::FromConcat
BUG=
R=hausner@google.com

Review URL: https://codereview.chromium.org//1308013002 .
2015-08-21 11:16:30 -07:00
Florian Schneider c05f1f9448 VM: Link native calls lazily.
The first invocation of a native functions goes into LinkNativeCall which
determines the final entry point and patches the object pool entry.

When running precompiled code, this makes deserializing the object
pool entries for native functions easy, they all initially point to
a single entry (LinkNativeCall).

BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org//1294113004 .
2015-08-21 11:37:50 +02:00
Srdjan Mitrovic 14be219d84 GrowableObjectArray -> GrowableArray for parsing type arguments
BUG=
R=hausner@google.com

Review URL: https://codereview.chromium.org//1309523002 .
2015-08-20 15:54:46 -07:00
Srdjan Mitrovic 4280716656 Remove new space allocation in optimizing compiler, use Symbols::FromConcat where appropriate
BUG=
R=hausner@google.com

Review URL: https://codereview.chromium.org//1303923002 .
2015-08-20 15:13:06 -07:00
Daniel Andersson 00ef260503 Enable concurrent optimization test after migrating scopes to Thread*
Also move static call target table allocation into old space.

Note that stats are not thread-safe, so running two compilers concurrently may lead to inaccurate stats.

BUG=https://github.com/dart-lang/sdk/issues/24109

Review URL: https://codereview.chromium.org//1291803009 .
2015-08-19 15:16:47 -07:00
Srdjan Mitrovic 5dedcf9d28 Reuse canonicalized type for receiver type if class is not signature class and has no type parameters.
BUG=
R=hausner@google.com

Review URL: https://codereview.chromium.org//1284093004 .
2015-08-19 10:57:36 -07:00
Regis Crelier 6d6a6a49b6 Clean up code capturing variables explicitly.
R=hausner@google.com

Review URL: https://codereview.chromium.org//1284103008 .
2015-08-17 16:09:42 -07:00
Daniel Andersson 76ff397c1c Migrate LongJumpScope to Thread.
This was one of the blockers for concurrent compilation (issue 24109).

BUG=
R=srdjan@google.com

Review URL: https://codereview.chromium.org//1299653003 .
2015-08-17 13:29:17 -07:00
Florian Loitsch debf1d6f7c Don't zone-register async callbacks for every await call in the VM.
This has the nice side-effect that the stack_trace package provides nicer chains.
Fixes issue 23394.

R=hausner@google.com

Committed: https://github.com/dart-lang/sdk/commit/4dae43d63727268f2e0cc45d6020246eb49177b8
Reverted: https://github.com/dart-lang/sdk/commit/cb4f9fc925c5a92c6cf756751e38296383f66507

Review URL: https://codereview.chromium.org//1274133002 .
2015-08-17 19:26:50 +02:00
Florian Loitsch cb4f9fc925 Revert "Don't zone-register async callbacks for every await call in the VM."
This reverts commit 4dae43d637.

Review URL: https://codereview.chromium.org//1296973002 .
2015-08-17 16:43:35 +02:00
Florian Loitsch 4dae43d637 Don't zone-register async callbacks for every await call in the VM.
This has the nice side-effect that the stack_trace package provides nicer chains.
Fixes issue 23394.

R=hausner@google.com

Review URL: https://codereview.chromium.org//1274133002 .
2015-08-17 15:58:19 +02:00
Daniel Andersson bc149bf2f5 Migrate most uses of StackZone(Isolate*) to Thread*.
Also migrate some HANDLESCOPE uses.
This prepares for concurrent compilation.

BUG=
R=asiva@google.com

Review URL: https://codereview.chromium.org//1285293004 .
2015-08-13 13:11:30 -07:00
Siva Annamalai 228e0877a7 Use Object::null_instance and Object::null_function and do not create Handles everytime.
BUG=
R=hausner@google.com

Review URL: https://codereview.chromium.org//1289813005 .
2015-08-13 10:57:18 -07:00
Florian Loitsch f2d08149fd Don't delay values and errors from async/await functions.
Fixes issue 23497.

R=hausner@google.com

Review URL: https://codereview.chromium.org//1287673002 .
2015-08-13 13:00:11 +02:00
Matthias Hausner fc55f38aaf Fix ??= AST modification.
BUG=23988
R=srdjan@google.com

Review URL: https://codereview.chromium.org//1273033007 .
2015-08-11 13:13:56 -07:00
Daniel Andersson ecccff2566 Refactor VMTagScope to Thread* rather than Isolate*.
Prepares for per-thread vm tags, but only changes the interface for now.

BUG=
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org//1284713003 .
2015-08-10 10:43:30 -07:00
Matthias Hausner 55b7315d83 Make constructor closure functions invisible on the stack
Matches implicit closures and method extractor functions.

BUG=

Review URL: https://codereview.chromium.org//1282633002 .
2015-08-07 16:56:50 -07:00
Srdjan Mitrovic 8cee9ac89d Change heuristic to determine which fields contain modifieable double boxes: do it if field was initialized with a double constant. Fix a parser bug
BUG=
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org//1278003002 .
2015-08-07 09:16:02 -07:00
Ryan Macnak b34267d0d7 Replace is_synthetic bit on Fields with is_reflectable. Mark private fields of dart:* as non-reflectable.
This fixes an inconsistency in mirrors where some classes in dart:* would claim to have a field but throw NSM if one attempts to access it, and prevents accessing private static fields of dart:* that don't have implicit getters or setters.

R=asiva@google.com

Review URL: https://codereview.chromium.org//1280713002 .
2015-08-06 16:48:01 -07:00
Matthias Hausner 223e5a6bb5 Adapt C?.m to latest spec version
BUG=23794
R=srdjan@google.com

Review URL: https://codereview.chromium.org//1269413005 .
2015-08-05 15:41:31 -07:00
Matthias Hausner 1426ac4f77 Reuse constructor closures
Previously created constructor closures now get
reused when the parent function is recompiled.

BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org//1271343003 .
2015-08-05 11:07:52 -07:00
Matthias Hausner 90adbb2968 Fix constructor closures in checked mode
The parameters of constructor closures must be dynamic.
The Spec says so, and it’s necessary. The formal type
of constructor parameters may not be valid in the context
of the closure function, e.g. if it is a type parameter.

BUG=
R=regis@google.com

Review URL: https://codereview.chromium.org//1269783004 .
2015-08-04 12:36:13 -07:00
Ryan Macnak 5ea1f9eb39 Initial tree-shaking for precompilation: only selective compilation, no removal of unused Functions/Classes.
hello world 23.1 -> 8.1 MB heap

R=fschneider@google.com

Review URL: https://codereview.chromium.org//1259123009 .
2015-08-04 11:35:36 -07:00
Matthias Hausner 4ebab25d8f Implement constructor closures
One detail that isn't implemented yet is canonicalization of constructor tear-offs. At the moment, two tear-offs of the same constructor result in closures that are not equal.

BUG=
R=regis@google.com

Review URL: https://codereview.chromium.org//1255063005 .
2015-08-03 15:50:46 -07:00
Srdjan Mitrovic 1a1ff00a29 Use zone when allocating handles in FlowGraphCompiler assembling operations. Add profiling VM tags for parse and flow graph builder, active only when --profile_vm. Lazily generate IR constant_value handles.
BUG=
R=regis@google.com

Review URL: https://codereview.chromium.org//1263573010 .
2015-08-03 10:10:24 -07:00
Ryan Macnak 8a3e134502 Non-tree-shaking --precompile.
R=srdjan@google.com

Review URL: https://codereview.chromium.org//1261673004 .
2015-07-30 15:29:19 -07:00
Ryan Macnak ea65b867d3 Fix bad assert in constant evaluation.
R=regis@google.com

Review URL: https://codereview.chromium.org//1243263003 .
2015-07-22 14:25:04 -07:00
Matthias Hausner f1da09741d Implement tear-off closure operator #
BUG=
R=fschneider@google.com

Review URL: https://codereview.chromium.org//1234883005 .
2015-07-22 12:50:36 -07:00
Daniel Andersson 700bd54362 Remove more uses of Isolate::current_zone.
The most substantial change is in Parser and ParsedFunction, which now cache their calling thread. (A similar change was tried unsuccessfully in the past, but can now be safely implemented thanks to the ThreadRegistry state saving.)

Only remaining users are the Object::Handle(Isolate*, [...]) methods. Then, this deprecated interface will be removed.

BUG=
R=asiva@google.com

Review URL: https://codereview.chromium.org//1242343002 .
2015-07-21 09:37:23 -07:00
Regis Crelier 15de03e2d5 Allow super calls in mixins (for now behind a --supermixin flag).
As a consequence, allow a mixin application alias as a mixin, even if it does
not extend Object.
Add new tests.
Fix an existing test.
Update status files.

Fixes #23771

R=hausner@google.com

Review URL: https://codereview.chromium.org//1232613005 .
2015-07-17 11:32:23 -07:00
Ryan Macnak 83b2b7125b Create only one closure for the body of an async* function.
Helps implementation of async step.

R=hausner@google.com

Review URL: https://codereview.chromium.org//1236943003 .
2015-07-13 13:26:23 -07:00
Srdjan Mitrovic 04fa456a88 Fix prefix errors with --noopt
BUG=

Review URL: https://codereview.chromium.org//1227123004 .
2015-07-10 13:28:46 -07:00
Srdjan Mitrovic 1eac96c5ba Fix deferred error reporting.
BUG=
R=hausner@google.com

Review URL: https://codereview.chromium.org//1230173003 .
2015-07-10 11:31:37 -07:00
Srdjan Mitrovic d503d2f0ed Added full deferred loading semantic to precompiled/--noopt/eager-loading code (some corner cases, e.g., compile-time errors for constants, still missing)
BUG=
R=hausner@google.com

Review URL: https://codereview.chromium.org//1211273011 .
2015-07-09 10:56:55 -07:00
Ryan Macnak 40fcf4a72d Handle field-invocation and method-extraction in the runtime when --lazy_dispatchers=false.
R=fschneider@google.com

Review URL: https://codereview.chromium.org//1195573006.
2015-06-30 15:14:35 -07:00
Matthias Hausner ce917c5160 Redirection type of a redirecting factory can be deferred
BUG=23408
R=regis@google.com

Review URL: https://codereview.chromium.org//1219023002.
2015-06-30 14:57:07 -07:00
Matthias Hausner e5f339b861 Yield in non-generator function is compile-time error
BUG=23710
R=srdjan@google.com

Review URL: https://codereview.chromium.org//1204103002.
2015-06-25 10:40:25 -07:00
Matthias Hausner 84be183a32 Library prefixes used to be invisible. The newest spec treats them as objects, but it's a compile-time error to do most anything with them.
This change brings the VM in compliance with the current spec.

BUG=23612
R=iposva@google.com

Review URL: https://codereview.chromium.org//1201523002.
2015-06-22 13:01:29 -07:00
Matthias Hausner 0535e37619 Implement ?? ??= and ?. operators
BUG=23455
R=srdjan@google.com

Review URL: https://codereview.chromium.org//1180903002.
2015-06-18 11:05:16 -07:00