5#ifndef V8_BASE_POINTER_WITH_PAYLOAD_H_
6#define V8_BASE_POINTER_WITH_PAYLOAD_H_
16template <
typename Po
interType>
19 alignof(PointerType) >= 8 ? 3 : alignof(PointerType) >= 4 ? 2 : 1;
39template <
typename Po
interType,
typename PayloadType,
int NumPayloadBits>
68 static_cast<uintptr_t
>(payload));
75 static_cast<uintptr_t
>(new_payload);
92 uintptr_t new_payload_ptr =
static_cast<uintptr_t
>(new_payload);
106 "Ptr does not have sufficient alignment for the selected amount of "
107 "storage bits. Override PointerWithPayloadTraits to guarantee available "
111 (uintptr_t{1} << NumPayloadBits) - 1;
117template <
typename Po
interType,
typename PayloadType,
int NumPayloadBits>
121 return lhs.
raw() == rhs.
raw();
uintptr_t pointer_with_payload_
V8_INLINE PointerType * operator->() const
PointerWithPayload(PayloadType payload)
V8_INLINE void Update(PointerType *new_pointer, PayloadType new_payload)
V8_INLINE PointerType * GetPointer() const
static constexpr uintptr_t kPayloadMask
V8_INLINE void SetPayload(PayloadType new_payload)
V8_INLINE PointerType * GetPointerWithKnownPayload(PayloadType payload) const
static constexpr int kAvailableBits
V8_INLINE PayloadType GetPayload() const
PointerWithPayload(PointerType *pointer, PayloadType payload)
static constexpr uintptr_t kPointerMask
V8_INLINE void SetPointer(PointerType *newptr)
PointerWithPayload(PointerType *pointer)
PointerWithPayload()=default
bool operator==(PointerWithPayload< PointerType, PayloadType, NumPayloadBits > lhs, PointerWithPayload< PointerType, PayloadType, NumPayloadBits > rhs)
#define DCHECK_EQ(v1, v2)
static constexpr int kAvailableBits