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

Issue 2503393002: [cpu-profiler] use new source position information for deoptimization in cpu profiler (Closed)

Created:
4 years, 1 month ago by Tobias Tebbi
Modified:
4 years, 1 month ago
Reviewers:
Benedikt Meurer, alph, Yang
CC:
v8-reviews_googlegroups.com
Target Ref:
refs/pending/heads/master
Project:
v8
Visibility:
Public.

Description

[cpu-profiler] use new source position information for deoptimization in cpu profiler The new SourcePosition class allows for precise tracking of source positions including the stack of inlinings. This CL makes the cpu profiler use this new information. Before, the cpu profiler used the deoptimization data to reconstruct the inlining stack. However, optimizing compilers (especially Turbofan) can hoist out checks such that the inlining stack of the deopt reason and the inlining stack of the position the deoptimizer jumps to can be different (the old cpu profiler tests and the ones introduced in this cl produce such situations for turbofan). In this case, relying on the deoptimization info produces paradoxical results, where the reported position is before the function responsible is called. Even worse, https://codereview.chromium.org/2451853002/ combines the precise position with the wrong inlining stack from the deopt info, leading to completely wrong results. Other changes in this CL: - DeoptInlinedFrame is no longer needed, because we can compute the correct inlining stack up front. - I changed the cpu profiler tests back to test situations where deopt checks are hoisted out in Turbofan and made them robust enough to handle the differences between Crankshaft and Turbofan. - I reversed the order of SourcePosition::InliningStack to make it match the cpu profiler convention. - I removed CodeDeoptEvent::position, as it is no longer used. R=alph@chromium.org BUG=v8:5432 Committed: https://crrev.com/1b320d2039f961f8271a0b3e2a06abaf7bf0c3f0 Cr-Commit-Position: refs/heads/master@{#41168}

Patch Set 1 #

Patch Set 2 : removed CodeDeoptEvent::position #

Total comments: 9

Patch Set 3 : addressed comments #

Patch Set 4 : compile issues #

Total comments: 1

Patch Set 5 : fixed crash #

Patch Set 6 : addressed comment #

Unified diffs Side-by-side diffs Delta from patch set Stats (+133 lines, -179 lines) Patch
M src/compilation-info.h View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M src/compiler/code-generator.cc View 1 2 3 4 1 chunk +2 lines, -2 lines 0 comments Download
M src/crankshaft/lithium-codegen.cc View 1 2 3 4 1 chunk +2 lines, -2 lines 0 comments Download
M src/objects.h View 1 2 3 4 1 chunk +6 lines, -0 lines 0 comments Download
M src/objects.cc View 1 2 3 4 1 chunk +8 lines, -0 lines 0 comments Download
M src/profiler/cpu-profiler.h View 1 1 chunk +0 lines, -1 line 0 comments Download
M src/profiler/cpu-profiler-inl.h View 1 chunk +1 line, -1 line 0 comments Download
M src/profiler/profile-generator.h View 1 2 4 chunks +4 lines, -15 lines 0 comments Download
M src/profiler/profile-generator.cc View 1 2 3 4 3 chunks +8 lines, -22 lines 0 comments Download
M src/profiler/profile-generator-inl.h View 1 chunk +0 lines, -1 line 0 comments Download
M src/profiler/profiler-listener.cc View 1 2 3 4 5 4 chunks +33 lines, -59 lines 0 comments Download
M src/source-position.h View 1 2 chunks +4 lines, -7 lines 0 comments Download
M src/source-position.cc View 1 2 3 4 3 chunks +35 lines, -41 lines 0 comments Download
M test/cctest/test-cpu-profiler.cc View 1 2 7 chunks +29 lines, -27 lines 0 comments Download

Messages

