5#ifndef V8_OBJECTS_TAGGED_IMPL_H_
6#define V8_OBJECTS_TAGGED_IMPL_H_
18#if defined(V8_EXTERNAL_CODE_SPACE) || defined(V8_ENABLE_SANDBOX)
32template <HeapObjectReferenceType kRefType,
typename StorageType>
35 static_assert(std::is_same<StorageType, Address>::value ||
36 std::is_same<StorageType, Tagged_t>::value,
37 "StorageType must be either Address or Tagged_t");
44 static const bool kCanBeWeak = kRefType == HeapObjectReferenceType::WEAK;
50 explicit operator bool()
const =
delete;
55 template <HeapObjectReferenceType kOtherRefType,
typename U>
58 std::is_same<U, Address>::value || std::is_same<U, Tagged_t>::value,
59 "U must be either Address or Tagged_t");
60#if defined(V8_EXTERNAL_CODE_SPACE) || defined(V8_ENABLE_SANDBOX)
62 if (std::is_same<StorageType, Address>::value &&
63 std::is_same<U, Address>::value) {
73 template <HeapObjectReferenceType kOtherRefType,
typename U>
76 std::is_same<U, Address>::value || std::is_same<U, Tagged_t>::value,
77 "U must be either Address or Tagged_t");
78#if defined(V8_EXTERNAL_CODE_SPACE) || defined(V8_ENABLE_SANDBOX)
80 if (std::is_same<StorageType, Address>::value &&
81 std::is_same<U, Address>::value) {
92 template <HeapObjectReferenceType kOtherRefType>
95 static_assert(std::is_same<StorageType, Address>::value,
96 "Safe comparison is allowed only for full tagged values");
98 return ptr_ == other.ptr();
105#if defined(V8_EXTERNAL_CODE_SPACE) || defined(V8_ENABLE_SANDBOX)
107 if (std::is_same<StorageType, Address>::value) {
163#ifdef V8_COMPRESS_POINTERS
166 constexpr inline bool IsInMainCageBase() {
169 return S::GetPtrComprCageBaseAddress(
ptr_) ==
170 S::GetPtrComprCageBaseAddress(S::base());
210 HeapObjectReferenceType* reference_type)
const;
212 HeapObjectReferenceType* reference_type)
const;
225 template <
typename T>
247template <HeapObjectReferenceType kRefType,
typename StorageType>
252template <HeapObjectReferenceType kRefType,
typename StorageType>
257template <HeapObjectReferenceType kRefType,
typename StorageType>
262template <HeapObjectReferenceType kRefType,
typename StorageType>
265template <HeapObjectReferenceType kRefType,
typename StorageType>
269template <HeapObjectReferenceType kRefType,
typename StorageType>
273template <HeapObjectReferenceType kRefType,
typename StorageType>
#define SLOW_DCHECK(condition)
V8_INLINE constexpr StorageType ptr() const
constexpr bool operator<(TaggedImpl other) const
bool GetHeapObjectIfStrong(Tagged< HeapObject > *result) const
constexpr bool IsStrong() const
constexpr bool SafeEquals(TaggedImpl< kOtherRefType, StorageType > other) const
friend class CompressedObjectSlot
Tagged< HeapObject > GetHeapObjectAssumeStrong() const
constexpr bool operator!=(TaggedImpl< kOtherRefType, U > other) const
constexpr bool IsStrongOrWeak() const
V8_INLINE constexpr TaggedImpl(StorageType ptr)
constexpr bool IsCleared() const
bool GetHeapObjectIfWeak(Tagged< HeapObject > *result) const
Tagged< Smi > ToSmi() const
V8_INLINE constexpr TaggedImpl()
friend class CompressedMaybeObjectSlot
Tagged< HeapObject > GetHeapObject() const
static const bool kCanBeWeak
constexpr bool operator==(TaggedImpl< kOtherRefType, U > other) const
const StorageType * ptr_location() const
static const bool kIsFull
constexpr bool IsWeak() const
constexpr bool IsSmi() const
StorageType * ptr_location()
constexpr bool IsWeakOrCleared() const
constexpr bool IsObject() const
Tagged< Object > GetHeapObjectOrSmi() const
constexpr bool IsStrongOrSmi() const
constexpr bool IsHeapObject() const
Tagged< HeapObject > GetHeapObjectAssumeWeak() const
#define HAS_STRONG_HEAP_OBJECT_TAG(value)
#define V8_EXTERNAL_CODE_SPACE_BOOL
#define HAS_SMI_TAG(value)
#define V8_ENABLE_SANDBOX_BOOL
#define HAS_WEAK_HEAP_OBJECT_TAG(value)
#define EXPORT_TEMPLATE_DECLARE(export)
ZoneVector< RpoNumber > & result
kInterpreterTrampolineOffset Tagged< HeapObject >
void Print(Tagged< Object > obj)
constexpr int kSystemPointerSize
void ShortPrint(Tagged< Object > obj, FILE *out)
const uint32_t kClearedWeakHeapObjectLower32
V8HeapCompressionSchemeImpl< MainCage > V8HeapCompressionScheme
Tagged< To > Cast(Tagged< From > value, const v8::SourceLocation &loc=INIT_SOURCE_LOCATION_IN_DEBUG)
#define DCHECK(condition)
#define V8_EXPORT_PRIVATE