v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
remembered-set-inl.h
Go to the documentation of this file.
1// Copyright 2016 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_REMEMBERED_SET_INL_H_
6#define V8_HEAP_REMEMBERED_SET_INL_H_
7
9// Include the non-inl header before the rest of the headers.
10
14
15namespace v8 {
16namespace internal {
17
18template <typename Callback>
20 WritableJitAllocation& jit_allocation, Heap* heap, SlotType slot_type,
21 Address addr, Callback callback) {
22 switch (slot_type) {
24 WritableRelocInfo rinfo(jit_allocation, addr, RelocInfo::CODE_TARGET);
25 return UpdateCodeTarget(&rinfo, callback);
26 }
28 return UpdateCodeEntry(addr, callback);
29 }
31 WritableRelocInfo rinfo(jit_allocation, addr,
33 return UpdateEmbeddedPointer(heap, &rinfo, callback);
34 }
36 WritableRelocInfo rinfo(jit_allocation, addr,
38 return UpdateEmbeddedPointer(heap, &rinfo, callback);
39 }
43 heap->isolate(), base::Memory<Tagged_t>(addr))));
44 Tagged<HeapObject> new_target = old_target;
45 SlotCallbackResult result = callback(FullMaybeObjectSlot(&new_target));
47 if (new_target != old_target) {
48 jit_allocation.WriteValue<Tagged_t>(
50 }
51 return result;
52 }
54 Tagged<HeapObject> old_target =
56 Tagged<HeapObject> new_target = old_target;
57 SlotCallbackResult result = callback(FullMaybeObjectSlot(&new_target));
58 if (new_target != old_target) {
59 jit_allocation.WriteValue(addr, new_target.ptr());
60 }
61 return result;
62 }
64 break;
65 }
67}
68
70 SlotType slot_type,
71 Address addr) {
72 switch (slot_type) {
76 }
79 }
82 return rinfo.target_object(heap->isolate());
83 }
86 return rinfo.target_object(heap->isolate());
87 }
90 heap->isolate(), base::Memory<Tagged_t>(addr));
91 return Cast<HeapObject>(Tagged<Object>(full));
92 }
94 FullHeapObjectSlot slot(addr);
95 return (*slot).GetHeapObjectAssumeStrong(heap->isolate());
96 }
98 break;
99 }
100 UNREACHABLE();
101}
102
103} // namespace internal
104} // namespace v8
105#endif // V8_HEAP_REMEMBERED_SET_INL_H_
static Tagged< InstructionStream > FromTargetAddress(Address address)
static Tagged< InstructionStream > FromEntryAddress(Address location_of_address)
V8_INLINE Address target_address()
V8_INLINE Tagged< HeapObject > target_object(PtrComprCageBase cage_base)
static SlotCallbackResult UpdateCodeEntry(Address entry_address, Callback callback)
static SlotCallbackResult UpdateTypedSlot(WritableJitAllocation &jit_allocation, Heap *heap, SlotType slot_type, Address addr, Callback callback)
static Tagged< HeapObject > GetTargetObject(Heap *heap, SlotType slot_type, Address addr)
static SlotCallbackResult UpdateCodeTarget(WritableRelocInfo *rinfo, Callback callback)
static SlotCallbackResult UpdateEmbeddedPointer(Heap *heap, WritableRelocInfo *rinfo, Callback callback)
static V8_INLINE Tagged_t CompressObject(Address tagged)
static V8_INLINE Address DecompressTagged(TOnHeapAddress on_heap_addr, Tagged_t raw_value)
V8_INLINE void WriteValue(Address address, T value)
DirectHandle< Object > new_target
Definition execution.cc:75
TNode< Object > callback
ZoneVector< RpoNumber > & result
T & Memory(Address addr)
Definition memory.h:18
static V8_INLINE bool HasWeakHeapObjectTag(const Tagged< Object > value)
Definition objects.h:653
Address Tagged_t
Definition globals.h:547
Tagged< To > Cast(Tagged< From > value, const v8::SourceLocation &loc=INIT_SOURCE_LOCATION_IN_DEBUG)
Definition casting.h:150
#define DCHECK(condition)
Definition logging.h:482