Total messages: 35 (19 generated)
Tobias Tebbi
4 years, 1 month ago (2016-11-16 15:42:06 UTC) #2
alph
Great! Thanks for doing this. +yang for the stuff beyond src/profiler https://codereview.chromium.org/2503393002/diff/20001/src/profiler/profile-generator.cc File src/profiler/profile-generator.cc (right): ...
4 years, 1 month ago (2016-11-17 00:09:44 UTC) #4
Tobias Tebbi
https://codereview.chromium.org/2503393002/diff/20001/src/profiler/profiler-listener.cc File src/profiler/profiler-listener.cc (right): https://codereview.chromium.org/2503393002/diff/20001/src/profiler/profiler-listener.cc#newcode97 src/profiler/profiler-listener.cc:97: if (it.source_position().InliningId() != SourcePosition::kNotInlined) On 2016/11/17 00:09:44, alph wrote: ...
4 years, 1 month ago (2016-11-17 11:41:34 UTC) #5
alph
Thank you! profiler lgtm https://codereview.chromium.org/2503393002/diff/20001/src/profiler/profiler-listener.cc File src/profiler/profiler-listener.cc (right): https://codereview.chromium.org/2503393002/diff/20001/src/profiler/profiler-listener.cc#newcode251 src/profiler/profiler-listener.cc:251: Handle<Code> code(abstract_code->GetCode()); On 2016/11/17 11:41:34, ...
4 years, 1 month ago (2016-11-18 22:51:46 UTC) #6
alph
On 2016/11/18 22:51:46, alph wrote: > Thank you! profiler lgtm > > https://codereview.chromium.org/2503393002/diff/20001/src/profiler/profiler-listener.cc > File ...
4 years, 1 month ago (2016-11-19 01:35:22 UTC) #7
Yang
https://codereview.chromium.org/2503393002/diff/60001/src/profiler/profiler-listener.cc File src/profiler/profiler-listener.cc (right): https://codereview.chromium.org/2503393002/diff/60001/src/profiler/profiler-listener.cc#newcode268 src/profiler/profiler-listener.cc:268: if (!last_position.IsKnown()) continue; Should this happen? Can we have ...
4 years, 1 month ago (2016-11-21 12:57:20 UTC) #16
Tobias Tebbi
The bug was (@Yang indeed) in the indexing of the literals array. I fixed it ...
4 years, 1 month ago (2016-11-21 16:03:51 UTC) #18
alph
On 2016/11/21 16:03:51, Tobias Tebbi wrote: > The bug was (@Yang indeed) in the indexing ...
4 years, 1 month ago (2016-11-21 19:59:52 UTC) #19
Yang
On 2016/11/21 19:59:52, alph wrote: > On 2016/11/21 16:03:51, Tobias Tebbi wrote: > > The ...
4 years, 1 month ago (2016-11-22 09:33:00 UTC) #20
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2503393002/120001
4 years, 1 month ago (2016-11-22 09:45:47 UTC) #23
commit-bot: I haz the power
Try jobs failed on following builders: v8_presubmit on master.tryserver.v8 (JOB_FAILED, http://build.chromium.org/p/tryserver.v8/builders/v8_presubmit/builds/29072)
4 years, 1 month ago (2016-11-22 09:49:36 UTC) #25
Tobias Tebbi
I need an LGTM from a Crankshaft and Turbofan owner.
4 years, 1 month ago (2016-11-22 09:50:06 UTC) #27
Benedikt Meurer
LGTM
4 years, 1 month ago (2016-11-22 10:08:06 UTC) #28
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2503393002/120001
4 years, 1 month ago (2016-11-22 10:08:58 UTC) #30
commit-bot: I haz the power
Committed patchset #6 (id:120001)
4 years, 1 month ago (2016-11-22 10:14:43 UTC) #33
commit-bot: I haz the power
4 years, 1 month ago (2016-11-22 10:15:04 UTC) #35
Message was sent while issue was closed.
Patchset 6 (id:??) landed as
https://crrev.com/1b320d2039f961f8271a0b3e2a06abaf7bf0c3f0
Cr-Commit-Position: refs/heads/master@{#41168}

Powered by Google App Engine
This is Rietveld 408576698