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

Issue 1743283002: dart2js cps: Use definitions by default, not references. (Closed)

Created:
4 years, 9 months ago by asgerf
Modified:
4 years, 9 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: Use definitions by default, not references. Example of new client code: x.object => x.objectRef x.object.definition => x.object x.arguments[n].definition => x.argument(n) BUG= R=sigmund@google.com Committed: https://github.com/dart-lang/sdk/commit/e54c4c7003477c67457367701614fdfe721a50c9

Patch Set 1 #

Patch Set 2 : Fix long lines and use helpers that we already have #

Total comments: 4

Patch Set 3 : Rebase #

Patch Set 4 : Fix doc comments and long lines #

Total comments: 7
Unified diffs Side-by-side diffs Delta from patch set Stats (+840 lines, -748 lines) Patch
M pkg/compiler/lib/src/cps_ir/backward_null_check_remover.dart View 5 chunks +7 lines, -8 lines 0 comments Download
M pkg/compiler/lib/src/cps_ir/bounds_checker.dart View 12 chunks +32 lines, -32 lines 1 comment Download
M pkg/compiler/lib/src/cps_ir/cps_ir_builder.dart View 1 chunk +2 lines, -2 lines 0 comments Download
M pkg/compiler/lib/src/cps_ir/cps_ir_integrity.dart View 3 chunks +3 lines, -3 lines 0 comments Download
M pkg/compiler/lib/src/cps_ir/cps_ir_nodes.dart View 1 2 3 91 chunks +383 lines, -287 lines 4 comments Download
M pkg/compiler/lib/src/cps_ir/cps_ir_nodes_sexpr.dart View 8 chunks +53 lines, -53 lines 0 comments Download
M pkg/compiler/lib/src/cps_ir/cps_ir_tracer.dart View 9 chunks +55 lines, -55 lines 0 comments Download
M pkg/compiler/lib/src/cps_ir/finalize.dart View 4 chunks +10 lines, -11 lines 1 comment Download
M pkg/compiler/lib/src/cps_ir/gvn.dart View 2 chunks +3 lines, -3 lines 0 comments Download
M pkg/compiler/lib/src/cps_ir/inline.dart View 6 chunks +16 lines, -17 lines 0 comments Download
M pkg/compiler/lib/src/cps_ir/insert_refinements.dart View 6 chunks +15 lines, -15 lines 0 comments Download
M pkg/compiler/lib/src/cps_ir/loop_hierarchy.dart View 1 chunk +4 lines, -4 lines 0 comments Download
M pkg/compiler/lib/src/cps_ir/loop_invariant_branch.dart View 3 chunks +5 lines, -5 lines 0 comments Download
M pkg/compiler/lib/src/cps_ir/mutable_ssa.dart View 5 chunks +12 lines, -12 lines 0 comments Download
M pkg/compiler/lib/src/cps_ir/optimize_interceptors.dart View 6 chunks +7 lines, -7 lines 0 comments Download
M pkg/compiler/lib/src/cps_ir/path_based_optimizer.dart View 4 chunks +6 lines, -6 lines 0 comments Download
M pkg/compiler/lib/src/cps_ir/redundant_join.dart View 1 2 3 6 chunks +13 lines, -11 lines 0 comments Download
M pkg/compiler/lib/src/cps_ir/redundant_phi.dart View 6 chunks +6 lines, -6 lines 0 comments Download
M pkg/compiler/lib/src/cps_ir/scalar_replacement.dart View 5 chunks +8 lines, -8 lines 0 comments Download
M pkg/compiler/lib/src/cps_ir/shrinking_reductions.dart View 9 chunks +19 lines, -19 lines 1 comment Download
M pkg/compiler/lib/src/cps_ir/type_propagation.dart View 52 chunks +101 lines, -104 lines 0 comments Download
M pkg/compiler/lib/src/cps_ir/update_refinements.dart View 2 chunks +3 lines, -3 lines 0 comments Download
M pkg/compiler/lib/src/cps_ir/use_field_initializers.dart View 3 chunks +9 lines, -9 lines 0 comments Download
M pkg/compiler/lib/src/js_backend/codegen/unsugar.dart View 5 chunks +12 lines, -12 lines 0 comments Download
M pkg/compiler/lib/src/tree_ir/tree_ir_builder.dart View 16 chunks +56 lines, -56 lines 0 comments Download

