diff options
Diffstat (limited to 'deps/v8/test/cctest/heap/test-concurrent-marking.cc')
-rw-r--r-- | deps/v8/test/cctest/heap/test-concurrent-marking.cc | 97 |
1 files changed, 2 insertions, 95 deletions
diff --git a/deps/v8/test/cctest/heap/test-concurrent-marking.cc b/deps/v8/test/cctest/heap/test-concurrent-marking.cc index e57fa68f37..280ecb11aa 100644 --- a/deps/v8/test/cctest/heap/test-concurrent-marking.cc +++ b/deps/v8/test/cctest/heap/test-concurrent-marking.cc @@ -5,102 +5,11 @@ #include <stdlib.h> #include "src/heap/concurrent-marking.h" -#include "src/heap/heap-inl.h" #include "src/heap/heap.h" -#include "src/heap/mark-compact.h" -#include "src/heap/marking-worklist-inl.h" -#include "src/heap/marking-worklist.h" -#include "src/init/v8.h" #include "test/cctest/cctest.h" #include "test/cctest/heap/heap-utils.h" -namespace v8 { -namespace internal { -namespace heap { - -void PublishSegment(MarkingWorklist& worklist, HeapObject object) { - MarkingWorklist::Local local(worklist); - for (size_t i = 0; i < MarkingWorklist::kMinSegmentSizeForTesting; i++) { - local.Push(object); - } - local.Publish(); -} - -TEST(ConcurrentMarking) { - if (!i::v8_flags.concurrent_marking) return; - CcTest::InitializeVM(); - Heap* heap = CcTest::heap(); - CcTest::CollectAllGarbage(); - if (!heap->incremental_marking()->IsStopped()) return; - if (heap->sweeping_in_progress()) { - heap->EnsureSweepingCompleted( - Heap::SweepingForcedFinalizationMode::kV8Only); - } - - WeakObjects weak_objects; - ConcurrentMarking* concurrent_marking = - new ConcurrentMarking(heap, &weak_objects); - MarkCompactCollector* collector = CcTest::heap()->mark_compact_collector(); - PublishSegment(*collector->marking_worklists()->shared(), - ReadOnlyRoots(heap).undefined_value()); - concurrent_marking->ScheduleJob(GarbageCollector::MARK_COMPACTOR); - concurrent_marking->Join(); - delete concurrent_marking; -} - -TEST(ConcurrentMarkingReschedule) { - if (!i::v8_flags.concurrent_marking) return; - CcTest::InitializeVM(); - Heap* heap = CcTest::heap(); - CcTest::CollectAllGarbage(); - if (!heap->incremental_marking()->IsStopped()) return; - if (heap->sweeping_in_progress()) { - heap->EnsureSweepingCompleted( - Heap::SweepingForcedFinalizationMode::kV8Only); - } - - WeakObjects weak_objects; - ConcurrentMarking* concurrent_marking = - new ConcurrentMarking(heap, &weak_objects); - MarkCompactCollector* collector = CcTest::heap()->mark_compact_collector(); - PublishSegment(*collector->marking_worklists()->shared(), - ReadOnlyRoots(heap).undefined_value()); - concurrent_marking->ScheduleJob(GarbageCollector::MARK_COMPACTOR); - concurrent_marking->Join(); - PublishSegment(*collector->marking_worklists()->shared(), - ReadOnlyRoots(heap).undefined_value()); - concurrent_marking->RescheduleJobIfNeeded(GarbageCollector::MARK_COMPACTOR); - concurrent_marking->Join(); - delete concurrent_marking; -} - -TEST(ConcurrentMarkingPreemptAndReschedule) { - if (!i::v8_flags.concurrent_marking) return; - CcTest::InitializeVM(); - Heap* heap = CcTest::heap(); - CcTest::CollectAllGarbage(); - if (!heap->incremental_marking()->IsStopped()) return; - if (heap->sweeping_in_progress()) { - heap->EnsureSweepingCompleted( - Heap::SweepingForcedFinalizationMode::kV8Only); - } - - WeakObjects weak_objects; - ConcurrentMarking* concurrent_marking = - new ConcurrentMarking(heap, &weak_objects); - MarkCompactCollector* collector = CcTest::heap()->mark_compact_collector(); - for (int i = 0; i < 5000; i++) - PublishSegment(*collector->marking_worklists()->shared(), - ReadOnlyRoots(heap).undefined_value()); - concurrent_marking->ScheduleJob(GarbageCollector::MARK_COMPACTOR); - concurrent_marking->Pause(); - for (int i = 0; i < 5000; i++) - PublishSegment(*collector->marking_worklists()->shared(), - ReadOnlyRoots(heap).undefined_value()); - concurrent_marking->RescheduleJobIfNeeded(GarbageCollector::MARK_COMPACTOR); - concurrent_marking->Join(); - delete concurrent_marking; -} +namespace v8::internal::heap { TEST(ConcurrentMarkingMarkedBytes) { if (!v8_flags.incremental_marking) return; @@ -150,6 +59,4 @@ UNINITIALIZED_TEST(ConcurrentMarkingStoppedOnTeardown) { isolate->Dispose(); } -} // namespace heap -} // namespace internal -} // namespace v8 +} // namespace v8::internal::heap |