OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/profiler/cpu-profiler.h" | 5 #include "src/profiler/cpu-profiler.h" |
6 | 6 |
7 #include "src/debug/debug.h" | 7 #include "src/debug/debug.h" |
8 #include "src/deoptimizer.h" | 8 #include "src/deoptimizer.h" |
9 #include "src/frames-inl.h" | 9 #include "src/frames-inl.h" |
10 #include "src/locked-queue-inl.h" | 10 #include "src/locked-queue-inl.h" |
(...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
346 processor_->Enqueue(evt_rec); | 346 processor_->Enqueue(evt_rec); |
347 } | 347 } |
348 | 348 |
349 void CpuProfiler::CodeDeoptEvent(Code* code, Address pc, int fp_to_sp_delta) { | 349 void CpuProfiler::CodeDeoptEvent(Code* code, Address pc, int fp_to_sp_delta) { |
350 CodeEventsContainer evt_rec(CodeEventRecord::CODE_DEOPT); | 350 CodeEventsContainer evt_rec(CodeEventRecord::CODE_DEOPT); |
351 CodeDeoptEventRecord* rec = &evt_rec.CodeDeoptEventRecord_; | 351 CodeDeoptEventRecord* rec = &evt_rec.CodeDeoptEventRecord_; |
352 Deoptimizer::DeoptInfo info = Deoptimizer::GetDeoptInfo(code, pc); | 352 Deoptimizer::DeoptInfo info = Deoptimizer::GetDeoptInfo(code, pc); |
353 rec->start = code->address(); | 353 rec->start = code->address(); |
354 rec->deopt_reason = Deoptimizer::GetDeoptReason(info.deopt_reason); | 354 rec->deopt_reason = Deoptimizer::GetDeoptReason(info.deopt_reason); |
355 rec->position = info.position; | 355 rec->position = info.position; |
356 rec->pc_offset = pc - code->instruction_start(); | 356 rec->inlining_id = info.inlining_id; |
357 processor_->Enqueue(evt_rec); | 357 processor_->Enqueue(evt_rec); |
358 processor_->AddDeoptStack(isolate_, pc, fp_to_sp_delta); | 358 processor_->AddDeoptStack(isolate_, pc, fp_to_sp_delta); |
359 } | 359 } |
360 | 360 |
361 void CpuProfiler::GetterCallbackEvent(Name* name, Address entry_point) { | 361 void CpuProfiler::GetterCallbackEvent(Name* name, Address entry_point) { |
362 CodeEventsContainer evt_rec(CodeEventRecord::CODE_CREATION); | 362 CodeEventsContainer evt_rec(CodeEventRecord::CODE_CREATION); |
363 CodeCreateEventRecord* rec = &evt_rec.CodeCreateEventRecord_; | 363 CodeCreateEventRecord* rec = &evt_rec.CodeCreateEventRecord_; |
364 rec->start = entry_point; | 364 rec->start = entry_point; |
365 rec->entry = profiles_->NewCodeEntry( | 365 rec->entry = profiles_->NewCodeEntry( |
366 Logger::CALLBACK_TAG, | 366 Logger::CALLBACK_TAG, |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
589 Builtins::Name id = static_cast<Builtins::Name>(i); | 589 Builtins::Name id = static_cast<Builtins::Name>(i); |
590 rec->start = builtins->builtin(id)->address(); | 590 rec->start = builtins->builtin(id)->address(); |
591 rec->builtin_id = id; | 591 rec->builtin_id = id; |
592 processor_->Enqueue(evt_rec); | 592 processor_->Enqueue(evt_rec); |
593 } | 593 } |
594 } | 594 } |
595 | 595 |
596 | 596 |
597 } // namespace internal | 597 } // namespace internal |
598 } // namespace v8 | 598 } // namespace v8 |
OLD | NEW |