v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
combined-heap.h
Go to the documentation of this file.
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#ifndef V8_HEAP_COMBINED_HEAP_H_
6#define V8_HEAP_COMBINED_HEAP_H_
7
8#include "src/heap/heap.h"
10#include "src/heap/safepoint.h"
11#include "src/objects/objects.h"
12
13namespace v8 {
14namespace internal {
15
16// This class allows iteration over the entire heap (Heap and ReadOnlyHeap). It
17// uses the HeapObjectIterator to iterate over non-read-only objects and accepts
18// the same filtering option.
20 public:
23 HeapObjectIterator::HeapObjectsFiltering::kNoFiltering);
24 Tagged<HeapObject> Next();
25
26 private:
29};
30
32 Tagged<HeapObject> object) {
33 return ReadOnlyHeap::Contains(object) || heap->Contains(object) ||
34 heap->SharedHeapContains(object);
35}
36
38 Tagged<HeapObject> object) {
40 return heap->ContainsCode(object);
41 } else {
42 return ReadOnlyHeap::Contains(object) || heap->ContainsCode(object);
43 }
44}
45
46} // namespace internal
47} // namespace v8
48
49#endif // V8_HEAP_COMBINED_HEAP_H_
ReadOnlyHeapObjectIterator ro_heap_iterator_
static V8_EXPORT_PRIVATE bool Contains(Address address)
#define V8_EXTERNAL_CODE_SPACE_BOOL
Definition globals.h:255
V8_WARN_UNUSED_RESULT bool IsValidCodeObject(Heap *heap, Tagged< HeapObject > object)
V8_WARN_UNUSED_RESULT bool IsValidHeapObject(Heap *heap, Tagged< HeapObject > object)
#define V8_EXPORT_PRIVATE
Definition macros.h:460
#define V8_WARN_UNUSED_RESULT
Definition v8config.h:671