Commit Graph

4835 Commits

Author SHA1 Message Date
Stephen Adams d7237c5275 Don't inline methods that only throw.
R=sigmund@google.com

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

Reverted: https://github.com/dart-lang/sdk/commit/890e900c3100daf34e08cba632d277101eec18bc

Review URL: https://codereview.chromium.org/1587053003 .
2016-01-15 11:35:46 -08:00
Asger Feldthaus f123fa568d dart2js: Default to an empty set instead of null
The set of interceptor classes that can respond to a given selector
depends on which classes are considered instantiated by resolution.
It can therefore be empty even for intercepted selectors.
Do not surprise the caller by returning null.

BUG=
R=sigmund@google.com

Review URL: https://codereview.chromium.org/1588733008 .
2016-01-15 09:29:12 -08:00
Asger Feldthaus 8226a28185 dart2js cps: Remove default call to visit return continuation.
There seems to be no use case for visiting the return continuation
automatically, and it's often causing problems.

BUG=
R=kmillikin@google.com

Review URL: https://codereview.chromium.org/1585073004 .
2016-01-15 09:26:50 -08:00
Stephen Adams 890e900c31 Don't inline methods that only throw.
R=sigmund@google.com

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

Reverted.

Review URL: https://codereview.chromium.org/1587053003 .
2016-01-14 21:20:24 -08:00
Stephen Adams 033d78c579 Don't inline methods that only throw.
R=sigmund@google.com

Review URL: https://codereview.chromium.org/1587053003 .
2016-01-14 14:54:23 -08:00
Asger Feldthaus fb0330df46 dart2js cps: Improve constant folding of equality operators.
Previously we would only fold comparisons between primitive constants, missing out on e.g. the list sentinel comparisons.

BUG=
R=sra@google.com

Review URL: https://codereview.chromium.org/1583993005 .
2016-01-14 14:01:20 -08:00
Asger Feldthaus 1b9a7e0be5 dart2js cps: Avoid comparing boolean values to boolean constants.
E.g. (x === true) can be replaced with x if x is a boolean.

Box2D has some code where this happens.

BUG=
R=kmillikin@google.com, sra@google.com

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

Review URL: https://codereview.chromium.org/1588813002 .
2016-01-14 13:01:31 -08:00
Asger Feldthaus 2680d9ab04 Revert "dart2js cps: Avoid comparing boolean values to boolean constants."
This reverts commit dd8ba75909.

BUG=

Review URL: https://codereview.chromium.org/1590523004 .
2016-01-14 12:55:42 -08:00
Asger Feldthaus dd8ba75909 dart2js cps: Avoid comparing boolean values to boolean constants.
E.g. (x === true) can be replaced with x if x is a boolean.

Box2D has some code where this happens.

BUG=
R=kmillikin@google.com, sra@google.com

Review URL: https://codereview.chromium.org/1588813002 .
2016-01-14 12:28:16 -08:00
Asger Feldthaus 2dd2a0d3f7 dart2js cps: Remove redundant traversal from variable merger pass.
This was a leftover from when we had nested functions in the IR.

BUG=
R=kmillikin@google.com

Review URL: https://codereview.chromium.org/1582033002 .
2016-01-14 10:52:58 -08:00
Asger Feldthaus 2bd0de209c dart2js cps: Use dartArgumentsLength instead of arguments.length
BUG=
R=sra@google.com

Review URL: https://codereview.chromium.org/1589643004 .
2016-01-14 10:51:24 -08:00
Asger Feldthaus 27e2977dc7 dart2js cps: Fix traversal order in statement rewriter.
The statement rewriter uses a backward traversal, but the visitor for
yield and logical operator did not follow this order.

Fixes #25460

BUG=
R=het@google.com

Review URL: https://codereview.chromium.org/1584253003 .
2016-01-14 10:49:41 -08:00
Stephen Adams 1aab83e6dd Add cleanup ShrinkingReducer pass after second TypePropagation pass.
The need for cleanup shows up in
co19/LibTest/collection/DoubleLinkedQueue/forEachEntry_A01_t02

The compiler crashed: Internal Error: Unreachable continuations must be removed before computing loop side effects.

TBR=asgerf@google.com

Review URL: https://codereview.chromium.org/1586943002 .
2016-01-13 22:10:42 -08:00
Stephen Adams a56036b0a3 Do TypePropagation again after inlining
R=asgerf@google.com

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

Reverted.

Review URL: https://codereview.chromium.org/1560963002 .
2016-01-13 20:03:47 -08:00
Stephen Adams bec587aaf3 Revert "Do TypePropagation again after inlining"
Tests need to be updated.

TBR=asgerf@google.com

Review URL: https://codereview.chromium.org/1588723003 .
2016-01-13 15:45:33 -08:00
Stephen Adams 9392a2ece9 Do TypePropagation again after inlining
R=asgerf@google.com

