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

Issue 1375213003: dart2js cps: Maintain parent pointers instead of recomputing them. (Closed)

Created:
5 years, 2 months ago by asgerf
Modified:
5 years, 2 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: Maintain parent pointers instead of recomputing them. All passes must now preserve valid parent pointers. Several passes already did this (or tried to do it). The IR integrity checker can now check that parent pointers are valid. This has caught a number of missing parent pointers assignments in passes that otherwise tried to preserve them. All node constructors now set parent pointers. This is very convenient for simple transformations, but also a bit of a trap since updating a field on an existing node does not update the parent pointer. This is a pretty heavy-handed change. The main rationale for it are: - The helpers methods require parent pointers, so they are more useful when parent pointers are always set. - The integrity checker can catch bogus parent pointers after passes that have to maintain them anyway. - The integrity checker is super slow, but this can finally be fixed if it can assume parent pointers are valid (not part of this CL). The IR visitors have been changed a bit to support a generic parent visitor that does not have to implement every visit method. The 'parent index' fields have been removed. BUG= R=kmillikin@google.com Committed: https://github.com/dart-lang/sdk/commit/6cc9b435354ea4fe3796437e3cc7091f6a11de19 Committed: https://github.com/dart-lang/sdk/commit/d43d95aaa3a347fe51c78130c72cbc8ce93238f8

Patch Set 1 #

Total comments: 2

Patch Set 2 : Fix #

Total comments: 6

Patch Set 3 : Remove unnecessary code #

Patch Set 4 : Rebase #

Patch Set 5 : Parent pointer fix after merge #

Patch Set 6 : Revert + Unrevert #

Patch Set 7 : Fix imports #

Patch Set 8 : Remove more unused imports #

Patch Set 9 : Rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+415 lines, -357 lines) Patch
M pkg/compiler/lib/src/cps_ir/cps_fragment.dart View 1 2 2 chunks +16 lines, -0 lines 0 comments Download
M pkg/compiler/lib/src/cps_ir/cps_ir_integrity.dart View 3 chunks +50 lines, -5 lines 0 comments Download
M pkg/compiler/lib/src/cps_ir/cps_ir_nodes.dart View 1 2 3 4 55 chunks +250 lines, -25 lines 0 comments Download
M pkg/compiler/lib/src/cps_ir/insert_refinements.dart View 1 2 3 4 5 6 7 4 chunks +6 lines, -11 lines 0 comments Download
M pkg/compiler/lib/src/cps_ir/mutable_ssa.dart View 1 chunk +1 line, -1 line 0 comments Download
M pkg/compiler/lib/src/cps_ir/optimizers.dart View 1 chunk +2 lines, -1 line 0 comments Download
A pkg/compiler/lib/src/cps_ir/parent_visitor.dart View 1 chunk +43 lines, -0 lines 0 comments Download
M pkg/compiler/lib/src/cps_ir/redundant_join.dart View 3 chunks +3 lines, -3 lines 0 comments Download
M pkg/compiler/lib/src/cps_ir/redundant_phi.dart View 1 chunk +1 line, -4 lines 0 comments Download
M pkg/compiler/lib/src/cps_ir/remove_refinements.dart View 1 chunk +1 line, -3 lines 0 comments Download
M pkg/compiler/lib/src/cps_ir/scalar_replacement.dart View 1 2 3 4 chunks +3 lines, -4 lines 0 comments Download
M pkg/compiler/lib/src/cps_ir/share_interceptors.dart View 2 chunks +2 lines, -1 line 0 comments Download
M pkg/compiler/lib/src/cps_ir/shrinking_reductions.dart View 1 2 3 8 chunks +8 lines, -240 lines 0 comments Download
M pkg/compiler/lib/src/cps_ir/type_propagation.dart View 1 2 3 4 5 6 7 8 6 chunks +4 lines, -9 lines 0 comments Download
M pkg/compiler/lib/src/js_backend/codegen/task.dart View 1 2 3 3 chunks +4 lines, -3 lines 0 comments Download
M pkg/compiler/lib/src/js_backend/codegen/unsugar.dart View 1 2 3 10 chunks +20 lines, -46 lines 0 comments Download
M tests/compiler/dart2js/js_backend_cps_ir_source_information_test.dart View 1 2 3 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 6 (1 generated)
asgerf
https://codereview.chromium.org/1375213003/diff/1/pkg/compiler/lib/src/cps_ir/shrinking_reductions.dart File pkg/compiler/lib/src/cps_ir/shrinking_reductions.dart (left): https://codereview.chromium.org/1375213003/diff/1/pkg/compiler/lib/src/cps_ir/shrinking_reductions.dart#oldcode66 pkg/compiler/lib/src/cps_ir/shrinking_reductions.dart:66: continuations.removeLast(); The array shift kind of defeats the purpose ...
5 years, 2 months ago (2015-10-01 10:54:46 UTC) #2
Kevin Millikin (Google)
I'd go farther and make the parent points be set properly immediately after construction, if ...
5 years, 2 months ago (2015-10-05 12:04:37 UTC) #3
asgerf
https://codereview.chromium.org/1375213003/diff/20001/pkg/compiler/lib/src/cps_ir/cps_fragment.dart File pkg/compiler/lib/src/cps_ir/cps_fragment.dart (right): https://codereview.chromium.org/1375213003/diff/20001/pkg/compiler/lib/src/cps_ir/cps_fragment.dart#newcode57 pkg/compiler/lib/src/cps_ir/cps_fragment.dart:57: InteriorNode context; On 2015/10/05 12:04:37, Kevin Millikin (Google) wrote: ...
5 years, 2 months ago (2015-10-12 13:18:32 UTC) #4
asgerf
Committed patchset #5 (id:80001) manually as 6cc9b435354ea4fe3796437e3cc7091f6a11de19 (presubmit successful).
5 years, 2 months ago (2015-10-12 14:26:37 UTC) #5
asgerf
5 years, 2 months ago (2015-10-13 08:50:46 UTC) #6
Message was sent while issue was closed.
Committed patchset #9 (id:160001) manually as
d43d95aaa3a347fe51c78130c72cbc8ce93238f8 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698