summaryrefslogtreecommitdiff
path: root/deps/v8/src/heap/combined-heap.cc
blob: 0416bb62a42926963afbda42da3aa98506f288df (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// 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