Index: src/api.cc |
diff --git a/src/api.cc b/src/api.cc |
index 9b1d01cd8f4ead1bab6e46f03c3ed362157f8c13..f399bc96931dae90e46c5f2f535215012a442414 100644 |
--- a/src/api.cc |
+++ b/src/api.cc |
@@ -7373,11 +7373,18 @@ void CpuProfiler::StartProfiling(Handle<String> title, bool record_samples) { |
IsDeadCheck(isolate, "v8::CpuProfiler::StartProfiling"); |
i::CpuProfiler* profiler = isolate->cpu_profiler(); |
ASSERT(profiler != NULL); |
+ v8::Local<v8::Context> context = v8::Context::New( |
+ reinterpret_cast<v8::Isolate*>(isolate)); |
+ v8::Context::Scope contextScope(context); |
profiler->StartProfiling(*Utils::OpenHandle(*title), record_samples); |
} |
void CpuProfiler::StartCpuProfiling(Handle<String> title, bool record_samples) { |
+ i::Isolate* isolate = i::Isolate::Current(); |
+ v8::Local<v8::Context> context = v8::Context::New( |
+ reinterpret_cast<v8::Isolate*>(isolate)); |
+ v8::Context::Scope contextScope(context); |
reinterpret_cast<i::CpuProfiler*>(this)->StartProfiling( |
*Utils::OpenHandle(*title), record_samples); |
} |