[handles] Check FLAG_local_heaps in IsDereferenceAllowed()

While LocalHeap allow to dereference handles on background threads, this
is only possible when FLAG_local_heaps is enabled.

Bug: v8:10315
Change-Id: Ia27582cda7e4b4faf4d2c76959de418415e1ae68
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2372147
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#69557}
This commit is contained in:
Dominik Inführ 2020-08-25 15:16:23 +02:00 committed by Commit Bot
parent 289c15eb6d
commit 2c879c68c5
2 changed files with 2 additions and 1 deletions

View File

@ -43,7 +43,7 @@ bool HandleBase::IsDereferenceAllowed() const {
}
LocalHeap* local_heap = LocalHeap::Current();
if (V8_UNLIKELY(local_heap)) {
if (FLAG_local_heaps && local_heap) {
// Local heap can't access handles when parked
if (!local_heap->IsHandleDereferenceAllowed()) return false;

View File

@ -31,6 +31,7 @@ SerializerTester::SerializerTester(const char* source)
// We need allocation of executable memory for the compilation.
FLAG_jitless = false;
FLAG_allow_natives_syntax = true;
FlagList::EnforceFlagImplications();
std::string function_string = "(function() { ";
function_string += source;