Commit Graph

3219 Commits

Author SHA1 Message Date
Asger Feldthaus 0216e21efc dart2js cps: Use 'this' instead of receiver-arg when possible.
This fixes a bug in how intercepted super calls were handled,
and enables the redundant receiver optimization.

BUG=
R=kmillikin@google.com

Review URL: https://codereview.chromium.org//1312393002 .
2015-08-26 16:06:41 +02:00
Asger Feldthaus 496a1e0085 dart2js cps: More status files updates.
BUG=
R=kmillikin@google.com

Review URL: https://codereview.chromium.org//1302473002 .
2015-08-18 11:01:05 +02:00
Asger Feldthaus 689ea4f24a dart2js: Update status files.
dart2js/http_test passes when run in isolation, but always times out
on my machine when run in a large batch. I marked it as slow in
unchecked mode (was already marked as slow in checked mode).

Some timeouts that were fixed in dart2js cps but somehow were added to
the status file again.

Some tests in corelib fail in CPS.

BUG=

Review URL: https://codereview.chromium.org//1292223003 .
2015-08-18 10:35:47 +02:00
Karl Klose bafb8fb191 dart2js cps: Support async/await by rewriting the JavaScript AST.
BUG=
R=kmillikin@google.com

Review URL: https://codereview.chromium.org//1253333002 .
2015-08-07 11:27:40 +02:00
Karl Klose 7eb3bb82b7 dart2js cps: update test expectations for new tests.
TBR=kmillikin@google.com

Review URL: https://codereview.chromium.org//1280603003 .
2015-08-07 08:36:47 +02:00
Sigurd 37fdc0a102 update co19 status file.
BUG=
R=floitsch@google.com

Review URL: https://codereview.chromium.org//1272643002 .
2015-08-06 12:06:30 +02:00
William Hesse 5d38e0cebd Update status for co19 test on ie11.
BUG=

Review URL: https://codereview.chromium.org//1260403003 .
2015-08-04 15:23:28 +02:00
Florian Loitsch 277bfc3355 Update status files.
Review URL: https://codereview.chromium.org//1269023006 .
2015-08-04 14:16:14 +02:00
William Hesse b936ffb73b Update co19 status for failing typed_data/ByteData test in ie11.
BUG=
R=sgjesse@google.com

Review URL: https://codereview.chromium.org//1260943003 .
2015-08-03 10:14:19 +02:00
Karl Klose 2a137d16db dart2js cps: Fix performance issues in optimization passes.
Type propagation, shrinking reductions, and let sinking each took
more than 2 minutes on a stress test, where now they take a few
seconds.

Huge hash tables (Map/Set) were a big problem, especially when used as
worklists.

Let sinking had an issue with a linear-time search for the enclosing
continuation of an expression. This has been replaced with a visitor
state.

The stress test was:

  tests/co19/src/LibTest/collection/ListBase/ListBase_class_A01_t02

This was only slow because negative constants get translated to
intercepted calls. That itself should be fixed, but the IR should
still be able to handle the stress.

The change in shrinking reductions altered the redex priority from
FIFO to LIFO which has a negative effect on code quality in
unwrapException (in any test case with a try/catch). It seems like
an existing issue that has surfaced.

Since I am going on vacation, I ask that someone would please
commit this on my behalf (assuming things are looking good).
--asgerf

BUG=
R=karlklose@google.com

Review URL: https://codereview.chromium.org//1252883003 .
2015-07-27 12:12:06 +02:00
Asger Feldthaus 7d038fbc67 dart2js cps: Avoid deep recursion using trampolines and basic blocks.
The CPS RecursiveVisitor now uses an explicit stack of things to do
on the way out of a term. Every CPS pass has been hacked to fit the
new visitor paradigm.

The tree visitors now iterate over chains of ExpressionStatements.
This seems to do the trick, mostly because direct-style rewriting
significantly reduces the height of the tree.

The IR tracers still use deep recursion, but they are disabled by
default anyway so they are not critical.

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

Review URL: https://codereview.chromium.org//1251083002.
2015-07-23 13:52:04 +02:00
Matthias Hausner f1da09741d Implement tear-off closure operator #
BUG=
R=fschneider@google.com

Review URL: https://codereview.chromium.org//1234883005 .
2015-07-22 12:50:36 -07:00
William Hesse 0bb497875a Update status for Chrome 44 on dart2js tests.
BUG=
R=kustermann@google.com