Messages

Total messages: 13 (5 generated)
asgerf
4 years, 9 months ago (2016-02-29 17:18:34 UTC) #4
Siggi Cherem (dart-lang)
lgtm https://codereview.chromium.org/1743283002/diff/20001/pkg/compiler/lib/src/cps_ir/cps_ir_nodes.dart File pkg/compiler/lib/src/cps_ir/cps_ir_nodes.dart (right): https://codereview.chromium.org/1743283002/diff/20001/pkg/compiler/lib/src/cps_ir/cps_ir_nodes.dart#newcode2002 pkg/compiler/lib/src/cps_ir/cps_ir_nodes.dart:2002: /// variables with consecutive values from [argumentRefs], in ...
4 years, 9 months ago (2016-02-29 18:00:00 UTC) #5
asgerf
https://codereview.chromium.org/1743283002/diff/20001/pkg/compiler/lib/src/cps_ir/cps_ir_nodes.dart File pkg/compiler/lib/src/cps_ir/cps_ir_nodes.dart (right): https://codereview.chromium.org/1743283002/diff/20001/pkg/compiler/lib/src/cps_ir/cps_ir_nodes.dart#newcode2002 pkg/compiler/lib/src/cps_ir/cps_ir_nodes.dart:2002: /// variables with consecutive values from [argumentRefs], in the ...
4 years, 9 months ago (2016-03-01 12:07:00 UTC) #6
asgerf
Committed patchset #4 (id:60001) manually as e54c4c7003477c67457367701614fdfe721a50c9 (presubmit successful).
4 years, 9 months ago (2016-03-01 12:25:38 UTC) #8
sra1
I have misgivings about this change. Perhaps there is some context I am missing. I'm ...
4 years, 9 months ago (2016-03-01 17:59:53 UTC) #10
sra1
I have misgivings about this change. Perhaps there is some context I am missing. I'm ...
4 years, 9 months ago (2016-03-01 17:59:57 UTC) #11
sra1
I have misgivings about this change. Perhaps there is some context I am missing. I'm ...
4 years, 9 months ago (2016-03-01 18:00:02 UTC) #12
asgerf
4 years, 9 months ago (2016-03-01 19:21:24 UTC) #13
Message was sent while issue was closed.
On 2016/03/01 18:00:02, sra1 wrote:
> I have misgivings about this change. Perhaps there is some context I am
missing.
> 
> I'm not sure the change is a overall win. Some code looks better, some worse
for
> the longer names.
> 
> The cost of operations is incrementally hidden. It is harder to recognize that
> when a reference and its definition are used that they could be bound to
locals,
> or an access hoisted.

I used to feel the same way, but after using that API for about a year or so I
can't justify References being the "default" thing to access in a node.

I can't think of a time I had any reason to keep a Reference object in a local,
except when iterating over uses, and that API is the same.

> I think the extra methods will make it harder to learn the IR. The `get
> arguments` case is especially subtle. I think we should live with the
> representation or change the representation rather than add more 'convenience'
> methods that are adding more ways to do the same thing without providing a
true
> abstraction.

Really?  If it had been like this when you started looking at the CPS IR, would
this had been a problem?

I also don't like "semi-abstractions" like this, but I think it's just the
lesser
of two evils.

I do find that the code is more self-documenting now.  It shows how things are
supposed to be used.

I'm completely in favor of changing the representation if it can be done, but
I'm afraid that ship has sailed.

> We try to avoid abbreviations. How do you feel about changing xxxRef(s) to
> xxxReference(s)?
> (If we like the abbreviations, perhaps we should change the classes to Ref and
> Def.)

Once again I feel it's just the lesser of two evils.

There are 51 fields with that suffix. It's a very straightforward naming scheme.

The short name doesn't break lines as much and it doesn't steal as much
attention
from the important part of the field name.

Powered by Google App Engine
This is Rietveld 408576698