Chromium Code Reviews| Index: test/cctest/test-heap.cc |
| diff --git a/test/cctest/test-heap.cc b/test/cctest/test-heap.cc |
| index 2c85596090bd6e4f858336be88b464ed766ef64b..4022beac3200120f9e41b54ccf82593fcec174e9 100644 |
| --- a/test/cctest/test-heap.cc |
| +++ b/test/cctest/test-heap.cc |
| @@ -6663,5 +6663,37 @@ 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); |
| + } |
|
Michael Lippautz
2015/09/03 15:01:49
nit: Please add a comment stating that we are conc
ulan_google
2015/09/03 15:07:01
Done.
|
| + heap->StartIncrementalMarking(); |
| + heap->FinalizeIncrementalMarkingIfComplete("test"); |
| +} |
| + |
| + |
| } // namespace internal |
| } // namespace v8 |