Index: src/api.cc |
diff --git a/src/api.cc b/src/api.cc |
index 72de33dd47ced2cf7da6c62caf615f817c7a075c..bf57a3aa14376ab17e6c42a8004561e72a2f80e6 100644 |
--- a/src/api.cc |
+++ b/src/api.cc |
@@ -157,18 +157,6 @@ |
}; |
-#ifdef V8_ENABLE_CHECKS |
-void CheckMicrotasksScopesConsistency(i::Isolate* isolate) { |
- auto handle_scope_implementer = isolate->handle_scope_implementer(); |
- if (handle_scope_implementer->microtasks_policy() == |
- v8::MicrotasksPolicy::kScoped) { |
- DCHECK(handle_scope_implementer->GetMicrotasksScopeDepth() || |
- !handle_scope_implementer->DebugMicrotasksScopeDepthIsZero()); |
- } |
-} |
-#endif |
- |
- |
class CallDepthScope { |
public: |
explicit CallDepthScope(i::Isolate* isolate, Local<Context> context, |
@@ -188,9 +176,6 @@ |
if (!context_.IsEmpty()) context_->Exit(); |
if (!escaped_) isolate_->handle_scope_implementer()->DecrementCallDepth(); |
if (do_callback_) isolate_->FireCallCompletedCallback(); |
-#ifdef V8_ENABLE_CHECKS |
- if (do_callback_) CheckMicrotasksScopesConsistency(isolate_); |
-#endif |
} |
void Escape() { |
@@ -7313,12 +7298,10 @@ |
Isolate* isolate) |
: isolate_(reinterpret_cast<i::Isolate*>(isolate)) { |
isolate_->handle_scope_implementer()->IncrementCallDepth(); |
- isolate_->handle_scope_implementer()->IncrementMicrotasksSuppressions(); |
} |
Isolate::SuppressMicrotaskExecutionScope::~SuppressMicrotaskExecutionScope() { |
- isolate_->handle_scope_implementer()->DecrementMicrotasksSuppressions(); |
isolate_->handle_scope_implementer()->DecrementCallDepth(); |
} |
@@ -7460,7 +7443,6 @@ |
void Isolate::RunMicrotasks() { |
- DCHECK(MicrotasksPolicy::kScoped != GetMicrotasksPolicy()); |
reinterpret_cast<i::Isolate*>(this)->RunMicrotasks(); |
} |
@@ -7484,25 +7466,12 @@ |
void Isolate::SetAutorunMicrotasks(bool autorun) { |
- SetMicrotasksPolicy(MicrotasksPolicy::kAuto); |
+ reinterpret_cast<i::Isolate*>(this)->set_autorun_microtasks(autorun); |
} |
bool Isolate::WillAutorunMicrotasks() const { |
- return GetMicrotasksPolicy() == MicrotasksPolicy::kAuto; |
-} |
- |
- |
-void Isolate::SetMicrotasksPolicy(MicrotasksPolicy policy) { |
- i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); |
- isolate->handle_scope_implementer()->set_microtasks_policy(policy); |
-} |
- |
- |
-MicrotasksPolicy Isolate::GetMicrotasksPolicy() const { |
- i::Isolate* isolate = |
- reinterpret_cast<i::Isolate*>(const_cast<Isolate*>(this)); |
- return isolate->handle_scope_implementer()->microtasks_policy(); |
+ return reinterpret_cast<const i::Isolate*>(this)->autorun_microtasks(); |
} |
@@ -7738,49 +7707,6 @@ |
VisitorAdapter visitor_adapter(visitor); |
isolate->global_handles()->IterateWeakRootsInNewSpaceWithClassIds( |
&visitor_adapter); |
-} |
- |
- |
-MicrotasksScope::MicrotasksScope(Isolate* isolate, MicrotasksScope::Type type) |
- : isolate_(reinterpret_cast<i::Isolate*>(isolate)), |
- run_(type == MicrotasksScope::kRunMicrotasks) { |
- auto handle_scope_implementer = isolate_->handle_scope_implementer(); |
- if (run_) handle_scope_implementer->IncrementMicrotasksScopeDepth(); |
-#ifdef V8_ENABLE_CHECKS |
- if (!run_) handle_scope_implementer->IncrementDebugMicrotasksScopeDepth(); |
-#endif |
-} |
- |
- |
-MicrotasksScope::~MicrotasksScope() { |
- auto handle_scope_implementer = isolate_->handle_scope_implementer(); |
- if (run_) { |
- handle_scope_implementer->DecrementMicrotasksScopeDepth(); |
- if (MicrotasksPolicy::kScoped == |
- handle_scope_implementer->microtasks_policy()) { |
- PerformCheckpoint(reinterpret_cast<Isolate*>(isolate_)); |
- } |
- } |
-#ifdef V8_ENABLE_CHECKS |
- if (!run_) handle_scope_implementer->DecrementDebugMicrotasksScopeDepth(); |
-#endif |
-} |
- |
- |
-void MicrotasksScope::PerformCheckpoint(Isolate* v8Isolate) { |
- i::Isolate* isolate = reinterpret_cast<i::Isolate*>(v8Isolate); |
- if (IsExecutionTerminatingCheck(isolate)) return; |
- auto handle_scope_implementer = isolate->handle_scope_implementer(); |
- if (!handle_scope_implementer->GetMicrotasksScopeDepth() && |
- !handle_scope_implementer->HasMicrotasksSuppressions()) { |
- isolate->RunMicrotasks(); |
- } |
-} |
- |
- |
-int MicrotasksScope::GetCurrentDepth(Isolate* v8Isolate) { |
- i::Isolate* isolate = reinterpret_cast<i::Isolate*>(v8Isolate); |
- return isolate->handle_scope_implementer()->GetMicrotasksScopeDepth(); |
} |