Review URL: https://codereview.chromium.org//1240363003 .
2015-07-22 18:02:03 +02:00
Karl Klose 1b7053bcf6 dart2js cps: Use CPS IR for patched functions and typed data.
R=asgerf@google.com

Review URL: https://codereview.chromium.org//1241303003 .
2015-07-22 13:07:35 +02:00
Karl Klose 0869c5ca4a dart2js cps: Update test expectations.
TBR=asgerf@google.com

Review URL: https://codereview.chromium.org//1240253002 .
2015-07-20 14:40:37 +02:00
Regis Crelier 7f10c1420d Make invocation namedArguments unmodifiable.
Fixes #13714

R=rmacnak@google.com

Review URL: https://codereview.chromium.org//1241583008 .
2015-07-17 14:04:54 -07:00
Alan Knight 2523c63b11 SafariMobileSim also ignores setting innerHtml on a frameset
BUG=

Review URL: https://codereview.chromium.org//1225403009 .
2015-07-17 11:18:30 -07:00
Alan Knight 982a4ea6e5 Also suppress IE tests that rely on setting innerHtml on a frameset
BUG=

Review URL: https://codereview.chromium.org//1229423004 .
2015-07-16 15:33:38 -07:00
Alan Knight d5599eb63b Restore workaround for old Chrome bug that also affects Safari and in some cases Firefox, fix test suppressions
BUG=

Review URL: https://codereview.chromium.org//1242063002 .
2015-07-16 13:20:26 -07:00
Alan Knight 4e790fef3d appendHtml, when sanitizing, should create document fragment in the right context
BUG=
R=terry@google.com

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

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

Review URL: https://codereview.chromium.org//1221043003 .
2015-07-16 10:30:51 -07:00
Terry L. Lucas 1fa61ee114 Fixed a few more things to make Dartium build w/o --gen-interop
TBR=vsm@google.com

Review URL: https://codereview.chromium.org//1239653003 .
2015-07-14 07:17:59 -07:00
William Hesse 161a558627 Update co19 status for analyzer issue.
BUG=https://github.com/dart-lang/sdk/issues/23839
R=kustermann@google.com

Review URL: https://codereview.chromium.org//1233593004 .
2015-07-14 14:20:58 +02:00
Karl Klose 04dacd24f4 Remove functions white-listed for use of try-finally and switch, add JS_SET_CURRENT_ISOLATE.
R=asgerf@google.com

Review URL: https://codereview.chromium.org//1237573002 .
2015-07-14 10:26:38 +02:00
William Hesse e29d39a363 Update co19 status for IE11.
BUG=
R=kustermann@google.com

Review URL: https://codereview.chromium.org//1235953003 .
2015-07-13 19:22:37 +02:00
Karl Klose 52f0390b68 dart2js cps: Update test expectations after 6b36c8acc6.
TBR=johnniwinther@google.com

Review URL: https://codereview.chromium.org//1232133002 .
2015-07-10 14:19:10 +02:00
Johnni Winther 6b36c8acc6 Refactor handling of library prefixes.
Closes #13632

BUG=
R=karlklose@google.com

Review URL: https://codereview.chromium.org//1227353002.
2015-07-09 16:28:06 +02:00
Karl Klose 3fe9309c96 dart2js cps: Implement compilation of redirecting factory constructors for reflection.
Without reflection, redirecting factory constructor invocations are shortcut at the instantiation site.  With reflection, code like
  reflectClass(Foo).newInstance(const Symbol(''), [])
can hit a redirecting factory constructor and we need to emit a function that does the redirection and type substitution.

R=asgerf@google.com

Review URL: https://codereview.chromium.org//1227873004 .
2015-07-09 14:54:23 +02:00
William Hesse 815d589319 Update co19 test status for Firefox 39 on Windows.
BUG=
R=kustermann@google.com

Review URL: https://codereview.chromium.org//1222903004.
2015-07-07 18:47:45 +02:00
Asger Feldthaus 11b2ae1307 dart2js cps: Generate direct field accesses a build-time.
The world will refuse to emit getters and setters for field it thinks
will be accessed directly.

Rewriting getter/setter calls to field accesses must happen at
build-time so we do not rely on an optimization for correctness.

BUG=
R=karlklose@google.com

