diff options
Diffstat (limited to 'deps/v8/src/assert-scope.cc')
-rw-r--r-- | deps/v8/src/assert-scope.cc | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/deps/v8/src/assert-scope.cc b/deps/v8/src/assert-scope.cc index 3852709966..f446ad0895 100644 --- a/deps/v8/src/assert-scope.cc +++ b/deps/v8/src/assert-scope.cc @@ -83,15 +83,21 @@ PerThreadAssertScope<kType, kAllow>::PerThreadAssertScope() template <PerThreadAssertType kType, bool kAllow> PerThreadAssertScope<kType, kAllow>::~PerThreadAssertScope() { + if (data_ == nullptr) return; + Release(); +} + +template <PerThreadAssertType kType, bool kAllow> +void PerThreadAssertScope<kType, kAllow>::Release() { DCHECK_NOT_NULL(data_); data_->Set(kType, old_state_); if (data_->DecrementLevel()) { PerThreadAssertData::SetCurrent(NULL); delete data_; } + data_ = nullptr; } - // static template <PerThreadAssertType kType, bool kAllow> bool PerThreadAssertScope<kType, kAllow>::IsAllowed() { @@ -149,6 +155,8 @@ template class PerIsolateAssertScope<DEOPTIMIZATION_ASSERT, false>; template class PerIsolateAssertScope<DEOPTIMIZATION_ASSERT, true>; template class PerIsolateAssertScope<COMPILATION_ASSERT, false>; template class PerIsolateAssertScope<COMPILATION_ASSERT, true>; +template class PerIsolateAssertScope<NO_EXCEPTION_ASSERT, false>; +template class PerIsolateAssertScope<NO_EXCEPTION_ASSERT, true>; } // namespace internal } // namespace v8 |