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

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

Issue 2005173003: Immediatelly promote marked objects (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Really should concentrate more 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/scavenger-inl.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 426eb63a74da0c8383323f0f0534b5361b432522..e0252781cffae1cdd215c88c59e325e64f02fd9d 100644
--- a/test/cctest/heap/test-heap.cc
+++ b/test/cctest/heap/test-heap.cc
@@ -711,6 +711,44 @@ TEST(DeleteWeakGlobalHandle) {
CHECK(WeakPointerCleared);
}
+TEST(DoNotPromoteWhiteObjectsOnScavenge) {
+ CcTest::InitializeVM();
+ Isolate* isolate = CcTest::i_isolate();
+ Heap* heap = isolate->heap();
+ Factory* factory = isolate->factory();
+
+ HandleScope scope(isolate);
+ Handle<Object> white = factory->NewStringFromStaticChars("white");
+
+ CHECK(Marking::IsWhite(Marking::MarkBitFrom(HeapObject::cast(*white))));
+
+ heap->CollectGarbage(NEW_SPACE);
+
+ CHECK(heap->InNewSpace(*white));
+}
+
+TEST(PromoteGreyOrBlackObjectsOnScavenge) {
+ CcTest::InitializeVM();
+ Isolate* isolate = CcTest::i_isolate();
+ Heap* heap = isolate->heap();
+ Factory* factory = isolate->factory();
+
+ HandleScope scope(isolate);
+ Handle<Object> marked = factory->NewStringFromStaticChars("marked");
+
+ IncrementalMarking* marking = heap->incremental_marking();
+ marking->Stop();
+ heap->StartIncrementalMarking();
+ while (Marking::IsWhite(Marking::MarkBitFrom(HeapObject::cast(*marked)))) {
+ marking->Step(MB, IncrementalMarking::NO_GC_VIA_STACK_GUARD,
+ IncrementalMarking::FORCE_MARKING,
+ IncrementalMarking::DO_NOT_FORCE_COMPLETION);
+ }
+
+ heap->CollectGarbage(NEW_SPACE);
+
+ CHECK(!heap->InNewSpace(*marked));
+}
TEST(BytecodeArray) {
static const uint8_t kRawBytes[] = {0xc3, 0x7e, 0xa5, 0x5a};
« no previous file with comments | « src/heap/scavenger-inl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698