herhut@google.com
831cf80143
Mark [this] as exposed if generative constructor contains function expression.
...
BUG= http://dartbug.com/20840
R=floitsch@google.com , karlklose@google.com
Review URL: https://codereview.chromium.org//558633002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40028 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-09 13:43:36 +00:00
mlippautz@google.com
b05de8ab68
Fix build: exclude async/await exception tests from everything but the VM.
...
BUG=
Review URL: https://codereview.chromium.org//539343003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39927 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-05 20:39:18 +00:00
mlippautz@google.com
800508d980
Bubble up exceptions throw async/await.
...
This CL addresses bubbling up exceptions through async and await. It adds another parameter to the continuation that can be used to rethrow an error.
BUG=
R=hausner@google.com , srdjan@google.com
Review URL: https://codereview.chromium.org//542893004
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39926 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-05 19:50:34 +00:00
mlippautz@google.com
8558638543
Enable await in for and for-in loops.
...
BUG=
R=srdjan@google.com
Review URL: https://codereview.chromium.org//538803002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39880 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-04 17:42:38 +00:00
mlippautz@google.com
8db9d5ceac
Parse await as part of an unary expression.
...
BUG=
R=hausner@google.com
Review URL: https://codereview.chromium.org//543433003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39879 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-04 17:09:44 +00:00
floitsch@google.com
46043093af
Move js library back into compiler directory.
...
R=ricow@google.com
Review URL: https://codereview.chromium.org//538513002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39870 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-04 13:49:30 +00:00
johnniwinther@google.com
e4736148b1
Skip d8-dependent test on Windows.
...
BUG=
R=sigurdm@google.com
Review URL: https://codereview.chromium.org//537343002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39862 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-04 12:01:12 +00:00
mlippautz@google.com
98628f3543
Enable await in while and do-while.
...
BUG=
R=srdjan@google.com
Review URL: https://codereview.chromium.org//538703002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39839 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-03 21:51:15 +00:00
vegorov@google.com
a1e2035eda
Improve List.sublist and List.toList for large lists.
...
- Merge array allocation and List._copyFromObjectArray to provide memmove fast path;
- In optimizer given v2 = CreateArray(v0, v1) fold v2.length load to v1;
BUG=
R=iposva@google.com , srdjan@google.com
Review URL: https://codereview.chromium.org//536043002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39831 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-03 20:36:01 +00:00
collinsn@google.com
2ccac8093b
Add language tests for Issue 18628.
...
As suggested by @karlklose in https://codereview.chromium.org/513563002/
comments.
Improve testing documentation.
- add a README
- add a description by example of selectors to the "./tools/test.py -h"
output
- update/add source comments
I had a hard time figuring out how to add and run the tests, mostly
because I tried to call them "*_test_1.dart" and "*_test_2.dart", but
language test files must have names of the form "*_test.dart". So, I
added a README summarizing and referencing the relevant docs.
R=brianwilkerson@google.com , karlklose@google.com , jwren@google.com
BUG=
Review URL: https://codereview.chromium.org//521773003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39822 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-03 18:51:25 +00:00
mlippautz@google.com
5faff13d23
Enable await in more statements.
...
Properly parse await in if, else if, switch, and return.
BUG=
R=hausner@google.com
Review URL: https://codereview.chromium.org//537623002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39813 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-03 17:34:21 +00:00
mlippautz@google.com
56f63abc4f
Reland: Fix scoping async functions.
...
This CL fixes several scoping/context issues:
* Do not reuse scopes in SequenceNode_s as they might introduce a new context
level. In that case we would trigger context allocationg multiple times
resulting in scope/contexts being out of sync.
* Properly save and restore saved_try_context in try/catch/finally blocks and
nesting closures. For this we need to keep track of async closures top scopes.
Updated version of https://codereview.chromium.org/520223002/
BUG=
R=hausner@google.com , srdjan@google.com
Review URL: https://codereview.chromium.org//530313002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39810 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-03 16:34:00 +00:00
sigurdm@google.com
457c8c33c7
Remove support for the DeferredLibrary annotation and remove tests of it
...
BUG= 18562
R=floitsch@google.com , hausner@google.com
Review URL: https://codereview.chromium.org//429883002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39797 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-03 08:34:34 +00:00
mlippautz@google.com
165df6920d
Revert "Fix scoping async functions."
...
This reverts commit 7c03f3ef75f546c73d46680206cd7fe61997e1be.
BUG=
Review URL: https://codereview.chromium.org//536543002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39777 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-02 20:54:04 +00:00
mlippautz@google.com
bfbc0c1118
Fix scoping async functions.
...
This CL fixes several scoping/context issues:
* Do not reuse scopes in SequenceNode_s as they might introduce a new context
level. In that case we would trigger context allocationg multiple times
resulting in scope/contexts being out of sync.
* Properly save and restore saved_try_context in try/catch/finally blocks and
nesting closures. For this we need to keep track of async closures top scopes.
R=hausner@google.com
Review URL: https://codereview.chromium.org//520223002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39775 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-02 20:25:35 +00:00
johnniwinther@google.com
f513ad198b
Remove unneeded generation of default constructors from the dart backend.
...
BUG=
R=sigurdm@google.com
Review URL: https://codereview.chromium.org//526263002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39737 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-02 10:00:54 +00:00
herhut@google.com
fc71b4218d
Properly handle forwarding factory constructors in type inference.
...
BUG= http://dartbug.com/18257
R=karlklose@google.com , johnniwinther@google.com
Review URL: https://codereview.chromium.org//519693002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39695 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-29 11:19:31 +00:00
mlippautz@google.com
c65636490f
Fix conditionally parsing await as keyword.
...
BUG=
R=hausner@google.com
Review URL: https://codereview.chromium.org//507233002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39602 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-27 16:22:52 +00:00
scheglov@google.com
8647752153
New analyzer snapshot.
...
R=brianwilkerson@google.com
BUG=
Review URL: https://codereview.chromium.org//515543002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39599 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-27 15:51:56 +00:00
mlippautz@google.com
d7943b4029
Revert "Fix scope/context behavior in await transformer."
...
This reverts commit fb220928acc36cc9078f905bb185b4c32b9a5608.
BUG=
Review URL: https://codereview.chromium.org//511483003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39573 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-27 00:10:45 +00:00
mlippautz@google.com
3a46e60f17
Fix scope/context behavior in await transformer.
...
We are not allowed to reuse LocalScope in different SequenceNode_s. The problem is that if a context needs to be created for that scope the FlowGraphbuilder will insert context creation code at all SequenNoce_s that use this scope. This results in scopes and contexts being out of sync and writing garbage. The fix is to just chain a new scope that is on the same function- and loop-level.
Also fix recognizing of "await" in async functions. A follow up CL will enable await in loops, if, return, ...
BUG=
R=hausner@google.com
Review URL: https://codereview.chromium.org//508643004
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39571 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-26 23:01:58 +00:00
hausner@google.com
6e637eb27f
Initializing a final instance is a runtime error
...
If a final instance variable is initialized at the point of declaration, it
is a runtime error if it is initialized again in a constructor’s initializer
list or by an initializing formal.
If any instance field is initialized more than once in the initializer list of
a constructor, or by an initializing formal parameter, it is a compile time
error.
Adding a new test to cover the expected runtime error.
Fixes issue 13335.
R=regis@google.com
Review URL: https://codereview.chromium.org//505033002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39562 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-26 19:37:36 +00:00
mlippautz@google.com
1f7e71df2b
Fix build by excluding await tests from all but the vm.
...
BUG=
Review URL: https://codereview.chromium.org//504293002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39560 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-26 17:58:47 +00:00
mlippautz@google.com
7c7919f8ef
Await it!
...
Add support for awaiting futures. This leaves us with a non-structural CFG.
TODOs:
* Forwarding exceptions through futures in async functions and rethrowing them using await.
* Known bug with nested contexts (will be fixed in following CL)
* await is not recognized at all expressions specified (yet)
BUG=
R=hausner@google.com , srdjan@google.com
Review URL: https://codereview.chromium.org//484933003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39559 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-26 17:35:56 +00:00
hausner@google.com
0b7efcd0b0
Private names are not exported, not even if the library imports itself
...
Prevent access to a private name if it’s imported through a self-import.
Adding a test case.
Fixes issue 20162
R=srdjan@google.com
Review URL: https://codereview.chromium.org//489993004
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39459 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-21 17:07:25 +00:00
srawlins@google.com
0201d225ce
Prevent double reporting on hex, strings, and multiline strings and comments.
...
BUG= https://code.google.com/p/dart/issues/detail?id=18574
R=ahe@google.com
Review URL: https://codereview.chromium.org//340703003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39451 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-21 14:51:20 +00:00
floitsch@google.com
e636fb3859
dart2js: Fix static initializer.
...
BUG= http://dartbug.com/20532
R=johnniwinther@google.com
Review URL: https://codereview.chromium.org//480513003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39402 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-20 11:11:27 +00:00
hausner@google.com
0bbf6c5b16
Runtime support for evaluation of static field initializer expressions
...
Eliminates the generation of field initializer functions by the parser.
Adds a runtime call that creates a one-shot function to evaluate the
initializer of a static field. The runtime function gets called from
the implicit static getter function for the field.
R=srdjan@google.com , zra@google.com
Review URL: https://codereview.chromium.org//471283002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39387 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-19 21:53:44 +00:00
mlippautz@google.com
5f02ceed86
Introduce await.
...
This CL adds basic infrastructure needed for awaitable expressions. Implementation of continuations is not part of this CL.
Expressions containing ``await'' are transformed into a series of operations on intermediates, effectively getting rid
of the temporary expression stack. Currently only expressions evaluating to an actual value (read: non-future) are supported.
Also, not all kinds of statements support awaitable expressions yet.
Missing:
* Capturing all (needed) variables
* Continuations (connecting a preamble with await statements; re-adding the closure to the run queue)
BUG=
R=hausner@google.com
Review URL: https://codereview.chromium.org//447003003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39345 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-18 18:41:12 +00:00
sigurdm@google.com
b5c73a4890
Fix status file.
...
R=floitsch@google.com
Review URL: https://codereview.chromium.org//478303002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39329 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-18 14:07:43 +00:00
sigurdm@google.com
74889f5721
Refactor and simplify the dart2dart renamer and placeholder collector.
...
Also solves an issue where a local was renamed to dynamic.
BUG=19751, 13077, 12747, 12753
R=jgruber@google.com , johnniwinther@google.com
Review URL: https://codereview.chromium.org//448943004
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39326 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-18 10:39:14 +00:00
asiva@google.com
fccb33a355
Update status files to ensure dartium-debug builds are green on the bot.
...
R=rmacnak@google.com
Review URL: https://codereview.chromium.org//472953004
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39303 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-15 16:59:31 +00:00
mlippautz@google.com
8285db5d29
Fix call to completer for async closures.
...
Addressing comments from https://codereview.chromium.org/460763002/
BUG=
R=srdjan@google.com
Review URL: https://codereview.chromium.org//467323002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39207 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-13 17:14:44 +00:00
srdjan@google.com
5d27559bd4
Fix issue 20476: creating multiple LocalVariables with same name (finally_ret_val35), confuses the compiler. token_pos is not enough to guarantee unique name for inlined finally-s. Instead of uniques names per inlined return node, use one function level local.
...
R=fschneider@google.com
Review URL: https://codereview.chromium.org//467933002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39206 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-13 17:03:49 +00:00
fschneider@google.com
8f458094f6
Fix dart2dart status after adding tests that use deferred loading.
...
TBR=vegorov@google.com
Review URL: https://codereview.chromium.org//464343003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39200 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-13 14:51:56 +00:00
fschneider@google.com
54a7410866
Fix bug with CHA dependencies by recording a set of classes for registering code.
...
CHA is not only used with the receiver class, but also with other classes
when doing type propagation. The optimized code has to be registered with
all classes that are affected by CHA so that deoptimization occurs whenever
the set of subclasses changes for these classes.
R=vegorov@google.com
Review URL: https://codereview.chromium.org//463103002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39194 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-13 12:43:03 +00:00
mlippautz@google.com
648dca65ba
This CL deals with handling of return statements in functions modified as
...
async. These functions contain a so-called async closure (with the actual body)
that should not just return when encountering a return statement, but rather call
the completer first and then return (null).
Previously the last return node has been replaced with a completer.complete call.
This does not work for return statements in nested blocks or try-catch-finally
blocks.
Instead of replacing return statements we now call the completer after
resolving all steps necessary for return nodes, i.e., right after inlining all
finally blocks.
We also need "continuation" returns later on that do not complete the
completer. We differentiate by whether a return node has its scope set or not.
BUG=
R=hausner@google.com , srdjan@google.com
Review URL: https://codereview.chromium.org//460763002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39167 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-12 21:50:37 +00:00
mlippautz@google.com
1f4a7759ad
Add regression test for issue 20476
...
BUG=http://dartbug.com/20476
R=iposva@google.com
Review URL: https://codereview.chromium.org//466013002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39150 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-12 17:15:39 +00:00
lrn@google.com
f4ca529e54
Update test to have second argument on Pattern.allMatches.
...
Avoids warning when running test.
R=sgjesse@google.com
Review URL: https://codereview.chromium.org//460953003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39124 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-12 10:35:31 +00:00
kmillikin@google.com
61d8882842
dart2dart: Fix a scoping bug in the translation of loops.
...
Side effects to local variables in the condition must be visible after
the loop exit. Thus the translation of the statements following a
loop must be in the scope of the condition.
R=sigurdm@google.com
BUG=
Review URL: https://codereview.chromium.org//459763003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39121 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-12 08:55:15 +00:00
lrn@google.com
7b516974b2
Add optional start index to Pattern.allMatches.
...
This is a non-breaking change.
Very few classes implement Pattern, so it's also a mostly non-intrusive change.
If we add startIndex to other methods, like replaceFirstMatch, we can use the extra parameter only for non-zero start indices without breaking existing code.
R=ajohnsen@google.com
Review URL: https://codereview.chromium.org//460613002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39119 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-12 07:13:01 +00:00
karlklose@google.com
066c4086ee
Do not add forwarding constructors to a pricate constructor from a different library.
...
BUG= http://dartbug.com/20394
R=johnniwinther@google.com
Review URL: https://codereview.chromium.org//455393003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39084 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-11 12:55:00 +00:00
whesse@google.com
0986f8b4c8
Deflake status files for Android content_shell tests.
...
R=ricow@google.com
Review URL: https://codereview.chromium.org//449423002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39033 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-08 09:54:58 +00:00
johnniwinther@google.com
bc05c60051
Add a compile time error for non-static const fields
...
Based on https://codereview.chromium.org/339583004/
BUG=http://dartbug.com/11049
R=karlklose@google.com
Review URL: https://codereview.chromium.org//443923002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38924 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-06 10:34:41 +00:00
hausner@google.com
68aecc232b
Report compile time error if const class has non-const initializer
...
A recent language change requires classes with a const constructor
to have compile-time constant field initializer expressions. This
CL adds the check, and removes code to handle const instance fields,
which do not exist in Dart.
Fixes issue 18779.
R=regis@google.com
Review URL: https://codereview.chromium.org//444793002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38910 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-05 21:50:03 +00:00
whesse@google.com
19beb61abc
Update mips test status.
...
R=ricow@google.com
Review URL: https://codereview.chromium.org//439283002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38861 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-04 15:19:10 +00:00
johnniwinther@google.com
0054dcae58
Add regression test for issue 20074.
...
Issue solved for dart2js in r38847.
BUG=
R=karlklose@google.com
Review URL: https://codereview.chromium.org//437813003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38860 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-04 14:31:00 +00:00
whesse@google.com
5b80dbf09c
Update Android content-shell status
...
One test started passing, and one times out flakily, with the roll to chrome 37.
BUG=dartbug.com/19127
R=ricow@google.com
Review URL: https://codereview.chromium.org//432333002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38828 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-01 09:30:39 +00:00
scheglov@google.com
57f076f17f
New analyzer snapshot.
...
Not to be published.
R=brianwilkerson@google.com
BUG=
Review URL: https://codereview.chromium.org//435483002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38764 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-31 00:40:17 +00:00
mlippautz@google.com
ec8a3464f9
Skip async tests on dart2dart.
...
BUG=
Review URL: https://codereview.chromium.org//430633003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38719 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-30 01:58:06 +00:00