Index: src/cpu-profiler.cc |
diff --git a/src/cpu-profiler.cc b/src/cpu-profiler.cc |
index 3894748174a98862121b1d471ec3a94337389d9a..8d11e7a00b7e60a6da6cac1c1a1a57e4b7b97740 100644 |
--- a/src/cpu-profiler.cc |
+++ b/src/cpu-profiler.cc |
@@ -288,14 +288,16 @@ void CpuProfiler::StartProfiling(String* title) { |
CpuProfile* CpuProfiler::StopProfiling(const char* title) { |
- return is_profiling() ? |
- Isolate::Current()->cpu_profiler()->StopCollectingProfile(title) : NULL; |
+ Isolate* isolate = Isolate::Current(); |
+ return is_profiling(isolate) ? |
+ isolate->cpu_profiler()->StopCollectingProfile(title) : NULL; |
} |
CpuProfile* CpuProfiler::StopProfiling(Object* security_token, String* title) { |
- return is_profiling() ? |
- Isolate::Current()->cpu_profiler()->StopCollectingProfile( |
+ Isolate* isolate = Isolate::Current(); |
+ return is_profiling(isolate) ? |
+ isolate->cpu_profiler()->StopCollectingProfile( |
security_token, title) : NULL; |
} |
@@ -336,8 +338,9 @@ TickSample* CpuProfiler::TickSampleEvent(Isolate* isolate) { |
void CpuProfiler::DeleteAllProfiles() { |
Isolate* isolate = Isolate::Current(); |
ASSERT(isolate->cpu_profiler() != NULL); |
- if (is_profiling()) |
+ if (is_profiling(isolate)) { |
isolate->cpu_profiler()->StopProcessor(); |
+ } |
isolate->cpu_profiler()->ResetProfiles(); |
} |