Commit Graph

1767 Commits

Author SHA1 Message Date
asgerf@google.com abc37952d4 dart2js: Refactoring, documentation, and a few bugfixes in Namer class.
See long doc comment in namer.dart.

BUG=
R=floitsch@google.com

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

Reverted: https://code.google.com/p/dart/source/detail?r=43590

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43724 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-12 13:43:25 +00:00
sra@google.com 5852e9ef90 Redo "Steps towards making dart2js JS AST templates an indepentent library."
Adds fix for dart2js_incremental

TBR=floitsch@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43712 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-12 01:58:01 +00:00
sra@google.com ba909cfb3e Revert "Redo "Steps towards making dart2js JS AST templates an indepentent library.""
Investigating failure of dart2js_incremental.

TBR=floitsch@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43710 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-12 01:18:03 +00:00
sra@google.com b1a31838f2 Redo "Steps towards making dart2js JS AST templates an indepentent library."
TBR=floitsch@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43703 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-11 22:52:24 +00:00
sra@google.com 068d8a7349 Revert "Steps towards making dart2js JS AST templates an indepentent library."
Investigating snapshot issues.

TBR=floitsch@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43696 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-11 18:43:07 +00:00
sra@google.com 4585a0df9d Steps towards making dart2js JS AST templates an indepentent library.
- Removed unused type Blob
- Remove use of CodeBuffer, Compiler, SourceInformation
- Moved existing code into library js_ast
- Added new library js that re-exports js_ast and adds dart2js specific code.

The next step is to move the code into its own package under pkg.

BUG=
R=floitsch@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43695 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-11 18:24:43 +00:00
asgerf@google.com ec384eb0ad dart2js cps: Handle optional parameters in builder.
For static invocations, default values are inlined.

For all invocations, named parameters are reordered alphabetically.

BUG=
R=karlklose@google.com

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

Reverted: https://code.google.com/p/dart/source/detail?r=43679

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43684 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-11 15:13:40 +00:00
asgerf@google.com 096a40419e Revert "dart2js cps: Handle optional parameters in builder."
This reverts commit 43643.

BUG=
R=johnniwinther@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43679 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-11 10:19:25 +00:00
johnniwinther@google.com 986ce5c39c Support default constructors in analyzer2dart.
BUG=
R=paulberry@google.com, sigurdm@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43652 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-10 15:18:36 +00:00
asgerf@google.com febb77ce10 dart2js cps: Handle optional parameters in builder.
For static invocations, default values are inlined.

For all invocations, named parameters are reordered alphabetically.

BUG=
R=karlklose@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43643 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-10 13:36:58 +00:00
asgerf@google.com fbf1f00690 cps2js: Bugfix in named parameters in call to superconstructor.
BUG=
R=karlklose@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43633 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-10 10:31:22 +00:00
johnniwinther@google.com aa5e543b8b Allow sync *, async * and yield * in dart2js
BUG=http://dartbug.com/22234
R=sigurdm@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43593 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-09 14:26:03 +00:00
sigurdm@google.com 7b0bc3d220 Implementation of async-await transformation on js ast.
BUG=
R=floitsch@google.com, johnniwinther@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43591 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-09 12:02:52 +00:00
asgerf@google.com f72a18378b Revert "dart2js: Refactoring, documentation, and a few bugfixes in Namer class."
This reverts commit r43588.

BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43590 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-09 11:58:07 +00:00
asgerf@google.com c767597da3 dart2js: Refactoring, documentation, and a few bugfixes in Namer class.
See long doc comment in namer.dart.

BUG=
R=floitsch@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43588 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-09 11:31:10 +00:00
herhut@google.com 44541ff62b Support [AssumeDynamic] and [TrustTypeAnnotations] in the inferrer.
BUG=
R=floitsch@google.com, johnniwinther@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43550 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-06 11:38:46 +00:00
karlklose@google.com 2b8950be87 cps-ir: Implement string concatenation.
R=kmillikin@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43549 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-06 11:36:27 +00:00
hausner@google.com 5e48c4a728 Suppress a dart2js test failure
Review URL: https://codereview.chromium.org//898043007

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43525 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-05 21:49:01 +00:00
johnniwinther@google.com 9d9b462cc5 Add test annotations to package:expect
BUG=
R=floitsch@google.com, herhut@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43510 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-05 16:29:26 +00:00
johnniwinther@google.com ddc57facd6 Update yield warnings.
BUG=http://dartbug.com/22260
R=floitsch@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43500 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-05 11:38:40 +00:00
karlklose@google.com 2ad9020c1d Support intercepted getters, setters and index operations.
R=asgerf@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43471 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-04 15:31:24 +00:00
paulberry@google.com 8806ba7456 Mark test "dart2js/async_await_syntax_test" as failing.
BUG=dartbug.com/22260
TBR=johnniwinther@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43432 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-03 21:50:29 +00:00
johnniwinther@google.com 2e253b6b39 Fix await parsing.
BUG=http://dartbug.com/22183
R=floitsch@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43398 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-03 14:20:21 +00:00
kmillikin@google.com 31fc0e5a8e Rename ClosureVariable, use separate IR forms for declaration and assignment.
I plan to use ClosureVariable for the variables assigned in try, so
the name will become incorrect.  They are renamed to MutableVariable.

Use separate IR forms for declaration of MutableVariable (LetMutable)
and for assignment to mutable variables (SetMutableVariable).  This
distinction doesn't do much in this change other than make the tree a
bit more well-formed, but I plan to make LetMutable take a list of
variables and values (e.g. all the variables mutated in a try).

R=asgerf@google.com, karlklose@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43396 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-03 14:18:13 +00:00
herhut@google.com 953159ef36 Minor cleanup in resolver_test.dart.
BUG=
R=johnniwinther@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43382 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-03 09:11:05 +00:00
johnniwinther@google.com d9e1bcc91b Support async/await in dart2dart.
BUG=
R=floitsch@google.com, paulberry@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43380 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-03 08:31:54 +00:00
johnniwinther@google.com c0d40c8992 Fix shift in source map positions.
BUG=
R=floitsch@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43352 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-02 10:54:57 +00:00
kmillikin@google.com d729e9a9b5 dart2dart: Remove the list of closureVariables from FunctionDefinitions.
Function definitions had a list of closure variables (which was always
empty in the JS backend).  This list has no code generation semantics
because it is ignored by the Tree IR builder.  Instead, when translating
to Tree IR, a reference to an unbound closure variable implicitly
'declares' it.

The closure variables were however used for the S-expression serialized
representation.  They can be eliminated here as well by using the same
trick as the Tree IR builder.

R=asgerf@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43337 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-30 13:20:23 +00:00
johnniwinther@google.com 6adce0d176 Enable enums by default.
BUG=http://dartbug.com/21885
R=floitsch@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43334 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-30 12:21:12 +00:00
johnniwinther@google.com f555a43210 Support async getters.
BUG=http://dartbug.com/22184
R=floitsch@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43333 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-30 12:13:46 +00:00
herhut@google.com 52473bd7ba Move computation of method flags into model.
BUG=
R=floitsch@google.com, zarah@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43279 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-29 12:56:04 +00:00
herhut@google.com cf16709196 Fix remaining uses of lookupConstructor.
BUG=
TBR=johnniwinther@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43277 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-29 12:24:54 +00:00
johnniwinther@google.com adb08cfc80 Supported versioned patching.
BUG=
R=herhut@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43275 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-29 12:07:48 +00:00
herhut@google.com e80c770de6 Fix private_test to reflect new, better warning.
BUG=
TBR=johnniwinther@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43273 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-29 11:51:43 +00:00
johnniwinther@google.com 6fb90bc36c Support constructor declarations in analyzer2dart.
BUG=
R=herhut@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43271 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-29 07:57:57 +00:00
floitsch@google.com 07caf85dd0 Fix test.
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43248 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-28 17:42:47 +00:00
herhut@google.com 4d1d78dc85 Fix deferred loading test for is checks.
BUG=
TBR=sigurdm@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43233 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-28 10:07:51 +00:00
herhut@google.com f1ac5d30ad Use prototype inheritance to reduce number of is check properties.
BUG=
R=floitsch@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43229 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-28 08:54:46 +00:00
floitsch@google.com b449450a51 Native classes are now part of the classes-list.
Review URL: https://codereview.chromium.org//873543004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43180 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-27 12:54:22 +00:00
kmillikin@google.com 5f57d08cb8 Reapply "Add a shrinking reduction for dead continuation parameters."
This reapplies SVN revision r43093 with bug fixes.  A failing assert
was fixed, and continuation eta-reduction was restricted to not change
non-call continuations into call continuations.  If these were to
occur, they risk duplicating code and so are not always on
optimization.

