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

Issue 267077: Add initial semi-working producers profile. (Closed)

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

Description

Add initial semi-working producers profile. Turned on with '--log-producers' flag, also needs '--noinline-new' (this is temporarily), '--log-code', '--log-gc'. Not all allocations are traced (I'm investigating.) Stacks are stored using weak handles. Thus, when an object is collected, its allocation stack is deleted. Committed: http://code.google.com/p/v8/source/detail?r=3069

Patch Set 1 #

Patch Set 2 : wrapped long lines #

Total comments: 16

Patch Set 3 : Comments addressed #

Unified diffs Side-by-side diffs Delta from patch set Stats (+151 lines, -1 line) Patch
M src/flag-definitions.h View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M src/global-handles.h View 1 2 2 chunks +6 lines, -0 lines 0 comments Download
M src/global-handles.cc View 1 2 1 chunk +10 lines, -0 lines 0 comments Download
M src/heap.cc View 1 2 3 chunks +5 lines, -0 lines 0 comments Download
M src/heap-profiler.h View 1 2 1 chunk +8 lines, -0 lines 0 comments Download
M src/heap-profiler.cc View 1 2 5 chunks +55 lines, -1 line 0 comments Download
M src/log.h View 1 chunk +2 lines, -0 lines 0 comments Download
M src/log.cc View 1 2 1 chunk +15 lines, -0 lines 0 comments Download
M tools/tickprocessor.js View 1 3 chunks +49 lines, -0 lines 0 comments Download

Messages

Total messages: 5 (0 generated)
mnaganov (inactive)
11 years, 2 months ago (2009-10-13 15:57:12 UTC) #1
mnaganov (inactive)
Hi Kevin, Both Soeren and Mads are on vacation. Can you please take a look?
11 years, 2 months ago (2009-10-13 16:03:53 UTC) #2
Kevin Millikin (Chromium)
As an initial implementation it LGTM. http://codereview.chromium.org/267077/diff/2001/22 File src/global-handles.h (right): http://codereview.chromium.org/267077/diff/2001/22#newcode57 Line 57: typedef void ...
11 years, 2 months ago (2009-10-14 15:11:30 UTC) #3
Vitaly Repeshko
Drive by comments. http://codereview.chromium.org/267077/diff/2001/23 File src/heap-profiler.cc (right): http://codereview.chromium.org/267077/diff/2001/23#newcode587 Line 587: object.ClearWeak(); You probably want to ...
11 years, 2 months ago (2009-10-14 17:05:55 UTC) #4
mnaganov (inactive)
11 years, 2 months ago (2009-10-15 07:44:16 UTC) #5
Thanks Kevin and Vitaly!

http://codereview.chromium.org/267077/diff/2001/22
File src/global-handles.h (right):

http://codereview.chromium.org/267077/diff/2001/22#newcode57
Line 57: typedef void (*WeakReferenceVisitor)(Object* object, void* parameter);
On 2009/10/14 15:11:31, Kevin Millikin wrote:
> This shouldn't be called ...Visitor unless it's a subclass of the
ObjectVisitor.
>  I can't think of a better name, though.

Renamed to WeakReferenceGuest.

http://codereview.chromium.org/267077/diff/2001/23
File src/heap-profiler.cc (right):

http://codereview.chromium.org/267077/diff/2001/23#newcode587
Line 587: object.ClearWeak();
On 2009/10/14 17:05:55, Vitaly wrote:
> You probably want to Dispose() the weak handle here. ClearWeak() turns it into
a
> strong handle.

Yes, I want the handle to disappear. Thanks for spotting this!

http://codereview.chromium.org/267077/diff/2001/23#newcode597
Line 597: static_cast<Address*>(trace)));
On 2009/10/14 15:11:31, Kevin Millikin wrote:
> Can reinterpret_cast here.

Done.

http://codereview.chromium.org/267077/diff/2001/23#newcode643
Line 643: GlobalHandles::IterateWeakRoots(PrintProducerStackTrace,
StackWeakReferenceCallback);
On 2009/10/14 17:05:55, Vitaly wrote:
> Line too long?

Fixed. I forgot run presubmit.

http://codereview.chromium.org/267077/diff/2001/23#newcode665
Line 665: HandleScope scope;
On 2009/10/14 17:05:55, Vitaly wrote:
> Persistent handles don't need handle scope.

This remained from my attempt to use public API that required lots of handles to
be created. Removed.

http://codereview.chromium.org/267077/diff/2001/23#newcode666
Line 666: Handle<Object> handle = GlobalHandles::Create(obj);
On 2009/10/14 17:05:55, Vitaly wrote:
> Why not use include/v8.h API here?

I tried initially, but this caused me to write ugly redundant chains of handles
conversions back and forth, so I decided to boil it down by using internal API
directly.

http://codereview.chromium.org/267077/diff/2001/24
File src/heap-profiler.h (right):

http://codereview.chromium.org/267077/diff/2001/24#newcode261
Line 261: static bool can_log;
On 2009/10/14 15:11:31, Kevin Millikin wrote:
> can_log_.  I'd prefer that it was private, and there was a Setup function that
> set it to true.

Done.

http://codereview.chromium.org/267077/diff/2001/25
File src/heap.cc (right):

http://codereview.chromium.org/267077/diff/2001/25#newcode3313
Line 3313: ProducerHeapProfile::can_log = true;
On 2009/10/14 15:11:31, Kevin Millikin wrote:
> If you have a ProducerHeapProfile::Setup function you can call it here (with a
> comment that it should be called last during heap setup).

Done.

Powered by Google App Engine
This is Rietveld 408576698