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

Issue 39009: Dump more stack frames to perf log when executing a C++ function. (Closed)

Created:
11 years, 9 months ago by Mikhail Naganov
Modified:
9 years, 7 months ago
CC:
v8-dev
Visibility:
Public.

Description

Dump more stack frames to perf log when executing a C++ function. JavaScriptFrameIterator is templatized on the iterator type and renamed to JavaScriptFrameIteratorTemp. The original JSFI is now a typedef for JavaScriptFrameIteratorTemp<StackFrameIterator>. Because of templatizing, JSFI code is moved to frames-inl.h StackTraceFrameIterator moved to frames.* Implemented SafeStackFrameIterator which wraps StackFrameIterator and have the same interface. It performs additional checks of stack addresses prior to delegating to StackFrameIterator. SafeSFI is used in an another specialization of JavaScriptFrameIteratorTemp template to perform safe JS frames iteration on sampler ticks. I haven't took an advantage of having multiple stack frames in tickprocessor yet. Committed: http://code.google.com/p/v8/source/detail?r=1404

Patch Set 1 #

Patch Set 2 : Fixed presubmit.py errors #

Total comments: 19

Patch Set 3 : Changes according to Soren's comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+211 lines, -49 lines) Patch
M src/frames.h View 1 2 3 chunks +70 lines, -4 lines 0 comments Download
M src/frames.cc View 1 2 2 chunks +63 lines, -13 lines 0 comments Download
M src/frames-inl.h View 1 2 2 chunks +35 lines, -1 line 0 comments Download
M src/log.h View 1 chunk +3 lines, -0 lines 0 comments Download
M src/log.cc View 1 2 1 chunk +28 lines, -4 lines 0 comments Download
M src/platform.h View 1 chunk +5 lines, -3 lines 0 comments Download
M src/top.cc View 1 chunk +0 lines, -20 lines 0 comments Download
M test/cctest/test-log-ia32.cc View 1 2 chunks +7 lines, -4 lines 0 comments Download

Messages

Total messages: 4 (0 generated)
Mikhail Naganov
Kasper, please look at this CL as Søren said that you wrote some of stack ...
11 years, 9 months ago (2009-03-03 10:32:59 UTC) #1
Søren Thygesen Gjesse
LGTM http://codereview.chromium.org/39009/diff/1001/1002 File src/frames-inl.h (right): http://codereview.chromium.org/39009/diff/1001/1002#newcode187 Line 187: while (true) { while (true) -> while(!done()). ...
11 years, 9 months ago (2009-03-03 11:30:10 UTC) #2
Mikhail Naganov
http://codereview.chromium.org/39009/diff/1001/1002 File src/frames-inl.h (right): http://codereview.chromium.org/39009/diff/1001/1002#newcode187 Line 187: while (true) { On 2009/03/03 11:30:11, Søren Gjesse ...
11 years, 9 months ago (2009-03-03 11:54:41 UTC) #3
Kasper Lund
11 years, 9 months ago (2009-03-03 13:28:43 UTC) #4
I'm okay with this change even though I'm not completely convinced that the
template trick is superior to simply specializing an abstract iterator, but it
still LGTM.

http://codereview.chromium.org/39009/diff/1001/1003
File src/frames.cc (right):

http://codereview.chromium.org/39009/diff/1001/1003#newcode171
Line 171: if (!iteration_done_) {
How about inverting this and returning with an early bailout?

http://codereview.chromium.org/39009/diff/1001/1003#newcode173
Line 173: if (!iterator_.done()) {
Ditto.

http://codereview.chromium.org/39009/diff/1001/1004
File src/frames.h (right):

http://codereview.chromium.org/39009/diff/1001/1004#newcode561
Line 561: explicit JavaScriptFrameIteratorTemp(Address low_bound, Address
high_bound) :
Nit: Doesn't have to be explicit.

http://codereview.chromium.org/39009/diff/1001/1004#newcode611
Line 611: static bool IsInBounds(
Maybe IsWithinBounds?

http://codereview.chromium.org/39009/diff/1001/1004#newcode615
Line 615: bool IsGoodStackAddress(Address addr) const {
Maybe IsValidStackAddress?

http://codereview.chromium.org/39009/diff/1001/1006
File src/log.h (right):

http://codereview.chromium.org/39009/diff/1001/1006#newcode282
Line 282: // Maximum number of stack frames to capture
Terminate comment with .

http://codereview.chromium.org/39009/diff/1001/1007
File src/platform.h (right):

http://codereview.chromium.org/39009/diff/1001/1007#newcode484
Line 484: if (depth) {
depth != 0 (or maybe >)

Powered by Google App Engine
This is Rietveld 408576698