Commit Graph

4835 Commits

Author SHA1 Message Date
Asger Feldthaus a8d36ce761 dart2js cps: Cleanup.
Add LetCont.two constructor for convenience.

Remove old code for specialized static calls to getInterceptor.
This should had been done in a previous CL where the Interceptor IR node
was added.

Remove InvokeStatic.isEffectivelyConstant, since this was only used for
interceptor and identical calls, which are no longer static calls.

Remove redundant imports and use consistent parameters for SourceInformation.

BUG=
R=floitsch@google.com

Review URL: https://codereview.chromium.org//1218843003.
2015-07-02 18:01:41 +02:00
Asger Feldthaus 1b9d41c5e7 dart2js cps: Reanalyze subterms when they get inserted.
This shouldn't change any visible behavior right now, but the change is
needed in a bigger incoming CL.

BUG=
R=floitsch@google.com

Review URL: https://codereview.chromium.org//1218223004.
2015-07-02 17:49:06 +02:00
Asger Feldthaus 01d2d2cb73 dart2js cps: Do not propagate uses of loop variables past their update.
Also some documentation specifying the SSA-like assumptions we make
about the input to StatementRewriter.

BUG=
R=kmillikin@google.com

Review URL: https://codereview.chromium.org//1215503012.
2015-07-02 15:15:04 +02:00
Florian Loitsch 24fbfa7f78 Revert "Fix runtimeType.toString for tear-offs."
This reverts commit 87a7ca0720.

Review URL: https://codereview.chromium.org//1220793012.
2015-07-02 13:57:07 +02:00
Stephan Herhut 7ea6facff6 dart2js: Reuse names for constructor bodes.
BUG=
R=sra@google.com

Review URL: https://codereview.chromium.org//1215223002.
2015-07-02 11:41:09 +02:00
Florian Loitsch 87a7ca0720 Fix runtimeType.toString for tear-offs.
Tear-offs are constructed by building a fresh constructor on the fly. However, that constructor is unnamed and didn't have the 'builtin$cls' property set. As such, the runtime-type system was unable to extract a good name and wasn't able to provide a good 'toString' for it. With this CL the constructor has a good 'name' set.

Also removes the 'builtin$cls' property that was a duplicate of 'name'. Whenever we defined a new Dart class, we added a 'builtin$cls' property on the constructor which was a duplicate of the name. This was necessary, because IE doesn't store the function name on the constructor. However, there we can just assign the 'name' field, and don't need to introduce a new field-name ('builtin$cls'). As such, we can always use the 'name' property.

R=sra@google.com

Review URL: https://codereview.chromium.org//1213033002.
2015-07-02 10:59:31 +02:00
Johnni Winther 048a4651fe Create and test source mapping for invocations.
BUG=
R=floitsch@google.com

