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

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

Issue 2634033003: [heap] Fix live object iterator to skip grey filler objects. (Closed)
Patch Set: include Created 3 years, 11 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/mark-compact-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-mark-compact.cc
diff --git a/test/cctest/heap/test-mark-compact.cc b/test/cctest/heap/test-mark-compact.cc
index 0788e26108238052e35b224ff0633675b8e90681..ee37d070aca31dddf76e941e29b43fac197620e6 100644
--- a/test/cctest/heap/test-mark-compact.cc
+++ b/test/cctest/heap/test-mark-compact.cc
@@ -41,6 +41,8 @@
#include "src/full-codegen/full-codegen.h"
#include "src/global-handles.h"
+#include "src/heap/mark-compact-inl.h"
+#include "src/heap/mark-compact.h"
#include "test/cctest/cctest.h"
#include "test/cctest/heap/heap-tester.h"
#include "test/cctest/heap/heap-utils.h"
@@ -483,4 +485,36 @@ TEST(RegressJoinThreadsOnIsolateDeinit) {
}
}
+TEST(Regress5829) {
+ CcTest::InitializeVM();
+ Isolate* isolate = CcTest::i_isolate();
+ v8::HandleScope sc(CcTest::isolate());
+ Heap* heap = isolate->heap();
+ heap::SealCurrentObjects(heap);
+ 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(i::Heap::kNoGCFlags,
+ i::GarbageCollectionReason::kTesting);
+ }
+ CHECK(marking->IsMarking());
+ marking->StartBlackAllocationForTesting();
+ Handle<FixedArray> array = isolate->factory()->NewFixedArray(10, TENURED);
+ Address old_end = array->address() + array->Size();
+ // Right trim the array without clearing the mark bits.
+ array->set_length(9);
+ heap->CreateFillerObjectAt(old_end - kPointerSize, kPointerSize,
+ ClearRecordedSlots::kNo);
+ heap->old_space()->EmptyAllocationInfo();
+ LiveObjectIterator<kGreyObjects> it(Page::FromAddress(array->address()));
+ HeapObject* object = nullptr;
+ while ((object = it.Next()) != nullptr) {
+ CHECK(!object->IsFiller());
+ }
+}
+
#endif // __linux__ and !USE_SIMULATOR
« no previous file with comments | « src/heap/mark-compact-inl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698