[heap][test] Set FLAG_local_heaps first before creating context

FLAG_local_heaps needs to be set before creating the context, otherwise
the StressConcurrentAllocatorTask is already started. Setting the flag
then races with background thread, which checks FLAG_local_heaps while
creating LocalHeap.

Bug: v8:10315
Change-Id: If6de748ec174dffb94a2582d24e37d24586ee95a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2404823
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#69850}
This commit is contained in:
Dominik Inführ 2020-09-11 14:38:53 +02:00 committed by Commit Bot
parent e9d3d232b7
commit b4ecc0e2d0

View File

@ -70,8 +70,8 @@ class ConcurrentSearchThread final : public v8::base::Thread {
// Uses linear search on a flat object, with up to 8 elements.
TEST(LinearSearchFlatObject) {
CcTest::InitializeVM();
FLAG_local_heaps = true;
CcTest::InitializeVM();
Isolate* isolate = CcTest::i_isolate();
std::unique_ptr<PersistentHandles> ph = isolate->NewPersistentHandles();