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

Issue 546089: Fix issue 553: function frame is skipped in profile when compare stub is called. (Closed)

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

Description

Fix issue 553: function frame is skipped in profile when compare stub is called. The problem appeared due to a fact that stubs doesn't create a stack frame, reusing the stack frame of the caller function. When building stack traces, the current function is retrieved from PC, and its callees are retrieved by traversing the stack backwards. Thus, for stubs, the stub itself was discovered via PC, and then stub's caller's caller was retrieved from stack. To fix this problem, a pointer to JSFunction object is now captured from the topmost stack frame, and is saved into stack trace log record. Then a simple heuristics is applied whether a referred function should be added to decoded stack, or not, to avoid reporting the same function twice (from PC and from the pointer.) BUG=553 TEST=added to mjsunit/tools/tickprocessor Committed: http://code.google.com/p/v8/source/detail?r=3673

Patch Set 1 #

Total comments: 10

Patch Set 2 : Introduced dedicated log event types, added stuff for DevTools #

Unified diffs Side-by-side diffs Delta from patch set Stats (+399 lines, -103 lines) Patch
M src/frames.h View 1 chunk +2 lines, -1 line 0 comments Download
M src/handles.cc View 1 1 chunk +6 lines, -2 lines 0 comments Download
M src/log.h View 1 4 chunks +20 lines, -0 lines 0 comments Download
M src/log.cc View 1 8 chunks +93 lines, -20 lines 0 comments Download
M src/mark-compact.h View 1 chunk +3 lines, -0 lines 0 comments Download
M src/mark-compact.cc View 1 5 chunks +15 lines, -11 lines 0 comments Download
M src/platform.h View 1 chunk +12 lines, -5 lines 0 comments Download
M src/platform-freebsd.cc View 1 chunk +9 lines, -9 lines 0 comments Download
M src/platform-linux.cc View 1 chunk +12 lines, -12 lines 0 comments Download
M src/platform-macos.cc View 1 chunk +3 lines, -3 lines 0 comments Download
M src/platform-win32.cc View 1 chunk +6 lines, -6 lines 0 comments Download
M src/runtime.cc View 1 1 chunk +1 line, -0 lines 0 comments Download
M src/spaces.cc View 1 chunk +1 line, -3 lines 0 comments Download
M test/cctest/test-log.cc View 2 chunks +4 lines, -3 lines 0 comments Download
M test/cctest/test-log-stack-tracer.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M test/mjsunit/tools/logreader.js View 1 chunk +1 line, -1 line 0 comments Download
M test/mjsunit/tools/tickprocessor.js View 2 chunks +5 lines, -2 lines 0 comments Download
A test/mjsunit/tools/tickprocessor-test.func-info View 1 chunk +29 lines, -0 lines 0 comments Download
M test/mjsunit/tools/tickprocessor-test.log View 1 1 chunk +14 lines, -13 lines 0 comments Download
A test/mjsunit/tools/tickprocessor-test-func-info.log View 1 1 chunk +13 lines, -0 lines 0 comments Download
M tools/codemap.js View 1 chunk +12 lines, -0 lines 0 comments Download
M tools/logreader.js View 1 chunk +3 lines, -2 lines 0 comments Download
M tools/profile.js View 1 4 chunks +52 lines, -0 lines 0 comments Download
M tools/tickprocessor.js View 1 5 chunks +41 lines, -4 lines 0 comments Download
M tools/tickprocessor.py View 1 6 chunks +40 lines, -4 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
mnaganov (inactive)
10 years, 11 months ago (2010-01-20 16:55:53 UTC) #1
Søren Thygesen Gjesse
LGTM! http://codereview.chromium.org/546089/diff/1/3 File src/handles.cc (right): http://codereview.chromium.org/546089/diff/1/3#newcode685 src/handles.cc:685: LOG(FunctionInfoEvent(*function)); How about FunctionCreateEvent? The actual JS function ...
10 years, 11 months ago (2010-01-21 08:28:52 UTC) #2
mnaganov (inactive)
10 years, 11 months ago (2010-01-21 16:02:39 UTC) #3
Thanks for thoughtful comments. I also discovered that I need to add some stuff
for DevTools to work after this patch.

http://codereview.chromium.org/546089/diff/1/3
File src/handles.cc (right):

http://codereview.chromium.org/546089/diff/1/3#newcode685
src/handles.cc:685: LOG(FunctionInfoEvent(*function));
On 2010/01/21 08:28:52, Søren Gjesse wrote:
> How about FunctionCreateEvent? The actual JS function object is created here.

Done.

http://codereview.chromium.org/546089/diff/1/5
File src/log.h (right):

http://codereview.chromium.org/546089/diff/1/5#newcode118
src/log.h:118: V(CODE_DELETE_EVENT,              "code-delete",            "cd")
      \
On 2010/01/21 08:28:52, Søren Gjesse wrote:
> Do we need a function delete event?

Added.

http://codereview.chromium.org/546089/diff/1/5#newcode119
src/log.h:119: V(FUNCTION_INFO_EVENT,            "function-info",          "fi")
      \
On 2010/01/21 08:28:52, Søren Gjesse wrote:
> INFO -> CREATION, info -> creation?

Done.

http://codereview.chromium.org/546089/diff/1/6
File src/mark-compact.cc (right):

http://codereview.chromium.org/546089/diff/1/6#newcode1954
src/mark-compact.cc:1954: LOG(CodeMoveEvent(old_addr, new_addr));
On 2010/01/21 08:28:52, Søren Gjesse wrote:
> Should we have a FunctionMoveEvent? Or just a generic ObjectMoveEvent (perhaps
> with a type)? Using the CodeMoveEvent for a JSFunction object seems confusing.

Added dedicated function-related events. Creating a generic events for "move"
and "delete" operations is OK, but for "create" operations is more elaborated
because it is assumed that all event instances have the same signature, while
for code objects and function objects they will be different:

ObjectCreateEvent,Code,Tag,address,size,...
ObjectCreateEvent,Function,address,code_address

So I decided not to create generic events in favor of dedicated ones.

http://codereview.chromium.org/546089/diff/1/20
File tools/tickprocessor.js (right):

http://codereview.chromium.org/546089/diff/1/20#newcode286
tools/tickprocessor.js:286: this.profile_.addCodeAlias(functionAddr, codeAddr);
On 2010/01/21 08:28:52, Søren Gjesse wrote:
> Are these aliases ever removed?

A good catch, thank you! Yes, I completely forgot reporting of function object
deletes.

Fixed.

Powered by Google App Engine
This is Rietveld 408576698