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

Issue 209028: Heap profiler: count the number of back references for objects. (Closed)

Created:
11 years, 3 months ago by mnaganov (inactive)
Modified:
9 years, 7 months ago
CC:
v8-dev
Visibility:
Public.

Description

Heap profiler: count the number of back references for objects. Also, perform some refactoring to reuse common code between constructor and retainer profiles. Committed: http://code.google.com/p/v8/source/detail?r=2936

Patch Set 1 #

Total comments: 18

Patch Set 2 : Fix invalid overloading. #

Total comments: 4

Patch Set 3 : Comments addressed #

Unified diffs Side-by-side diffs Delta from patch set Stats (+309 lines, -224 lines) Patch
M src/heap-profiler.h View 1 2 10 chunks +60 lines, -53 lines 0 comments Download
M src/heap-profiler.cc View 1 2 9 chunks +173 lines, -145 lines 0 comments Download
M src/log.h View 1 chunk +2 lines, -1 line 0 comments Download
M src/log.cc View 1 2 1 chunk +34 lines, -7 lines 0 comments Download
M src/log-utils.h View 1 3 chunks +6 lines, -3 lines 0 comments Download
M src/log-utils.cc View 1 2 1 chunk +12 lines, -0 lines 0 comments Download
M test/cctest/test-heap-profiler.cc View 1 2 10 chunks +22 lines, -15 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
mnaganov (inactive)
11 years, 3 months ago (2009-09-18 09:20:28 UTC) #1
Søren Thygesen Gjesse
LGTM http://codereview.chromium.org/209028/diff/1/2 File src/heap-profiler.cc (right): http://codereview.chromium.org/209028/diff/1/2#newcode48 Line 48: static void InsertIntoTree( We normally use this ...
11 years, 3 months ago (2009-09-18 11:18:28 UTC) #2
mnaganov (inactive)
11 years, 3 months ago (2009-09-18 12:03:38 UTC) #3
Thanks to your comments, I've removed 21 lines from this patch.

http://codereview.chromium.org/209028/diff/1/2
File src/heap-profiler.cc (right):

http://codereview.chromium.org/209028/diff/1/2#newcode48
Line 48: static void InsertIntoTree(
On 2009/09/18 11:18:28, Søren Gjesse wrote:
> We normally use this form for argument list that does not fit on one line.
> 
> static void InsertIntoTree(JSObjectsClusterTree* tree,
>                            HeapObject* obj,
>                            bool fine_grain);
> 
> Probable apply to other places below.

This form you mention has a drawback that changing method name requires you to
realign arguments (and you become the person whom to blame according to SVN.)
But I regard consistency, so I've changed them to conform to project style.

http://codereview.chromium.org/209028/diff/1/2#newcode74
Line 74: JSObjectsCluster Clusterizer::Clusterize(
On 2009/09/18 11:18:28, Søren Gjesse wrote:
> void Clusterizer::Clusterize(..., ClusterrizeResult& result) {
>   ...
>   result.SetCluster(...);
>   ...
>   result.SetSize(...):
>   ...
> }

Thanks to your comment, I discovered that I can remove size calculation from
this function, as it only was here due to historical reasons.

http://codereview.chromium.org/209028/diff/1/2#newcode180
Line 180: void Call(
On 2009/09/18 11:18:28, Søren Gjesse wrote:
> Move arguments one line up.

Done.

http://codereview.chromium.org/209028/diff/1/2#newcode185
Line 185: static void Print(
On 2009/09/18 11:18:28, Søren Gjesse wrote:
> Move arguments one line up. Probably more below where this apply.

Done.

http://codereview.chromium.org/209028/diff/1/3
File src/heap-profiler.h (right):

http://codereview.chromium.org/209028/diff/1/3#newcode130
Line 130: virtual void Call(
On 2009/09/18 11:18:28, Søren Gjesse wrote:
> Move arguments one line up.

Done.

http://codereview.chromium.org/209028/diff/1/3#newcode236
Line 236: virtual void PrintRetainers(
On 2009/09/18 11:18:28, Søren Gjesse wrote:
> Move arguments one line up and split.

Done.

http://codereview.chromium.org/209028/diff/1/3#newcode259
Line 259: void Call(
On 2009/09/18 11:18:28, Søren Gjesse wrote:
> Move arguments one line up.

Done.

http://codereview.chromium.org/209028/diff/1/4
File src/log-utils.cc (right):

http://codereview.chromium.org/209028/diff/1/4#newcode258
Line 258: len = Log::kMessageBufferSize - pos_;
On 2009/09/18 11:18:28, Søren Gjesse wrote:
> Wouldn't the right thing here be to assert that len is >= 0 and return if len
==
> 0?

Done.

http://codereview.chromium.org/209028/diff/1/8
File test/cctest/test-heap-profiler.cc (right):

http://codereview.chromium.org/209028/diff/1/8#newcode37
Line 37: const i::NumberAndSizeInfo& number_and_size) {
On 2009/09/18 11:18:28, Søren Gjesse wrote:
> Please move the parameters one line up:
> 
> void Call(const JSObjectsCluster& cluster,
>           const i::NumberAndSizeInfo& number_and_size) {
> ...

Done.

http://codereview.chromium.org/209028/diff/3001/3004
File src/log-utils.cc (right):

http://codereview.chromium.org/209028/diff/3001/3004#newcode315
Line 315: len = Log::kMessageBufferSize - pos_;
On 2009/09/18 11:18:28, Søren Gjesse wrote:
> Wouldn't the right thing to do here be to assert len >= 0 and return if len ==
> 0?

Done.

http://codereview.chromium.org/209028/diff/3001/3006
File src/log.cc (right):

http://codereview.chromium.org/209028/diff/3001/3006#newcode904
Line 904: static const int event_text_len = strlen(event_text);
On 2009/09/18 11:18:28, Søren Gjesse wrote:
> The actual output len will be 2 less as the %S is overtaken by the constructor
> name. Maybe comment that being conservative with the length is OK.

Done.

Powered by Google App Engine
This is Rietveld 408576698