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/compiler.h" | |
8 #include "src/deoptimizer.h" | 7 #include "src/deoptimizer.h" |
9 #include "src/frames-inl.h" | 8 #include "src/frames-inl.h" |
10 #include "src/hashmap.h" | |
11 #include "src/log-inl.h" | 9 #include "src/log-inl.h" |
12 #include "src/profiler/cpu-profiler-inl.h" | 10 #include "src/profiler/cpu-profiler-inl.h" |
13 #include "src/vm-state-inl.h" | 11 #include "src/vm-state-inl.h" |
14 | 12 |
15 #include "include/v8-profiler.h" | 13 #include "include/v8-profiler.h" |
16 | 14 |
17 namespace v8 { | 15 namespace v8 { |
18 namespace internal { | 16 namespace internal { |
19 | 17 |
20 static const int kProfilerStackSize = 64 * KB; | 18 static const int kProfilerStackSize = 64 * KB; |
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
247 CompilationInfo* info, Name* script_name) { | 245 CompilationInfo* info, Name* script_name) { |
248 CodeEventsContainer evt_rec(CodeEventRecord::CODE_CREATION); | 246 CodeEventsContainer evt_rec(CodeEventRecord::CODE_CREATION); |
249 CodeCreateEventRecord* rec = &evt_rec.CodeCreateEventRecord_; | 247 CodeCreateEventRecord* rec = &evt_rec.CodeCreateEventRecord_; |
250 rec->start = code->address(); | 248 rec->start = code->address(); |
251 rec->entry = profiles_->NewCodeEntry( | 249 rec->entry = profiles_->NewCodeEntry( |
252 tag, profiles_->GetFunctionName(shared->DebugName()), | 250 tag, profiles_->GetFunctionName(shared->DebugName()), |
253 CodeEntry::kEmptyNamePrefix, profiles_->GetName(script_name), | 251 CodeEntry::kEmptyNamePrefix, profiles_->GetName(script_name), |
254 CpuProfileNode::kNoLineNumberInfo, CpuProfileNode::kNoColumnNumberInfo, | 252 CpuProfileNode::kNoLineNumberInfo, CpuProfileNode::kNoColumnNumberInfo, |
255 NULL, code->instruction_start()); | 253 NULL, code->instruction_start()); |
256 if (info) { | 254 if (info) { |
257 rec->entry->set_no_frame_ranges(info->ReleaseNoFrameRanges()); | |
258 rec->entry->set_inlined_function_infos(info->inlined_function_infos()); | 255 rec->entry->set_inlined_function_infos(info->inlined_function_infos()); |
259 } | 256 } |
260 rec->entry->FillFunctionInfo(shared); | 257 rec->entry->FillFunctionInfo(shared); |
261 rec->size = code->ExecutableSize(); | 258 rec->size = code->ExecutableSize(); |
262 processor_->Enqueue(evt_rec); | 259 processor_->Enqueue(evt_rec); |
263 } | 260 } |
264 | 261 |
265 | 262 |
266 void CpuProfiler::CodeCreateEvent(Logger::LogEventsAndTags tag, Code* code, | 263 void CpuProfiler::CodeCreateEvent(Logger::LogEventsAndTags tag, Code* code, |
267 SharedFunctionInfo* shared, | 264 SharedFunctionInfo* shared, |
(...skipping 16 matching lines...) Expand all Loading... |
284 line_table->SetPosition(pc_offset, line_number); | 281 line_table->SetPosition(pc_offset, line_number); |
285 } | 282 } |
286 } | 283 } |
287 } | 284 } |
288 } | 285 } |
289 rec->entry = profiles_->NewCodeEntry( | 286 rec->entry = profiles_->NewCodeEntry( |
290 tag, profiles_->GetFunctionName(shared->DebugName()), | 287 tag, profiles_->GetFunctionName(shared->DebugName()), |
291 CodeEntry::kEmptyNamePrefix, profiles_->GetName(script_name), line, | 288 CodeEntry::kEmptyNamePrefix, profiles_->GetName(script_name), line, |
292 column, line_table, code->instruction_start()); | 289 column, line_table, code->instruction_start()); |
293 if (info) { | 290 if (info) { |
294 rec->entry->set_no_frame_ranges(info->ReleaseNoFrameRanges()); | |
295 rec->entry->set_inlined_function_infos(info->inlined_function_infos()); | 291 rec->entry->set_inlined_function_infos(info->inlined_function_infos()); |
296 } | 292 } |
297 rec->entry->FillFunctionInfo(shared); | 293 rec->entry->FillFunctionInfo(shared); |
298 rec->size = code->ExecutableSize(); | 294 rec->size = code->ExecutableSize(); |
299 processor_->Enqueue(evt_rec); | 295 processor_->Enqueue(evt_rec); |
300 } | 296 } |
301 | 297 |
302 | 298 |
303 void CpuProfiler::CodeCreateEvent(Logger::LogEventsAndTags tag, | 299 void CpuProfiler::CodeCreateEvent(Logger::LogEventsAndTags tag, |
304 Code* code, | 300 Code* code, |
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
522 Builtins::Name id = static_cast<Builtins::Name>(i); | 518 Builtins::Name id = static_cast<Builtins::Name>(i); |
523 rec->start = builtins->builtin(id)->address(); | 519 rec->start = builtins->builtin(id)->address(); |
524 rec->builtin_id = id; | 520 rec->builtin_id = id; |
525 processor_->Enqueue(evt_rec); | 521 processor_->Enqueue(evt_rec); |
526 } | 522 } |
527 } | 523 } |
528 | 524 |
529 | 525 |
530 } // namespace internal | 526 } // namespace internal |
531 } // namespace v8 | 527 } // namespace v8 |
OLD | NEW |