Review URL: https://codereview.chromium.org/1560963002 .
2016-01-13 15:32:13 -08:00
Harry Terkelsen 22200410c0 dart2js: update pubspec
BUG=
R=sigmund@google.com

Review URL: https://codereview.chromium.org/1582923002 .
2016-01-13 15:01:05 -08:00
Asger Feldthaus add29e3cba dart2js cps: Do redundant join elimination after inlining.
Redundant join elimination can enable optimizations in GVN and BCE, and
redundant joins can occur after inlining a method used in a condition,
such as isEmpty or isNotEmpty.

BUG=
R=het@google.com

Review URL: https://codereview.chromium.org/1581593004 .
2016-01-13 14:17:48 -08:00
Stephen Adams 9db58343b3 dart2js cps: for(;;) is shorter than while(true)
R=asgerf@google.com

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

Reverted.

Review URL: https://codereview.chromium.org/1584693003 .
2016-01-13 12:57:13 -08:00
Stephen Adams 33056a1ab8 Revert "dart2js cps: for(;;) is shorter than while(true)"
There are some tests I should have updated.

TBR=asgerf@google.com

Review URL: https://codereview.chromium.org/1582103002 .
2016-01-13 12:35:00 -08:00
Kevin Millikin 5c2125c9af dart2js: Flatten the printed representation of the CPS IR.
BUG=
R=sigmund@google.com

Review URL: https://codereview.chromium.org/1588543003 .
2016-01-13 20:59:57 +01:00
Stephen Adams dbb96bac32 dart2js cps: for(;;) is shorter than while(true)
R=asgerf@google.com

Review URL: https://codereview.chromium.org/1584693003 .
2016-01-13 10:25:41 -08:00
Florian Loitsch 45f4d82cde Revert shared dart2js messages.
This partially reverts commit e802e26d7b.
This reverts commit 6ecea2f559.

R=sigmund@google.com

Review URL: https://codereview.chromium.org/1589493002 .
2016-01-13 18:32:55 +01:00
Florian Loitsch e775fa0932 Add support for 'dart.library.X' environment variables in dart2js.
R=johnniwinther@google.com, sigurdm@google.com

Committed: https://github.com/dart-lang/sdk/commit/369899c8ffca28f28a1af3cc323d1111c1a4a48a
Reverted: https://github.com/dart-lang/sdk/commit/b80994d6ad63ac30b400590cf51815e862c0e8a1

Review URL: https://codereview.chromium.org/1404183002 .
2016-01-13 16:34:46 +01:00
Asger Feldthaus a3cf74fdda dart2js cps: Copy allocation site type when cloning.
Currently makes no difference because type propagation is not run after
inlining, but it will be needed.

BUG=
R=kmillikin@google.com

Review URL: https://codereview.chromium.org/1581853002 .
2016-01-12 16:38:49 -08:00
Harry Terkelsen 666964b3fc dart2js cps: specialize isEmpty and isNotEmpty
BUG=
R=asgerf@google.com

Review URL: https://codereview.chromium.org/1583663003 .
2016-01-12 15:55:50 -08:00
Asger Feldthaus c85916dedc dart2js cps: Hoist unsafe expressions from loop entry.
Primitives that potentially throw cannot normally be hoisted, but we can
sometimes hoist them anyway if they are at the loop entry.

We now hoist GetLength, GetField, GetIndex, NullCheck, and BoundsCheck.

BUG=
R=sigmund@google.com

Review URL: https://codereview.chromium.org/1578963002 .
2016-01-12 15:18:31 -08:00
Asger Feldthaus e6cc028c6f dart2js cps: Preserve parameter hints during eta and beta reductions.
BUG=
R=kmillikin@google.com

Review URL: https://codereview.chromium.org/1582643002 .
2016-01-12 15:12:51 -08:00
Harry Terkelsen 32dc120668 dart2js: fix type annotation
BUG=
R=kmillikin@google.com

Review URL: https://codereview.chromium.org/1580593006 .
2016-01-12 10:57:48 -08:00
Kevin Millikin 1791fb62de dart2js: Remove rethrow from the Tree IR.
BUG=
R=asgerf@google.com

Review URL: https://codereview.chromium.org/1580613002 .
2016-01-12 10:49:25 -08:00
Harry Terkelsen c08bcf530d dart2js: lazily load fields in their own deferred parts
Fixes #24356

BUG=
R=floitsch@google.com

Review URL: https://codereview.chromium.org/1575603002 .
2016-01-12 10:40:41 -08:00
Kevin Millikin 5180cef547 dart2js: Simplification of the IrBuilderVisitor.
Remove more simple helpers by inlining them and simplify.

BUG=
R=asgerf@google.com

Review URL: https://codereview.chromium.org/1570603006 .
2016-01-12 09:15:24 -08:00
Florian Loitsch b80994d6ad Revert "Add support for 'dart.library.X' environment variables in dart2js."
This reverts commit 369899c8ff.

Review URL: https://codereview.chromium.org/1573243004 .
2016-01-12 14:41:00 +01:00
Florian Loitsch 369899c8ff Add support for 'dart.library.X' environment variables in dart2js.
R=johnniwinther@google.com, sigurdm@google.com

Review URL: https://codereview.chromium.org/1404183002 .
2016-01-12 13:58:46 +01:00
Lasse R.H. Nielsen fd59c87146 Make ?? a compile-time constant operator.
Update specification, change analyzer, VM and dart2js.

Fixes issue #25054.
BUG= http://dartbug.com/25054
R=floitsch@google.com, gbracha@google.com

Review URL: https://codereview.chromium.org/1493693002 .
2016-01-12 12:30:07 +01:00
Stephen Adams 133493c5c9 Fix BoundsCheck copying.
The length may be null for a lower-only check.

Review URL: https://codereview.chromium.org/1579073002 .
2016-01-11 19:59:55 -08:00
Asger Feldthaus d432ec78c0 dart2js cps: Remove inlining from TypePropagator.
It seems wasteful to do inlining in two places.

BUG=
R=kmillikin@google.com

Review URL: https://codereview.chromium.org/1575103003 .
2016-01-11 17:50:49 -08:00
Harry Terkelsen 41dde543fe dart2js: remove resolved TODO
The answer to the question in the TODO ("does this cover all cases?") is yes.
In Dart, the LHS of a for-in loop must be an identifier. It cannot be a super
access or a static variable access (unless that variable is in scope).

BUG=
R=sra@google.com

Review URL: https://codereview.chromium.org/1580493003 .
2016-01-11 15:41:21 -08:00
Stephen Adams 7f724c151d Null check remover understands JS fragments.
This is an SSA-parity item.

R=asgerf@google.com

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

Reverted.

Review URL: https://codereview.chromium.org/1567103006 .
2016-01-11 14:33:17 -08:00
Sigmund Cherem 714bf980e1 cpsir: fix co19 test - use process* instead of visit* (we unadvertly removed code that recursed into the arguments)
BUG=
R=asgerf@google.com

Review URL: https://codereview.chromium.org/1572423002 .
2016-01-11 14:19:20 -08:00
Stephen Adams 62c30c6c21 Revert "Null check remover understands JS fragments."
BUG=

Review URL: https://codereview.chromium.org/1577993005 .
2016-01-11 14:11:19 -08:00
Stephen Adams 1576feeb23 Null check remover understands JS fragments.
This is an SSA-parity item.

R=asgerf@google.com

Review URL: https://codereview.chromium.org/1567103006 .
2016-01-11 13:42:17 -08:00
Asger Feldthaus 4f1d09e208 dart2js cps: Fix a comment.
BUG=

Review URL: https://codereview.chromium.org/1579713002 .
2016-01-11 11:08:10 -08:00
Sigmund Cherem 0f626270ad cps_ir: add refinement on "success" arguments for a set of whitelisted methods
and operators.

R=asgerf@google.com

Review URL: https://codereview.chromium.org/1571953002 .
2016-01-11 10:48:14 -08:00
Asger Feldthaus 41412aaa70 dart2js cps: Hoist loop-invariant branches from loop entry.
Performs the following optimization:

  b = COND
  while (true) {
    if (b)
      BRANCH (contains no continue to loop)
    else
      LOOP
  }

==>

  b = COND
  if (b)
    BRANCH
  else
    while (true)
      LOOP

BUG=
R=sra@google.com

Review URL: https://codereview.chromium.org/1573693002 .
2016-01-11 10:06:40 -08:00
Asger Feldthaus 4e0a152f63 dart2js cps: Do not count refinement nodes when measuring size.
BUG=
R=kmillikin@google.com

Review URL: https://codereview.chromium.org/1570353002 .
2016-01-11 09:15:59 -08:00
Asger Feldthaus e3a9b74b56 dart2js cps: Do not remove unused refinements.
Unused refinements may become used after GVN.

BUG=
R=kmillikin@google.com

Review URL: https://codereview.chromium.org/1572043002 .
2016-01-11 09:13:03 -08:00
Johnni Winther 2ddf46bb85 Add EnumSet.
BUG=
R=sigurdm@google.com

Review URL: https://codereview.chromium.org/1568213003.
2016-01-11 11:29:44 +01:00
Kevin Millikin aa21250b7a dart2js: Fix build.
When moving code, I forgot to change a parameter type.  This triggered a
warning.

TBR=asgerf@google.com

Review URL: https://codereview.chromium.org/1572673005 .
2016-01-08 17:38:31 -08:00
Kevin Millikin ad0b2701bb dart2js: Start creating IR nodes in the IrBuilderVisitor class.
BUG=
R=asgerf@google.com

Review URL: https://codereview.chromium.org/1574543003 .
2016-01-08 16:13:10 -08:00