v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
reference-summarizer.h
Go to the documentation of this file.
1// Copyright 2022 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_REFERENCE_SUMMARIZER_H_
6#define V8_HEAP_REFERENCE_SUMMARIZER_H_
7
8#include <unordered_set>
9
11
12namespace v8 {
13namespace internal {
14
15class Heap;
16
18 public:
19 ReferenceSummary() = default;
21 : strong_references_(std::move(other.strong_references_)),
22 weak_references_(std::move(other.weak_references_)) {}
23
24 // Produces a set of objects referred to by the object. This function uses a
25 // realistic marking visitor, so its results are likely to match real GC
26 // behavior. Intended only for verification.
29
31 std::unordered_set<Tagged<HeapObject>, Object::Hasher,
33
34 // All objects which the chosen object has strong pointers to.
36
37 // All objects which the chosen object has weak pointers to. The values in
38 // ephemeron hash tables are also included here, even though they aren't
39 // normal weak pointers.
41
42 void Clear() {
43 strong_references_.clear();
44 weak_references_.clear();
45 }
46
47 private:
51};
52
53} // namespace internal
54} // namespace v8
55
56#endif // V8_HEAP_REFERENCE_SUMMARIZER_H_
#define DISALLOW_GARBAGE_COLLECTION(name)
std::unordered_set< Tagged< HeapObject >, Object::Hasher, Object::KeyEqualSafe > UnorderedHeapObjectSet
ReferenceSummary(ReferenceSummary &&other) V8_NOEXCEPT
UnorderedHeapObjectSet & weak_references()
UnorderedHeapObjectSet weak_references_
UnorderedHeapObjectSet strong_references_
UnorderedHeapObjectSet & strong_references()
static ReferenceSummary SummarizeReferencesFrom(Heap *heap, Tagged< HeapObject > obj)
#define V8_NOEXCEPT