5#ifndef INCLUDE_V8_TRACED_HANDLE_H_
6#define INCLUDE_V8_TRACED_HANDLE_H_
28class BasicTracedReferenceExtractor;
66 internal::ValueHelper::SlotAsValue<Value>(
val_));
93 reinterpret_cast<std::atomic<void*>*
>(&
val_)->store(
94 new_val, std::memory_order_relaxed);
101 return reinterpret_cast<std::atomic<const void*> const*
>(&
val_)->load(
102 std::memory_order_relaxed);
114 template <
typename F>
116 template <
typename U>
143#ifdef V8_ENABLE_CONSERVATIVE_STACK_SCANNING
156#ifdef V8_ENABLE_CHECKS
159 return reinterpret_cast<T*
>(
val_);
162#ifdef V8_ENABLE_CHECKS
165 return reinterpret_cast<T*
>(
val_);
175 Isolate* isolate, T* that,
void* slot,
178 template <
typename F>
181 template <
typename F>
183 template <
typename F>
185 template <
typename F>
212 this->
val_ = this->New(isolate, *that, &this->
val_,
214 static_assert(std::is_base_of<T, S>::value,
"type check");
223 *
this = std::move(other);
230 template <
typename S>
233 *
this = std::move(other);
249 template <
typename S>
294 Isolate* isolate, T* that,
void* slot,
296 if (that == internal::ValueHelper::EmptyValue<T>())
return nullptr;
299 reinterpret_cast<internal::Isolate*
>(isolate), p,
328 return !(lhs == rhs);
334 return !(lhs == rhs);
340 return !(rhs == lhs);
346 static_assert(std::is_base_of<T, S>::value,
"type check");
349 this->SetSlotThreadSafe(
350 this->New(isolate, *other, &this->val_,
358 static_assert(std::is_base_of<T, S>::value,
"type check");
359 *
this = std::move(rhs.template As<T>());
367 static_assert(std::is_base_of<T, S>::value,
"type check");
368 *
this = rhs.template As<T>();
387 if (rhs.
val_ !=
nullptr) {
400 uint8_t* addr =
reinterpret_cast<uint8_t*
>(obj) + I::kTracedNodeClassIdOffset;
401 *
reinterpret_cast<uint16_t*
>(addr) = class_id;
408 uint8_t* addr =
reinterpret_cast<uint8_t*
>(obj) + I::kTracedNodeClassIdOffset;
409 return *
reinterpret_cast<uint16_t*
>(addr);
V8_INLINE BasicTracedReference< S > & As() const
Local< T > Get(Isolate *isolate) const
friend class BasicTracedReference
V8_INLINE bool IsEmpty() const
static V8_INLINE Local< T > New(Isolate *isolate, Local< T > that)
V8_INLINE uint16_t WrapperClassId() const
V8_INLINE v8::Local< v8::Value > Get(v8::Isolate *isolate) const
const void * GetSlotThreadSafe() const
V8_EXPORT void CheckValue() const
friend class internal::BasicTracedReferenceExtractor
friend bool operator==(const TracedReferenceBase &, const Local< U > &)
V8_INLINE internal::Address address() const
bool IsEmptyThreadSafe() const
V8_INLINE void SetWrapperClassId(uint16_t class_id)
void SetSlotThreadSafe(void *new_val)
V8_INLINE void Reset(Isolate *isolate, const Local< S > &other)
V8_INLINE TracedReference(TracedReference &&other) noexcept
V8_INLINE TracedReference & operator=(TracedReference< S > &&rhs) noexcept
V8_INLINE TracedReference & operator=(const TracedReference< S > &rhs)
V8_INLINE TracedReference(const TracedReference &other)
V8_INLINE TracedReference< S > & As() const
TracedReference(Isolate *isolate, Local< S > that)
V8_INLINE TracedReference(TracedReference< S > &&other) noexcept
V8_INLINE TracedReference(const TracedReference< S > &other)
V8_INLINE TracedReference & operator=(TracedReference &&rhs) noexcept
static V8_INLINE bool EqualHandles(const T1 &lhs, const T2 &rhs)
V8_EXPORT void CopyTracedReference(const internal::Address *const *from, internal::Address **to)
V8_EXPORT void MoveTracedReference(internal::Address **from, internal::Address **to)
V8_EXPORT void DisposeTracedReference(internal::Address *global_handle)
V8_EXPORT internal::Address * GlobalizeTracedReference(internal::Isolate *isolate, internal::Address *handle, internal::Address *slot, GlobalHandleStoreMode store_mode)
V8_INLINE bool operator==(const TracedReferenceBase &lhs, const TracedReferenceBase &rhs)
V8_INLINE bool operator!=(const TracedReferenceBase &lhs, const TracedReferenceBase &rhs)