BUG=
R=asgerf@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43135 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-26 13:51:37 +00:00
johnniwinther@google.com 2840d792f1 Mark unittests slow in debug mode.
BUG=
R=sigurdm@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43129 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-26 08:28:44 +00:00
floitsch@google.com e12100dc8e White-list work-around function for try.
Review URL: https://codereview.chromium.org//869233003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43110 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-23 16:09:13 +00:00
kmillikin@google.com c74e16c5d5 Revert "Add a shrinking reduction for dead continuation parameters."
This reverts svn revision r43093, due to failures in dart2dart.  It
clashes with the commit just before it which has changed the type of
FunctionDefinition parameters.

Also, continuation eta-reduction can destroy a dead parameter
reduction.  In this case, it's not obvious which reduction we actually
want.  So though the fixes are simple, I will back this change out and
reevaluate it.

R=asgerf@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43105 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-23 13:44:41 +00:00
kmillikin@google.com bdba8f356b Add a shrinking reduction for dead continuation parameters.
Continuation parameters that have no uses can be eliminated.  This is
similar to the reduction for dead values except that that continuation
invocations need to be adjusted.

Performing a dead parameter reduction can create other dead parameter
redexes, dead value redexes, or continuation eta-redexes.  Detection
of these redexes does not fit the existing model, where an entire
deleted subterm is visited after being eliminated from the whole term.
Instead, they are detected explicit as part of the reduction
implementation.

R=asgerf@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43093 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-23 10:27:46 +00:00
asgerf@google.com b78959f1d7 Implement constructor bodies and initializers in CPS->JS backend.
As in the SSA backend, a constructor consists of three parts:
1. Instantiator: creates an object and sets its fields
2. Factory: evaluates field initializers, calls instantiator, then
   calls bodies.
3. Body: executes the body of a constructor.

The CreateClosureClass instruction has been replaced by CreateInstance
for invoking the instantiator for an arbitrary class.

The IrBuilderVisitor has been split into two subclasses to better
isolate the JS-specific code.

BUG=
R=floitsch@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43092 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-23 10:19:28 +00:00
kmillikin@google.com b79e6f5905 Incorporate some code review comments.
Change the CPS IR's LetCont constructor to have single and multiple
continuation versions.  Update a pair of comments.

R=asgerf@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43071 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-22 13:09:27 +00:00
sra@google.com 37e2caf317 Optimize is-check to instanceof when it eliminates an interceptor
See http://dartbug.com/22016 for discussion

R=floitsch@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43058 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-22 02:24:00 +00:00
asgerf@google.com b29366b9e6 Handle super-method invocations in CPS->JS backend.
InvokeSuperMethod has been replaced by InvokeMethodDirectly. This
instruction works like InvokeMethod, except it has an explicit target
element that it always invokes, regardless of overriding.

The new instruction is easier to handle in the JS backend, it is more
amenable to inlining, and it should also be useful for calling
backend-specific methods, such as constructor bodies.

When targeting Dart, we translate it back to a 'super' at the end,
because the instruction is never used for any other purpose with
that backend.

R=karlklose@google.com, sigurdm@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43011 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-20 14:33:17 +00:00
sigurdm@google.com ef57c8bdac Implement await and async for the js-ast.
Implementing a new expression 'await e' in the js mini-parser and printer.

Implementing async, async*, sync* function body modifiers.

Also implementing while, do, switch, case, labelled statement in the js mini parser.

This is in preparation for an await-desugaring transformation on the js ast.

BUG=
R=asgerf@google.com, floitsch@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42999 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-20 08:10:47 +00:00
karlklose@google.com d007ebe166 Mark deferred worker test as failing on Safari.
R=herhut@google.com
BUG= http://dartbug.com/22106

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42996 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-19 15:07:44 +00:00