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/frames-inl.h" | 10 #include "src/frames-inl.h" |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 CpuProfileNode::kNoLineNumberInfo, CpuProfileNode::kNoColumnNumberInfo, | 239 CpuProfileNode::kNoLineNumberInfo, CpuProfileNode::kNoColumnNumberInfo, |
240 NULL, code->instruction_start()); | 240 NULL, code->instruction_start()); |
241 if (info) { | 241 if (info) { |
242 rec->entry->set_no_frame_ranges(info->ReleaseNoFrameRanges()); | 242 rec->entry->set_no_frame_ranges(info->ReleaseNoFrameRanges()); |
243 } | 243 } |
244 if (shared->script()->IsScript()) { | 244 if (shared->script()->IsScript()) { |
245 DCHECK(Script::cast(shared->script())); | 245 DCHECK(Script::cast(shared->script())); |
246 Script* script = Script::cast(shared->script()); | 246 Script* script = Script::cast(shared->script()); |
247 rec->entry->set_script_id(script->id()->value()); | 247 rec->entry->set_script_id(script->id()->value()); |
248 rec->entry->set_bailout_reason( | 248 rec->entry->set_bailout_reason( |
249 GetBailoutReason(shared->DisableOptimizationReason())); | 249 GetBailoutReason(shared->disable_optimization_reason())); |
250 } | 250 } |
251 rec->size = code->ExecutableSize(); | 251 rec->size = code->ExecutableSize(); |
252 rec->shared = shared->address(); | 252 rec->shared = shared->address(); |
253 processor_->Enqueue(evt_rec); | 253 processor_->Enqueue(evt_rec); |
254 } | 254 } |
255 | 255 |
256 | 256 |
257 void CpuProfiler::CodeCreateEvent(Logger::LogEventsAndTags tag, Code* code, | 257 void CpuProfiler::CodeCreateEvent(Logger::LogEventsAndTags tag, Code* code, |
258 SharedFunctionInfo* shared, | 258 SharedFunctionInfo* shared, |
259 CompilationInfo* info, Name* script_name, | 259 CompilationInfo* info, Name* script_name, |
(...skipping 22 matching lines...) Expand all Loading... |
282 tag, profiles_->GetFunctionName(shared->DebugName()), | 282 tag, profiles_->GetFunctionName(shared->DebugName()), |
283 CodeEntry::kEmptyNamePrefix, profiles_->GetName(script_name), line, | 283 CodeEntry::kEmptyNamePrefix, profiles_->GetName(script_name), line, |
284 column, line_table, code->instruction_start()); | 284 column, line_table, code->instruction_start()); |
285 if (info) { | 285 if (info) { |
286 rec->entry->set_no_frame_ranges(info->ReleaseNoFrameRanges()); | 286 rec->entry->set_no_frame_ranges(info->ReleaseNoFrameRanges()); |
287 } | 287 } |
288 rec->entry->set_script_id(script->id()->value()); | 288 rec->entry->set_script_id(script->id()->value()); |
289 rec->size = code->ExecutableSize(); | 289 rec->size = code->ExecutableSize(); |
290 rec->shared = shared->address(); | 290 rec->shared = shared->address(); |
291 rec->entry->set_bailout_reason( | 291 rec->entry->set_bailout_reason( |
292 GetBailoutReason(shared->DisableOptimizationReason())); | 292 GetBailoutReason(shared->disable_optimization_reason())); |
293 processor_->Enqueue(evt_rec); | 293 processor_->Enqueue(evt_rec); |
294 } | 294 } |
295 | 295 |
296 | 296 |
297 void CpuProfiler::CodeCreateEvent(Logger::LogEventsAndTags tag, | 297 void CpuProfiler::CodeCreateEvent(Logger::LogEventsAndTags tag, |
298 Code* code, | 298 Code* code, |
299 int args_count) { | 299 int args_count) { |
300 if (FilterOutCodeCreateEvent(tag)) return; | 300 if (FilterOutCodeCreateEvent(tag)) return; |
301 CodeEventsContainer evt_rec(CodeEventRecord::CODE_CREATION); | 301 CodeEventsContainer evt_rec(CodeEventRecord::CODE_CREATION); |
302 CodeCreateEventRecord* rec = &evt_rec.CodeCreateEventRecord_; | 302 CodeCreateEventRecord* rec = &evt_rec.CodeCreateEventRecord_; |
(...skipping 14 matching lines...) Expand all Loading... |
317 rec->from = from; | 317 rec->from = from; |
318 rec->to = to; | 318 rec->to = to; |
319 processor_->Enqueue(evt_rec); | 319 processor_->Enqueue(evt_rec); |
320 } | 320 } |
321 | 321 |
322 | 322 |
323 void CpuProfiler::CodeDisableOptEvent(Code* code, SharedFunctionInfo* shared) { | 323 void CpuProfiler::CodeDisableOptEvent(Code* code, SharedFunctionInfo* shared) { |
324 CodeEventsContainer evt_rec(CodeEventRecord::CODE_DISABLE_OPT); | 324 CodeEventsContainer evt_rec(CodeEventRecord::CODE_DISABLE_OPT); |
325 CodeDisableOptEventRecord* rec = &evt_rec.CodeDisableOptEventRecord_; | 325 CodeDisableOptEventRecord* rec = &evt_rec.CodeDisableOptEventRecord_; |
326 rec->start = code->address(); | 326 rec->start = code->address(); |
327 rec->bailout_reason = GetBailoutReason(shared->DisableOptimizationReason()); | 327 rec->bailout_reason = GetBailoutReason(shared->disable_optimization_reason()); |
328 processor_->Enqueue(evt_rec); | 328 processor_->Enqueue(evt_rec); |
329 } | 329 } |
330 | 330 |
331 | 331 |
332 void CpuProfiler::CodeDeleteEvent(Address from) { | 332 void CpuProfiler::CodeDeleteEvent(Address from) { |
333 } | 333 } |
334 | 334 |
335 | 335 |
336 void CpuProfiler::SharedFunctionInfoMoveEvent(Address from, Address to) { | 336 void CpuProfiler::SharedFunctionInfoMoveEvent(Address from, Address to) { |
337 CodeEventsContainer evt_rec(CodeEventRecord::SHARED_FUNC_MOVE); | 337 CodeEventsContainer evt_rec(CodeEventRecord::SHARED_FUNC_MOVE); |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
519 ReportBuiltinEventRecord* rec = &evt_rec.ReportBuiltinEventRecord_; | 519 ReportBuiltinEventRecord* rec = &evt_rec.ReportBuiltinEventRecord_; |
520 Builtins::Name id = static_cast<Builtins::Name>(i); | 520 Builtins::Name id = static_cast<Builtins::Name>(i); |
521 rec->start = builtins->builtin(id)->address(); | 521 rec->start = builtins->builtin(id)->address(); |
522 rec->builtin_id = id; | 522 rec->builtin_id = id; |
523 processor_->Enqueue(evt_rec); | 523 processor_->Enqueue(evt_rec); |
524 } | 524 } |
525 } | 525 } |
526 | 526 |
527 | 527 |
528 } } // namespace v8::internal | 528 } } // namespace v8::internal |
OLD | NEW |