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 12932 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
12943 NULL, | 12943 NULL, |
12944 0); | 12944 0); |
12945 | 12945 |
12946 // Allocate an array to hold the result. | 12946 // Allocate an array to hold the result. |
12947 Object* object; | 12947 Object* object; |
12948 { MaybeObject* maybe_object = heap->AllocateFixedArray(count); | 12948 { MaybeObject* maybe_object = heap->AllocateFixedArray(count); |
12949 if (!maybe_object->ToObject(&object)) return maybe_object; | 12949 if (!maybe_object->ToObject(&object)) return maybe_object; |
12950 } | 12950 } |
12951 FixedArray* instances = FixedArray::cast(object); | 12951 FixedArray* instances = FixedArray::cast(object); |
12952 | 12952 |
12953 ASSERT(HEAP->IsHeapIterable()); | 12953 ASSERT(isolate->heap()->IsHeapIterable()); |
12954 // Fill the referencing objects. | 12954 // Fill the referencing objects. |
12955 HeapIterator heap_iterator2(heap); | 12955 HeapIterator heap_iterator2(heap); |
12956 count = DebugConstructedBy(&heap_iterator2, | 12956 count = DebugConstructedBy(&heap_iterator2, |
12957 constructor, | 12957 constructor, |
12958 max_references, | 12958 max_references, |
12959 instances, | 12959 instances, |
12960 count); | 12960 count); |
12961 | 12961 |
12962 // Return result as JS array. | 12962 // Return result as JS array. |
12963 Object* result; | 12963 Object* result; |
(...skipping 1712 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
14676 // Handle last resort GC and make sure to allow future allocations | 14676 // Handle last resort GC and make sure to allow future allocations |
14677 // to grow the heap without causing GCs (if possible). | 14677 // to grow the heap without causing GCs (if possible). |
14678 isolate->counters()->gc_last_resort_from_js()->Increment(); | 14678 isolate->counters()->gc_last_resort_from_js()->Increment(); |
14679 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, | 14679 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, |
14680 "Runtime::PerformGC"); | 14680 "Runtime::PerformGC"); |
14681 } | 14681 } |
14682 } | 14682 } |
14683 | 14683 |
14684 | 14684 |
14685 } } // namespace v8::internal | 14685 } } // namespace v8::internal |
OLD | NEW |