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

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

Issue 2020743002: [heap] Add the free remainder of a black page to the free list. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rename test Created 4 years, 7 months 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 | « src/heap/spaces.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 8611d5f823a41b0f0c640995a2cbf1d1c0eb0f78..bea39fb5437518ce995465607021cea1941b30dd 100644
--- a/test/cctest/heap/test-heap.cc
+++ b/test/cctest/heap/test-heap.cc
@@ -6766,5 +6766,43 @@ TEST(Regress609761) {
CHECK_EQ(size_after, size_before + array->Size());
}
+TEST(Regress615489) {
+ FLAG_black_allocation = true;
+ CcTest::InitializeVM();
+ v8::HandleScope scope(CcTest::isolate());
+ Heap* heap = CcTest::heap();
+ Isolate* isolate = heap->isolate();
+ heap->CollectAllGarbage();
+
+ i::MarkCompactCollector* collector = heap->mark_compact_collector();
+ i::IncrementalMarking* marking = heap->incremental_marking();
+ if (collector->sweeping_in_progress()) {
+ collector->EnsureSweepingCompleted();
+ }
+ CHECK(marking->IsMarking() || marking->IsStopped());
+ if (marking->IsStopped()) {
+ heap->StartIncrementalMarking();
+ }
+ CHECK(marking->IsMarking());
+ marking->StartBlackAllocationForTesting();
+ {
+ AlwaysAllocateScope always_allocate(CcTest::i_isolate());
+ v8::HandleScope inner(CcTest::isolate());
+ isolate->factory()->NewFixedArray(500, TENURED)->Size();
+ }
+ while (!marking->IsComplete()) {
+ marking->Step(i::MB, i::IncrementalMarking::NO_GC_VIA_STACK_GUARD);
+ if (marking->IsReadyToOverApproximateWeakClosure()) {
+ marking->FinalizeIncrementally();
+ }
+ }
+ CHECK(marking->IsComplete());
+ intptr_t size_before = heap->SizeOfObjects();
+ CcTest::heap()->CollectAllGarbage();
+ intptr_t size_after = heap->SizeOfObjects();
+ // Live size does not increase after garbage collection.
+ CHECK_LE(size_after, size_before);
+}
+
} // namespace internal
} // namespace v8
« no previous file with comments | « src/heap/spaces.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698