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

Issue 1188253006: dart2js cps: Replace getter/setter calls with direct field access. (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: Replace getter/setter calls with direct field access. .length on JS arrays are not introduced yet because that is not seen as field accesses by our class hierarchy. I've changed the contract on Primitives so they can have side effects, depend on state, diverge, throw, anything goes. GetField on possibly null receivers would not be allowed otherwise. AFAIK there are no optimizations that actually used the contract on primitives, it just seemed like a good idea at one point in the past, so that change only affects a single doc comment. I'll migrate some of the classes that can now be primitives in another CL. BuiltinOperators are still required to be pure, although that too may possibly change soon. BUG= R=kmillikin@google.com Committed: https://github.com/dart-lang/sdk/commit/2f3b889c7b515ccbd720507f85a1b45ce9a5a998

Patch Set 1 #

Patch Set 2 : Track if GetField may throw to avoid eliminating a NPE #

Patch Set 3 : Fix test case #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+111 lines, -23 lines) Patch
M pkg/compiler/lib/src/cps_ir/cps_ir_nodes.dart View 1 3 chunks +20 lines, -5 lines 0 comments Download
M pkg/compiler/lib/src/cps_ir/shrinking_reductions.dart View 1 1 chunk +5 lines, -2 lines 0 comments Download
M pkg/compiler/lib/src/cps_ir/type_propagation.dart View 1 9 chunks +75 lines, -7 lines 2 comments Download
A + tests/language/dead_field_access_test.dart View 1 2 1 chunk +11 lines, -9 lines 0 comments Download

Messages

Total messages: 8 (1 generated)
asgerf
5 years, 6 months ago (2015-06-18 17:17:06 UTC) #2
Kevin Millikin (Google)
There is one place where we rely on primitives having a notion of purity: in ...
5 years, 6 months ago (2015-06-19 11:40:36 UTC) #3
asgerf
Thanks for catching that. I'm surprised the test suite did not catch that. I added ...
5 years, 6 months ago (2015-06-19 11:47:24 UTC) #4
Kevin Millikin (Google)
Nice, thanks.
5 years, 6 months ago (2015-06-19 12:00:53 UTC) #5
sra1
DBC https://codereview.chromium.org/1188253006/diff/40001/pkg/compiler/lib/src/cps_ir/type_propagation.dart File pkg/compiler/lib/src/cps_ir/type_propagation.dart (right): https://codereview.chromium.org/1188253006/diff/40001/pkg/compiler/lib/src/cps_ir/type_propagation.dart#newcode691 pkg/compiler/lib/src/cps_ir/type_propagation.dart:691: SetField set = new SetField(getDartReceiver(node), This is not ...
5 years, 6 months ago (2015-06-19 18:21:00 UTC) #6
asgerf
https://codereview.chromium.org/1188253006/diff/40001/pkg/compiler/lib/src/cps_ir/type_propagation.dart File pkg/compiler/lib/src/cps_ir/type_propagation.dart (right): https://codereview.chromium.org/1188253006/diff/40001/pkg/compiler/lib/src/cps_ir/type_propagation.dart#newcode691 pkg/compiler/lib/src/cps_ir/type_propagation.dart:691: SetField set = new SetField(getDartReceiver(node), On 2015/06/19 18:21:00, sra1 ...
5 years, 6 months ago (2015-06-22 09:31:58 UTC) #7
asgerf
5 years, 6 months ago (2015-06-22 14:08:56 UTC) #8
Message was sent while issue was closed.
Committed patchset #3 (id:40001) manually as
2f3b889c7b515ccbd720507f85a1b45ce9a5a998 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698