Commit Graph

1278 Commits

Author SHA1 Message Date
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
regis@google.com 3caf1669dc Fix indentation of parser trace (several threads may compile at once).
R=hausner@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43885 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-19 18:54:24 +00:00
fschneider@google.com 2442d5e047 VM: Fix a bug with local variable values when breaking at a variable declaration.
This fixes the case When breaking at a declaration 'var a;'

BUG=dartbug.com/22353
R=hausner@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43882 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-19 17:11:07 +00:00
iposva@google.com db9faebe98 - Simplify collection of stack traces. If we determine that a stack
trace is needed we collect the full stack trace instead of piecing
  it together as we walk up the stack.

R=rmacnak@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43863 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-19 02:18:53 +00:00
fschneider@google.com aefdc04fa8 VM: Fix issue with local variable values reported by the debugger.
I added a function to test if a variable is visible or not to the
debugger tests.

BUG=dartbug.com/22353
TEST=standalone/debugger/local_variables_test
R=hausner@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43850 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-18 18:48:00 +00:00
rmacnak@google.com 511c997316 Implement DeclarationMirror.location for all but ParameterMirrors.
- Mark NativeFieldWrapper classes as synthetic.
- Mark ClassID fields as synthetic.

BUG=http://dartbug.com/22378
R=gbracha@google.com, hausner@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43784 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-13 23:32:20 +00:00
hausner@google.com 2f0d13af3b Fix yield statements in catch blocks
This is a partial fix for issue 22300. The VM no longer setfaults when
using yield in try statements. Yield in catch blocks work. What’s still
not working right is if a value is yielded before an exception is
propagated to the caller.

R=regis@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43707 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-12 00:12:07 +00:00
rmacnak@google.com 4de5f89b99 Rename IsConstructor to IsGenerativeConstructor.
This matches the terminology in the spec, and it avoids confusion with the function kind kConstructor, which indicates either a generative constructor or a factory constructor.

R=johnmccutchan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43673 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-11 00:59:19 +00:00
hausner@google.com 00366dcfa1 Fix Windows build
Review URL: https://codereview.chromium.org//903843002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43522 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-05 21:00:02 +00:00
hausner@google.com a28a13d936 Attempt to fix the Windows build
Review URL: https://codereview.chromium.org//901263002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43518 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-05 19:33:37 +00:00
hausner@google.com 2487c76886 Add support for sync* and yield and yield*
R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43516 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-05 18:36:40 +00:00
fschneider@google.com 2727257bf8 VM: Fix source location in stack trace of async code.
This eliminates an invalid source position and allows async code
to work with the stack_traces package to a get full async stack chain.

Frames with an invalid location (file.dart:1:1) are now printed without
line/column information (file.dart)

BUG=dartbug.com/22009
R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43497 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-05 10:26:27 +00:00
zra@google.com 1299ad1485 Allows turning on checked mode on a per-isolate basis
using the embedding API.

R=regis@google.com, srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43481 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-04 18:32:48 +00:00
zerny@google.com e449cd0329 Propagate the stack trace of the inner-most throw when using async/await.
This patch does not provide a full async stack trace, it only ensures
that the inner-most stack frame will be the point of the initial throw.

BUG=http://dartbug.com/22009
R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43463 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-04 11:54:23 +00:00
fschneider@google.com d9be656941 VM: Share closure-call dispatchers.
Instead of caching these in each signature class,
cache them in the common super-class of all closures (_FunctionImpl)

This avoid unecessary polymorphism when invoking.

R=vegorov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43336 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-30 13:06:11 +00:00
fschneider@google.com a33e651a42 VM: Simplify dispatcher code for closure calls.
The getter call to ".call" can be avoided for Function objects, since
it just returns the receiver there.

This makes the unoptimized code smaller. Optimized code will
only be affected if the getter call was not inlined before.

R=vegorov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43287 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-29 14:50:37 +00:00
srdjan@google.com 12c5e2bbaf Cleanup: use const reference for ParsedFunction where possible.
R=rmacnak@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43226 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-28 00:41:09 +00:00
hausner@google.com 7a83c9d449 Eliminate the --enable_async flag
The default value for --enable_async has been true for a couple of weeks now. This
change eliminates the flag altogether, which may be a breaking change unless the
dart executable is invoked with --ignore-unrecognized-flags

R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43160 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-26 23:01:38 +00:00
koda@google.com 99127744c6 Add Zone-based handle allocation interface and reduce use of Isolate-based interfaces.
Remove deprecated Isolate-based BitVector constructor.

R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43136 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-26 14:54:02 +00:00
rmacnak@google.com db79e9cca6 Rename is_visible to is_reflectable; use is_debuggable instead of is_reflectable to decide whether to filter a frame from stack traces.
Merge verbose_stacktrace flag into show_hidden_frames.

