Commit Graph

5559 Commits

Author SHA1 Message Date
Johnni Winther 783ed933ff Fix boolean conversion bug in dart2js + update JSRegExp accordingly.
BUG=
R=herhut@google.com

Review URL: https://codereview.chromium.org//1259473005.
2015-07-27 14:19:26 +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
Paul Berry 926525dab0 Avoid creating illegal symbols in symbol_conflict_test.
Fixes #23870.

R=karlklose@google.com

Review URL: https://codereview.chromium.org//1256583002 .
2015-07-24 06:33:52 -07:00
Asger Feldthaus c4443d47c8 Fix analyzer warnings in test case.
TBR=karlklose@google.com

BUG=

Review URL: https://codereview.chromium.org//1256543002.
2015-07-23 14:04:42 +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
Asger Feldthaus 7d8067135c dart2js cps: Support 'on T' clauses without a 'catch'.
BUG=
R=karlklose@google.com

Review URL: https://codereview.chromium.org//1247333003.
2015-07-23 12:39:10 +02:00
Karl Klose f4075e6bad dart2js cps: Revert change to status file in 0bb497875a.
TBR=whesse@google.com

Review URL: https://codereview.chromium.org//1254553002 .
2015-07-23 09:55:56 +02:00
Ryan Macnak ea65b867d3 Fix bad assert in constant evaluation.
R=regis@google.com

Review URL: https://codereview.chromium.org//1243263003 .
2015-07-22 14:25:04 -07:00
Regis Crelier 33aa038e7f Make vm buildbot green (2nd attempt, was red in debug mode only)
Review URL: https://codereview.chromium.org//1241263008 .
2015-07-22 13:54:19 -07:00
Regis Crelier 18b1f43afe Make vm buildbot green
Review URL: https://codereview.chromium.org//1241263007 .
2015-07-22 13:44:50 -07: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 ce101ebef3 Revert "Update status for failing deferred_type_dependency_test."
This reverts commit 08e6d1259d8f20978cd7efe9e918a8b8ad8d5a3a.

BUG=

Review URL: https://codereview.chromium.org//1251193002 .
2015-07-22 19:22:06 +02:00
William Hesse 1c2fcc5d9a Update status for failing deferred_type_dependency_test.
BUG=https://github.com/dart-lang/sdk/issues/23894
R=kustermann@google.com

Review URL: https://codereview.chromium.org//1251963002 .
2015-07-22 19:19:10 +02:00
Sigurd 0a12c37516 Move shared class to it's own library.
The multi-test framework did not like my circular imports.

BUG=

Review URL: https://codereview.chromium.org//1248833003 .
2015-07-22 18:59:31 +02: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
Florian Loitsch 2037ddc564 Test is actually not failing.
Review URL: https://codereview.chromium.org//1251073002 .
2015-07-22 14:11:12 +02:00
Johnni Winther f49f00608f Add tests for problem with newline encoding in multiline strings.
R=karlklose@google.com

Review URL: https://codereview.chromium.org//1252443002.
2015-07-22 13:10:13 +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 d9fd2b654f dart2js cps: mark deferred_type_dependency_tests as failing.
TBR=sigurdm@google.com

Review URL: https://codereview.chromium.org//1244373002 .
2015-07-22 12:51:30 +02:00
Sigurd 253ffeed4a Deferred loading track type-dependencies for is, as and type-annotations.
BUG=
R=johnniwinther@google.com, sigmund@google.com

Review URL: https://codereview.chromium.org//1245583002 .
2015-07-22 11:05:41 +02:00
Karl Klose 1ce0e2b087 dart2js cps: Update test expectations after addition of new test.
TBR=floitsch@google.com

Review URL: https://codereview.chromium.org//1248963002 .
2015-07-22 09:34:03 +02:00
Florian Loitsch 11a0f292a3 dart2js: add failing test for namer and global stubs.
R=sigmund@google.com

