blob: 0416bb62a42926963afbda42da3aa98506f288df [file] [log] [blame]
// Copyright 2019 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "src/heap/combined-heap.h"
#include "src/heap/heap-inl.h"
namespace v8 {
namespace internal {
CombinedHeapObjectIterator::CombinedHeapObjectIterator(
Heap* heap, HeapObjectIterator::HeapObjectsFiltering filtering)
: heap_iterator_(heap, filtering),
ro_heap_iterator_(heap->isolate()->read_only_heap()) {}
HeapObject CombinedHeapObjectIterator::Next() {
HeapObject object = ro_heap_iterator_.Next();
if (!object.is_null()) {
return object;
}
return heap_iterator_.Next();
}
} // namespace internal
} // namespace v8