diff options
Diffstat (limited to 'deps/v8/test/cctest/heap/test-concurrent-allocation.cc')
-rw-r--r-- | deps/v8/test/cctest/heap/test-concurrent-allocation.cc | 41 |
1 files changed, 28 insertions, 13 deletions
diff --git a/deps/v8/test/cctest/heap/test-concurrent-allocation.cc b/deps/v8/test/cctest/heap/test-concurrent-allocation.cc index 5c4ba35974..846d2bf6dc 100644 --- a/deps/v8/test/cctest/heap/test-concurrent-allocation.cc +++ b/deps/v8/test/cctest/heap/test-concurrent-allocation.cc @@ -132,7 +132,14 @@ UNINITIALIZED_TEST(ConcurrentAllocationInOldSpaceFromMainThread) { } UNINITIALIZED_TEST(ConcurrentAllocationWhileMainThreadIsParked) { +#ifndef V8_ENABLE_CONSERVATIVE_STACK_SCANNING v8_flags.max_old_space_size = 4; +#else + // With CSS, it is expected that the GCs triggered by concurrent allocation + // will reclaim less memory. If this test fails, this limit should probably + // be further increased. + v8_flags.max_old_space_size = 10; +#endif v8_flags.stress_concurrent_allocation = false; v8::Isolate::CreateParams create_params; @@ -144,8 +151,6 @@ UNINITIALIZED_TEST(ConcurrentAllocationWhileMainThreadIsParked) { const int kThreads = 4; { - ScanStackModeScopeForTesting no_stack_scanning(i_isolate->heap(), - Heap::ScanStackMode::kNone); ParkedScope scope(i_isolate->main_thread_local_isolate()); for (int i = 0; i < kThreads; i++) { @@ -164,9 +169,17 @@ UNINITIALIZED_TEST(ConcurrentAllocationWhileMainThreadIsParked) { } UNINITIALIZED_TEST(ConcurrentAllocationWhileMainThreadParksAndUnparks) { +#ifndef V8_ENABLE_CONSERVATIVE_STACK_SCANNING v8_flags.max_old_space_size = 4; +#else + // With CSS, it is expected that the GCs triggered by concurrent allocation + // will reclaim less memory. If this test fails, this limit should probably + // be further increased. + v8_flags.max_old_space_size = 10; +#endif v8_flags.stress_concurrent_allocation = false; v8_flags.incremental_marking = false; + i::FlagList::EnforceFlagImplications(); v8::Isolate::CreateParams create_params; create_params.array_buffer_allocator = CcTest::array_buffer_allocator(); @@ -177,9 +190,6 @@ UNINITIALIZED_TEST(ConcurrentAllocationWhileMainThreadParksAndUnparks) { const int kThreads = 4; { - ScanStackModeScopeForTesting no_stack_scanning(i_isolate->heap(), - Heap::ScanStackMode::kNone); - for (int i = 0; i < kThreads; i++) { auto thread = std::make_unique<ConcurrentAllocationThread>(i_isolate->heap()); @@ -204,9 +214,17 @@ UNINITIALIZED_TEST(ConcurrentAllocationWhileMainThreadParksAndUnparks) { } UNINITIALIZED_TEST(ConcurrentAllocationWhileMainThreadRunsWithSafepoints) { +#ifndef V8_ENABLE_CONSERVATIVE_STACK_SCANNING v8_flags.max_old_space_size = 4; +#else + // With CSS, it is expected that the GCs triggered by concurrent allocation + // will reclaim less memory. If this test fails, this limit should probably + // be further increased. + v8_flags.max_old_space_size = 10; +#endif v8_flags.stress_concurrent_allocation = false; v8_flags.incremental_marking = false; + i::FlagList::EnforceFlagImplications(); v8::Isolate::CreateParams create_params; create_params.array_buffer_allocator = CcTest::array_buffer_allocator(); @@ -217,9 +235,6 @@ UNINITIALIZED_TEST(ConcurrentAllocationWhileMainThreadRunsWithSafepoints) { const int kThreads = 4; { - ScanStackModeScopeForTesting no_stack_scanning(i_isolate->heap(), - Heap::ScanStackMode::kNone); - for (int i = 0; i < kThreads; i++) { auto thread = std::make_unique<ConcurrentAllocationThread>(i_isolate->heap()); @@ -385,9 +400,9 @@ UNINITIALIZED_TEST(ConcurrentBlackAllocation) { HeapObject object = HeapObject::FromAddress(address); if (i < kWhiteIterations * kObjectsAllocatedPerIteration) { - CHECK(heap->marking_state()->IsWhite(object)); + CHECK(heap->marking_state()->IsUnmarked(object)); } else { - CHECK(heap->marking_state()->IsBlack(object)); + CHECK(heap->marking_state()->IsMarked(object)); } } @@ -441,7 +456,7 @@ UNINITIALIZED_TEST(ConcurrentWriteBarrier) { } heap->StartIncrementalMarking(i::Heap::kNoGCFlags, i::GarbageCollectionReason::kTesting); - CHECK(heap->marking_state()->IsWhite(value)); + CHECK(heap->marking_state()->IsUnmarked(value)); auto thread = std::make_unique<ConcurrentWriteBarrierThread>(heap, fixed_array, value); @@ -468,7 +483,7 @@ class ConcurrentRecordRelocSlotThread final : public v8::base::Thread { RwxMemoryWriteScope::SetDefaultPermissionsForNewThread(); LocalHeap local_heap(heap_, ThreadKind::kBackground); UnparkedScope unparked_scope(&local_heap); - // Modification of Code object requires write access. + // Modification of InstructionStream object requires write access. RwxMemoryWriteScopeForTesting rwx_write_scope; int mode_mask = RelocInfo::EmbeddedObjectModeMask(); for (RelocIterator it(code_, mode_mask); !it.done(); it.next()) { @@ -527,7 +542,7 @@ UNINITIALIZED_TEST(ConcurrentRecordRelocSlot) { } heap->StartIncrementalMarking(i::Heap::kNoGCFlags, i::GarbageCollectionReason::kTesting); - CHECK(heap->marking_state()->IsWhite(value)); + CHECK(heap->marking_state()->IsUnmarked(value)); { // TODO(v8:13023): remove ResetPKUPermissionsForThreadSpawning in the |