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

Unified Diff: src/cpu-profiler.cc

Issue 910773002: Propagate Deopt reason to cpu-profiler (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: comments addressed Created 5 years, 10 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/cpu-profiler.h ('k') | src/cpu-profiler-inl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/cpu-profiler.cc
diff --git a/src/cpu-profiler.cc b/src/cpu-profiler.cc
index 456770b4c67c122e0db54063431ee7e22dd4eee9..c276bb6d6079dcd065340b16a817681dc930f713 100644
--- a/src/cpu-profiler.cc
+++ b/src/cpu-profiler.cc
@@ -7,6 +7,7 @@
#include "src/cpu-profiler-inl.h"
#include "src/compiler.h"
+#include "src/deoptimizer.h"
#include "src/frames-inl.h"
#include "src/hashmap.h"
#include "src/log-inl.h"
@@ -38,6 +39,19 @@ void ProfilerEventsProcessor::Enqueue(const CodeEventsContainer& event) {
}
+void ProfilerEventsProcessor::AddDeoptStack(Isolate* isolate, Address from,
+ int fp_to_sp_delta) {
+ TickSampleEventRecord record(last_code_event_id_);
+ RegisterState regs;
+ Address fp = isolate->c_entry_fp(isolate->thread_local_top());
+ regs.sp = fp - fp_to_sp_delta;
+ regs.fp = fp;
+ regs.pc = from;
+ record.sample.Init(isolate, regs, TickSample::kSkipCEntryFrame);
+ ticks_from_vm_buffer_.Enqueue(record);
+}
+
+
void ProfilerEventsProcessor::AddCurrentStack(Isolate* isolate) {
TickSampleEventRecord record(last_code_event_id_);
RegisterState regs;
@@ -329,6 +343,19 @@ void CpuProfiler::CodeDisableOptEvent(Code* code, SharedFunctionInfo* shared) {
}
+void CpuProfiler::CodeDeoptEvent(Code* code, int bailout_id, Address pc,
+ int fp_to_sp_delta) {
+ CodeEventsContainer evt_rec(CodeEventRecord::CODE_DEOPT);
+ CodeDeoptEventRecord* rec = &evt_rec.CodeDeoptEventRecord_;
+ Deoptimizer::DeoptInfo info = Deoptimizer::GetDeoptInfo(code, bailout_id);
+ rec->start = code->address();
+ rec->deopt_reason = Deoptimizer::GetDeoptReason(info.deopt_reason);
+ rec->raw_position = info.raw_position;
+ processor_->Enqueue(evt_rec);
+ processor_->AddDeoptStack(isolate_, pc, fp_to_sp_delta);
+}
+
+
void CpuProfiler::CodeDeleteEvent(Address from) {
}
« no previous file with comments | « src/cpu-profiler.h ('k') | src/cpu-profiler-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698