From 6df1aec62cc6f0f7c438ce674d10b91e042d7e6c Mon Sep 17 00:00:00 2001 From: Ulan Degenbaev Date: Fri, 29 Jan 2021 13:17:15 +0100 Subject: [PATCH] [heap, infra] Remove --local-heaps and --concurrent-allocation flags MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The flags are enabled by default and have stable coverage. This also removes the corresponding bots. Bug: v8:10315 Change-Id: Icce01383050dff758b6554db8e0c3589d6e5459c Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2658324 Commit-Queue: Ulan Degenbaev Reviewed-by: Dominik Inführ Reviewed-by: Michael Achenbach Cr-Commit-Position: refs/heads/master@{#72457} --- infra/testing/builders.pyl | 4 --- src/flags/flag-definitions.h | 11 ------- src/handles/handles.cc | 30 ++++++++--------- src/handles/persistent-handles.cc | 2 +- src/heap/concurrent-allocator-inl.h | 2 -- src/heap/concurrent-allocator.cc | 1 - src/heap/heap.cc | 12 ++----- src/heap/incremental-marking.cc | 33 ++++++++----------- src/heap/local-heap.cc | 4 +-- src/heap/mark-compact.cc | 8 ++--- src/heap/marking-barrier.cc | 27 +++++---------- src/heap/new-spaces.cc | 2 +- src/heap/paged-spaces.h | 4 +-- src/heap/safepoint.cc | 4 --- src/objects/string-table.cc | 6 ++-- test/cctest/compiler/serializer-tester.cc | 4 --- test/cctest/heap/heap-utils.cc | 6 ---- test/cctest/heap/heap-utils.h | 2 -- .../cctest/heap/test-concurrent-allocation.cc | 13 -------- test/cctest/heap/test-heap.cc | 1 - .../test-concurrent-descriptor-array.cc | 2 -- .../cctest/test-concurrent-feedback-vector.cc | 1 - test/cctest/test-concurrent-prototype.cc | 3 -- test/cctest/test-concurrent-string.cc | 3 -- test/cctest/test-local-handles.cc | 4 --- test/cctest/test-persistent-handles.cc | 3 -- test/unittests/heap/local-factory-unittest.cc | 1 - test/unittests/heap/safepoint-unittest.cc | 9 ----- tools/testrunner/local/variants.py | 4 --- 29 files changed, 49 insertions(+), 157 deletions(-) diff --git a/infra/testing/builders.pyl b/infra/testing/builders.pyl index f55d673e65..e3e99d19af 100644 --- a/infra/testing/builders.pyl +++ b/infra/testing/builders.pyl @@ -294,7 +294,6 @@ {'name': 'test262', 'shards': 7}, {'name': 'v8testing', 'shards': 3}, {'name': 'v8testing', 'variant': 'extra', 'shards': 3}, - {'name': 'v8testing', 'variant': 'no_local_heaps'}, {'name': 'v8testing', 'variant': 'slow_path'}, ], }, @@ -447,7 +446,6 @@ {'name': 'test262', 'variant': 'default', 'shards': 3}, {'name': 'v8testing', 'shards': 5}, {'name': 'v8testing', 'variant': 'extra', 'shards': 3}, - {'name': 'v8testing', 'variant': 'no_local_heaps'}, {'name': 'v8testing', 'variant': 'slow_path'}, {'name': 'v8testing', 'variant': 'stress_concurrent_allocation'}, ], @@ -1201,7 +1199,6 @@ {'name': 'test262', 'shards': 5}, {'name': 'v8testing', 'shards': 2}, {'name': 'v8testing', 'variant': 'extra', 'shards': 2}, - {'name': 'v8testing', 'variant': 'no_local_heaps', 'shards': 1}, {'name': 'v8testing', 'variant': 'slow_path', 'shards': 1}, ], }, @@ -1227,7 +1224,6 @@ {'name': 'test262', 'variant': 'default', 'shards': 3}, {'name': 'v8testing', 'shards': 5}, {'name': 'v8testing', 'variant': 'extra', 'shards': 3}, - {'name': 'v8testing', 'variant': 'no_local_heaps', 'shards': 1}, {'name': 'v8testing', 'variant': 'slow_path', 'shards': 1}, {'name': 'v8testing', 'variant': 'stress_concurrent_allocation', 'shards': 1}, ], diff --git a/src/flags/flag-definitions.h b/src/flags/flag-definitions.h index 6422872964..8cd5258134 100644 --- a/src/flags/flag-definitions.h +++ b/src/flags/flag-definitions.h @@ -1036,19 +1036,8 @@ DEFINE_BOOL(concurrent_marking, V8_CONCURRENT_MARKING_BOOL, "use concurrent marking") DEFINE_BOOL(concurrent_array_buffer_sweeping, true, "concurrently sweep array buffers") -DEFINE_BOOL(concurrent_allocation, true, "concurrently allocate in old space") DEFINE_BOOL(stress_concurrent_allocation, false, "start background threads that allocate memory") -DEFINE_BOOL(local_heaps, true, "allow heap access from background tasks") -// Since the local_heaps flag is enabled by default, we defined reverse -// implications to simplify disabling the flag. -DEFINE_NEG_NEG_IMPLICATION(local_heaps, turbo_direct_heap_access) -DEFINE_NEG_NEG_IMPLICATION(local_heaps, stress_concurrent_inlining) -DEFINE_NEG_NEG_IMPLICATION(local_heaps, concurrent_inlining) -DEFINE_NEG_NEG_IMPLICATION(local_heaps, concurrent_allocation) -DEFINE_NEG_NEG_IMPLICATION(concurrent_allocation, - finalize_streaming_on_background) -DEFINE_NEG_NEG_IMPLICATION(concurrent_allocation, stress_concurrent_allocation) DEFINE_BOOL(parallel_marking, V8_CONCURRENT_MARKING_BOOL, "use parallel marking in atomic pause") DEFINE_INT(ephemeron_fixpoint_iterations, 10, diff --git a/src/handles/handles.cc b/src/handles/handles.cc index 9a2b813263..392b1f8153 100644 --- a/src/handles/handles.cc +++ b/src/handles/handles.cc @@ -46,24 +46,22 @@ bool HandleBase::IsDereferenceAllowed() const { if (isolate->IsBuiltinsTableHandleLocation(location_)) return true; if (!AllowHandleDereference::IsAllowed()) return false; - if (FLAG_local_heaps) { - LocalHeap* local_heap = isolate->CurrentLocalHeap(); + LocalHeap* local_heap = isolate->CurrentLocalHeap(); - // Local heap can't access handles when parked - if (!local_heap->IsHandleDereferenceAllowed()) { - StdoutStream{} << "Cannot dereference handle owned by " - << "non-running local heap\n"; - return false; - } + // Local heap can't access handles when parked + if (!local_heap->IsHandleDereferenceAllowed()) { + StdoutStream{} << "Cannot dereference handle owned by " + << "non-running local heap\n"; + return false; + } - // We are pretty strict with handle dereferences on background threads: A - // background local heap is only allowed to dereference its own local or - // persistent handles. - if (!local_heap->is_main_thread()) { - // The current thread owns the handle and thus can dereference it. - return local_heap->ContainsPersistentHandle(location_) || - local_heap->ContainsLocalHandle(location_); - } + // We are pretty strict with handle dereferences on background threads: A + // background local heap is only allowed to dereference its own local or + // persistent handles. + if (!local_heap->is_main_thread()) { + // The current thread owns the handle and thus can dereference it. + return local_heap->ContainsPersistentHandle(location_) || + local_heap->ContainsLocalHandle(location_); } // If LocalHeap::Current() is null, we're on the main thread -- if we were to // check main thread HandleScopes here, we should additionally check the diff --git a/src/handles/persistent-handles.cc b/src/handles/persistent-handles.cc index df9a6d951c..c793d6aaa3 100644 --- a/src/handles/persistent-handles.cc +++ b/src/handles/persistent-handles.cc @@ -122,7 +122,7 @@ void PersistentHandlesList::Remove(PersistentHandles* persistent_handles) { } void PersistentHandlesList::Iterate(RootVisitor* visitor, Isolate* isolate) { - DCHECK_IMPLIES(FLAG_local_heaps, isolate->heap()->safepoint()->IsActive()); + DCHECK(isolate->heap()->safepoint()->IsActive()); base::MutexGuard guard(&persistent_handles_mutex_); for (PersistentHandles* current = persistent_handles_head_; current; current = current->next_) { diff --git a/src/heap/concurrent-allocator-inl.h b/src/heap/concurrent-allocator-inl.h index 116bc55ac1..c92b91ca47 100644 --- a/src/heap/concurrent-allocator-inl.h +++ b/src/heap/concurrent-allocator-inl.h @@ -21,8 +21,6 @@ AllocationResult ConcurrentAllocator::AllocateRaw(int object_size, AllocationAlignment alignment, AllocationOrigin origin) { // TODO(dinfuehr): Add support for allocation observers - CHECK(FLAG_concurrent_allocation); - #ifdef DEBUG local_heap_->VerifyCurrent(); #endif diff --git a/src/heap/concurrent-allocator.cc b/src/heap/concurrent-allocator.cc index f49059d556..47cff165a4 100644 --- a/src/heap/concurrent-allocator.cc +++ b/src/heap/concurrent-allocator.cc @@ -61,7 +61,6 @@ void StressConcurrentAllocatorTask::RunInternal() { // static void StressConcurrentAllocatorTask::Schedule(Isolate* isolate) { - CHECK(FLAG_local_heaps && FLAG_concurrent_allocation); auto task = std::make_unique(isolate); const double kDelayInSeconds = 0.1; V8::GetCurrentPlatform()->CallDelayedOnWorkerThread(std::move(task), diff --git a/src/heap/heap.cc b/src/heap/heap.cc index 86049c4890..60cc5f8ce1 100644 --- a/src/heap/heap.cc +++ b/src/heap/heap.cc @@ -1989,7 +1989,6 @@ GCTracer::Scope::ScopeId CollectorScopeId(GarbageCollector collector) { size_t Heap::PerformGarbageCollection( GarbageCollector collector, const v8::GCCallbackFlags gc_callback_flags) { DisallowJavascriptExecution no_js(isolate()); - base::Optional optional_safepoint_scope; if (IsYoungGenerationCollector(collector)) { CompleteSweepingYoung(collector); @@ -2008,9 +2007,7 @@ size_t Heap::PerformGarbageCollection( TRACE_GC_EPOCH(tracer(), CollectorScopeId(collector), ThreadKind::kMain); - if (FLAG_local_heaps) { - optional_safepoint_scope.emplace(this); - } + SafepointScope safepoint_scope(this); #ifdef VERIFY_HEAP if (FLAG_verify_heap) { @@ -3289,7 +3286,6 @@ void Heap::MakeHeapIterable() { } void Heap::MakeLocalHeapLabsIterable() { - if (!FLAG_local_heaps) return; safepoint()->IterateLocalHeaps([](LocalHeap* local_heap) { local_heap->MakeLinearAllocationAreaIterable(); }); @@ -4498,10 +4494,8 @@ void Heap::IterateRoots(RootVisitor* v, base::EnumSet options) { isolate_->handle_scope_implementer()->Iterate(v); #endif - if (FLAG_local_heaps) { - safepoint_->Iterate(&left_trim_visitor); - safepoint_->Iterate(v); - } + safepoint_->Iterate(&left_trim_visitor); + safepoint_->Iterate(v); isolate_->persistent_handles_list()->Iterate(&left_trim_visitor, isolate_); isolate_->persistent_handles_list()->Iterate(v, isolate_); diff --git a/src/heap/incremental-marking.cc b/src/heap/incremental-marking.cc index 076f1fe51c..a093835981 100644 --- a/src/heap/incremental-marking.cc +++ b/src/heap/incremental-marking.cc @@ -261,11 +261,9 @@ void IncrementalMarking::StartBlackAllocation() { heap()->old_space()->MarkLinearAllocationAreaBlack(); heap()->map_space()->MarkLinearAllocationAreaBlack(); heap()->code_space()->MarkLinearAllocationAreaBlack(); - if (FLAG_local_heaps) { - heap()->safepoint()->IterateLocalHeaps([](LocalHeap* local_heap) { - local_heap->MarkLinearAllocationAreaBlack(); - }); - } + heap()->safepoint()->IterateLocalHeaps([](LocalHeap* local_heap) { + local_heap->MarkLinearAllocationAreaBlack(); + }); if (FLAG_trace_incremental_marking) { heap()->isolate()->PrintWithTimestamp( "[IncrementalMarking] Black allocation started\n"); @@ -277,11 +275,8 @@ void IncrementalMarking::PauseBlackAllocation() { heap()->old_space()->UnmarkLinearAllocationArea(); heap()->map_space()->UnmarkLinearAllocationArea(); heap()->code_space()->UnmarkLinearAllocationArea(); - if (FLAG_local_heaps) { - heap()->safepoint()->IterateLocalHeaps([](LocalHeap* local_heap) { - local_heap->UnmarkLinearAllocationArea(); - }); - } + heap()->safepoint()->IterateLocalHeaps( + [](LocalHeap* local_heap) { local_heap->UnmarkLinearAllocationArea(); }); if (FLAG_trace_incremental_marking) { heap()->isolate()->PrintWithTimestamp( "[IncrementalMarking] Black allocation paused\n"); @@ -600,19 +595,17 @@ void IncrementalMarking::Stop() { is_compacting_ = false; FinishBlackAllocation(); - if (FLAG_local_heaps) { - // Merge live bytes counters of background threads - for (auto pair : background_live_bytes_) { - MemoryChunk* memory_chunk = pair.first; - intptr_t live_bytes = pair.second; + // Merge live bytes counters of background threads + for (auto pair : background_live_bytes_) { + MemoryChunk* memory_chunk = pair.first; + intptr_t live_bytes = pair.second; - if (live_bytes) { - marking_state()->IncrementLiveBytes(memory_chunk, live_bytes); - } + if (live_bytes) { + marking_state()->IncrementLiveBytes(memory_chunk, live_bytes); } - - background_live_bytes_.clear(); } + + background_live_bytes_.clear(); } diff --git a/src/heap/local-heap.cc b/src/heap/local-heap.cc index 38f2cf17a8..0fd5f6acdb 100644 --- a/src/heap/local-heap.cc +++ b/src/heap/local-heap.cc @@ -52,7 +52,7 @@ LocalHeap::LocalHeap(Heap* heap, ThreadKind kind, marking_barrier_(new MarkingBarrier(this)), old_space_allocator_(this, heap->old_space()) { heap_->safepoint()->AddLocalHeap(this, [this] { - if (FLAG_local_heaps && !is_main_thread()) { + if (!is_main_thread()) { WriteBarrier::SetForThread(marking_barrier_.get()); if (heap_->incremental_marking()->IsMarking()) { marking_barrier_->Activate( @@ -75,7 +75,7 @@ LocalHeap::~LocalHeap() { heap_->safepoint()->RemoveLocalHeap(this, [this] { old_space_allocator_.FreeLinearAllocationArea(); - if (FLAG_local_heaps && !is_main_thread()) { + if (!is_main_thread()) { marking_barrier_->Publish(); WriteBarrier::ClearForThread(marking_barrier_.get()); } diff --git a/src/heap/mark-compact.cc b/src/heap/mark-compact.cc index dbe90439c0..1c4a567d92 100644 --- a/src/heap/mark-compact.cc +++ b/src/heap/mark-compact.cc @@ -858,11 +858,9 @@ void MarkCompactCollector::Prepare() { space->PrepareForMarkCompact(); } - if (FLAG_local_heaps) { - // Fill and reset all background thread LABs - heap_->safepoint()->IterateLocalHeaps( - [](LocalHeap* local_heap) { local_heap->FreeLinearAllocationArea(); }); - } + // Fill and reset all background thread LABs + heap_->safepoint()->IterateLocalHeaps( + [](LocalHeap* local_heap) { local_heap->FreeLinearAllocationArea(); }); // All objects are guaranteed to be initialized in atomic pause heap()->new_lo_space()->ResetPendingObject(); diff --git a/src/heap/marking-barrier.cc b/src/heap/marking-barrier.cc index 8e73518d97..130c707f41 100644 --- a/src/heap/marking-barrier.cc +++ b/src/heap/marking-barrier.cc @@ -94,36 +94,27 @@ void MarkingBarrier::RecordRelocSlot(Code host, RelocInfo* rinfo, // static void MarkingBarrier::ActivateAll(Heap* heap, bool is_compacting) { heap->marking_barrier()->Activate(is_compacting); - if (FLAG_local_heaps) { - heap->safepoint()->IterateLocalHeaps( - [is_compacting](LocalHeap* local_heap) { - local_heap->marking_barrier()->Activate(is_compacting); - }); - } + heap->safepoint()->IterateLocalHeaps([is_compacting](LocalHeap* local_heap) { + local_heap->marking_barrier()->Activate(is_compacting); + }); } // static void MarkingBarrier::DeactivateAll(Heap* heap) { heap->marking_barrier()->Deactivate(); - if (FLAG_local_heaps) { - heap->safepoint()->IterateLocalHeaps([](LocalHeap* local_heap) { - local_heap->marking_barrier()->Deactivate(); - }); - } + heap->safepoint()->IterateLocalHeaps([](LocalHeap* local_heap) { + local_heap->marking_barrier()->Deactivate(); + }); } // static void MarkingBarrier::PublishAll(Heap* heap) { heap->marking_barrier()->Publish(); - if (FLAG_local_heaps) { - heap->safepoint()->IterateLocalHeaps([](LocalHeap* local_heap) { - local_heap->marking_barrier()->Publish(); - }); - } + heap->safepoint()->IterateLocalHeaps( + [](LocalHeap* local_heap) { local_heap->marking_barrier()->Publish(); }); } void MarkingBarrier::Publish() { - DCHECK_IMPLIES(!is_main_thread_barrier_, FLAG_local_heaps); if (is_activated_) { worklist_.Publish(); for (auto& it : typed_slots_map_) { @@ -153,7 +144,6 @@ void MarkingBarrier::DeactivateSpace(NewSpace* space) { void MarkingBarrier::Deactivate() { is_activated_ = false; is_compacting_ = false; - DCHECK_IMPLIES(!is_main_thread_barrier_, FLAG_local_heaps); if (is_main_thread_barrier_) { DeactivateSpace(heap_->old_space()); DeactivateSpace(heap_->map_space()); @@ -191,7 +181,6 @@ void MarkingBarrier::ActivateSpace(NewSpace* space) { void MarkingBarrier::Activate(bool is_compacting) { DCHECK(!is_activated_); DCHECK(worklist_.IsLocalEmpty()); - DCHECK_IMPLIES(!is_main_thread_barrier_, FLAG_local_heaps); is_compacting_ = is_compacting; is_activated_ = true; if (is_main_thread_barrier_) { diff --git a/src/heap/new-spaces.cc b/src/heap/new-spaces.cc index d6cfe7249e..029b77beb4 100644 --- a/src/heap/new-spaces.cc +++ b/src/heap/new-spaces.cc @@ -429,7 +429,7 @@ void NewSpace::ResetParkedAllocationBuffers() { void NewSpace::Flip() { SemiSpace::Swap(&from_space_, &to_space_); } void NewSpace::Grow() { - DCHECK_IMPLIES(FLAG_local_heaps, heap()->safepoint()->IsActive()); + DCHECK(heap()->safepoint()->IsActive()); // Double the semispace size but only up to maximum capacity. DCHECK(TotalCapacity() < MaximumCapacity()); size_t new_capacity = std::min( diff --git a/src/heap/paged-spaces.h b/src/heap/paged-spaces.h index 233bd60d35..5168f0f053 100644 --- a/src/heap/paged-spaces.h +++ b/src/heap/paged-spaces.h @@ -326,9 +326,7 @@ class V8_EXPORT_PRIVATE PagedSpace base::Optional guard_; }; - bool SupportsConcurrentAllocation() { - return FLAG_concurrent_allocation && !is_local_space(); - } + bool SupportsConcurrentAllocation() { return !is_local_space(); } // Set space linear allocation area. void SetTopAndLimit(Address top, Address limit); diff --git a/src/heap/safepoint.cc b/src/heap/safepoint.cc index ad36dadb7c..6ae7b9e680 100644 --- a/src/heap/safepoint.cc +++ b/src/heap/safepoint.cc @@ -18,8 +18,6 @@ GlobalSafepoint::GlobalSafepoint(Heap* heap) : heap_(heap), local_heaps_head_(nullptr), active_safepoint_scopes_(0) {} void GlobalSafepoint::EnterSafepointScope() { - if (!FLAG_local_heaps) return; - if (++active_safepoint_scopes_ > 1) return; TimedHistogramScope timer( @@ -54,8 +52,6 @@ void GlobalSafepoint::EnterSafepointScope() { } void GlobalSafepoint::LeaveSafepointScope() { - if (!FLAG_local_heaps) return; - DCHECK_GT(active_safepoint_scopes_, 0); if (--active_safepoint_scopes_ > 0) return; diff --git a/src/objects/string-table.cc b/src/objects/string-table.cc index 1f772f6edf..8d5b44c6c5 100644 --- a/src/objects/string-table.cc +++ b/src/objects/string-table.cc @@ -681,14 +681,14 @@ size_t StringTable::GetCurrentMemoryUsage() const { void StringTable::IterateElements(RootVisitor* visitor) { // This should only happen during garbage collection when background threads // are paused, so the load can be relaxed. - DCHECK_IMPLIES(FLAG_local_heaps, isolate_->heap()->safepoint()->IsActive()); + DCHECK(isolate_->heap()->safepoint()->IsActive()); data_.load(std::memory_order_relaxed)->IterateElements(visitor); } void StringTable::DropOldData() { // This should only happen during garbage collection when background threads // are paused, so the load can be relaxed. - DCHECK_IMPLIES(FLAG_local_heaps, isolate_->heap()->safepoint()->IsActive()); + DCHECK(isolate_->heap()->safepoint()->IsActive()); DCHECK_NE(isolate_->heap()->gc_state(), Heap::NOT_IN_GC); data_.load(std::memory_order_relaxed)->DropPreviousData(); } @@ -696,7 +696,7 @@ void StringTable::DropOldData() { void StringTable::NotifyElementsRemoved(int count) { // This should only happen during garbage collection when background threads // are paused, so the load can be relaxed. - DCHECK_IMPLIES(FLAG_local_heaps, isolate_->heap()->safepoint()->IsActive()); + DCHECK(isolate_->heap()->safepoint()->IsActive()); DCHECK_NE(isolate_->heap()->gc_state(), Heap::NOT_IN_GC); data_.load(std::memory_order_relaxed)->ElementsRemoved(count); } diff --git a/test/cctest/compiler/serializer-tester.cc b/test/cctest/compiler/serializer-tester.cc index d870c4f074..88e0becf23 100644 --- a/test/cctest/compiler/serializer-tester.cc +++ b/test/cctest/compiler/serializer-tester.cc @@ -22,10 +22,6 @@ SerializerTester::SerializerTester(const char* source) : canonical_(main_isolate()) { // The tests only make sense in the context of concurrent compilation. FLAG_concurrent_inlining = true; - // --local-heaps is enabled by default, but some bots disable it. - // Ensure that it is enabled here because we have reverse implication - // from --no-local-heaps to --no-concurrent-inlining. - if (!FLAG_local_heaps) FLAG_local_heaps = true; // The tests don't make sense when optimizations are turned off. FLAG_opt = true; // We need the IC to feed it to the serializer. diff --git a/test/cctest/heap/heap-utils.cc b/test/cctest/heap/heap-utils.cc index 171beb5f82..24f04e9eed 100644 --- a/test/cctest/heap/heap-utils.cc +++ b/test/cctest/heap/heap-utils.cc @@ -243,12 +243,6 @@ bool InCorrectGeneration(HeapObject object) { : i::Heap::InYoungGeneration(object); } -void EnsureFlagLocalHeapsEnabled() { - // Avoid data race in concurrent thread by only setting the flag to true if - // not already enabled. - if (!FLAG_local_heaps) FLAG_local_heaps = true; -} - void GrowNewSpace(Heap* heap) { SafepointScope scope(heap); if (!heap->new_space()->IsAtMaximumCapacity()) { diff --git a/test/cctest/heap/heap-utils.h b/test/cctest/heap/heap-utils.h index 33974294df..ab06763872 100644 --- a/test/cctest/heap/heap-utils.h +++ b/test/cctest/heap/heap-utils.h @@ -70,8 +70,6 @@ void InvokeScavenge(Isolate* isolate = nullptr); void InvokeMarkSweep(Isolate* isolate = nullptr); -void EnsureFlagLocalHeapsEnabled(); - void GrowNewSpace(Heap* heap); void GrowNewSpaceToMaximumCapacity(Heap* heap); diff --git a/test/cctest/heap/test-concurrent-allocation.cc b/test/cctest/heap/test-concurrent-allocation.cc index edc04065fb..e70bb91345 100644 --- a/test/cctest/heap/test-concurrent-allocation.cc +++ b/test/cctest/heap/test-concurrent-allocation.cc @@ -83,8 +83,6 @@ class ConcurrentAllocationThread final : public v8::base::Thread { UNINITIALIZED_TEST(ConcurrentAllocationInOldSpace) { FLAG_max_old_space_size = 32; - FLAG_concurrent_allocation = true; - FLAG_local_heaps = true; FLAG_stress_concurrent_allocation = false; v8::Isolate::CreateParams create_params; @@ -118,8 +116,6 @@ UNINITIALIZED_TEST(ConcurrentAllocationInOldSpace) { UNINITIALIZED_TEST(ConcurrentAllocationInOldSpaceFromMainThread) { FLAG_max_old_space_size = 4; - FLAG_concurrent_allocation = true; - FLAG_local_heaps = true; FLAG_stress_concurrent_allocation = false; v8::Isolate::CreateParams create_params; @@ -167,8 +163,6 @@ class LargeObjectConcurrentAllocationThread final : public v8::base::Thread { UNINITIALIZED_TEST(ConcurrentAllocationInLargeSpace) { FLAG_max_old_space_size = 32; - FLAG_concurrent_allocation = true; - FLAG_local_heaps = true; FLAG_stress_concurrent_allocation = false; v8::Isolate::CreateParams create_params; @@ -243,9 +237,6 @@ class ConcurrentBlackAllocationThread final : public v8::base::Thread { }; UNINITIALIZED_TEST(ConcurrentBlackAllocation) { - FLAG_concurrent_allocation = true; - FLAG_local_heaps = true; - v8::Isolate::CreateParams create_params; create_params.array_buffer_allocator = CcTest::array_buffer_allocator(); v8::Isolate* isolate = v8::Isolate::New(create_params); @@ -310,8 +301,6 @@ UNINITIALIZED_TEST(ConcurrentWriteBarrier) { return; } ManualGCScope manual_gc_scope; - FLAG_concurrent_allocation = true; - FLAG_local_heaps = true; v8::Isolate::CreateParams create_params; create_params.array_buffer_allocator = CcTest::array_buffer_allocator(); @@ -377,8 +366,6 @@ UNINITIALIZED_TEST(ConcurrentRecordRelocSlot) { } FLAG_manual_evacuation_candidates_selection = true; ManualGCScope manual_gc_scope; - FLAG_concurrent_allocation = true; - FLAG_local_heaps = true; v8::Isolate::CreateParams create_params; create_params.array_buffer_allocator = CcTest::array_buffer_allocator(); diff --git a/test/cctest/heap/test-heap.cc b/test/cctest/heap/test-heap.cc index c8bde661c0..bf517b2c11 100644 --- a/test/cctest/heap/test-heap.cc +++ b/test/cctest/heap/test-heap.cc @@ -7116,7 +7116,6 @@ TEST(Regress978156) { } TEST(GarbageCollectionWithLocalHeap) { - EnsureFlagLocalHeapsEnabled(); ManualGCScope manual_gc_scope; CcTest::InitializeVM(); diff --git a/test/cctest/test-concurrent-descriptor-array.cc b/test/cctest/test-concurrent-descriptor-array.cc index bc9eb53ff5..aefb7ac38b 100644 --- a/test/cctest/test-concurrent-descriptor-array.cc +++ b/test/cctest/test-concurrent-descriptor-array.cc @@ -70,7 +70,6 @@ class ConcurrentSearchThread final : public v8::base::Thread { // Uses linear search on a flat object, with up to 8 elements. TEST(LinearSearchFlatObject) { - heap::EnsureFlagLocalHeapsEnabled(); CcTest::InitializeVM(); Isolate* isolate = CcTest::i_isolate(); @@ -122,7 +121,6 @@ TEST(LinearSearchFlatObject) { // Uses linear search on a flat object, which has more than 8 elements. TEST(LinearSearchFlatObject_ManyElements) { - heap::EnsureFlagLocalHeapsEnabled(); CcTest::InitializeVM(); Isolate* isolate = CcTest::i_isolate(); diff --git a/test/cctest/test-concurrent-feedback-vector.cc b/test/cctest/test-concurrent-feedback-vector.cc index 7279e28567..38f7c05ffe 100644 --- a/test/cctest/test-concurrent-feedback-vector.cc +++ b/test/cctest/test-concurrent-feedback-vector.cc @@ -156,7 +156,6 @@ static void CheckedWait(base::Semaphore& semaphore) { // Verify that a LoadIC can be cycled through different states and safely // read on a background thread. TEST(CheckLoadICStates) { - heap::EnsureFlagLocalHeapsEnabled(); CcTest::InitializeVM(); FLAG_lazy_feedback_allocation = false; Isolate* isolate = CcTest::i_isolate(); diff --git a/test/cctest/test-concurrent-prototype.cc b/test/cctest/test-concurrent-prototype.cc index e46f3a5ade..88e902d13d 100644 --- a/test/cctest/test-concurrent-prototype.cc +++ b/test/cctest/test-concurrent-prototype.cc @@ -68,7 +68,6 @@ class ConcurrentSearchThread final : public v8::base::Thread { // Test to search on a background thread, while the main thread is idle. TEST(ProtoWalkBackground) { - heap::EnsureFlagLocalHeapsEnabled(); CcTest::InitializeVM(); Isolate* isolate = CcTest::i_isolate(); @@ -108,7 +107,6 @@ TEST(ProtoWalkBackground) { // Test to search on a background thread, while the main thread modifies the // descriptor array. TEST(ProtoWalkBackground_DescriptorArrayWrite) { - heap::EnsureFlagLocalHeapsEnabled(); CcTest::InitializeVM(); Isolate* isolate = CcTest::i_isolate(); @@ -155,7 +153,6 @@ TEST(ProtoWalkBackground_DescriptorArrayWrite) { } TEST(ProtoWalkBackground_PrototypeChainWrite) { - heap::EnsureFlagLocalHeapsEnabled(); CcTest::InitializeVM(); Isolate* isolate = CcTest::i_isolate(); diff --git a/test/cctest/test-concurrent-string.cc b/test/cctest/test-concurrent-string.cc index 3ff3f72f82..e6d9be60f5 100644 --- a/test/cctest/test-concurrent-string.cc +++ b/test/cctest/test-concurrent-string.cc @@ -100,7 +100,6 @@ class ConcurrentStringThread final : public v8::base::Thread { // Inspect a one byte string, while the main thread externalizes it. TEST(InspectOneByteExternalizing) { - heap::EnsureFlagLocalHeapsEnabled(); CcTest::InitializeVM(); Isolate* isolate = CcTest::i_isolate(); @@ -146,7 +145,6 @@ TEST(InspectOneByteExternalizing) { // Inspect a one byte string, while the main thread externalizes it into a two // bytes string. TEST(InspectOneIntoTwoByteExternalizing) { - heap::EnsureFlagLocalHeapsEnabled(); CcTest::InitializeVM(); Isolate* isolate = CcTest::i_isolate(); @@ -189,7 +187,6 @@ TEST(InspectOneIntoTwoByteExternalizing) { // Inspect a two byte string, while the main thread externalizes it. TEST(InspectTwoByteExternalizing) { - heap::EnsureFlagLocalHeapsEnabled(); CcTest::InitializeVM(); Isolate* isolate = CcTest::i_isolate(); diff --git a/test/cctest/test-local-handles.cc b/test/cctest/test-local-handles.cc index 90bee202c9..ca8d01bdb6 100644 --- a/test/cctest/test-local-handles.cc +++ b/test/cctest/test-local-handles.cc @@ -72,7 +72,6 @@ class LocalHandlesThread final : public v8::base::Thread { }; TEST(CreateLocalHandles) { - heap::EnsureFlagLocalHeapsEnabled(); CcTest::InitializeVM(); Isolate* isolate = CcTest::i_isolate(); @@ -100,7 +99,6 @@ TEST(CreateLocalHandles) { } TEST(CreateLocalHandlesWithoutLocalHandleScope) { - heap::EnsureFlagLocalHeapsEnabled(); CcTest::InitializeVM(); Isolate* isolate = CcTest::i_isolate(); HandleScope handle_scope(isolate); @@ -109,7 +107,6 @@ TEST(CreateLocalHandlesWithoutLocalHandleScope) { } TEST(DereferenceLocalHandle) { - heap::EnsureFlagLocalHeapsEnabled(); CcTest::InitializeVM(); Isolate* isolate = CcTest::i_isolate(); @@ -133,7 +130,6 @@ TEST(DereferenceLocalHandle) { } TEST(DereferenceLocalHandleFailsWhenDisallowed) { - heap::EnsureFlagLocalHeapsEnabled(); CcTest::InitializeVM(); Isolate* isolate = CcTest::i_isolate(); diff --git a/test/cctest/test-persistent-handles.cc b/test/cctest/test-persistent-handles.cc index 5b18b1cb35..f5ebf7944a 100644 --- a/test/cctest/test-persistent-handles.cc +++ b/test/cctest/test-persistent-handles.cc @@ -83,7 +83,6 @@ class PersistentHandlesThread final : public v8::base::Thread { }; TEST(CreatePersistentHandles) { - heap::EnsureFlagLocalHeapsEnabled(); CcTest::InitializeVM(); Isolate* isolate = CcTest::i_isolate(); @@ -119,7 +118,6 @@ TEST(CreatePersistentHandles) { } TEST(DereferencePersistentHandle) { - heap::EnsureFlagLocalHeapsEnabled(); CcTest::InitializeVM(); Isolate* isolate = CcTest::i_isolate(); @@ -139,7 +137,6 @@ TEST(DereferencePersistentHandle) { } TEST(DereferencePersistentHandleFailsWhenDisallowed) { - heap::EnsureFlagLocalHeapsEnabled(); CcTest::InitializeVM(); Isolate* isolate = CcTest::i_isolate(); diff --git a/test/unittests/heap/local-factory-unittest.cc b/test/unittests/heap/local-factory-unittest.cc index a41ce1a3e1..bd8e5db0a7 100644 --- a/test/unittests/heap/local-factory-unittest.cc +++ b/test/unittests/heap/local-factory-unittest.cc @@ -63,7 +63,6 @@ class LocalFactoryTest : public TestWithIsolateAndZone { REPLMode::kNo), &state_), local_isolate_(isolate()->main_thread_local_isolate()) { - FLAG_concurrent_allocation = true; } FunctionLiteral* ParseProgram(const char* source) { diff --git a/test/unittests/heap/safepoint-unittest.cc b/test/unittests/heap/safepoint-unittest.cc index 0846e0de6f..8cd21c1bed 100644 --- a/test/unittests/heap/safepoint-unittest.cc +++ b/test/unittests/heap/safepoint-unittest.cc @@ -15,16 +15,9 @@ namespace v8 { namespace internal { -void EnsureFlagLocalHeapsEnabled() { - // Avoid data race in concurrent thread by only setting the flag to true if - // not already enabled. - if (!FLAG_local_heaps) FLAG_local_heaps = true; -} - using SafepointTest = TestWithIsolate; TEST_F(SafepointTest, ReachSafepointWithoutLocalHeaps) { - EnsureFlagLocalHeapsEnabled(); Heap* heap = i_isolate()->heap(); bool run = false; { @@ -54,7 +47,6 @@ class ParkedThread final : public v8::base::Thread { }; TEST_F(SafepointTest, StopParkedThreads) { - EnsureFlagLocalHeapsEnabled(); Heap* heap = i_isolate()->heap(); int safepoints = 0; @@ -114,7 +106,6 @@ class RunningThread final : public v8::base::Thread { }; TEST_F(SafepointTest, StopRunningThreads) { - EnsureFlagLocalHeapsEnabled(); Heap* heap = i_isolate()->heap(); const int kThreads = 10; diff --git a/tools/testrunner/local/variants.py b/tools/testrunner/local/variants.py index 2e67704733..2069b0ac23 100644 --- a/tools/testrunner/local/variants.py +++ b/tools/testrunner/local/variants.py @@ -16,10 +16,6 @@ ALL_VARIANT_FLAGS = { "jitless": [["--jitless"]], "minor_mc": [["--minor-mc"]], "no_lfa": [["--no-lazy-feedback-allocation"]], - "no_local_heaps": [[ - "--no-local-heaps", - "--no-turbo-direct-heap-access", - "--no-finalize-streaming-on-background"]], # No optimization means disable all optimizations. OptimizeFunctionOnNextCall # would not force optimization too. It turns into a Nop. Please see # https://chromium-review.googlesource.com/c/452620/ for more discussion.