Commit Graph

1263 Commits

Author SHA1 Message Date
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
regis@google.com 06115b867c Allow await in assert (fix issue 22728).
Add regression test.

R=iposva@google.com

Review URL: https://codereview.chromium.org//991373003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44388 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-10 22:44:52 +00:00
hausner@google.com 15f91a1979 Suspend after async generator terminates
Suspend the async generator after it closes the stream. If there
are outstanding requests to schedule the generator, this ensures
that no portions of the generator body get executed again.

R=regis@google.com

Review URL: https://codereview.chromium.org//990363002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44352 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-09 23:25:01 +00:00
hausner@google.com 0505673560 Fix async getter with => syntax
Fixes issue 22632.

Also adding test cases and compile-time error for arrow style getters that are marked as generators (sync* or async*).

R=iposva@google.com

Review URL: https://codereview.chromium.org//996443002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44345 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-09 20:56:38 +00:00
regis@google.com 438d13fc9e Allow direct access to type parameters from factory (issue 22700).
Add regression test.
Fix wrong test and update status files.

Review URL: https://codereview.chromium.org//985203002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44339 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-09 19:39:17 +00:00
koda@google.com d73d6de73d Support enum keys in maps in messages.
Make enum classes implement hashCode, rather than use the identity hash code, so that they can be portably serialized.

BUG=dart:21675
R=asiva@google.com, lrn@google.com

Review URL: https://codereview.chromium.org//752123003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44278 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-06 02:57:34 +00:00
regis@google.com c502cb8371 Fix more async machinery (issue 22579 and possibly more to be triaged).
Add regression test.

R=hausner@google.com

Review URL: https://codereview.chromium.org//977243002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44250 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-05 00:42:17 +00:00
hausner@google.com 8873c9962a Fix issue 22633
Put saved try context variables in the right scope when the try
statement has a label.

Added new test.

R=regis@google.com

Review URL: https://codereview.chromium.org//977993002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44246 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-04 20:52:48 +00:00
fschneider@google.com d0ca8036a2 Fix VM bug with super-constructor invocation and mixins.
When using mixins, the constructor of a super-class was incorrectly
invoked twice if the super() call was not at the end of the initializer
list.

When generating the super constructor call in an implicit constructor, pass
along the phase parameter that comes in instead of invoking all phases.

BUG=dartbug.com/22604
TEST=tests/language/constructor_with_mixin_test.dart
R=hausner@google.com

Review URL: https://codereview.chromium.org//973843005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44242 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-04 18:02:40 +00:00
regis@google.com 17f01a0489 Fix more async machinery (capture return value when necessary, issue 22620).
Review URL: https://codereview.chromium.org//981433002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44216 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-04 02:08:52 +00:00
regis@google.com 5cb782b7fb Fix async machinery for finally clauses (issues 22445, 22300).
R=hausner@google.com

Review URL: https://codereview.chromium.org//974073002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44210 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-03 23:55:18 +00:00
regis@google.com 8618df1864 One more fix to async machinery (rethrow in finally, issue 22595).
R=hausner@google.com

Review URL: https://codereview.chromium.org//973103002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44189 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-03 18:34:01 +00:00
hausner@google.com 9a6ed9a718 Implement async* functions in VM
R=iposva@google.com

Review URL: https://codereview.chromium.org//944893005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44185 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-03 17:49:53 +00:00
regis@google.com a9e03a9166 More fixes in async machinery (issue 22438 and maybe more).
Add a regression test.

R=hausner@google.com

Review URL: https://codereview.chromium.org//969903002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44153 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-02 23:09:01 +00:00
regis@google.com 0036014d8a Fix async machinery (issue 22445 and possibly others to be triaged later).
R=hausner@google.com, iposva@google.com

Review URL: https://codereview.chromium.org//958243003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44107 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-27 22:19:47 +00:00
regis@google.com afd4864b0e Save exception and stack trace variables in async catch clauses and use them
in rethrow statements (fix issue 22523).

R=hausner@google.com

Review URL: https://codereview.chromium.org//956583003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44001 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-24 22:05:35 +00:00