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 { ...@@ -156,7 +156,7 @@ class InternalEscapableScope : public v8::EscapableHandleScope {
}; };
#ifdef V8_ENABLE_CHECKS #ifdef DEBUG
void CheckMicrotasksScopesConsistency(i::Isolate* isolate) { void CheckMicrotasksScopesConsistency(i::Isolate* isolate) {
auto handle_scope_implementer = isolate->handle_scope_implementer(); auto handle_scope_implementer = isolate->handle_scope_implementer();
if (handle_scope_implementer->microtasks_policy() == if (handle_scope_implementer->microtasks_policy() ==
...@@ -187,7 +187,7 @@ class CallDepthScope { ...@@ -187,7 +187,7 @@ class CallDepthScope {
if (!context_.IsEmpty()) context_->Exit(); if (!context_.IsEmpty()) context_->Exit();
if (!escaped_) isolate_->handle_scope_implementer()->DecrementCallDepth(); if (!escaped_) isolate_->handle_scope_implementer()->DecrementCallDepth();
if (do_callback_) isolate_->FireCallCompletedCallback(); if (do_callback_) isolate_->FireCallCompletedCallback();
#ifdef V8_ENABLE_CHECKS #ifdef DEBUG
if (do_callback_) CheckMicrotasksScopesConsistency(isolate_); if (do_callback_) CheckMicrotasksScopesConsistency(isolate_);
#endif #endif
} }
...@@ -7804,7 +7804,7 @@ MicrotasksScope::MicrotasksScope(Isolate* isolate, MicrotasksScope::Type type) ...@@ -7804,7 +7804,7 @@ MicrotasksScope::MicrotasksScope(Isolate* isolate, MicrotasksScope::Type type)
run_(type == MicrotasksScope::kRunMicrotasks) { run_(type == MicrotasksScope::kRunMicrotasks) {
auto handle_scope_implementer = isolate_->handle_scope_implementer(); auto handle_scope_implementer = isolate_->handle_scope_implementer();
if (run_) handle_scope_implementer->IncrementMicrotasksScopeDepth(); if (run_) handle_scope_implementer->IncrementMicrotasksScopeDepth();
#ifdef V8_ENABLE_CHECKS #ifdef DEBUG
if (!run_) handle_scope_implementer->IncrementDebugMicrotasksScopeDepth(); if (!run_) handle_scope_implementer->IncrementDebugMicrotasksScopeDepth();
#endif #endif
} }
...@@ -7819,7 +7819,7 @@ MicrotasksScope::~MicrotasksScope() { ...@@ -7819,7 +7819,7 @@ MicrotasksScope::~MicrotasksScope() {
PerformCheckpoint(reinterpret_cast<Isolate*>(isolate_)); PerformCheckpoint(reinterpret_cast<Isolate*>(isolate_));
} }
} }
#ifdef V8_ENABLE_CHECKS #ifdef DEBUG
if (!run_) handle_scope_implementer->DecrementDebugMicrotasksScopeDepth(); if (!run_) handle_scope_implementer->DecrementDebugMicrotasksScopeDepth();
#endif #endif
} }
......
...@@ -454,7 +454,7 @@ class HandleScopeImplementer { ...@@ -454,7 +454,7 @@ class HandleScopeImplementer {
call_depth_(0), call_depth_(0),
microtasks_depth_(0), microtasks_depth_(0),
microtasks_suppressions_(0), microtasks_suppressions_(0),
#ifdef V8_ENABLE_CHECKS #ifdef DEBUG
debug_microtasks_depth_(0), debug_microtasks_depth_(0),
#endif #endif
microtasks_policy_(v8::MicrotasksPolicy::kAuto), microtasks_policy_(v8::MicrotasksPolicy::kAuto),
...@@ -495,7 +495,7 @@ class HandleScopeImplementer { ...@@ -495,7 +495,7 @@ class HandleScopeImplementer {
inline void DecrementMicrotasksSuppressions() {microtasks_suppressions_--;} inline void DecrementMicrotasksSuppressions() {microtasks_suppressions_--;}
inline bool HasMicrotasksSuppressions() { return !!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 // In debug we check that calls not intended to invoke microtasks are
// still correctly wrapped with microtask scopes. // still correctly wrapped with microtask scopes.
inline void IncrementDebugMicrotasksScopeDepth() {debug_microtasks_depth_++;} inline void IncrementDebugMicrotasksScopeDepth() {debug_microtasks_depth_++;}
...@@ -566,7 +566,7 @@ class HandleScopeImplementer { ...@@ -566,7 +566,7 @@ class HandleScopeImplementer {
int call_depth_; int call_depth_;
int microtasks_depth_; int microtasks_depth_;
int microtasks_suppressions_; int microtasks_suppressions_;
#ifdef V8_ENABLE_CHECKS #ifdef DEBUG
int debug_microtasks_depth_; int debug_microtasks_depth_;
#endif #endif
v8::MicrotasksPolicy microtasks_policy_; 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