Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(213)

Issue 1159643005: dart2js cps: Do not propagate impure expressions across null receiver. (Closed)

Created:
5 years, 6 months ago by asgerf
Modified:
5 years, 6 months ago
CC:
reviews_dartlang.org
Base URL:
git@github.com:dart-lang/sdk.git@master
Target Ref:
refs/heads/master
Visibility:
Public.

Description

dart2js cps: Do not propagate impure expressions across null receiver. If the receiver is null, the arguments are not evaluated. Example: Dart: var x = null; var y = bar(); x.foo(y); JS before: null.foo$1(bar()); JS after: var y = bar(); null.foo$1(y); If the receiver is known not be null, we still propagate into the arguments, and "pure" expressions can always propagate even if the receiver might be null. InvokeMethod now has a field isReceiverNotNull, which carries a bit of static type information. Another field like this is InvokeStatic.isPure. I intentionally chose to pass along the *least* amount of information that is sufficient for what we need in the tree optimizations. That CPS type propagation was not very good at proving when things are not null, so a couple of things missing from it have been filled in. BUG= R=kmillikin@google.com Committed: https://github.com/dart-lang/sdk/commit/c442bf56976854100a98d4ce59aac65c718bfb7c

Patch Set 1 #

Patch Set 2 : Rebase #

Patch Set 3 : Beefed up type propagation #

Patch Set 4 : Extra fix in type propagation #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+77 lines, -17 lines) Patch
M pkg/compiler/lib/src/cps_ir/cps_ir_nodes.dart View 1 chunk +5 lines, -0 lines 0 comments Download
M pkg/compiler/lib/src/cps_ir/type_propagation.dart View 1 2 3 14 chunks +49 lines, -9 lines 1 comment Download
M pkg/compiler/lib/src/tree_ir/optimization/statement_rewriter.dart View 1 chunk +11 lines, -2 lines 0 comments Download
M pkg/compiler/lib/src/tree_ir/tree_ir_builder.dart View 1 chunk +4 lines, -3 lines 0 comments Download
M pkg/compiler/lib/src/tree_ir/tree_ir_nodes.dart View 2 chunks +8 lines, -2 lines 0 comments Download
M tests/co19/co19-dart2js.status View 1 2 1 chunk +0 lines, -1 line 0 comments Download

Messages

Total messages: 8 (2 generated)
asgerf
5 years, 6 months ago (2015-06-01 17:35:43 UTC) #2
Kevin Millikin (Google)
lgtm
5 years, 6 months ago (2015-06-02 09:39:17 UTC) #3
asgerf
PTAL at delta 4->2. The regression was unbearable so a few improvements to type propagation ...
5 years, 6 months ago (2015-06-02 12:09:04 UTC) #4
karlklose
DBC: https://codereview.chromium.org/1159643005/diff/60001/pkg/compiler/lib/src/cps_ir/type_propagation.dart File pkg/compiler/lib/src/cps_ir/type_propagation.dart (right): https://codereview.chromium.org/1159643005/diff/60001/pkg/compiler/lib/src/cps_ir/type_propagation.dart#newcode122 pkg/compiler/lib/src/cps_ir/type_propagation.dart:122: if (element.isClosure) return functionType; We could also create ...
5 years, 6 months ago (2015-06-02 12:53:23 UTC) #6
Kevin Millikin (Google)
LGTM.
5 years, 6 months ago (2015-06-02 12:55:36 UTC) #7
asgerf
5 years, 6 months ago (2015-06-02 13:06:35 UTC) #8
Message was sent while issue was closed.
Committed patchset #4 (id:60001) manually as
c442bf56976854100a98d4ce59aac65c718bfb7c (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698