1 // Copyright 2019 the V8 project authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #include "src/heap/combined-heap.h" 6 #include "src/heap/heap-inl.h" 7 8 namespace v8 { 9 namespace internal { 10 CombinedHeapObjectIterator(Heap * heap,HeapObjectIterator::HeapObjectsFiltering filtering)11CombinedHeapObjectIterator::CombinedHeapObjectIterator( 12 Heap* heap, HeapObjectIterator::HeapObjectsFiltering filtering) 13 : safepoint_scope_(heap), 14 heap_iterator_(heap, filtering), 15 ro_heap_iterator_(heap->isolate()->read_only_heap()) {} 16 Next()17HeapObject CombinedHeapObjectIterator::Next() { 18 HeapObject object = ro_heap_iterator_.Next(); 19 if (!object.is_null()) { 20 return object; 21 } 22 return heap_iterator_.Next(); 23 } 24 25 } // namespace internal 26 } // namespace v8 27