Review URL: https://codereview.chromium.org//1196433002.
2015-07-02 10:38:19 +02:00
Sigmund Cherem b273d56f0d Fix pkgbuild tests after adding a pubspec on pkg/compiler (fix #23750)
BUG=
R=whesse@google.com

Review URL: https://codereview.chromium.org//1217353002.
2015-07-01 08:19:00 -07:00
Stephan Herhut 964afc0523 dart2js: Fix regression in minified names for one shot interceptors.
R=sra@google.com
BUG= http://dartbug.com/23731

Review URL: https://codereview.chromium.org//1220793006.
2015-07-01 11:01:01 +02:00
Stephen Adams 6d1b57277a Tweak order of parts of lazy initializer list.
Keeping all the names together rather than sandwiching the function makes it less confusing to read.

BUG=
R=sigmund@google.com

Review URL: https://codereview.chromium.org//1221823002.
2015-06-30 17:32:46 -07:00
Stephen Adams 0b19fb7f26 Use 'a' as the first field name rather than 'Q'.
Miniscule extra compression plus it bothered me.

TBR=herhut@google.com

Review URL: https://codereview.chromium.org//1214853008.
2015-06-30 14:04:29 -07:00
Sigmund Cherem b18c5a3e7c sdk files reorganization to make dart2js a proper package
BUG=
R=brianwilkerson@google.com, floitsch@google.com, whesse@google.com

Review URL: https://codereview.chromium.org//1212513002.
2015-06-29 10:21:14 -07:00
Johnni Winther 76f1fec4f9 Translate package URIs to resource URIs for diagnostics.
Closes #23699

BUG=http://dartbug.com/23699
R=ahe@google.com, het@google.com

Review URL: https://codereview.chromium.org//1205373002.
2015-06-29 17:13:31 +02:00
Asger Feldthaus 009cc956d1 dart2js cps: Fix a couple of minor issues.
BUG=
R=kmillikin@google.com

Review URL: https://codereview.chromium.org//1212663004.
2015-06-29 16:44:58 +02:00
Asger Feldthaus 4f8d7b42d2 dart2js cps: Set receiver type in type propagation.
BUG=
R=kmillikin@google.com

Review URL: https://codereview.chromium.org//1214643003.
2015-06-29 16:01:44 +02:00
Asger Feldthaus 34302b1320 dart2js cps: Translate synthesized mixin constructors.
BUG=
R=kmillikin@google.com

Review URL: https://codereview.chromium.org//1216593002.
2015-06-29 15:28:40 +02:00
Stephan Herhut 63ccf506d7 dart2js: Fix off-by-one in assert.
TBR=johnniwinther@google.com
BUG=

Review URL: https://codereview.chromium.org//1217823002.
2015-06-29 14:41:10 +02:00
Asger Feldthaus ec55d46148 dart2js cps: Fix translation of local constants.
BUG=
R=kmillikin@google.com

Review URL: https://codereview.chromium.org//1211393003.
2015-06-29 14:32:49 +02:00
Stephan Herhut d24580087d dart2js: Extract minified field naming into mixin.
R=johnniwinther@google.com
BUG=

Review URL: https://codereview.chromium.org//1209973002.
2015-06-29 14:19:59 +02:00
Johnni Winther 74d04a6a48 Compute constant constructors in resolution.
BUG=
R=sigurdm@google.com

Review URL: https://codereview.chromium.org//1218793002.
2015-06-29 12:56:06 +02:00
Sigmund Cherem 76cb9faa27 Update some files from CRLF to LF
R=sra@google.com

Review URL: https://codereview.chromium.org//1214853002.
2015-06-26 16:55:46 -07:00
Stephen Adams 7d6051f21e Mark static function getters as used in codegen.
Move marking from SSA builder to codegen.  If the only a reference to (a closure over a) static or top level function is optimized away, it is no longer retained in the generated code.

R=ahe@google.com, sigmund@google.com

Committed: https://github.com/dart-lang/sdk/commit/4d784a7d0165aa768695d5d185c6b82c29501759

Reverted.

Review URL: https://codereview.chromium.org//1211223002.
2015-06-26 08:36:15 -07:00
Johnni Winther 4dced50c38 Use a FunctionSignature in CallStructure.signatureApplies
BUG=
R=ajohnsen@google.com

Review URL: https://codereview.chromium.org//1213833002.
2015-06-26 14:53:02 +02:00
Asger Feldthaus e7e3706c59 dart2js cps: Better fallthrough analysis and eliminate "return null".
BUG=
R=kmillikin@google.com

Review URL: https://codereview.chromium.org//1203423003.
2015-06-26 14:14:12 +02:00
Stephan Herhut b3730bc4eb dart2js: Fix encoding of field names in csp mode.
R=floitsch@google.com
BUG=

Review URL: https://codereview.chromium.org//1215613002.
2015-06-26 13:00:53 +02:00
Johnni Winther 02d52374d4 Implement SsaBuilder without the ResolvedVisitor.
BUG=
R=sigurdm@google.com

Review URL: https://codereview.chromium.org//1212433002.
2015-06-26 12:48:26 +02:00
Stephen Adams c1df2abeb0 Revert "Mark static function getters as used in codegen."
BUG=

Review URL: https://codereview.chromium.org//1215513003.
2015-06-25 21:20:52 -07:00
Stephen Adams 4d784a7d01 Mark static function getters as used in codegen.
Move marking from SSA builder to codegen.  If the only a reference to (a closure over a) static or top level function is optimized away, it is no longer retained in the generated code.

R=sigmund@google.com

Review URL: https://codereview.chromium.org//1211223002.
2015-06-25 20:29:38 -07:00
Asger Feldthaus cf920ec66c dart2js cps: Fix codegen for foreign statements.
BUG=
R=kmillikin@google.com

Review URL: https://codereview.chromium.org//1203353003.
2015-06-25 16:07:56 +02:00
Asger Feldthaus fceb7f00dc dart2js cps: Handle checks against mutable and extendable lists.
BUG=
R=kmillikin@google.com

Review URL: https://codereview.chromium.org//1206873003.
2015-06-25 15:03:00 +02:00
Stephan Herhut fbbc4c08ed dart2js: Also use new abstract names in csp mode.
BUG=
R=sigurdm@google.com

Review URL: https://codereview.chromium.org//1207823005.
2015-06-25 12:54:38 +02:00
Stephan Herhut d5a57db06a dart2js: Fix nsm emitter in non-minified mode.
BUG=
R=sigurdm@google.com

Review URL: https://codereview.chromium.org//1211503003.
2015-06-25 11:21:10 +02:00
Johnni Winther 507bc962d7 Split TypedSelector into Selector and TypeMask.
BUG=
R=herhut@google.com, karlklose@google.com

Committed: https://github.com/dart-lang/sdk/commit/fc42c0e3bd30b3249f930d521a42af53366abcfd

Reverted: https://github.com/dart-lang/sdk/commit/9fb192bbb045b1f0d9c5181a21d6b61a10cd0d6e

Review URL: https://codereview.chromium.org//1182913003.
2015-06-25 10:13:11 +02:00
Stephan Herhut dd41983945 dart2js: Use an abstract Name class for names in the generated JavaScript ast.
BUG=
R=asgerf@google.com, floitsch@google.com, sigurdm@google.com, sra@google.com

Review URL: https://codereview.chromium.org//1198293002.
2015-06-25 09:39:57 +02:00
Harry Terkelsen 8c315d41ac Update invalid package name example
BUG=
R=pquitslund@google.com

Review URL: https://codereview.chromium.org//1203923007.
2015-06-24 16:29:37 -07:00
Kevin Millikin b9192ab9e2 dart2js CPS: Support try/catch/finally.
Support try/catch/finally by pretending it is macro-expanded into
try/catch and try/finally:

    try S0 catch (ex, st) S1 finally S2
    ==>
    try { try S0 catch (ex, st) S1 } finally S2

The duplicated code for try/catch and try/finally is abstracted into a
function parameterized over translations for all the parts that
differed.

R=asgerf@google.com

Review URL: https://codereview.chromium.org//1207703002.
2015-06-24 17:13:15 +02:00
Asger Feldthaus 371b5c16a8 dart2js cps: Merge JsIrBuilder and IrBuilder.
BUG=
R=kmillikin@google.com

Review URL: https://codereview.chromium.org//1201463003.
2015-06-24 14:32:12 +02:00
Lasse R.H. Nielsen d3013cfd35 Fix typos of "function".
R=sgjesse@google.com

Review URL: https://codereview.chromium.org//1210483002.
2015-06-24 12:36:34 +02:00
Kevin Millikin 089ed2965b Implement try/finally by inlining the finally code.
Try/finally is implemented by inlining.  There is a try/catch to catch
exceptions in the try block.  The catch body contains the finally code
followed by a rethrow.  The code for finally is translated again after the
normal exit of the try block.  Break, continue, and return exits in the try
block have the finally code inlined just before the exit is taken.

Try/catch/finally is not yet supported, it requires some changes to the
assigned variables analysis.

R=asgerf@google.com

Review URL: https://codereview.chromium.org//1201983002.
2015-06-24 10:12:42 +02:00
Asger Feldthaus c5bb081ed6 dart2js cps: Get typed selectors for compound operators.
This dramatically improves type inference. Previously, i++ would
completely destroy all type information known for i.

BUG=
R=kmillikin@google.com

Review URL: https://codereview.chromium.org//1197673003.
2015-06-23 17:04:19 +02:00
Asger Feldthaus 05497633df dart2js cps: Make Identical a built-in and add Interceptor to Tree IR.
Identical is now a built-in operator instead of a separate primitive.

Interceptor is now its own expression in the Tree IR instead of a static
invocation. This matches the CPS IR (where it is a primitive), and
should fix a problem it was causing for frequency-based naming.

The JS-specific subclass of the Tree IR builder no longer depended on
the backend, emitter, namer, glue, compiler, or anything so it has
been merged into the superclass.

BUG=
R=kmillikin@google.com

Review URL: https://codereview.chromium.org//1204733002.
2015-06-23 16:03:57 +02:00
Asger Feldthaus 04c5c61a10 dart2js cps: Refactor and optimize string concatenations.
The ConcatenateStrings IR node has been removed. It was a leftover from
dart2dart.

Expressions inside string interpolations are now stringified explicitly
and we concatenate strings with a pure StringConcat operator.

ConstantExpressions have also been removed from the IR. They were also
an artifact from dart2dart and were complicating the optimizer.

BUG=
R=kmillikin@google.com

Committed: https://github.com/dart-lang/sdk/commit/ac75893964144d5712d1da8417c27c232750ec37

Reverted: https://github.com/dart-lang/sdk/commit/988b65336b3194cd539781195a9b8be24b3bbdc3

Review URL: https://codereview.chromium.org//1195573003.
2015-06-23 13:17:59 +02:00
Asger Feldthaus 56158b54a1 dart2cps: Fix bug in constructors.
When visiting another constructor, the visitor must use another tree elements mapping (and source file info).

BUG=
R=floitsch@google.com

Committed: https://github.com/dart-lang/sdk/commit/4a1e6c7966272729d6350f9759f1645d4278983e

Reverted: https://github.com/dart-lang/sdk/commit/382319fe701021ecfa1e9faa37ef3ac589876007

Review URL: https://codereview.chromium.org//1200823002.
2015-06-23 10:55:02 +02:00
Stephan Herhut 1057e73019 dart2js: Avoid Object.create for bookeeping data structures during startup.
BUG=
R=floitsch@google.com

Review URL: https://codereview.chromium.org//1193423002.
2015-06-23 10:38:16 +02:00
Stephen Adams afe5b32e48 Fix for issue 23432.
Get the correct receiver in noSuchMethod stubs.

noSuchMethod stubs for selectors with Interceptor calling convention should pass the receiver to noSuchMethod (not 'this').  The actual receiver is selected by Object.noSuchMethod and Interceptor.noSuchMethod.

R=floitsch@google.com

Committed: https://github.com/dart-lang/sdk/commit/c8d7cd8ef46de11f5e4e7c757bb9ee2f12cb8cd6

Reverted: https://github.com/dart-lang/sdk/commit/21a322fd9969260a22034a372df8b62e9ca20456

Review URL: https://codereview.chromium.org//1181063005.
2015-06-22 17:02:21 -07:00
Stephen Adams 21a322fd99 Revert "Fix for issue 23432."
Reverted while investigating failed tests.

TBR=sigmund@google.com

Review URL: https://codereview.chromium.org//1203523003.
2015-06-22 13:46:29 -07:00
Stephen Adams c8d7cd8ef4 Fix for issue 23432.
Get the correct receiver in noSuchMethod stubs.

noSuchMethod stubs for selectors with Interceptor calling convention should pass the receiver to noSuchMethod (not 'this').  The actual receiver is selected by Object.noSuchMethod and Interceptor.noSuchMethod.

R=floitsch@google.com

Review URL: https://codereview.chromium.org//1181063005.
2015-06-22 13:16:05 -07:00
Asger Feldthaus 382319fe70 Revert "dart2cps: Fix bug in constructors."
This reverts commit 4a1e6c7966.

TBR=floitsch@google.com

BUG=

Review URL: https://codereview.chromium.org//1195393005.
2015-06-22 19:35:24 +02:00
Asger Feldthaus 988b65336b Revert "dart2js cps: Refactor and optimize string concatenations."
This reverts commit ac75893964.

TBR=kmillikin@google.com

BUG=

Review URL: https://codereview.chromium.org//1201753004.
2015-06-22 19:34:11 +02:00
Asger Feldthaus ac75893964 dart2js cps: Refactor and optimize string concatenations.
The ConcatenateStrings IR node has been removed. It was a leftover from
dart2dart.

Expressions inside string interpolations are now stringified explicitly
and we concatenate strings with a pure StringConcat operator.

ConstantExpressions have also been removed from the IR. They were also
an artifact from dart2dart and were complicating the optimizer.

BUG=
R=kmillikin@google.com

Review URL: https://codereview.chromium.org//1195573003.
2015-06-22 18:08:44 +02:00