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

Issue 1626603002: Add missing parent pointers in CopyingVisitor (Closed)

Created:
4 years, 11 months ago by Siggi Cherem (dart-lang)
Modified:
4 years, 10 months ago
CC:
reviews_dartlang.org
Base URL:
git@github.com:dart-lang/sdk.git@master
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+4 lines, -1 line) Patch
M pkg/compiler/lib/src/cps_ir/cps_ir_nodes.dart View 2 chunks +4 lines, -1 line 0 comments Download

Messages

Total messages: 7 (2 generated)
Siggi Cherem (dart-lang)
4 years, 11 months ago (2016-01-22 20:56:42 UTC) #2
asgerf
Nice catch. LGTM
4 years, 11 months ago (2016-01-22 21:12:36 UTC) #3
Siggi Cherem (dart-lang)
Committed patchset #1 (id:1) manually as 7778f54141f11ad3856734365d85f2646e35e754 (presubmit successful).
4 years, 11 months ago (2016-01-22 21:40:58 UTC) #5
Kevin Millikin (Google)
Why was this change necessary? The call to ParentVisitor.setParents in InliningCache.get should be enough. Parent ...
4 years, 11 months ago (2016-01-25 10:15:42 UTC) #6
Siggi Cherem (dart-lang)
4 years, 10 months ago (2016-02-04 22:22:54 UTC) #7
Message was sent while issue was closed.
On 2016/01/25 10:15:42, Kevin Millikin (Google) wrote:
> Why was this change necessary?  The call to ParentVisitor.setParents in
> InliningCache.get should be enough.
> 
> Parent pointers are 'derived' and that's why I implemented the cache so it
> didn't worry about maintaining them when it wasn't necessary, i.e., when terms
> are in the cache.
> 
> Future work might involve a more compact serialized representation of terms,
in
> which case they probably won't have parent pointers anyway.

Ah -- do you mean that to do an actual copy of an IR term I should call the
ParentVisitor after the CopingVisitor?

If so, then this change might not be necessary (although it might be worth
looking at whether it makes a difference in compile-time if we do this all at
once in one visitor or if the parentvisitor pass adds much to the compile-time
cost).

For context: I came across this trying to profile a phase. I was repeatedly
cloning and applying a phase. To clone the IR, I used the CopingVisitor, but I
didn't know about the ParentVisitor. I was just assuming that the CopingVisitor
would preserve the invariant of having parent pointers in place, but then run
into problems when running the phase afterwards.

Powered by Google App Engine
This is Rietveld 408576698