Index: src/cpu-profiler.cc |
diff --git a/src/cpu-profiler.cc b/src/cpu-profiler.cc |
index 42722191bd5a0cce0c9bdb7d8a909cbd3d30fb2a..b68e833c91450d7a372ef2d31c79c8ee4cf49113 100644 |
--- a/src/cpu-profiler.cc |
+++ b/src/cpu-profiler.cc |
@@ -30,6 +30,7 @@ |
#include "cpu-profiler-inl.h" |
#include "compiler.h" |
+#include "debug.h" |
#include "frames-inl.h" |
#include "hashmap.h" |
#include "log-inl.h" |
@@ -437,6 +438,9 @@ void CpuProfiler::ResetProfiles() { |
} |
void CpuProfiler::StartProfiling(const char* title, bool record_samples) { |
+ i::HandleScope scope(isolate_); |
+ v8::Local<v8::Context> context = v8::Debug::GetDebugContext(); |
+ v8::Context::Scope contextScope(context); |
if (profiles_->StartProfiling(title, next_profile_uid_++, record_samples)) { |
StartProcessorIfNotStarted(); |
} |