5#ifndef INCLUDE_V8_LOCAL_HANDLE_H_
6#define INCLUDE_V8_LOCAL_HANDLE_H_
18class BasicTracedReference;
20class EscapableHandleScope;
24class FunctionCallbackInfo;
29class NonCopyablePersistentTraits;
31template <
class T,
class M = NonCopyablePersistentTraits<T>>
35template <
class F1,
class F2,
class F3>
36class PersistentValueMapBase;
37template <
class F1,
class F2>
54class ConsoleCallArguments;
60class SamplingHeapProfiler;
63namespace api_internal {
94 return reinterpret_cast<Isolate*
>(i_isolate_);
114 void*
operator new(
size_t size);
115 void*
operator new[](
size_t size);
116 void operator delete(
void*, size_t);
117 void operator delete[](
void*, size_t);
119 internal::Isolate* i_isolate_;
150 template <
typename T1,
typename T2>
152 if (lhs.IsEmpty())
return rhs.IsEmpty();
153 if (rhs.IsEmpty())
return false;
154 return lhs.address() == rhs.address();
201 static_assert(std::is_base_of<T, S>::value,
"type check");
208 return val_ == internal::ValueHelper::EmptyValue<T>();
258#ifdef V8_ENABLE_CHECKS
282 return New(isolate, that.val_);
287 return New(isolate, internal::ValueHelper::SlotAsValue<T>(that.val_));
292 return New(isolate, internal::ValueHelper::SlotAsValue<T>(*that));
319 template <
class F1,
class F2,
class F3>
321 template <
class F1,
class F2>
338 return Local<T>(internal::ValueHelper::SlotAsValue<T>(slot));
342#ifdef V8_ENABLE_CONSERVATIVE_STACK_SCANNING
343 return Local<T>(that);
345 if (that ==
nullptr)
return Local<T>();
348 reinterpret_cast<internal::Isolate*
>(isolate), *p)));
355#if !defined(V8_IMMINENT_DEPRECATION_WARNINGS)
377 static_assert(std::is_base_of<T, S>::value,
"type check");
381 return val_ == internal::ValueHelper::EmptyValue<T>();
390 out->val_ =
IsEmpty() ? internal::ValueHelper::EmptyValue<T>() : this->val_;
431#ifdef V8_ENABLE_CONSERVATIVE_STACK_SCANNING
436 return Local<T>(
reinterpret_cast<T*
>(slot));
451 void*
operator new(
size_t size);
452 void*
operator new[](
size_t size);
453 void operator delete(
void*, size_t);
454 void operator delete[](
void*, size_t);
476 void*
operator new(
size_t size);
477 void*
operator new[](
size_t size);
478 void operator delete(
void*, size_t);
479 void operator delete[](
void*, size_t);
481 internal::Isolate*
const i_isolate_;
483 int prev_sealed_level_;
EscapableHandleScope(const EscapableHandleScope &)=delete
void operator=(const EscapableHandleScope &)=delete
V8_INLINE Local< T > Escape(Local< T > value)
EscapableHandleScope(Isolate *isolate)
V8_INLINE MaybeLocal< T > EscapeMaybe(MaybeLocal< T > value)
V8_INLINE ~EscapableHandleScope()=default
void Initialize(Isolate *isolate)
V8_INLINE HandleScope()=default
static int NumberOfHandles(Isolate *isolate)
V8_INLINE Isolate * GetIsolate() const
HandleScope(const HandleScope &)=delete
static internal::Address * CreateHandleForCurrentIsolate(internal::Address value)
HandleScope(Isolate *isolate)
void operator=(const HandleScope &)=delete
static internal::Address * CreateHandle(internal::Isolate *i_isolate, internal::Address value)
friend Local< Primitive > Null(Isolate *isolate)
V8_INLINE T * operator->() const
V8_INLINE Local(Local< S > that)
V8_INLINE bool operator!=(const Local< S > &that) const
static V8_INLINE Local< T > New(Isolate *isolate, const PersistentBase< T > &that)
static V8_INLINE Local< T > Cast(Local< S > that)
V8_INLINE bool IsEmpty() const
V8_INLINE bool operator==(const Local< S > &that) const
friend Local< Boolean > False(Isolate *isolate)
friend Local< Primitive > Undefined(Isolate *isolate)
static V8_INLINE Local< T > New(Isolate *isolate, const BasicTracedReference< T > &that)
V8_INLINE Local< S > As() const
V8_INLINE bool operator==(const PersistentBase< S > &that) const
friend Local< Boolean > True(Isolate *isolate)
friend class debug::ConsoleCallArguments
static V8_INLINE Local< T > New(Isolate *isolate, Local< T > that)
friend class internal::SamplingHeapProfiler
V8_INLINE T * operator*() const
V8_INLINE bool operator!=(const Persistent< S > &that) const
V8_INLINE Local< T > ToLocalChecked()
V8_INLINE bool IsEmpty() const
V8_INLINE MaybeLocal(Local< S > that)
V8_INLINE Local< S > FromMaybe(Local< S > default_value) const
V8_WARN_UNUSED_RESULT V8_INLINE bool ToLocal(Local< S > *out) const
void operator=(const SealHandleScope &)=delete
SealHandleScope(Isolate *isolate)
SealHandleScope(const SealHandleScope &)=delete
static V8_INLINE bool EqualHandles(const T1 &lhs, const T2 &rhs)
static V8_INLINE Address ValueAsAddress(const T *value)
internal::BasicPersistent< T, internal::StrongPersistentPolicy > Persistent
V8_EXPORT void ToLocalEmpty()
#define V8_WARN_UNUSED_RESULT
#define V8_UNLIKELY(condition)