Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1265)

Unified Diff: test/cctest/heap/test-heap.cc

Issue 2552613004: [heap] Ensure finalization of incremental marking even if all allocations (Closed)
Patch Set: revert marking change Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/cctest/heap/heap-tester.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/heap/test-heap.cc
diff --git a/test/cctest/heap/test-heap.cc b/test/cctest/heap/test-heap.cc
index 7d1cf4cefb452299a548e7df4db1b60f068fd323..6dcca5979117cb20084409ac2bfd6107cee0f3c9 100644
--- a/test/cctest/heap/test-heap.cc
+++ b/test/cctest/heap/test-heap.cc
@@ -7048,5 +7048,37 @@ TEST(RememberedSetRemoveRange) {
});
}
+HEAP_TEST(Regress670675) {
+ if (!FLAG_incremental_marking) return;
+ CcTest::InitializeVM();
+ v8::HandleScope scope(CcTest::isolate());
+ Heap* heap = CcTest::heap();
+ Isolate* isolate = heap->isolate();
+ i::MarkCompactCollector* collector = heap->mark_compact_collector();
+ CcTest::CollectAllGarbage(i::Heap::kFinalizeIncrementalMarkingMask);
+
+ if (collector->sweeping_in_progress()) {
+ collector->EnsureSweepingCompleted();
+ }
+ i::IncrementalMarking* marking = CcTest::heap()->incremental_marking();
+ if (marking->IsStopped()) {
+ marking->Start(i::GarbageCollectionReason::kTesting);
+ }
+ size_t array_length = Page::kPageSize / kPointerSize + 100;
+ size_t n = heap->OldGenerationSpaceAvailable() / array_length;
+ for (size_t i = 0; i < n + 10; i++) {
+ {
+ HandleScope inner_scope(isolate);
+ isolate->factory()->NewFixedArray(static_cast<int>(array_length));
+ }
+ if (marking->IsStopped()) break;
+ double deadline = heap->MonotonicallyIncreasingTimeInMs() + 1;
+ marking->AdvanceIncrementalMarking(
+ deadline, IncrementalMarking::GC_VIA_STACK_GUARD,
+ IncrementalMarking::FORCE_COMPLETION, StepOrigin::kV8);
+ }
+ DCHECK(marking->IsStopped());
+}
+
} // namespace internal
} // namespace v8
« no previous file with comments | « test/cctest/heap/heap-tester.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698