Index: src/api.cc |
diff --git a/src/api.cc b/src/api.cc |
index 82e4c54ba517e606257d0e5a73c27890d6348f51..41b5a45a70ebf78e86d271b1c68df2ddd29dd1d8 100644 |
--- a/src/api.cc |
+++ b/src/api.cc |
@@ -6455,21 +6455,17 @@ void V8::RemoveMemoryAllocationCallback(MemoryAllocationCallback callback) { |
void V8::RunMicrotasks(Isolate* isolate) { |
- i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate); |
- i::HandleScope scope(i_isolate); |
- i::V8::RunMicrotasks(i_isolate); |
+ isolate->RunMicrotasks(); |
} |
void V8::EnqueueMicrotask(Isolate* isolate, Handle<Function> microtask) { |
- i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate); |
- ENTER_V8(i_isolate); |
- i::Execution::EnqueueMicrotask(i_isolate, Utils::OpenHandle(*microtask)); |
+ isolate->EnqueueMicrotask(microtask); |
} |
void V8::SetAutorunMicrotasks(Isolate* isolate, bool autorun) { |
- reinterpret_cast<i::Isolate*>(isolate)->set_autorun_microtasks(autorun); |
+ isolate->SetAutorunMicrotasks(autorun); |
} |
@@ -6593,6 +6589,18 @@ Isolate::AllowJavascriptExecutionScope::~AllowJavascriptExecutionScope() { |
} |
+Isolate::SuppressMicrotaskExecutionScope::SuppressMicrotaskExecutionScope( |
+ Isolate* isolate) |
+ : isolate_(reinterpret_cast<i::Isolate*>(isolate)) { |
+ isolate_->handle_scope_implementer()->IncrementCallDepth(); |
+} |
+ |
+ |
+Isolate::SuppressMicrotaskExecutionScope::~SuppressMicrotaskExecutionScope() { |
+ isolate_->handle_scope_implementer()->DecrementCallDepth(); |
+} |
+ |
+ |
void Isolate::GetHeapStatistics(HeapStatistics* heap_statistics) { |
i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); |
if (!isolate->IsInitialized()) { |
@@ -6632,6 +6640,25 @@ void Isolate::RemoveCallCompletedCallback(CallCompletedCallback callback) { |
} |
+void Isolate::RunMicrotasks() { |
+ i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(this); |
+ i::HandleScope scope(i_isolate); |
+ i_isolate->RunMicrotasks(); |
+} |
+ |
+ |
+void Isolate::EnqueueMicrotask(Handle<Function> microtask) { |
+ i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(this); |
+ ENTER_V8(i_isolate); |
+ i::Execution::EnqueueMicrotask(i_isolate, Utils::OpenHandle(*microtask)); |
+} |
+ |
+ |
+void Isolate::SetAutorunMicrotasks(bool autorun) { |
+ reinterpret_cast<i::Isolate*>(this)->set_autorun_microtasks(autorun); |
+} |
+ |
+ |
String::Utf8Value::Utf8Value(v8::Handle<v8::Value> obj) |
: str_(NULL), length_(0) { |
i::Isolate* isolate = i::Isolate::Current(); |