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

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

Issue 1311993003: Reland "Make sure that memory reducer makes progress in incremental marking"" (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Address comments Created 5 years, 3 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/memory-reducer.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-heap.cc
diff --git a/test/cctest/test-heap.cc b/test/cctest/test-heap.cc
index 2c85596090bd6e4f858336be88b464ed766ef64b..66e4f2a114236589cc393d8d68f436f962fc54c6 100644
--- a/test/cctest/test-heap.cc
+++ b/test/cctest/test-heap.cc
@@ -6663,5 +6663,40 @@ TEST(SharedFunctionInfoIterator) {
CHECK_EQ(0, sfi_count);
}
+
+template <typename T>
+static UniqueId MakeUniqueId(const Persistent<T>& p) {
+ return UniqueId(reinterpret_cast<uintptr_t>(*v8::Utils::OpenPersistent(p)));
+}
+
+
+TEST(Regress519319) {
+ CcTest::InitializeVM();
+ v8::Isolate* isolate = CcTest::isolate();
+ v8::HandleScope scope(isolate);
+ Heap* heap = CcTest::heap();
+ LocalContext context;
+
+ v8::Persistent<Value> parent;
+ v8::Persistent<Value> child;
+
+ parent.Reset(isolate, v8::Object::New(isolate));
+ child.Reset(isolate, v8::Object::New(isolate));
+
+ SimulateFullSpace(heap->old_space());
+ heap->CollectGarbage(OLD_SPACE);
+ {
+ UniqueId id = MakeUniqueId(parent);
+ isolate->SetObjectGroupId(parent, id);
+ isolate->SetReferenceFromGroup(id, child);
+ }
+ // The CollectGarbage call above starts sweeper threads.
+ // The crash will happen if the following two functions
+ // are called before sweeping finishes.
+ heap->StartIncrementalMarking();
+ heap->FinalizeIncrementalMarkingIfComplete("test");
+}
+
+
} // namespace internal
} // namespace v8
« no previous file with comments | « src/heap/memory-reducer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698