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
Ryan Macnak
d42ff1052f
Add a runtime flag to control availability of dart:mirrors.
...
R=asiva@google.com
Review URL: https://codereview.chromium.org//1152833002 .
2015-06-16 10:01:44 -07:00
Ryan Macnak
bac8bc4b18
Fix accessing dart:_ libraries via exports.
...
R=hausner@google.com
Review URL: https://codereview.chromium.org//1185733003 .
2015-06-12 16:50:27 -07:00
Ivan Posva
f5e3f94019
Fix http://dartbug.com/23578 :
...
- Complete revamp of isolate-specific flags.
- Associate flags with the isolate on creation.
- Dart_CreateIsolate and associate callback do take an
extra flags argument.
- Make sure to clear IC data array when clearing code.
BUG=23578
Review URL: https://codereview.chromium.org//1162033005
2015-06-07 17:57:34 +02:00
Regis Crelier
601da25b92
Fix issue 23500
...
BUG=
R=srdjan@google.com
Review URL: https://codereview.chromium.org//1146993003
2015-05-29 13:31:16 -07:00
Regis Crelier
1761a60735
Fix restoring of async try context in catch clause (issue 23498).
...
Add regression test.
Merge branch 'master' into dart1
Fix issue 23498
BUG=
R=srdjan@google.com
Review URL: https://codereview.chromium.org//1160663004
2015-05-27 13:58:57 -07:00
Srdjan Mitrovic
ac27dc1c41
Add flag --load_deferred_eagerly
...
BUG=
R=hausner@google.com
Review URL: https://codereview.chromium.org//1154673002
2015-05-22 09:00:12 -07:00
Ryan Macnak
daf6fb6091
Ensure libraries always have at least one top-level class and therefore at least one script.
...
BUG=http://dartbug.com/23483
R=hausner@google.com
Review URL: https://codereview.chromium.org//1131793012
2015-05-19 08:58:23 -07:00
hausner@google.com
feae1f7b82
Compute accurate token count when loading from snapshot
...
With --compiler-stats, traverse heap at isolate shutdown to
find all token streams and compute the number of tokens in
the stream. This fixes incorrect token counts when loading
from snapshot.
R=asiva@google.com
Review URL: https://codereview.chromium.org//1131493007
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45806 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-15 00:11:01 +00:00
hausner@google.com
9db5059098
Fix CompilerStats info
...
Move the counters and timers into the isolate. Statically allocated data
does not work anymore now that we always have multiple isolates.
Remove unused counters, add some counters to measure size of compiled code
and meta info.
R=asiva@google.com
Review URL: https://codereview.chromium.org//1127383008
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45751 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-12 23:03:48 +00:00
hausner@google.com
ad130e2b0f
Minor cleanup for getter/setter lookup
...
Prevent a few getter/setter name mangling calls and random cleanup I came across while doing some experiments.
R=asiva@google.com
Review URL: https://codereview.chromium.org//1120223003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45544 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-05 23:42:53 +00:00
hausner@google.com
1890e567fe
Simplification in resolving classes
...
The helper functions in Parser to resolve classes in the library
and prefix scope created an unnecessary handlescope. With libraries
caching previous lookups, and with namespaces now using dictionaries,
there are just a handful (so to speak) of handles allocated for the
lookup. That does not warrant a handlescope. Removed the helper
functions.
R=asiva@google.com
Review URL: https://codereview.chromium.org//1087463005
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45399 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-24 15:45:54 +00:00
hausner@google.com
ec56ffcc1d
Minor refactoring of local name resolution
...
Not much to see here, move along please.
R=asiva@google.com
Review URL: https://codereview.chromium.org//1096383005
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45357 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-22 19:45:19 +00:00
hausner@google.com
21ca62f8bc
Properly resolve top-level setters
...
Fixes issue 4386.
When converting a getter to a setter (converting a right-hand
side expression to a left-hand side, assignable entity),
we need to know where to look for the setter function.
Top-level setters need to be resolved in the library or prefix
scope in which the getter was found.
R=regis@google.com
Review URL: https://codereview.chromium.org//1090373006
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45316 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-21 17:36:34 +00:00
hausner@google.com
a75b05bc31
Don’t search scope of top-level class twice
...
When resolving an identifier in top-level code, we don’t need
to search the class scope. That scope is searched again when
resolving the identifier in the library scope.
Sadly, the change makes no measurable difference. It’s just a drop
in the bucket.
R=regis@google.com
Review URL: https://codereview.chromium.org//1092053003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45249 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-17 18:08:12 +00:00
regis@google.com
9a2468736a
Add support for debug break in Dart source.
...
The new flag --enable-debug-break turns the otherwise illegal Dart statement
break "message";
into a break instruction preceded with a debug message, the equivalent of
emitting an Assembler::Stop("message").
Add a language test expecting a syntax error without the flag.
Change expected break instruction in arm64 simulator.
Remove constants related to now deleted simulator tracing on mips and arm64.
R=johnmccutchan@google.com , srdjan@google.com
Review URL: https://codereview.chromium.org//1087383002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45218 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-16 19:32:48 +00:00
hausner@google.com
c9400962f7
Cleanup obsolete setter code
...
Early on in Dart, it was ok to have a static getter and dynamic setter
with the same name. This is no longer the case. Remove code that handles
the obsolete case.
R=regis@google.com
Review URL: https://codereview.chromium.org//1055703005
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45122 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-13 21:23:10 +00:00
regis@google.com
23aa3d20e3
Avoid restoring the outer saved try context when inside a finally.
...
R=hausner@google.com
Review URL: https://codereview.chromium.org//1073343003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45083 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-10 23:24:05 +00:00
regis@google.com
8b73c2a3e5
Simplify restoring of saved try contexts in async code by passing around the
...
relevant variables instead of scopes and try indices.
R=hausner@google.com
Review URL: https://codereview.chromium.org//1079233002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45081 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-10 22:15:00 +00:00
hausner@google.com
eb83e6f8aa
Allocate named parameter names in old space
...
Make sure the array of names of named actual parameters remains
in old space when it grows. The array may be used as a literal
when generating code for a NSM exception, so it must be in old space.
Fixes issue 23121.
R=asiva@google.com
Review URL: https://codereview.chromium.org//1072153002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45024 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-09 18:37:42 +00:00
hausner@google.com
aa75044ff7
Fix spurious resume when awaiting future in async* code
...
Fixes issue reported in bug 23116.
The equivalent fix for dart2js contains a test case for this.
R=iposva@google.com
Review URL: https://codereview.chromium.org//1073623002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44985 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-08 22:09:20 +00:00
hausner@google.com
0b99d6dc95
Better error messages when matching parens and braces
...
Tell user where the mismatched closing paren or brace
opens.
Fix for 22820 and improvement for (previously closed) 2936
R=srdjan@google.com
Review URL: https://codereview.chromium.org//1054893003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44882 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-03 17:07:25 +00:00
koda@google.com
549c74a3da
Avoid caching thread in parser.
...
R=asiva@google.com
Review URL: https://codereview.chromium.org//1051713005
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44854 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-02 01:14:31 +00:00
hausner@google.com
f5339aaabb
Add the implicit return in the correct sequence node
...
Make sure we add the implicit return node into the sequence
node that contains the function’s code. Previously, we added
the implicit return in the outermost sequence. If the outermost
sequence is at a different context level than the sequence that
contains the function’s code, the debugger cannot access the
captured variables when stopped at the return statement.
R=regis@google.com
Review URL: https://codereview.chromium.org//1037183003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44826 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-31 22:11:06 +00:00
hausner@google.com
411a26e37e
Evaluate parameters of static calls that throw NSM
...
The spec mandates that parameters of calls get evaluated
even if the function can’t be resolved and the call results
in a noSuchMethod being thrown.
Fixes issue 17382.
R=srdjan@google.com
Review URL: https://codereview.chromium.org//1038283004
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44784 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-30 19:31:20 +00:00
hausner@google.com
dc602ae96d
Mark code when it instantiates an unloaded deferred type
...
The VM registers code objects that depend on deferred library prefixes,
e.g. when calling a function in the deferred library. We didn’t do this
when instantiating a type from the deferred library.
This is a fix for issue 22443.
R=regis@google.com
Review URL: https://codereview.chromium.org//1037343002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44757 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-27 19:39:31 +00:00
hausner@google.com
f138b4a849
Allow metadata on local functions
...
Fis issue 22126.
R=regis@google.com
Review URL: https://codereview.chromium.org//1034203003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44717 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-26 18:28:38 +00:00
hausner@google.com
0229072d4d
Evaluate expression before NSM
...
When assigning an expression to a final variable, evaluate the
expression before throwing the NoSuchMethod error.
This fixes issue 22936.
R=srdjan@google.com
Review URL: https://codereview.chromium.org//1027383004
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44700 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-25 21:45:12 +00:00
hausner@google.com
8c49660a7e
Make await for cancel the stream when breaking out of the loop
...
Wrap the await-for loop in a try-finally statement that ensures that
the stream is cancelled. Also adding the ability to the
AsyncStartStreamController class to return a cancellation future.
The cancel() call at the end of the await-for loop is not awaiting
the cancellation future yet. This is not part of the spec at this
point.
R=regis@google.com
Review URL: https://codereview.chromium.org//1014273003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44689 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-25 17:41:39 +00:00
fschneider@google.com
76f5627abd
Compile implicit closures as dispatchers instead of duplicating the original method's code.
...
This saves space in unoptimized code for implicit closures. In optimized code the
original method's code will often be inlined into the implicit closure dispatcher so that
there won't be a performance impact.
The static case just calls the original method. For implicit instance closures, the
this-parameter is loaded from the context and passed to the original method.
The coverage test is affected since the dispatcher has the original method's token position
associated with it. This means that the line with the method declaration is considered to
have executable code. Setting the token position to 0 (Scanner::kNoSourcePos) does not work
because it coincides with the first line (and first token) in the script.
R=hausner@google.com
Review URL: https://codereview.chromium.org//1024563004
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44655 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-24 09:33:36 +00:00
rmacnak@google.com
4b1de421ac
Revert "Mark async and generator functions as debuggable, so their frames are visible for return type errors during checked mode."
...
This makes it impossible to set a breakpoint inside a async or generator body.
TBR=hausner@google.com
Review URL: https://codereview.chromium.org//1025633003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44615 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-20 22:01:56 +00:00
rmacnak@google.com
406270bf8d
Mark async and generator functions as debuggable, so their frames are visible for return type errors during checked mode.
...
BUG=http://dartbug.com/22891
R=asiva@google.com
Review URL: https://codereview.chromium.org//1025783002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44614 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-20 21:50:14 +00:00
regis@google.com
3783f349dc
Be less aggressive in sharing contexts between scopes so that sibling contexts
...
cannot appear in nested node sequences (issue 22858), since this case cannot
be handled by the graph builder.
Add assert to graph builder to detect such occurences (uncovered async* bug).
Fix an async* issue where a scope was mistakenly reused.
Improve ast printing for node sequences.
Add regression test.
R=hausner@google.com , srdjan@google.com
Review URL: https://codereview.chromium.org//1020893004
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44592 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-19 22:39:46 +00:00
hausner@google.com
b88c3ee1b8
Fix await/async/yield keyword recognition
...
Fixes issue 22870.
The VM parser didn’t distinguish between await and “await”.
Added some additional symbol recognition cleanup which should speed up parsing.
R=srdjan@google.com
Review URL: https://codereview.chromium.org//1016833002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44540 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-17 17:26:58 +00:00
hausner@google.com
ada21bfda6
Fix do-while with await in condition
...
The await “preamble” code must be part of the expression,
not part of the body.
Fixes issue 22777
R=srdjan@google.com
Review URL: https://codereview.chromium.org//1012933002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44520 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-16 19:57:28 +00:00
rmacnak@google.com
e1bbc90322
Display call site data for functions.
...
- Requested with coverage data, only in function view for now.
- Adjust token position associated with ICData to correspond to the identifier instead of the open paren.
- Fix JSONifying ICs for static/constructor calls.
R=johnmccutchan@google.com
Review URL: https://codereview.chromium.org//977283002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44476 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-13 20:44:41 +00:00