| Index: src/profiler/cpu-profiler.cc
|
| diff --git a/src/profiler/cpu-profiler.cc b/src/profiler/cpu-profiler.cc
|
| index 7a0cf9c8bfabc571b82cfad26f29f1e60138960f..c14b0ef1bdfb1c29cab3c91c794e27536d3702e0 100644
|
| --- a/src/profiler/cpu-profiler.cc
|
| +++ b/src/profiler/cpu-profiler.cc
|
| @@ -326,33 +326,21 @@ void CpuProfiler::StartProcessorIfNotStarted() {
|
| processor_->StartSynchronously();
|
| }
|
|
|
| -
|
| CpuProfile* CpuProfiler::StopProfiling(const char* title) {
|
| if (!is_profiling_) return nullptr;
|
| StopProcessorIfLastProfile(title);
|
| - CpuProfile* result = profiles_->StopProfiling(title);
|
| - if (result) {
|
| - result->Print();
|
| - }
|
| - return result;
|
| + return profiles_->StopProfiling(title);
|
| }
|
|
|
| -
|
| CpuProfile* CpuProfiler::StopProfiling(String* title) {
|
| - if (!is_profiling_) return nullptr;
|
| - const char* profile_title = profiles_->GetName(title);
|
| - StopProcessorIfLastProfile(profile_title);
|
| - return profiles_->StopProfiling(profile_title);
|
| + return StopProfiling(profiles_->GetName(title));
|
| }
|
|
|
| -
|
| void CpuProfiler::StopProcessorIfLastProfile(const char* title) {
|
| - if (profiles_->IsLastProfile(title)) {
|
| - StopProcessor();
|
| - }
|
| + if (!profiles_->IsLastProfile(title)) return;
|
| + StopProcessor();
|
| }
|
|
|
| -
|
| void CpuProfiler::StopProcessor() {
|
| Logger* logger = isolate_->logger();
|
| is_profiling_ = false;
|
|
|