v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
evacuation-verifier.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_EVACUATION_VERIFIER_H_
6#define V8_HEAP_EVACUATION_VERIFIER_H_
7
10#include "src/objects/map.h"
12
13namespace v8 {
14namespace internal {
15
16#ifdef VERIFY_HEAP
17
18class EvacuationVerifier final : public ObjectVisitorWithCageBases,
19 public RootVisitor {
20 public:
21 explicit EvacuationVerifier(Heap* heap);
22
23 void Run();
24
25 void VisitPointers(Tagged<HeapObject> host, ObjectSlot start,
26 ObjectSlot end) final;
27 void VisitPointers(Tagged<HeapObject> host, MaybeObjectSlot start,
28 MaybeObjectSlot end) final;
29 void VisitInstructionStreamPointer(Tagged<Code> host,
30 InstructionStreamSlot slot) final;
31 void VisitRootPointers(Root root, const char* description,
32 FullObjectSlot start, FullObjectSlot end) final;
33 void VisitMapPointer(Tagged<HeapObject> object) final;
34 void VisitCodeTarget(Tagged<InstructionStream> host, RelocInfo* rinfo) final;
35 void VisitEmbeddedPointer(Tagged<InstructionStream> host,
36 RelocInfo* rinfo) final;
37
38 private:
39 V8_INLINE void VerifyHeapObjectImpl(Tagged<HeapObject> heap_object);
40 V8_INLINE bool ShouldVerifyObject(Tagged<HeapObject> heap_object);
41
42 template <typename TSlot>
43 void VerifyPointersImpl(TSlot start, TSlot end);
44
45 void VerifyRoots();
46 void VerifyEvacuationOnPage(Address start, Address end);
47 void VerifyEvacuation(NewSpace* new_space);
48 void VerifyEvacuation(PagedSpaceBase* paged_space);
49
50 Heap* heap_;
51};
52
53#endif // VERIFY_HEAP
54
55} // namespace internal
56} // namespace v8
57
58#endif // V8_HEAP_EVACUATION_VERIFIER_H_
int start
int end
Heap * heap_
#define V8_INLINE
Definition v8config.h:500