Review URL: https://codereview.chromium.org//1246983003 .
2015-07-21 22:47:13 +02:00
Florian Loitsch c8db556116 dart2js: Add failing test for Function.apply on normal class with call.
R=sigmund@google.com

Review URL: https://codereview.chromium.org//1245733002 .
2015-07-21 11:28:44 +02:00
Florian Loitsch 5b6cdbb0ca Mark test as failing for the analyzer.
Review URL: https://codereview.chromium.org//1238303002 .
2015-07-20 15:25:55 +02:00
Florian Loitsch 3c81651f2f Add failing test to illustrate issue 23857 (const Symbols are equal to unrelated symbols in dart2js).
R=sigmund@google.com

Review URL: https://codereview.chromium.org//1229723008 .
2015-07-20 15:09:33 +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
Ryan Macnak 7815590e0e Mark new tests relying on flag as failing on Dartium.
TBR=regis@google.com

Review URL: https://codereview.chromium.org//1245493003 .
2015-07-17 17:14:26 -07:00
Regis Crelier 15de03e2d5 Allow super calls in mixins (for now behind a --supermixin flag).
As a consequence, allow a mixin application alias as a mixin, even if it does
not extend Object.
Add new tests.
Fix an existing test.
Update status files.

Fixes #23771

R=hausner@google.com

Review URL: https://codereview.chromium.org//1232613005 .
2015-07-17 11:32:23 -07:00
Sigurd Meldgaard a466b6bd39 Allow return <expr> in sync* and async* javascript.
BUG=
R=floitsch@google.com

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

Patch from Sigurd Meldgaard <sigurdm@google.com>.
2015-07-15 16:59:05 +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
Paul Berry 4b83219847 Switch on null-aware operators by default in analyzer.
Patches to update analyzer_cli and analysis_server will follow once a
new version of analyzer has been published.

BUG=dartbug.com/23793
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org//1239513005 .
2015-07-13 15:56:21 -07: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
Srdjan Mitrovic d503d2f0ed Added full deferred loading semantic to precompiled/--noopt/eager-loading code (some corner cases, e.g., compile-time errors for constants, still missing)
BUG=
R=hausner@google.com

Review URL: https://codereview.chromium.org//1211273011 .
2015-07-09 10:56:55 -07: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
Sigurd 5d2b0b07f5 Remove flag for enabling null-aware operators. They are now on by default.
This solves #23791

R=johnniwinther@google.com

Review URL: https://codereview.chromium.org//1225273002 .
2015-07-09 13:49:45 +02:00
Asger Feldthaus 895283c21a dart2js cps: Direct access on JS arrays.
length, forEach, [], and []= are rewritten to direct array access nodes.
There are more methods to specialize, which will be added in separate
CLs.

This CL also contains a class CpsFragment to help build CPS code.

BUG=
R=karlklose@google.com

Review URL: https://codereview.chromium.org//1223813006.
2015-07-08 14:33:00 +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 0220393797 dart2js cps: Bugfix in operator specialization.
Binary operators were always replaced with string concatenation if both
operands were strings.

BUG=
R=floitsch@google.com

Review URL: https://codereview.chromium.org//1210403008.
2015-07-06 11:15:02 +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 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
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
Srdjan Mitrovic c0b359db6c Intrinsic version of Object.runtimeType
BUG=
R=regis@google.com

Review URL: https://codereview.chromium.org//1217323002.
2015-07-01 10:13:14 -07:00
Ryan Macnak 40fcf4a72d Handle field-invocation and method-extraction in the runtime when --lazy_dispatchers=false.
R=fschneider@google.com

Review URL: https://codereview.chromium.org//1195573006.
2015-06-30 15:14:35 -07:00
Matthias Hausner ce917c5160 Redirection type of a redirecting factory can be deferred
BUG=23408
R=regis@google.com

Review URL: https://codereview.chromium.org//1219023002.
2015-06-30 14:57:07 -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
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