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>
38class PersistentValueVector;
42class PropertyCallbackInfo;
58namespace api_internal {
89 return reinterpret_cast<Isolate*
>(isolate_);
106 void*
operator new(
size_t size);
107 void*
operator new[](
size_t size);
108 void operator delete(
void*, size_t);
109 void operator delete[](
void*, size_t);
111 internal::Isolate* isolate_;
165 static_assert(std::is_base_of<T, S>::value,
"type check");
196 if (a ==
nullptr)
return b ==
nullptr;
197 if (b ==
nullptr)
return false;
205 if (a ==
nullptr)
return b ==
nullptr;
206 if (b ==
nullptr)
return false;
237#ifdef V8_ENABLE_CHECKS
261 return New(isolate, that.val_);
266 return New(isolate, that.val_);
271 return New(isolate, *that);
281 template <
class F,
class M>
304 template <
class F1,
class F2,
class F3>
306 template <
class F1,
class F2>
319 if (that ==
nullptr)
return Local<T>();
323 reinterpret_cast<internal::Isolate*
>(isolate), *p)));
328#if !defined(V8_IMMINENT_DEPRECATION_WARNINGS)
350 static_assert(std::is_base_of<T, S>::value,
"type check");
361 out->val_ =
IsEmpty() ? nullptr : this->val_;
404 return Local<T>(
reinterpret_cast<T*
>(slot));
418 void*
operator new(
size_t size);
419 void*
operator new[](
size_t size);
420 void operator delete(
void*, size_t);
421 void operator delete[](
void*, size_t);
443 void*
operator new(
size_t size);
444 void*
operator new[](
size_t size);
445 void operator delete(
void*, size_t);
446 void operator delete[](
void*, size_t);
448 internal::Isolate*
const isolate_;
450 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
static internal::Address * CreateHandle(internal::Isolate *isolate, internal::Address value)
HandleScope(const HandleScope &)=delete
HandleScope(Isolate *isolate)
void operator=(const HandleScope &)=delete
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)
static V8_INLINE Local< T > New(Isolate *isolate, Local< T > that)
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
internal::BasicPersistent< T, internal::StrongPersistentPolicy > Persistent
V8_EXPORT void ToLocalEmpty()
#define V8_WARN_UNUSED_RESULT
#define V8_UNLIKELY(condition)