Don't mark native functions as non-debuggable (breakpoints don't actually work there now but nothing goes wrong).

BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43121 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-23 21:16:40 +00:00
rmacnak@google.com 2fb0bb020b Reapply "Mark all private functions in dart: libraries as invisible (*sniff*). Previously these functions were only marked invisible if they were also native, a constructor, or on a black list."
Broken assumption in Dartium fixed in blink r188698.

R=hausner@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43053 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-21 20:44:04 +00:00
rmacnak@google.com ed88ac7f0c Revert "Mark all private functions in dart: libraries as invisible (*sniff*). Previously these functions were only marked invisible if they were also native, a constructor, or on a black list."
Broke Dartium.

TBR=hausner@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43026 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-20 20:56:59 +00:00
rmacnak@google.com 045bd762d7 Mark all private functions in dart: libraries as invisible (*sniff*). Previously these functions were only marked invisible if they were also native, a constructor, or on a black list.
An invisible function is hidden from stack traces, will not be enumerated
by mirrors, and cannot be directly invoked by mirrors. Note that private
classes remain accessible.

Fix a few internal dart:io functions that should be private.

Fix bug where mirrors would enumerate top-level invisible functions.

Mark observatory test that was using such private functions through
mirrors as failing.

BUG=http://dartbug.com/15274
R=hausner@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43019 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-20 18:32:19 +00:00
hausner@google.com bb1ab60dc0 First step in eliminating —enable_async flag
Switch default value of enable-async to true, and remove the flag
from test source code.

Next step is to remove the flag altogether

R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42670 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-07 19:42:59 +00:00
hausner@google.com ab3af6ec00 Introduce is_debuggable state bit on function objects
Simplify debugger logic. Any function can be marked as
non-debuggable when is is created. The debugger no longer
needs a heuristic which functions are debuggable.
Mostly used for synthetic, generated functions that
have no source code, e.g. async code, implicit getters and
setters, implicit constructors, forwarding constructors,
dispatcher functions.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42570 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-29 22:31:17 +00:00
asiva@google.com b75b67f1e3 Fix error string to include information about class and library when the snapshot writer throws an exception for objects that cannot be serialized.
R=hausner@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42535 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-20 00:41:48 +00:00
hausner@google.com 9a54ccd905 Fix debugging of async code
Make sure the debugger finds the closure function containing the body
of async functions, but not the synthetic function that generates the
future.

Change the way the debugger sets one-time breakpoints. Instead of
compiling the function and instrumenting all safe-points, set a
breakpoint marked as “one-shot” at the beginning of the function
and wait until the function is compiled. Then, once it fires, it
gets automatically deleted.

Finally, be smarter how we resolve breakpoints in compiled code.
The compiler rearranges code in await expressions, which tripped
up the debugger. This change makes sure we select the lowest compiled
code address only within the line containing the requested breakpoint
position.

R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42368 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-15 18:20:20 +00:00
hausner@google.com 8ece5c1b84 Allow Symbols in switch and maps
Allow Symbol literals (and const Symbol instances) as switch expression
and as key values in const Maps.

This implements the most recent Spec changes.

R=regis@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42230 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-10 00:24:07 +00:00
johnmccutchan@google.com 80d39f91dc Remove overly strict assert around method name token position
BUG=
R=hausner@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42151 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-05 21:51:43 +00:00
johnmccutchan@google.com f216834af8 Expose set_source service command for functions
- Can change signatures
- Currently only works for unexecuted functions.

R=rmacnak@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42124 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-04 23:35:24 +00:00
iposva@google.com e8428aa507 - The body of a async function should be executed in a Future.mircotask.
R=floitsch@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42064 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-02 13:05:16 +00:00
zerny@google.com 8e807c8550 Integrate the Irregexp Regular Expression Engine.
BUG=http://dartbug.com/19090
R=fschneider@google.com

Committed: https://code.google.com/p/dart/source/detail?r=41949

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41983 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-26 09:32:43 +00:00
hausner@google.com 1b8fa74112 Fix parsing of awaitable expressions with nested functions
“have seen await” flag must be properly saved and restored when
parsing nested function (literals) inside an await expression.

Fixes issue 21536

R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41962 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-25 18:13:49 +00:00
zerny@google.com 84a4135901 Revert "Integrate the Irregexp Regular Expression Engine."
This reverts commit https://code.google.com/p/dart/source/detail?r=41949

TBR=fschneider@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41950 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-25 13:36:40 +00:00
zerny@google.com 43ac0c6f33 Integrate the Irregexp Regular Expression Engine.
BUG=http://dartbug.com/19090
R=fschneider@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41949 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-25 13:10:21 +00:00
koda@google.com 844dca3a21 Make toString visible on enum classes, as required by proposed spec.
R=hausner@google.com, rmacnak@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41939 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-24 19:19:18 +00:00