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

Unified Diff: src/profiler/profile-generator.cc

Issue 2451853002: Uniform and precise source positions for inlining (Closed)
Patch Set: fixed gcmole issue Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/profiler/profile-generator.cc
diff --git a/src/profiler/profile-generator.cc b/src/profiler/profile-generator.cc
index 5e9da159586ea64925cf2644a4349620ebbb03b8..a4da7cae7f320400aa366a5084c497674ee45e35 100644
--- a/src/profiler/profile-generator.cc
+++ b/src/profiler/profile-generator.cc
@@ -181,17 +181,18 @@ CpuProfileDeoptInfo CodeEntry::GetDeoptInfo() {
CpuProfileDeoptInfo info;
info.deopt_reason = deopt_reason_;
DCHECK_NE(kNoDeoptimizationId, deopt_id_);
+ size_t position = static_cast<size_t>(deopt_position_.ScriptOffset());
if (deopt_inlined_frames_.find(deopt_id_) == deopt_inlined_frames_.end()) {
- info.stack.push_back(CpuProfileDeoptFrame(
- {script_id_, position_ + deopt_position_.position()}));
+ info.stack.push_back(CpuProfileDeoptFrame({script_id_, position}));
} else {
- size_t deopt_position = deopt_position_.raw();
// Copy stack of inlined frames where the deopt happened.
std::vector<DeoptInlinedFrame>& frames = deopt_inlined_frames_[deopt_id_];
+ bool first = true;
for (DeoptInlinedFrame& inlined_frame : base::Reversed(frames)) {
- info.stack.push_back(CpuProfileDeoptFrame(
- {inlined_frame.script_id, deopt_position + inlined_frame.position}));
- deopt_position = 0; // Done with innermost frame.
+ info.stack.push_back(
+ CpuProfileDeoptFrame({inlined_frame.script_id,
+ first ? position : inlined_frame.position}));
+ first = false; // Done with innermost frame.
}
}
return info;

Powered by Google App Engine
This is Rietveld 408576698