5 #ifndef V8_PROFILER_CPU_PROFILER_INL_H_ 6 #define V8_PROFILER_CPU_PROFILER_INL_H_ 8 #include "src/profiler/cpu-profiler.h" 11 #include "src/profiler/circular-queue-inl.h" 12 #include "src/profiler/profile-generator-inl.h" 13 #include "src/profiler/unbound-queue-inl.h" 18 void CodeCreateEventRecord::UpdateCodeMap(CodeMap* code_map) {
19 code_map->AddCode(instruction_start, entry, instruction_size);
23 void CodeMoveEventRecord::UpdateCodeMap(CodeMap* code_map) {
24 code_map->MoveCode(from_instruction_start, to_instruction_start);
28 void CodeDisableOptEventRecord::UpdateCodeMap(CodeMap* code_map) {
29 CodeEntry* entry = code_map->FindEntry(instruction_start);
30 if (entry !=
nullptr) {
31 entry->set_bailout_reason(bailout_reason);
36 void CodeDeoptEventRecord::UpdateCodeMap(CodeMap* code_map) {
37 CodeEntry* entry = code_map->FindEntry(instruction_start);
38 if (entry ==
nullptr)
return;
39 std::vector<CpuProfileDeoptFrame> frames_vector(
40 deopt_frames, deopt_frames + deopt_frame_count);
41 entry->set_deopt_info(deopt_reason, deopt_id, std::move(frames_vector));
42 delete[] deopt_frames;
46 void ReportBuiltinEventRecord::UpdateCodeMap(CodeMap* code_map) {
47 CodeEntry* entry = code_map->FindEntry(instruction_start);
53 entry->SetBuiltinId(builtin_id);
56 TickSample* SamplingEventsProcessor::StartTickSample() {
57 void* address = ticks_buffer_.StartEnqueue();
58 if (address ==
nullptr)
return nullptr;
59 TickSampleEventRecord* evt =
60 new (address) TickSampleEventRecord(last_code_event_id_);
64 void SamplingEventsProcessor::FinishTickSample() {
65 ticks_buffer_.FinishEnqueue();
71 #endif // V8_PROFILER_CPU_PROFILER_INL_H_