[handles] DCHECK that thread isn't parked when creating handles
Parked threads are not allowed to create new handles or access the heap in any other way. This is a pretty fundamental invariant of our safepoint mechanism, which doesn't stop parked threads. Change-Id: I577dbeffbb70e0843644cdc12ffbef022890c364 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3324542 Auto-Submit: Dominik Inführ <dinfuehr@chromium.org> Reviewed-by: Michael Lippautz <mlippautz@chromium.org> Commit-Queue: Michael Lippautz <mlippautz@chromium.org> Cr-Commit-Position: refs/heads/main@{#78316}
This commit is contained in:
parent
f668e9f7ae
commit
35ae63443b
@ -178,6 +178,7 @@ Address* HandleScope::CreateHandle(Isolate* isolate, Address value) {
|
||||
|
||||
Address* HandleScope::GetHandle(Isolate* isolate, Address value) {
|
||||
DCHECK(AllowHandleAllocation::IsAllowed());
|
||||
DCHECK(isolate->main_thread_local_heap()->IsRunning());
|
||||
DCHECK_WITH_MSG(isolate->thread_id() == ThreadId::Current(),
|
||||
"main-thread handle can only be created on the main thread.");
|
||||
HandleScopeData* data = isolate->handle_scope_data();
|
||||
|
@ -16,6 +16,7 @@ namespace internal {
|
||||
// static
|
||||
V8_INLINE Address* LocalHandleScope::GetHandle(LocalHeap* local_heap,
|
||||
Address value) {
|
||||
DCHECK(local_heap->IsRunning());
|
||||
if (local_heap->is_main_thread())
|
||||
return LocalHandleScope::GetMainThreadHandle(local_heap, value);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user