5#ifndef INCLUDE_V8_TEMPLATE_H_
6#define INCLUDE_V8_TEMPLATE_H_
28#define V8_INTRINSICS_LIST(F) \
29 F(ArrayProto_entries, array_entries_iterator) \
30 F(ArrayProto_forEach, array_for_each_iterator) \
31 F(ArrayProto_keys, array_keys_iterator) \
32 F(ArrayProto_values, array_values_iterator) \
33 F(ArrayPrototype, initial_array_prototype) \
34 F(AsyncIteratorPrototype, initial_async_iterator_prototype) \
35 F(ErrorPrototype, initial_error_prototype) \
36 F(IteratorPrototype, initial_iterator_prototype) \
37 F(MapIteratorPrototype, initial_map_iterator_prototype) \
38 F(ObjProto_valueOf, object_value_of_function) \
39 F(SetIteratorPrototype, initial_set_iterator_prototype)
42#define V8_DECL_INTRINSIC(name, iname) k##name,
44#undef V8_DECL_INTRINSIC
579 const CFunction* c_function =
nullptr, uint16_t instance_type = 0,
580 uint16_t allowed_receiver_instance_type_range_start = 0,
581 uint16_t allowed_receiver_instance_type_range_end = 0);
717 static void CheckCast(
Data* that);
765 static_cast<int>(
flags) |
844 static_cast<int>(
flags) |
1045 static void CheckCast(
Data* that);
1079 static void CheckCast(
Data* that);
1081 DictionaryTemplate();
1103 static void CheckCast(Data* that);
1116#ifdef V8_ENABLE_CHECKS
1119 return reinterpret_cast<FunctionTemplate*
>(data);
1123#ifdef V8_ENABLE_CHECKS
1126 return reinterpret_cast<ObjectTemplate*
>(data);
1130#ifdef V8_ENABLE_CHECKS
1133 return reinterpret_cast<DictionaryTemplate*
>(data);
1137#ifdef V8_ENABLE_CHECKS
1140 return reinterpret_cast<Signature*
>(data);
V8_WARN_UNUSED_RESULT Local< Object > NewInstance(Local< Context > context, MemorySpan< MaybeLocal< Value > > property_values)
static Local< DictionaryTemplate > New(Isolate *isolate, MemorySpan< const std::string_view > names)
static V8_INLINE DictionaryTemplate * Cast(Data *data)
bool HasInstance(Local< Value > object)
friend class ObjectTemplate
static Local< FunctionTemplate > New(Isolate *isolate, FunctionCallback callback=nullptr, Local< Value > data=Local< Value >(), Local< Signature > signature=Local< Signature >(), int length=0, ConstructorBehavior behavior=ConstructorBehavior::kAllow, SideEffectType side_effect_type=SideEffectType::kHasSideEffect, const CFunction *c_function=nullptr, uint16_t instance_type=0, uint16_t allowed_receiver_instance_type_range_start=0, uint16_t allowed_receiver_instance_type_range_end=0)
void SealAndPrepareForPromotionToReadOnly()
static Local< FunctionTemplate > NewWithCache(Isolate *isolate, FunctionCallback callback, Local< Private > cache_property, Local< Value > data=Local< Value >(), Local< Signature > signature=Local< Signature >(), int length=0, SideEffectType side_effect_type=SideEffectType::kHasSideEffect)
void SetCallHandler(FunctionCallback callback, Local< Value > data=Local< Value >(), SideEffectType side_effect_type=SideEffectType::kHasSideEffect, const MemorySpan< const CFunction > &c_function_overloads={})
void SetExceptionContext(ExceptionContext context)
static Local< FunctionTemplate > NewWithCFunctionOverloads(Isolate *isolate, FunctionCallback callback=nullptr, Local< Value > data=Local< Value >(), Local< Signature > signature=Local< Signature >(), int length=0, ConstructorBehavior behavior=ConstructorBehavior::kAllow, SideEffectType side_effect_type=SideEffectType::kHasSideEffect, const MemorySpan< const CFunction > &c_function_overloads={})
Local< ObjectTemplate > InstanceTemplate()
void SetInterfaceName(Local< String > name)
void SetLength(int length)
bool IsLeafTemplateForApiObject(v8::Local< v8::Value > value) const
Local< ObjectTemplate > PrototypeTemplate()
void Inherit(Local< FunctionTemplate > parent)
V8_WARN_UNUSED_RESULT MaybeLocal< Function > GetFunction(Local< Context > context)
static V8_INLINE FunctionTemplate * Cast(Data *data)
V8_WARN_UNUSED_RESULT MaybeLocal< Object > NewRemoteInstance()
void SetPrototypeProviderTemplate(Local< FunctionTemplate > prototype_provider)
void SetClassName(Local< String > name)
void SetAcceptAnyReceiver(bool value)
void SetHandler(const NamedPropertyHandlerConfiguration &configuration)
void SetInternalFieldCount(int value)
static Local< ObjectTemplate > New(Isolate *isolate, Local< FunctionTemplate > constructor=Local< FunctionTemplate >())
friend class FunctionTemplate
void SetCallAsFunctionHandler(FunctionCallback callback, Local< Value > data=Local< Value >())
void MarkAsUndetectable()
void SetAccessCheckCallbackAndHandler(AccessCheckCallback callback, const NamedPropertyHandlerConfiguration &named_handler, const IndexedPropertyHandlerConfiguration &indexed_handler, Local< Value > data=Local< Value >())
void SetAccessCheckCallback(AccessCheckCallback callback, Local< Value > data=Local< Value >())
bool IsImmutableProto() const
void SetHandler(const IndexedPropertyHandlerConfiguration &configuration)
V8_WARN_UNUSED_RESULT MaybeLocal< Object > NewInstance(Local< Context > context)
static V8_INLINE ObjectTemplate * Cast(Data *data)
int InternalFieldCount() const
static V8_INLINE Signature * Cast(Data *data)
static Local< Signature > New(Isolate *isolate, Local< FunctionTemplate > receiver=Local< FunctionTemplate >())
static V8_WARN_UNUSED_RESULT MaybeLocal< String > NewFromUtf8(Isolate *isolate, const char *data, NewStringType type=NewStringType::kNormal, int length=-1)
void SetNativeDataProperty(Local< Name > name, AccessorNameGetterCallback getter, AccessorNameSetterCallback setter=nullptr, Local< Value > data=Local< Value >(), PropertyAttribute attribute=None, SideEffectType getter_side_effect_type=SideEffectType::kHasSideEffect, SideEffectType setter_side_effect_type=SideEffectType::kHasSideEffect)
friend class FunctionTemplate
friend class ObjectTemplate
void SetIntrinsicDataProperty(Local< Name > name, Intrinsic intrinsic, PropertyAttribute attribute=None)
void SetPrivate(Local< Private > name, Local< Data > value, PropertyAttribute attributes=None)
void SetLazyDataProperty(Local< Name > name, AccessorNameGetterCallback getter, Local< Value > data=Local< Value >(), PropertyAttribute attribute=None, SideEffectType getter_side_effect_type=SideEffectType::kHasSideEffect, SideEffectType setter_side_effect_type=SideEffectType::kHasSideEffect)
void Set(Local< Name > name, Local< Data > value, PropertyAttribute attributes=None)
void SetAccessorProperty(Local< Name > name, Local< FunctionTemplate > getter=Local< FunctionTemplate >(), Local< FunctionTemplate > setter=Local< FunctionTemplate >(), PropertyAttribute attribute=None)
void(*)(const PropertyCallbackInfo< Array > &info) NamedPropertyEnumeratorCallback
void(*)(Local< Name > property, const PropertyCallbackInfo< Value > &info) AccessorNameGetterCallback
void(*)(uint32_t index, const PropertyCallbackInfo< Integer > &info) IndexedPropertyQueryCallback
bool(*)(Local< Context > accessing_context, Local< Object > accessed_object, Local< Value > data) AccessCheckCallback
void(*)(Local< Name > property, const PropertyCallbackInfo< Value > &info) GenericNamedPropertyDescriptorCallback
void(*)(uint32_t index, Local< Value > value, const PropertyCallbackInfo< Value > &info) IndexedPropertySetterCallback
Intercepted(*)( uint32_t index, Local< Value > value, const PropertyCallbackInfo< void > &info) IndexedPropertySetterCallbackV2
void(*)(const PropertyCallbackInfo< Array > &info) IndexedPropertyEnumeratorCallback
void(*)(const FunctionCallbackInfo< Value > &info) FunctionCallback
void(*)(Local< Name > property, const PropertyCallbackInfo< Boolean > &info) GenericNamedPropertyDeleterCallback
void(*)(uint32_t index, const PropertyDescriptor &desc, const PropertyCallbackInfo< Value > &info) IndexedPropertyDefinerCallback
Intercepted(*)(uint32_t index, const PropertyCallbackInfo< Value > &info) IndexedPropertyDescriptorCallbackV2
Intercepted(*)(Local< Name > property, Local< Value > value, const PropertyCallbackInfo< void > &info) NamedPropertySetterCallback
void(*)(uint32_t index, const PropertyCallbackInfo< Value > &info) IndexedPropertyDescriptorCallback
NamedPropertyEnumeratorCallback GenericNamedPropertyEnumeratorCallback
Intercepted(*)( Local< Name > property, const PropertyCallbackInfo< Integer > &info) NamedPropertyQueryCallback
void(*)(uint32_t index, const PropertyCallbackInfo< Value > &info) IndexedPropertyGetterCallback
Intercepted(*)(uint32_t index, const PropertyCallbackInfo< Integer > &info) IndexedPropertyQueryCallbackV2
void(*)(Local< Name > property, const PropertyCallbackInfo< Value > &info) GenericNamedPropertyGetterCallback
void(*)(Local< Name > property, const PropertyDescriptor &desc, const PropertyCallbackInfo< Value > &info) GenericNamedPropertyDefinerCallback
Intercepted(*)(uint32_t index, const PropertyCallbackInfo< Value > &info) IndexedPropertyGetterCallbackV2
void(*)(Local< Name > property, Local< Value > value, const PropertyCallbackInfo< void > &info) AccessorNameSetterCallback
Intercepted(*)( Local< Name > property, const PropertyCallbackInfo< Value > &info) NamedPropertyGetterCallback
Intercepted(*)(Local< Name > property, const PropertyDescriptor &desc, const PropertyCallbackInfo< void > &info) NamedPropertyDefinerCallback
void(*)(uint32_t index, const PropertyCallbackInfo< Boolean > &info) IndexedPropertyDeleterCallback
void(*)(Local< Name > property, Local< Value > value, const PropertyCallbackInfo< Value > &info) GenericNamedPropertySetterCallback
Intercepted(*)( Local< Name > property, const PropertyCallbackInfo< Boolean > &info) NamedPropertyDeleterCallback
Intercepted(*)( Local< Name > property, const PropertyCallbackInfo< Value > &info) NamedPropertyDescriptorCallback
Intercepted(*)(uint32_t index, const PropertyDescriptor &desc, const PropertyCallbackInfo< void > &info) IndexedPropertyDefinerCallbackV2
Intercepted(*)(uint32_t index, const PropertyCallbackInfo< Boolean > &info) IndexedPropertyDeleterCallbackV2
void(*)(Local< Name > property, const PropertyCallbackInfo< Integer > &info) GenericNamedPropertyQueryCallback
@ kInternalNewCallbacksSignatures
IndexedPropertyQueryCallbackV2 query
IndexedPropertyDefinerCallbackV2 definer
IndexedPropertySetterCallbackV2 setter
IndexedPropertyHandlerConfiguration(IndexedPropertyGetterCallbackV2 getter=nullptr, IndexedPropertySetterCallbackV2 setter=nullptr, IndexedPropertyQueryCallbackV2 query=nullptr, IndexedPropertyDeleterCallbackV2 deleter=nullptr, IndexedPropertyEnumeratorCallback enumerator=nullptr, Local< Value > data=Local< Value >(), PropertyHandlerFlags flags=PropertyHandlerFlags::kNone)
IndexedPropertyGetterCallbackV2 getter
IndexedPropertyHandlerConfiguration(IndexedPropertyGetterCallbackV2 getter, IndexedPropertySetterCallbackV2 setter, IndexedPropertyDescriptorCallbackV2 descriptor, IndexedPropertyDeleterCallbackV2 deleter, IndexedPropertyEnumeratorCallback enumerator, IndexedPropertyDefinerCallbackV2 definer, Local< Value > data=Local< Value >(), PropertyHandlerFlags flags=PropertyHandlerFlags::kNone)
IndexedPropertyDeleterCallbackV2 deleter
IndexedPropertyHandlerConfiguration(IndexedPropertyGetterCallbackV2 getter, IndexedPropertySetterCallbackV2 setter, IndexedPropertyQueryCallbackV2 query, IndexedPropertyDeleterCallbackV2 deleter, IndexedPropertyEnumeratorCallback enumerator, IndexedPropertyDefinerCallbackV2 definer, IndexedPropertyDescriptorCallbackV2 descriptor, Local< Value > data=Local< Value >(), PropertyHandlerFlags flags=PropertyHandlerFlags::kNone)
PropertyHandlerFlags flags
IndexedPropertyDescriptorCallbackV2 descriptor
IndexedPropertyEnumeratorCallback enumerator
NamedPropertyDeleterCallback deleter
NamedPropertySetterCallback setter
NamedPropertyDescriptorCallback descriptor
NamedPropertyHandlerConfiguration(NamedPropertyGetterCallback getter, NamedPropertySetterCallback setter, NamedPropertyDescriptorCallback descriptor, NamedPropertyDeleterCallback deleter, NamedPropertyEnumeratorCallback enumerator, NamedPropertyDefinerCallback definer, Local< Value > data=Local< Value >(), PropertyHandlerFlags flags=PropertyHandlerFlags::kNone)
NamedPropertyQueryCallback query
NamedPropertyEnumeratorCallback enumerator
NamedPropertyDefinerCallback definer
NamedPropertyHandlerConfiguration(NamedPropertyGetterCallback getter, NamedPropertySetterCallback setter, NamedPropertyQueryCallback query, NamedPropertyDeleterCallback deleter, NamedPropertyEnumeratorCallback enumerator, NamedPropertyDefinerCallback definer, NamedPropertyDescriptorCallback descriptor, Local< Value > data=Local< Value >(), PropertyHandlerFlags flags=PropertyHandlerFlags::kNone)
NamedPropertyGetterCallback getter
PropertyHandlerFlags flags
NamedPropertyHandlerConfiguration(NamedPropertyGetterCallback getter, NamedPropertySetterCallback setter=nullptr, NamedPropertyQueryCallback query=nullptr, NamedPropertyDeleterCallback deleter=nullptr, NamedPropertyEnumeratorCallback enumerator=nullptr, Local< Value > data=Local< Value >(), PropertyHandlerFlags flags=PropertyHandlerFlags::kNone)
#define V8_INTRINSICS_LIST(F)
#define V8_DECL_INTRINSIC(name, iname)
#define V8_WARN_UNUSED_RESULT