Review URL: https://codereview.chromium.org//1227543008.
2015-07-07 16:17:35 +02:00
Karl Klose 71e2bec0a5 dart2js cps: Support JS_CURRENT_ISOLATE.
R=asgerf@google.com

Review URL: https://codereview.chromium.org//1222913003 .
2015-07-07 15:55:13 +02:00
Asger Feldthaus 61f47e7384 dart2js cps: Ensure JSArray is emitted when we see a type cast.
This is a workaround to resolve an issue that is affecting a lot
of tests.

BUG=
R=floitsch@google.com

Review URL: https://codereview.chromium.org//1214123003.
2015-07-03 14:32:01 +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
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
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
Stephen Adams 9425621eac JSInvocationMirror - return unmodifiable list or map
R=floitsch@google.com

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

Reverted.

Review URL: https://codereview.chromium.org//1200403003.
2015-06-24 11:00:31 -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
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
Kevin Millikin bf595224d5 Implement simple switch statements as nested if/else.
Simple switch statements that do not have continue to labeled cases
are compiled into a chain if/else comparisons.

R=asgerf@google.com

Review URL: https://codereview.chromium.org//1191193005.
2015-06-22 11:29:31 +02:00
Karl Klose 3f46181244 cps-ir: Support foreign code.
R=kmillikin@google.com

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

Reverted: https://github.com/dart-lang/sdk/commit/40ed0daaaf71904d2da271e66ba8381ef857116d

Review URL: https://codereview.chromium.org//1185633003.
2015-06-19 13:44:58 +02:00
Karl Klose 40ed0daaaf Revert "cps-ir: Support foreign code."
This reverts commit a120ee7c90.

TBR=kmillikin@google.com

Review URL: https://codereview.chromium.org//1196443002.
2015-06-18 13:37:52 +02:00
Karl Klose a120ee7c90 cps-ir: Support foreign code.
R=kmillikin@google.com

Review URL: https://codereview.chromium.org//1185633003.
2015-06-18 13:09:50 +02:00
Asger Feldthaus fb38d61dba dart2js cps: Support function types in 'is' and 'as' operators.
The generated code uses different helpers than the SSA. In SSA, there are calls to buildFunctionType and _isTest. The CPS uses checkSubtypeOfRuntimeType, the "one size fits all" method we also use to test against type variable types.

When the function type has no type variables in it we could hoist the function type into a constant, but the constant system does not support type representation constants at the moment. But it seems like an optimization we may want to add later.

BUG=
R=karlklose@google.com

Review URL: https://codereview.chromium.org//1180973003.
2015-06-18 11:30:57 +02:00
Paul Berry b2577accab Fix status file after changing least upper bound computation.
TBR=brianwilkerson@google.com

Review URL: https://codereview.chromium.org//1188313004.
2015-06-17 11:05:57 -07:00
Asger Feldthaus 9e5564c4eb dart2js cps: Fix bug in liveness analysis.
Rather embarrassingly, the CFG built for liveness analysis did not join
branches after a conditional, it just kept going out of the 'else'
branch.

BUG=
R=karlklose@google.com

Review URL: https://codereview.chromium.org//1178703014.
2015-06-17 13:25:35 +02:00
Karl Klose a842f6dff2 Update dart2js-cps_ir test expectations.
TBR=johnniwinther@google.com

Review URL: https://codereview.chromium.org//1188183006.
2015-06-17 09:41:50 +02:00
Karl Klose 7f8fe44067 Update dart2js-cps_ir test expectations.
TBR=kmillikin@google.com

Review URL: https://codereview.chromium.org//1181063004.
2015-06-16 15:47:35 +02:00
Asger Feldthaus eec1d88d9c dart2js cps: Introduce some built-in operators in type propagation.
There are also a number of somewhat unrelated changes to get
better type information out of the global type inference.
The dependency on TypedSelector is causing a lot of problems there.

BUG=
R=kmillikin@google.com

Review URL: https://codereview.chromium.org//1175973005.
2015-06-15 17:31:48 +02:00
Karl Klose bb45376735 Update dart2js-cps_ir status files.
R=kmillikin@google.com

Review URL: https://codereview.chromium.org//1191433002.
2015-06-15 12:50:58 +02:00
Karl Klose e4b56654ff Update dart2js-cps_ir test expectations with better annotations.
R=asgerf@google.com

Review URL: https://codereview.chromium.org//1181613003.
2015-06-11 10:56:56 +02:00