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

Issue 266643002: Object graph visitor: general depth-first search. (Closed)

Created:
6 years, 7 months ago by koda
Modified:
6 years, 7 months ago
Reviewers:
Cutch, Ivan Posva
CC:
reviews_dartlang.org, vm-dev_dartlang.org, Ivan Posva, turnidge
Visibility:
Public.

Description

Object graph visitor: general depth-first search. Features: * Performs a pre-order, depth-first search. * Allows the visitor to direct whether to proceed, backtrack, or abort. * Provides a complete chain of parents to the root. (unlike the GC marking stack). The plan is to use this in the observatory, e.g.: * inspect a path from the isolate roots to a particular object, or * determine how much memory is kept alive by some particular object or class of objects. R=johnmccutchan@google.com Committed: https://code.google.com/p/dart/source/detail?r=35711

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : #

Patch Set 4 : #

Patch Set 5 : #

Patch Set 6 : #

Total comments: 4

Patch Set 7 : #

Patch Set 8 : #

Total comments: 4

Patch Set 9 : #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+338 lines, -20 lines) Patch
M runtime/vm/heap.h View 1 2 3 4 5 6 7 8 1 chunk +3 lines, -0 lines 0 comments Download
A runtime/vm/object_graph.h View 1 2 3 4 5 6 1 chunk +71 lines, -0 lines 0 comments Download
A runtime/vm/object_graph.cc View 1 2 3 4 5 6 7 8 1 chunk +149 lines, -0 lines 2 comments Download
A runtime/vm/object_graph_test.cc View 1 2 3 4 5 6 7 1 chunk +92 lines, -0 lines 0 comments Download
M runtime/vm/pages.h View 1 2 3 4 5 6 7 8 1 chunk +2 lines, -0 lines 0 comments Download
M runtime/vm/pages.cc View 1 2 3 4 5 6 7 8 3 chunks +18 lines, -20 lines 0 comments Download
M runtime/vm/vm_sources.gypi View 1 2 3 4 5 6 7 8 1 chunk +3 lines, -0 lines 0 comments Download

Messages

Total messages: 10 (0 generated)
koda
6 years, 7 months ago (2014-05-01 20:59:08 UTC) #1
Cutch
https://codereview.chromium.org/266643002/diff/100001/runtime/vm/object_graph.cc File runtime/vm/object_graph.cc (right): https://codereview.chromium.org/266643002/diff/100001/runtime/vm/object_graph.cc#newcode41 runtime/vm/object_graph.cc:41: void Drain(ObjectGraph::Visitor* visitor) { I would rename this to ...
6 years, 7 months ago (2014-05-02 18:23:42 UTC) #2
koda
https://codereview.chromium.org/266643002/diff/100001/runtime/vm/object_graph.cc File runtime/vm/object_graph.cc (right): https://codereview.chromium.org/266643002/diff/100001/runtime/vm/object_graph.cc#newcode41 runtime/vm/object_graph.cc:41: void Drain(ObjectGraph::Visitor* visitor) { On 2014/05/02 18:23:42, Cutch wrote: ...
6 years, 7 months ago (2014-05-02 18:51:34 UTC) #3
koda
On 2014/05/02 18:51:34, koda wrote: > https://codereview.chromium.org/266643002/diff/100001/runtime/vm/object_graph.cc > File runtime/vm/object_graph.cc (right): > > https://codereview.chromium.org/266643002/diff/100001/runtime/vm/object_graph.cc#newcode41 > ...
6 years, 7 months ago (2014-05-02 20:03:31 UTC) #4
Cutch
lgtm
6 years, 7 months ago (2014-05-02 20:09:00 UTC) #5
Ivan Posva
DBC -ip https://codereview.chromium.org/266643002/diff/140001/runtime/vm/object_graph.cc File runtime/vm/object_graph.cc (right): https://codereview.chromium.org/266643002/diff/140001/runtime/vm/object_graph.cc#newcode7 runtime/vm/object_graph.cc:7: #include <vector> Please use a GrowableArray here.
6 years, 7 months ago (2014-05-02 21:20:53 UTC) #6
koda
https://codereview.chromium.org/266643002/diff/140001/runtime/vm/object_graph.cc File runtime/vm/object_graph.cc (right): https://codereview.chromium.org/266643002/diff/140001/runtime/vm/object_graph.cc#newcode7 runtime/vm/object_graph.cc:7: #include <vector> On 2014/05/02 21:20:53, Ivan Posva wrote: > ...
6 years, 7 months ago (2014-05-02 21:31:40 UTC) #7
koda
Committed patchset #9 manually as r35711 (presubmit successful).
6 years, 7 months ago (2014-05-02 21:38:34 UTC) #8
Ivan Posva
LGTMwC -Ivan https://codereview.chromium.org/266643002/diff/140001/runtime/vm/object_graph.h File runtime/vm/object_graph.h (right): https://codereview.chromium.org/266643002/diff/140001/runtime/vm/object_graph.h#newcode52 runtime/vm/object_graph.h:52: // No GC is allowed during the ...
6 years, 7 months ago (2014-05-02 22:20:40 UTC) #9
koda
6 years, 7 months ago (2014-05-02 22:45:18 UTC) #10
Message was sent while issue was closed.
https://codereview.chromium.org/266643002/diff/140001/runtime/vm/object_graph.h
File runtime/vm/object_graph.h (right):

https://codereview.chromium.org/266643002/diff/140001/runtime/vm/object_graph...
runtime/vm/object_graph.h:52: // No GC is allowed during the lifetime of an
ObjectGraph instance.
On 2014/05/02 22:20:41, Ivan Posva wrote:
> No allocation and no GC is allowed...

Actually, the comment is obsolete, since I moved the NoGCScope into the Iterate*
methods.

I clarified the warning on Visitor::VisitObject in the follow-up CL.

https://codereview.chromium.org/266643002/diff/160001/runtime/vm/object_graph.cc
File runtime/vm/object_graph.cc (right):

https://codereview.chromium.org/266643002/diff/160001/runtime/vm/object_graph...
runtime/vm/object_graph.cc:125: isolate_->heap()->WriteProtectCode(true);
On 2014/05/02 22:20:41, Ivan Posva wrote:
> To make sure that this destructor is called you need to make the ObjectGraph
> extend StackResource.

Done in follow-up CL.

Powered by Google App Engine
This is Rietveld 408576698