| Index: src/runtime.cc
|
| diff --git a/src/runtime.cc b/src/runtime.cc
|
| index a63fd65d4bc6b2298a08bcdad7a62e160867ede8..30735f1f97902f0df742a35a176b1a875592071f 100644
|
| --- a/src/runtime.cc
|
| +++ b/src/runtime.cc
|
| @@ -13126,14 +13126,6 @@ RUNTIME_FUNCTION(Runtime_DebugReferencedBy) {
|
| HandleScope scope(isolate);
|
| ASSERT(args.length() == 3);
|
|
|
| - // First perform a full GC in order to avoid references from dead objects.
|
| - Heap* heap = isolate->heap();
|
| - heap->CollectAllGarbage(Heap::kMakeHeapIterableMask, "%DebugReferencedBy");
|
| - // The heap iterator reserves the right to do a GC to make the heap iterable.
|
| - // Due to the GC above we know it won't need to do that, but it seems cleaner
|
| - // to get the heap iterator constructed before we start having unprotected
|
| - // Object* locals that are not protected by handles.
|
| -
|
| // Check parameters.
|
| CONVERT_ARG_HANDLE_CHECKED(JSObject, target, 0);
|
| CONVERT_ARG_HANDLE_CHECKED(Object, instance_filter, 1);
|
| @@ -13151,6 +13143,10 @@ RUNTIME_FUNCTION(Runtime_DebugReferencedBy) {
|
|
|
| // Get the number of referencing objects.
|
| int count;
|
| + // First perform a full GC in order to avoid dead objects and to make the heap
|
| + // iterable.
|
| + Heap* heap = isolate->heap();
|
| + heap->CollectAllGarbage(Heap::kMakeHeapIterableMask, "%DebugConstructedBy");
|
| HeapIterator heap_iterator(heap);
|
| count = DebugReferencedBy(&heap_iterator,
|
| *target, *instance_filter, max_references,
|
| @@ -13160,8 +13156,7 @@ RUNTIME_FUNCTION(Runtime_DebugReferencedBy) {
|
| Handle<FixedArray> instances = isolate->factory()->NewFixedArray(count);
|
|
|
| // Fill the referencing objects.
|
| - // AllocateFixedArray above does not make the heap non-iterable.
|
| - ASSERT(heap->IsHeapIterable());
|
| + heap->MakeHeapIterable();
|
| HeapIterator heap_iterator2(heap);
|
| count = DebugReferencedBy(&heap_iterator2,
|
| *target, *instance_filter, max_references,
|
| @@ -13216,9 +13211,6 @@ RUNTIME_FUNCTION(Runtime_DebugConstructedBy) {
|
| HandleScope scope(isolate);
|
| ASSERT(args.length() == 2);
|
|
|
| - // First perform a full GC in order to avoid dead objects.
|
| - Heap* heap = isolate->heap();
|
| - heap->CollectAllGarbage(Heap::kMakeHeapIterableMask, "%DebugConstructedBy");
|
|
|
| // Check parameters.
|
| CONVERT_ARG_HANDLE_CHECKED(JSFunction, constructor, 0);
|
| @@ -13227,6 +13219,10 @@ RUNTIME_FUNCTION(Runtime_DebugConstructedBy) {
|
|
|
| // Get the number of referencing objects.
|
| int count;
|
| + // First perform a full GC in order to avoid dead objects and to make the heap
|
| + // iterable.
|
| + Heap* heap = isolate->heap();
|
| + heap->CollectAllGarbage(Heap::kMakeHeapIterableMask, "%DebugConstructedBy");
|
| HeapIterator heap_iterator(heap);
|
| count = DebugConstructedBy(&heap_iterator,
|
| *constructor,
|
| @@ -13237,8 +13233,8 @@ RUNTIME_FUNCTION(Runtime_DebugConstructedBy) {
|
| // Allocate an array to hold the result.
|
| Handle<FixedArray> instances = isolate->factory()->NewFixedArray(count);
|
|
|
| - ASSERT(heap->IsHeapIterable());
|
| // Fill the referencing objects.
|
| + heap->MakeHeapIterable();
|
| HeapIterator heap_iterator2(heap);
|
| count = DebugConstructedBy(&heap_iterator2,
|
| *constructor,
|
| @@ -13376,7 +13372,7 @@ RUNTIME_FUNCTION(Runtime_LiveEditFindSharedFunctionInfosForScript) {
|
| int number;
|
| Heap* heap = isolate->heap();
|
| {
|
| - heap->EnsureHeapIsIterable();
|
| + heap->MakeHeapIterable();
|
| DisallowHeapAllocation no_allocation;
|
| HeapIterator heap_iterator(heap);
|
| Script* scr = *script;
|
| @@ -13385,7 +13381,7 @@ RUNTIME_FUNCTION(Runtime_LiveEditFindSharedFunctionInfosForScript) {
|
| }
|
| if (number > kBufferSize) {
|
| array = isolate->factory()->NewFixedArray(number);
|
| - heap->EnsureHeapIsIterable();
|
| + heap->MakeHeapIterable();
|
| DisallowHeapAllocation no_allocation;
|
| HeapIterator heap_iterator(heap);
|
| Script* scr = *script;
|
| @@ -14469,7 +14465,7 @@ static Handle<Object> Runtime_GetScriptFromScriptName(
|
| Handle<Script> script;
|
| Factory* factory = script_name->GetIsolate()->factory();
|
| Heap* heap = script_name->GetHeap();
|
| - heap->EnsureHeapIsIterable();
|
| + heap->MakeHeapIterable();
|
| DisallowHeapAllocation no_allocation_during_heap_iteration;
|
| HeapIterator iterator(heap);
|
| HeapObject* obj = NULL;
|
|
|