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

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

Issue 2451853002: Uniform and precise source positions for inlining (Closed)
Patch Set: addressed comments 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..567a3a2230be24561e259880ae90f0fcbcef582b 100644
--- a/src/profiler/profile-generator.cc
+++ b/src/profiler/profile-generator.cc
@@ -182,16 +182,17 @@ CpuProfileDeoptInfo CodeEntry::GetDeoptInfo() {
info.deopt_reason = deopt_reason_;
DCHECK_NE(kNoDeoptimizationId, deopt_id_);
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_, deopt_position_.ScriptOffset()}));
} 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.
+ {inlined_frame.script_id,
+ first ? deopt_position_.ScriptOffset() : inlined_frame.position}));
+ first = false; // Done with innermost frame.
}
}
return info;

Powered by Google App Engine
This is Rietveld 408576698