33 : old_data_(current_per_thread_assert_data) {
35 "PerThreadAssertScope types should not include the "
36 "ASSERT_TYPE_IS_VALID_MARKER");
52 if (old_data_ == kClearedValue)
return;
53 current_per_thread_assert_data = old_data_;
54 old_data_ = kClearedValue;
60 return current_per_thread_assert_data.contains_all({kTypes...});
63#define PER_ISOLATE_ASSERT_SCOPE_DEFINITION(ScopeType, field, enable) \
64 ScopeType::ScopeType(Isolate* isolate) \
65 : isolate_(isolate), old_data_(isolate->field()) { \
66 DCHECK_NOT_NULL(isolate); \
67 isolate_->set_##field(enable); \
70 ScopeType::~ScopeType() { isolate_->set_##field(old_data_); } \
73 bool ScopeType::IsAllowed(Isolate* isolate) { return isolate->field(); } \
76 void ScopeType::Open(Isolate* isolate, bool* was_execution_allowed) { \
77 DCHECK_NOT_NULL(isolate); \
78 DCHECK_NOT_NULL(was_execution_allowed); \
79 *was_execution_allowed = isolate->field(); \
80 isolate->set_##field(enable); \
83 void ScopeType::Close(Isolate* isolate, bool was_execution_allowed) { \
84 DCHECK_NOT_NULL(isolate); \
85 isolate->set_##field(was_execution_allowed); \
88#define PER_ISOLATE_ASSERT_ENABLE_SCOPE_DEFINITION(EnableType, _, field, \
90 PER_ISOLATE_ASSERT_SCOPE_DEFINITION(EnableType, field, enable)
92#define PER_ISOLATE_ASSERT_DISABLE_SCOPE_DEFINITION(_, DisableType, field, \
94 PER_ISOLATE_ASSERT_SCOPE_DEFINITION(DisableType, field, enable)
117template class PerThreadAssertScope<false,
GC_MOLE>;
124template class PerThreadAssertScope<
127template class PerThreadAssertScope<
131static_assert(Internals::kDisallowGarbageCollectionAlign ==
133static_assert(Internals::kDisallowGarbageCollectionSize ==
#define PER_ISOLATE_ASSERT_ENABLE_SCOPE_DEFINITION(EnableType, _, field, enable)
#define PER_ISOLATE_ASSERT_DISABLE_SCOPE_DEFINITION(_, DisableType, field, enable)
#define PER_ISOLATE_DCHECK_TYPE(V, enable)
#define PER_ISOLATE_CHECK_TYPE(V, enable)
constexpr bool contains(E element) const
static V8_EXPORT_PRIVATE bool IsAllowed()
V8_EXPORT_PRIVATE PerThreadAssertScope()
V8_EXPORT_PRIVATE ~PerThreadAssertScope()
PerThreadAsserts old_data_
PerThreadAssertScope< false, SAFEPOINTS_ASSERT, HEAP_ALLOCATION_ASSERT > DisallowGarbageCollectionInRelease
@ CODE_DEPENDENCY_CHANGE_ASSERT
@ HANDLE_USAGE_ON_ALL_THREADS_ASSERT
@ POSITION_INFO_SLOW_ASSERT
@ ASSERT_TYPE_IS_VALID_MARKER
@ HANDLE_ALLOCATION_ASSERT
@ HANDLE_DEREFERENCE_ASSERT
base::EnumSet< PerThreadAssertType, uint32_t > PerThreadAsserts
#define DCHECK(condition)