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

[handles] DCHECK that thread is running in LocalHandleScope constructor

It is easy to miss that a LocalHandleScope can only be created when
the current thread is in the running state and not parked. Add a DCHECK
for this, such that we don't need to rely on TSAN for finding such
issues.

Bug: v8:12357
Change-Id: I1f2f9b1fdf05814009f2edccf192afbb1caf6baf
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3257705
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@{#77672}
parent 042449fd
......@@ -34,6 +34,8 @@ LocalHandleScope::LocalHandleScope(LocalIsolate* local_isolate)
: LocalHandleScope(local_isolate->heap()) {}
LocalHandleScope::LocalHandleScope(LocalHeap* local_heap) {
DCHECK(local_heap->IsRunning());
if (local_heap->is_main_thread()) {
OpenMainThreadScope(local_heap);
} else {
......
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