OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 6645 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6656 } | 6656 } |
6657 | 6657 |
6658 { | 6658 { |
6659 SharedFunctionInfo::Iterator iterator(isolate); | 6659 SharedFunctionInfo::Iterator iterator(isolate); |
6660 while (iterator.Next()) sfi_count--; | 6660 while (iterator.Next()) sfi_count--; |
6661 } | 6661 } |
6662 | 6662 |
6663 CHECK_EQ(0, sfi_count); | 6663 CHECK_EQ(0, sfi_count); |
6664 } | 6664 } |
6665 | 6665 |
| 6666 |
| 6667 template <typename T> |
| 6668 static UniqueId MakeUniqueId(const Persistent<T>& p) { |
| 6669 return UniqueId(reinterpret_cast<uintptr_t>(*v8::Utils::OpenPersistent(p))); |
| 6670 } |
| 6671 |
| 6672 |
| 6673 TEST(Regress519319) { |
| 6674 CcTest::InitializeVM(); |
| 6675 v8::Isolate* isolate = CcTest::isolate(); |
| 6676 v8::HandleScope scope(isolate); |
| 6677 Heap* heap = CcTest::heap(); |
| 6678 LocalContext context; |
| 6679 |
| 6680 v8::Persistent<Value> parent; |
| 6681 v8::Persistent<Value> child; |
| 6682 |
| 6683 parent.Reset(isolate, v8::Object::New(isolate)); |
| 6684 child.Reset(isolate, v8::Object::New(isolate)); |
| 6685 |
| 6686 SimulateFullSpace(heap->old_space()); |
| 6687 heap->CollectGarbage(OLD_SPACE); |
| 6688 { |
| 6689 UniqueId id = MakeUniqueId(parent); |
| 6690 isolate->SetObjectGroupId(parent, id); |
| 6691 isolate->SetReferenceFromGroup(id, child); |
| 6692 } |
| 6693 // The CollectGarbage call above starts sweeper threads. |
| 6694 // The crash will happen if the following two functions |
| 6695 // are called before sweeping finishes. |
| 6696 heap->StartIncrementalMarking(); |
| 6697 heap->FinalizeIncrementalMarkingIfComplete("test"); |
| 6698 } |
| 6699 |
| 6700 |
6666 } // namespace internal | 6701 } // namespace internal |
6667 } // namespace v8 | 6702 } // namespace v8 |
OLD | NEW |