Commit 35ae6344 authored by Dominik Inführ's avatar Dominik Inführ Committed by V8 LUCI CQ

[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: 's avatarMichael Lippautz <mlippautz@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#78316}
parent f668e9f7
......@@ -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);
......
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