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

Unified Diff: src/profile-generator.cc

Issue 1012633002: CpuProfiler: Push inlining data forward to cpu profiler. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: rebaselined Created 5 years, 9 months 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
« no previous file with comments | « src/profile-generator.h ('k') | src/profile-generator-inl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/profile-generator.cc
diff --git a/src/profile-generator.cc b/src/profile-generator.cc
index d030b681ec669b1d7e99ed26751fd23e0899a59a..94790bcbcdede1efb1f437ff1562421e100b0775 100644
--- a/src/profile-generator.cc
+++ b/src/profile-generator.cc
@@ -52,6 +52,7 @@ const char* const CodeEntry::kNoDeoptReason = "";
CodeEntry::~CodeEntry() {
delete no_frame_ranges_;
delete line_info_;
+ delete inlined_function_infos_;
}
@@ -112,8 +113,41 @@ void CodeEntry::FillFunctionInfo(SharedFunctionInfo* shared) {
}
+DeoptInfo CodeEntry::GetDeoptInfo() {
+ DCHECK(has_deopt_info());
+ DCHECK(inlined_function_infos_);
+
+ DeoptInfo info;
+ info.deopt_reason = deopt_reason_;
+ if (inlined_function_infos_->empty()) {
+ info.AddInlineFrame(script_id_, position_ + deopt_position_.position());
+ return info;
+ }
+ // Copy the only branch from the inlining tree where the deopt happened.
+ SourcePosition position = deopt_position_;
+ int inlining_id = InlinedFunctionInfo::kNoParentId;
+ for (size_t i = 0; i < inlined_function_infos_->size(); ++i) {
+ InlinedFunctionInfo& current_info = inlined_function_infos_->at(i);
+ if (std::binary_search(current_info.deopt_pc_offsets.begin(),
+ current_info.deopt_pc_offsets.end(), pc_offset_)) {
+ inlining_id = i;
+ break;
+ }
+ }
+ while (inlining_id != InlinedFunctionInfo::kNoParentId) {
+ InlinedFunctionInfo& inlined_info =
+ inlined_function_infos_->at(inlining_id);
+ info.AddInlineFrame(inlined_info.script_id,
+ inlined_info.start_position + position.raw());
+ position = inlined_info.inline_position;
+ inlining_id = inlined_info.parent_id;
+ }
+ return info;
+}
+
+
void ProfileNode::CollectDeoptInfo(CodeEntry* entry) {
- deopt_infos_.Add(DeoptInfo(entry->deopt_reason(), entry->deopt_position()));
+ deopt_infos_.push_back(entry->GetDeoptInfo());
entry->clear_deopt_info();
}
@@ -181,14 +215,16 @@ void ProfileNode::Print(int indent) {
if (entry_->resource_name()[0] != '\0')
base::OS::Print(" %s:%d", entry_->resource_name(), entry_->line_number());
base::OS::Print("\n");
- for (auto info : deopt_infos_) {
- if (FLAG_hydrogen_track_positions) {
- base::OS::Print("%*s deopted at %d_%d with reason '%s'\n", indent + 10,
- "", info.deopt_position.inlining_id(),
- info.deopt_position.position(), info.deopt_reason);
- } else {
- base::OS::Print("%*s deopted at %d with reason '%s'\n", indent + 10, "",
- info.deopt_position.raw(), info.deopt_reason);
+ for (size_t i = 0; i < deopt_infos_.size(); ++i) {
+ DeoptInfo& info = deopt_infos_[i];
+ base::OS::Print(
+ "%*s;;; deopted at script_id: %d position: %d with reason '%s'.\n",
+ indent + 10, "", info.stack[0].script_id, info.stack[0].position,
+ info.deopt_reason);
+ for (size_t i = 1; i < info.stack.size(); ++i) {
+ base::OS::Print("%*s;;;%*s Inline point: script_id %d position: %d.\n",
+ indent + 10, "", 4, "", info.stack[i].script_id,
+ info.stack[i].position);
}
}
const char* bailout_reason = entry_->bailout_reason();
« no previous file with comments | « src/profile-generator.h ('k') | src/profile-generator-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698