Commit 5a476db0 authored by dgozman's avatar dgozman Committed by Commit bot

Switch microtasks checks from V8_ENABLE_CHECKS to DEBUG to work with dcheck_always_on.

BUG=chromium:594974
LOG=N

Review URL: https://codereview.chromium.org/1801313002

Cr-Commit-Position: refs/heads/master@{#34909}
parent 6a8de153
......@@ -156,7 +156,7 @@ class InternalEscapableScope : public v8::EscapableHandleScope {
};
#ifdef V8_ENABLE_CHECKS
#ifdef DEBUG
void CheckMicrotasksScopesConsistency(i::Isolate* isolate) {
auto handle_scope_implementer = isolate->handle_scope_implementer();
if (handle_scope_implementer->microtasks_policy() ==
......@@ -187,7 +187,7 @@ class CallDepthScope {
if (!context_.IsEmpty()) context_->Exit();
if (!escaped_) isolate_->handle_scope_implementer()->DecrementCallDepth();
if (do_callback_) isolate_->FireCallCompletedCallback();
#ifdef V8_ENABLE_CHECKS
#ifdef DEBUG
if (do_callback_) CheckMicrotasksScopesConsistency(isolate_);
#endif
}
......@@ -7804,7 +7804,7 @@ MicrotasksScope::MicrotasksScope(Isolate* isolate, MicrotasksScope::Type type)
run_(type == MicrotasksScope::kRunMicrotasks) {
auto handle_scope_implementer = isolate_->handle_scope_implementer();
if (run_) handle_scope_implementer->IncrementMicrotasksScopeDepth();
#ifdef V8_ENABLE_CHECKS
#ifdef DEBUG
if (!run_) handle_scope_implementer->IncrementDebugMicrotasksScopeDepth();
#endif
}
......@@ -7819,7 +7819,7 @@ MicrotasksScope::~MicrotasksScope() {
PerformCheckpoint(reinterpret_cast<Isolate*>(isolate_));
}
}
#ifdef V8_ENABLE_CHECKS
#ifdef DEBUG
if (!run_) handle_scope_implementer->DecrementDebugMicrotasksScopeDepth();
#endif
}
......
......@@ -454,7 +454,7 @@ class HandleScopeImplementer {
call_depth_(0),
microtasks_depth_(0),
microtasks_suppressions_(0),
#ifdef V8_ENABLE_CHECKS
#ifdef DEBUG
debug_microtasks_depth_(0),
#endif
microtasks_policy_(v8::MicrotasksPolicy::kAuto),
......@@ -495,7 +495,7 @@ class HandleScopeImplementer {
inline void DecrementMicrotasksSuppressions() {microtasks_suppressions_--;}
inline bool HasMicrotasksSuppressions() { return !!microtasks_suppressions_; }
#ifdef V8_ENABLE_CHECKS
#ifdef DEBUG
// In debug we check that calls not intended to invoke microtasks are
// still correctly wrapped with microtask scopes.
inline void IncrementDebugMicrotasksScopeDepth() {debug_microtasks_depth_++;}
......@@ -566,7 +566,7 @@ class HandleScopeImplementer {
int call_depth_;
int microtasks_depth_;
int microtasks_suppressions_;
#ifdef V8_ENABLE_CHECKS
#ifdef DEBUG
int debug_microtasks_depth_;
#endif
v8::MicrotasksPolicy microtasks_policy_;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment