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/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/cpu-profiler-inl.h" | 7 #include "src/cpu-profiler-inl.h" |
8 | 8 |
9 #include "src/compiler.h" | 9 #include "src/compiler.h" |
10 #include "src/deoptimizer.h" | 10 #include "src/deoptimizer.h" |
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
244 CodeEventsContainer evt_rec(CodeEventRecord::CODE_CREATION); | 244 CodeEventsContainer evt_rec(CodeEventRecord::CODE_CREATION); |
245 CodeCreateEventRecord* rec = &evt_rec.CodeCreateEventRecord_; | 245 CodeCreateEventRecord* rec = &evt_rec.CodeCreateEventRecord_; |
246 rec->start = code->address(); | 246 rec->start = code->address(); |
247 rec->entry = profiles_->NewCodeEntry( | 247 rec->entry = profiles_->NewCodeEntry( |
248 tag, profiles_->GetFunctionName(shared->DebugName()), | 248 tag, profiles_->GetFunctionName(shared->DebugName()), |
249 CodeEntry::kEmptyNamePrefix, profiles_->GetName(script_name), | 249 CodeEntry::kEmptyNamePrefix, profiles_->GetName(script_name), |
250 CpuProfileNode::kNoLineNumberInfo, CpuProfileNode::kNoColumnNumberInfo, | 250 CpuProfileNode::kNoLineNumberInfo, CpuProfileNode::kNoColumnNumberInfo, |
251 NULL, code->instruction_start()); | 251 NULL, code->instruction_start()); |
252 if (info) { | 252 if (info) { |
253 rec->entry->set_no_frame_ranges(info->ReleaseNoFrameRanges()); | 253 rec->entry->set_no_frame_ranges(info->ReleaseNoFrameRanges()); |
| 254 rec->entry->set_inlined_function_infos(info->ReleaseInlinedFunctionInfos()); |
254 } | 255 } |
255 rec->entry->FillFunctionInfo(shared); | 256 rec->entry->FillFunctionInfo(shared); |
256 rec->size = code->ExecutableSize(); | 257 rec->size = code->ExecutableSize(); |
257 processor_->Enqueue(evt_rec); | 258 processor_->Enqueue(evt_rec); |
258 } | 259 } |
259 | 260 |
260 | 261 |
261 void CpuProfiler::CodeCreateEvent(Logger::LogEventsAndTags tag, Code* code, | 262 void CpuProfiler::CodeCreateEvent(Logger::LogEventsAndTags tag, Code* code, |
262 SharedFunctionInfo* shared, | 263 SharedFunctionInfo* shared, |
263 CompilationInfo* info, Name* script_name, | 264 CompilationInfo* info, Name* script_name, |
(...skipping 17 matching lines...) Expand all Loading... |
281 } | 282 } |
282 } | 283 } |
283 } | 284 } |
284 } | 285 } |
285 rec->entry = profiles_->NewCodeEntry( | 286 rec->entry = profiles_->NewCodeEntry( |
286 tag, profiles_->GetFunctionName(shared->DebugName()), | 287 tag, profiles_->GetFunctionName(shared->DebugName()), |
287 CodeEntry::kEmptyNamePrefix, profiles_->GetName(script_name), line, | 288 CodeEntry::kEmptyNamePrefix, profiles_->GetName(script_name), line, |
288 column, line_table, code->instruction_start()); | 289 column, line_table, code->instruction_start()); |
289 if (info) { | 290 if (info) { |
290 rec->entry->set_no_frame_ranges(info->ReleaseNoFrameRanges()); | 291 rec->entry->set_no_frame_ranges(info->ReleaseNoFrameRanges()); |
| 292 rec->entry->set_inlined_function_infos(info->ReleaseInlinedFunctionInfos()); |
291 } | 293 } |
292 rec->entry->FillFunctionInfo(shared); | 294 rec->entry->FillFunctionInfo(shared); |
293 rec->size = code->ExecutableSize(); | 295 rec->size = code->ExecutableSize(); |
294 processor_->Enqueue(evt_rec); | 296 processor_->Enqueue(evt_rec); |
295 } | 297 } |
296 | 298 |
297 | 299 |
298 void CpuProfiler::CodeCreateEvent(Logger::LogEventsAndTags tag, | 300 void CpuProfiler::CodeCreateEvent(Logger::LogEventsAndTags tag, |
299 Code* code, | 301 Code* code, |
300 int args_count) { | 302 int args_count) { |
(...skipping 28 matching lines...) Expand all Loading... |
329 } | 331 } |
330 | 332 |
331 | 333 |
332 void CpuProfiler::CodeDeoptEvent(Code* code, Address pc, int fp_to_sp_delta) { | 334 void CpuProfiler::CodeDeoptEvent(Code* code, Address pc, int fp_to_sp_delta) { |
333 CodeEventsContainer evt_rec(CodeEventRecord::CODE_DEOPT); | 335 CodeEventsContainer evt_rec(CodeEventRecord::CODE_DEOPT); |
334 CodeDeoptEventRecord* rec = &evt_rec.CodeDeoptEventRecord_; | 336 CodeDeoptEventRecord* rec = &evt_rec.CodeDeoptEventRecord_; |
335 Deoptimizer::DeoptInfo info = Deoptimizer::GetDeoptInfo(code, pc); | 337 Deoptimizer::DeoptInfo info = Deoptimizer::GetDeoptInfo(code, pc); |
336 rec->start = code->address(); | 338 rec->start = code->address(); |
337 rec->deopt_reason = Deoptimizer::GetDeoptReason(info.deopt_reason); | 339 rec->deopt_reason = Deoptimizer::GetDeoptReason(info.deopt_reason); |
338 rec->position = info.position; | 340 rec->position = info.position; |
| 341 rec->pc_offset = static_cast<int>(pc - code->instruction_start()); |
339 processor_->Enqueue(evt_rec); | 342 processor_->Enqueue(evt_rec); |
340 processor_->AddDeoptStack(isolate_, pc, fp_to_sp_delta); | 343 processor_->AddDeoptStack(isolate_, pc, fp_to_sp_delta); |
341 } | 344 } |
342 | 345 |
343 | 346 |
344 void CpuProfiler::CodeDeleteEvent(Address from) { | 347 void CpuProfiler::CodeDeleteEvent(Address from) { |
345 } | 348 } |
346 | 349 |
347 | 350 |
348 void CpuProfiler::GetterCallbackEvent(Name* name, Address entry_point) { | 351 void CpuProfiler::GetterCallbackEvent(Name* name, Address entry_point) { |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
519 ReportBuiltinEventRecord* rec = &evt_rec.ReportBuiltinEventRecord_; | 522 ReportBuiltinEventRecord* rec = &evt_rec.ReportBuiltinEventRecord_; |
520 Builtins::Name id = static_cast<Builtins::Name>(i); | 523 Builtins::Name id = static_cast<Builtins::Name>(i); |
521 rec->start = builtins->builtin(id)->address(); | 524 rec->start = builtins->builtin(id)->address(); |
522 rec->builtin_id = id; | 525 rec->builtin_id = id; |
523 processor_->Enqueue(evt_rec); | 526 processor_->Enqueue(evt_rec); |
524 } | 527 } |
525 } | 528 } |
526 | 529 |
527 | 530 |
528 } } // namespace v8::internal | 531 } } // namespace v8::internal |
OLD | NEW |