| 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/deoptimizer.h" | 8 #include "src/deoptimizer.h" |
| 8 #include "src/frames-inl.h" | 9 #include "src/frames-inl.h" |
| 9 #include "src/locked-queue-inl.h" | 10 #include "src/locked-queue-inl.h" |
| 10 #include "src/log-inl.h" | 11 #include "src/log-inl.h" |
| 11 #include "src/profiler/cpu-profiler-inl.h" | 12 #include "src/profiler/cpu-profiler-inl.h" |
| 12 #include "src/vm-state-inl.h" | 13 #include "src/vm-state-inl.h" |
| 13 | 14 |
| 14 #include "include/v8-profiler.h" | 15 #include "include/v8-profiler.h" |
| 15 | 16 |
| 16 namespace v8 { | 17 namespace v8 { |
| (...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 431 | 432 |
| 432 void CpuProfiler::StartProfiling(const char* title, bool record_samples) { | 433 void CpuProfiler::StartProfiling(const char* title, bool record_samples) { |
| 433 if (profiles_->StartProfiling(title, record_samples)) { | 434 if (profiles_->StartProfiling(title, record_samples)) { |
| 434 StartProcessorIfNotStarted(); | 435 StartProcessorIfNotStarted(); |
| 435 } | 436 } |
| 436 } | 437 } |
| 437 | 438 |
| 438 | 439 |
| 439 void CpuProfiler::StartProfiling(String* title, bool record_samples) { | 440 void CpuProfiler::StartProfiling(String* title, bool record_samples) { |
| 440 StartProfiling(profiles_->GetName(title), record_samples); | 441 StartProfiling(profiles_->GetName(title), record_samples); |
| 442 isolate_->debug()->feature_tracker()->Track(DebugFeatureTracker::kProfiler); |
| 441 } | 443 } |
| 442 | 444 |
| 443 | 445 |
| 444 void CpuProfiler::StartProcessorIfNotStarted() { | 446 void CpuProfiler::StartProcessorIfNotStarted() { |
| 445 if (processor_ != NULL) { | 447 if (processor_ != NULL) { |
| 446 processor_->AddCurrentStack(isolate_); | 448 processor_->AddCurrentStack(isolate_); |
| 447 return; | 449 return; |
| 448 } | 450 } |
| 449 Logger* logger = isolate_->logger(); | 451 Logger* logger = isolate_->logger(); |
| 450 // Disable logging when using the new implementation. | 452 // Disable logging when using the new implementation. |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 519 Builtins::Name id = static_cast<Builtins::Name>(i); | 521 Builtins::Name id = static_cast<Builtins::Name>(i); |
| 520 rec->start = builtins->builtin(id)->address(); | 522 rec->start = builtins->builtin(id)->address(); |
| 521 rec->builtin_id = id; | 523 rec->builtin_id = id; |
| 522 processor_->Enqueue(evt_rec); | 524 processor_->Enqueue(evt_rec); |
| 523 } | 525 } |
| 524 } | 526 } |
| 525 | 527 |
| 526 | 528 |
| 527 } // namespace internal | 529 } // namespace internal |
| 528 } // namespace v8 | 530 } // namespace v8 |
| OLD | NEW |