5#ifndef INCLUDE_V8_OBJECT_H_
6#define INCLUDE_V8_OBJECT_H_
22class FunctionTemplate;
60 static void CheckCast(
Data* that);
108 bool has_value()
const;
111 bool has_get()
const;
113 bool has_set()
const;
115 void set_enumerable(
bool enumerable);
116 bool enumerable()
const;
117 bool has_enumerable()
const;
119 void set_configurable(
bool configurable);
120 bool configurable()
const;
121 bool has_configurable()
const;
123 bool writable()
const;
124 bool has_writable()
const;
171 "This enum is no longer used and will be removed in V8 12.9.")
364 SideEffectType getter_side_effect_type = SideEffectType::kHasSideEffect,
365 SideEffectType setter_side_effect_type = SideEffectType::kHasSideEffect);
379 SideEffectType getter_side_effect_type = SideEffectType::kHasSideEffect,
380 SideEffectType setter_side_effect_type = SideEffectType::kHasSideEffect);
431 "V8 will stop providing access to hidden prototype (i.e. "
432 "JSGlobalObject). Use GetPrototypeV2() instead. "
433 "See http://crbug.com/333672197.")
450 "
V8 will stop providing access to hidden prototype (
i.e. "
451 "JSGlobalObject). Use SetPrototypeV2() instead. "
490 int InternalFieldCount() const;
495 return object.template
value<Object>()->InternalFieldCount();
501 return object.template
value<Object>()->InternalFieldCount();
517 void SetInternalField(
int index,
Local<Data> data);
524 V8_INLINE void* GetAlignedPointerFromInternalField(
int index);
531 return object.template
value<Object>()->GetAlignedPointerFromInternalField(
538 return object.template
value<Object>()->GetAlignedPointerFromInternalField(
547 void SetAlignedPointerInInternalField(
int index,
void* value);
548 void SetAlignedPointerInInternalFields(
int argc,
int indices[],
561 template <CppHeapPo
interTag tag,
typename T =
void>
564 template <CppHeapPo
interTag tag,
typename T =
void>
567 template <CppHeapPo
interTag tag,
typename T =
void>
571 template <
typename T =
void>
575 template <
typename T =
void>
579 template <
typename T =
void>
593 template <CppHeapPo
interTag tag>
597 template <CppHeapPo
interTag tag>
601 template <CppHeapPo
interTag tag>
658 GetRealNamedPropertyAttributesInPrototypeChain(
Local<Context> context,
678 bool HasNamedLookupInterceptor()
const;
681 bool HasIndexedLookupInterceptor()
const;
690 int GetIdentityHash();
722 return object.template
value<Object>()->GetCreationContext(isolate);
742 void* GetAlignedPointerFromEmbedderDataInCreationContext(
v8::
Isolate* isolate,
744 void* GetAlignedPointerFromEmbedderDataInCreationContext(
int index);
751 bool IsCallable() const;
756 bool IsConstructor() const;
769 bool IsApiWrapper() const;
776 bool IsUndetectable() const;
839 bool IsCodeLike(
Isolate* isolate)
const;
848 static void CheckCast(
Value* obj);
850 void* SlowGetAlignedPointerFromInternalField(
int index);
851 void* SlowGetAlignedPointerFromInternalField(
v8::Isolate* isolate,
int index);
857#ifndef V8_ENABLE_CHECKS
863 int instance_type = I::GetInstanceType(obj);
864 if (I::CanHaveInternalField(instance_type)) {
865 int offset = I::kJSAPIObjectWithEmbedderSlotsHeaderSize +
866 (I::kEmbedderDataSlotSize *
index);
867 A value = I::ReadRawField<A>(obj,
offset);
868#ifdef V8_COMPRESS_POINTERS
871 value = I::DecompressTaggedField(obj,
static_cast<uint32_t
>(value));
884#if !defined(V8_ENABLE_CHECKS)
890 auto instance_type = I::GetInstanceType(obj);
891 if (
V8_LIKELY(I::CanHaveInternalField(instance_type))) {
892 int offset = I::kJSAPIObjectWithEmbedderSlotsHeaderSize +
893 (I::kEmbedderDataSlotSize *
index) +
894 I::kEmbedderDataSlotExternalPointerOffset;
896 I::ReadExternalPointerField<internal::kEmbedderDataSlotPayloadTag>(
898 return reinterpret_cast<void*
>(
value);
905#if !defined(V8_ENABLE_CHECKS)
911 auto instance_type = I::GetInstanceType(obj);
912 if (
V8_LIKELY(I::CanHaveInternalField(instance_type))) {
913 int offset = I::kJSAPIObjectWithEmbedderSlotsHeaderSize +
914 (I::kEmbedderDataSlotSize *
index) +
915 I::kEmbedderDataSlotExternalPointerOffset;
916 Isolate* isolate = I::GetIsolateForSandbox(obj);
918 I::ReadExternalPointerField<internal::kEmbedderDataSlotPayloadTag>(
920 return reinterpret_cast<void*
>(
value);
927template <CppHeapPo
interTag tag,
typename T>
931#if !defined(V8_ENABLE_CHECKS)
935 return reinterpret_cast<T*
>(
Unwrap(isolate, obj, tag_range));
940template <CppHeapPo
interTag tag,
typename T>
945#if !defined(V8_ENABLE_CHECKS)
949 return reinterpret_cast<T*
>(
Unwrap(isolate, obj, tag_range));
954template <CppHeapPo
interTag tag,
typename T>
960#if !defined(V8_ENABLE_CHECKS)
964 return reinterpret_cast<T*
>(
Unwrap(isolate, obj, tag_range));
973#if !defined(V8_ENABLE_CHECKS)
977 return reinterpret_cast<T*
>(
Unwrap(isolate, obj, tag_range));
987#if !defined(V8_ENABLE_CHECKS)
992 return reinterpret_cast<T*
>(
Unwrap(isolate, obj, tag_range));
1003#if !defined(V8_ENABLE_CHECKS)
1007 return reinterpret_cast<T*
>(
Unwrap(isolate, obj, tag_range));
1012template <CppHeapPo
interTag tag>
1016 Wrap(isolate, obj, tag, wrappable);
1020template <CppHeapPo
interTag tag>
1025 Wrap(isolate, obj, tag, wrappable);
1029template <CppHeapPo
interTag tag>
1035 Wrap(isolate, obj, tag, wrappable);
1042 Wrap(isolate, obj, tag, wrappable);
1050 Wrap(isolate, obj, tag, wrappable);
1059 Wrap(isolate, obj, tag, wrappable);
1063#ifdef V8_ENABLE_CHECKS
1070#ifdef V8_ENABLE_CHECKS
union v8::internal::@341::BuiltinMetadata::KindSpecificData data
static V8_INLINE Local< T > New(Isolate *isolate, Local< T > that)
static void * Unwrap(v8::Isolate *isolate, internal::Address wrapper_obj, CppHeapPointerTagRange tag_range)
static V8_INLINE void Wrap(v8::Isolate *isolate, const BasicTracedReference< Object > &wrapper, void *wrappable)
void * SlowGetAlignedPointerFromInternalField(int index)
static V8_INLINE T * Unwrap(v8::Isolate *isolate, const PersistentBase< Object > &wrapper)
static V8_INLINE Object * Cast(Value *obj)
V8_INLINE void * GetAlignedPointerFromInternalField(int index)
Local< Data > SlowGetInternalField(int index)
V8_DEPRECATE_SOON("V8 will stop providing access to hidden prototype (i.e. " "JSGlobalObject). Use GetPrototypeV2() instead. " "See http://crbug.com/333672197.") Local< Value > GetPrototype()
static V8_INLINE void Wrap(v8::Isolate *isolate, const v8::Local< v8::Object > &wrapper, void *wrappable)
static V8_INLINE void * GetAlignedPointerFromInternalField(const BasicTracedReference< Object > &object, int index)
static V8_INLINE void * GetAlignedPointerFromInternalField(const PersistentBase< Object > &object, int index)
V8_INLINE Local< Data > GetInternalField(int index)
static V8_INLINE T * Unwrap(v8::Isolate *isolate, const v8::Local< v8::Object > &wrapper)
static V8_INLINE T * Unwrap(v8::Isolate *isolate, const PersistentBase< Object > &wrapper, CppHeapPointerTagRange tag_range)
static V8_INLINE T * Unwrap(v8::Isolate *isolate, const BasicTracedReference< Object > &wrapper)
static void Wrap(v8::Isolate *isolate, internal::Address wrapper_obj, CppHeapPointerTag tag, void *wrappable)
static V8_INLINE T * Unwrap(v8::Isolate *isolate, const BasicTracedReference< Object > &wrapper, CppHeapPointerTagRange tag_range)
static V8_INLINE T * Unwrap(v8::Isolate *isolate, const v8::Local< v8::Object > &wrapper, CppHeapPointerTagRange tag_range)
static void CheckCast(Value *obj)
static V8_INLINE void Wrap(v8::Isolate *isolate, const PersistentBase< Object > &wrapper, void *wrappable)
static V8_INLINE int InternalFieldCount(const BasicTracedReference< Object > &object)
static void CheckCast(Data *that)
static V8_INLINE Private * Cast(Data *data)
PrivateData * get_private() const
void operator=(const PropertyDescriptor &)=delete
PropertyDescriptor(const PropertyDescriptor &)=delete
static const int kJSObjectHeaderSize
static V8_INLINE Address ValueAsAddress(const T *value)
Handle< SharedFunctionInfo > info
V8_INLINE Address ReadCppHeapPointerField(Address field_address, IsolateForPointerCompression isolate)
V8_EXPORT internal::Isolate * IsolateFromNeverReadOnlySpaceObject(Address obj)
void(*)(Local< Name > property, const PropertyCallbackInfo< Value > &info) AccessorNameGetterCallback
@ kHasSideEffectToReceiver
void(*)(Local< Name > property, Local< Value > value, const PropertyCallbackInfo< void > &info) AccessorNameSetterCallback
#define I(name, number_of_args, result_size)
#define V8_DEPRECATE_SOON(message)
#define V8_LIKELY(condition)
#define V8_WARN_UNUSED_RESULT
std::unique_ptr< ValueMirror > value
std::unique_ptr< ValueMirror > key