5#ifndef INCLUDE_V8_TRACED_HANDLE_H_
6#define INCLUDE_V8_TRACED_HANDLE_H_
28class BasicTracedReferenceExtractor;
92 reinterpret_cast<std::atomic<void*>*
>(&
val_)->store(
93 new_val, std::memory_order_relaxed);
100 return reinterpret_cast<std::atomic<const void*> const*
>(&
val_)->load(
101 std::memory_order_relaxed);
110 template <
typename F>
112 template <
typename U>
147#ifdef V8_ENABLE_CHECKS
150 return reinterpret_cast<T*
>(
val_);
153#ifdef V8_ENABLE_CHECKS
156 return reinterpret_cast<T*
>(
val_);
166 Isolate* isolate, T* that,
void* slot,
170 template <
typename F>
173 template <
typename F>
175 template <
typename F>
177 template <
typename F>
210 this->
val_ = this->New(isolate, that.val_, &this->val_,
212 static_assert(std::is_base_of<T, S>::value,
"type check");
221 *
this = std::move(other);
228 template <
typename S>
231 *
this = std::move(other);
247 template <
typename S>
292 Isolate* isolate, T* that,
void* slot,
294 if (that ==
nullptr)
return nullptr;
297 reinterpret_cast<internal::Isolate*
>(isolate), p,
311 if (a ==
nullptr)
return b ==
nullptr;
312 if (b ==
nullptr)
return false;
321 if (a ==
nullptr)
return b ==
nullptr;
322 if (b ==
nullptr)
return false;
334 return !(lhs == rhs);
340 return !(lhs == rhs);
346 return !(rhs == lhs);
352 static_assert(std::is_base_of<T, S>::value,
"type check");
355 this->SetSlotThreadSafe(
356 this->New(isolate, other.val_, &this->val_,
364 static_assert(std::is_base_of<T, S>::value,
"type check");
365 *
this = std::move(rhs.template As<T>());
373 static_assert(std::is_base_of<T, S>::value,
"type check");
374 *
this = rhs.template As<T>();
393 if (rhs.
val_ !=
nullptr) {
406 uint8_t* addr =
reinterpret_cast<uint8_t*
>(obj) + I::kNodeClassIdOffset;
407 *
reinterpret_cast<uint16_t*
>(addr) = class_id;
414 uint8_t* addr =
reinterpret_cast<uint8_t*
>(obj) + I::kNodeClassIdOffset;
415 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 > &)
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
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)