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

Issue 8716009: Distinguish weak references in heap snapshots, group GC roots. (Closed)

Created:
9 years ago by mnaganov (inactive)
Modified:
9 years ago
Reviewers:
Vitaly Repeshko
CC:
v8-dev, loislo, Vyacheslav Egorov (Chromium)
Visibility:
Public.

Description

Distinguish weak references in heap snapshots, group GC roots. Several changes to better organize snapshot data: 1. Provide information about weak references. 2. Group (GC roots) children. 3. Prettify debug snapshot printing. BUG=v8:1832 TEST=cctest/test-heap-profiler/*Weak* Committed: http://code.google.com/p/v8/source/detail?r=10158

Patch Set 1 #

Total comments: 22
Unified diffs Side-by-side diffs Delta from patch set Stats (+397 lines, -52 lines) Patch
M include/v8-profiler.h View 1 chunk +2 lines, -1 line 2 comments Download
M src/bootstrapper.cc View 1 chunk +1 line, -1 line 0 comments Download
M src/heap.cc View 4 chunks +13 lines, -13 lines 0 comments Download
M src/objects.h View 2 chunks +30 lines, -5 lines 4 comments Download
M src/objects.cc View 1 chunk +16 lines, -0 lines 0 comments Download
M src/profile-generator.h View 10 chunks +27 lines, -4 lines 0 comments Download
M src/profile-generator.cc View 20 chunks +210 lines, -28 lines 16 comments Download
M src/profile-generator-inl.h View 1 chunk +19 lines, -0 lines 0 comments Download
M test/cctest/test-heap-profiler.cc View 1 chunk +79 lines, -0 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
mnaganov (inactive)
9 years ago (2011-11-28 14:33:36 UTC) #1
Vitaly Repeshko
LGTM http://codereview.chromium.org/8716009/diff/1/include/v8-profiler.h File include/v8-profiler.h (right): http://codereview.chromium.org/8716009/diff/1/include/v8-profiler.h#newcode224 include/v8-profiler.h:224: kWeak = 6 // A weak persistent handle ...
9 years ago (2011-12-02 23:39:47 UTC) #2
mnaganov (inactive)
9 years ago (2011-12-05 12:55:25 UTC) #3
http://codereview.chromium.org/8716009/diff/1/include/v8-profiler.h
File include/v8-profiler.h (right):

http://codereview.chromium.org/8716009/diff/1/include/v8-profiler.h#newcode224
include/v8-profiler.h:224: kWeak = 6              // A weak persistent handle
reference.
On 2011/12/02 23:39:47, Vitaly Repeshko wrote:
> Can this be used for other weak references, e.g., context chaining?

Sure, just a stale comment. Updated.

http://codereview.chromium.org/8716009/diff/1/src/objects.h
File src/objects.h (right):

http://codereview.chromium.org/8716009/diff/1/src/objects.h#newcode7894
src/objects.h:7894: static const char* kTags[kNumberOfSyncTags];
On 2011/12/02 23:39:47, Vitaly Repeshko wrote:
> One more const.

Done.

http://codereview.chromium.org/8716009/diff/1/src/objects.h#newcode7895
src/objects.h:7895: static const char* kTagNames[kNumberOfSyncTags];
On 2011/12/02 23:39:47, Vitaly Repeshko wrote:
> Same here.

Done.

http://codereview.chromium.org/8716009/diff/1/src/profile-generator.cc
File src/profile-generator.cc (right):

http://codereview.chromium.org/8716009/diff/1/src/profile-generator.cc#newcod...
src/profile-generator.cc:1232: for (int i = 0; i <
VisitorSynchronization::kNumberOfSyncTags; ++i)
On 2011/12/02 23:39:47, Vitaly Repeshko wrote:
> nit: {}

Done.

http://codereview.chromium.org/8716009/diff/1/src/profile-generator.cc#newcod...
src/profile-generator.cc:1890: object_count_ += end - start;
On 2011/12/02 23:39:47, Vitaly Repeshko wrote:
> Will this require a follow up "Fix win64 build"? :)

Thanks. I forgot about this disaster.

http://codereview.chromium.org/8716009/diff/1/src/profile-generator.cc#newcod...
src/profile-generator.cc:1905: 
On 2011/12/02 23:39:47, Vitaly Repeshko wrote:
> nit: Insert one more blank line.

Done.

http://codereview.chromium.org/8716009/diff/1/src/profile-generator.cc#newcod...
src/profile-generator.cc:2338: class RootsReferencesExtractor : public
ObjectVisitor {
On 2011/12/02 23:39:47, Vitaly Repeshko wrote:
> nit: Consider adding more vertical whitespace to the body of this class.

Done.

http://codereview.chromium.org/8716009/diff/1/src/profile-generator.cc#newcod...
src/profile-generator.cc:2340: struct IndexTag {
On 2011/12/02 23:39:47, Vitaly Repeshko wrote:
> Can be private.

Done.

http://codereview.chromium.org/8716009/diff/1/src/profile-generator.cc#newcod...
src/profile-generator.cc:2363: while (strong_index <
strong_references_.length()) {
On 2011/12/02 23:39:47, Vitaly Repeshko wrote:
> You can have a single loop here (over all references) if you add "strong_index
<
> strong_references_.length()" to the first "if" below.

Right. I had this in mind but then forgot. Fixed.

http://codereview.chromium.org/8716009/diff/1/src/profile-generator.cc#newcod...
src/profile-generator.cc:2370:
explorer->SetGcSubrootReference(reference_tags_[tags_index].tag,
On 2011/12/02 23:39:47, Vitaly Repeshko wrote:
> Hmm, actually, are you sure this loop terminates in its current form?
> Strong_index is only incremented in one of the branches.

Yes. strong_references_ is a subset of all_references_. When we meet the item
that is in both sets, we advance both indexes, otherwise only all_references_.

http://codereview.chromium.org/8716009/diff/1/src/profile-generator.cc#newcod...
src/profile-generator.cc:2381: }
On 2011/12/02 23:39:47, Vitaly Repeshko wrote:
> ASSERT(strong_index <= all_index)?

Added to the beginning:

ASSERT(strong_references_.length() <= all_references_.length());

This will "guarantee" that strongs_references_ is a subset of all_references_.

Powered by Google App Engine
This is Rietveld 408576698