5#ifndef INCLUDE_V8_TEMPLATE_H_
6#define INCLUDE_V8_TEMPLATE_H_
21class FunctionTemplate;
27#define V8_INTRINSICS_LIST(F) \
28 F(ArrayProto_entries, array_entries_iterator) \
29 F(ArrayProto_forEach, array_for_each_iterator) \
30 F(ArrayProto_keys, array_keys_iterator) \
31 F(ArrayProto_values, array_values_iterator) \
32 F(ArrayPrototype, initial_array_prototype) \
33 F(AsyncIteratorPrototype, initial_async_iterator_prototype) \
34 F(ErrorPrototype, initial_error_prototype) \
35 F(IteratorPrototype, initial_iterator_prototype) \
36 F(MapIteratorPrototype, initial_map_iterator_prototype) \
37 F(ObjProto_valueOf, object_value_of_function) \
38 F(SetIteratorPrototype, initial_set_iterator_prototype)
41#define V8_DECL_INTRINSIC(name, iname) k##name,
43#undef V8_DECL_INTRINSIC
84 void SetNativeDataProperty(
91 void SetNativeDataProperty(
98 void SetNativeDataProperty(
104 void SetNativeDataProperty(
115 void SetLazyDataProperty(
573 const CFunction* c_function =
nullptr, uint16_t instance_type = 0,
574 uint16_t allowed_receiver_instance_type_range_start = 0,
575 uint16_t allowed_receiver_instance_type_range_end = 0);
593 SideEffectType side_effect_type = SideEffectType::kHasSideEffect);
691 static void CheckCast(
Data* that);
739 static_cast<int>(flags) |
741 PropertyHandlerFlags::kInternalNewCallbacksSignatures));
755 : getter(reinterpret_cast<void*>(getter)),
756 setter(reinterpret_cast<void*>(setter)),
757 query(reinterpret_cast<void*>(query)),
758 deleter(reinterpret_cast<void*>(deleter)),
759 enumerator(enumerator),
760 definer(reinterpret_cast<void*>(definer)),
761 descriptor(reinterpret_cast<void*>(descriptor)),
763 flags(WithNewSignatureFlag(flags)) {}
776 : getter(reinterpret_cast<void*>(getter)),
777 setter(reinterpret_cast<void*>(setter)),
778 query(reinterpret_cast<void*>(query)),
779 deleter(reinterpret_cast<void*>(deleter)),
780 enumerator(enumerator),
781 definer(reinterpret_cast<void*>(definer)),
782 descriptor(reinterpret_cast<void*>(descriptor)),
794 : getter(reinterpret_cast<void*>(getter)),
795 setter(reinterpret_cast<void*>(setter)),
796 query(reinterpret_cast<void*>(query)),
797 deleter(reinterpret_cast<void*>(deleter)),
798 enumerator(enumerator),
802 flags(WithNewSignatureFlag(flags)) {}
813 : getter(reinterpret_cast<void*>(getter)),
814 setter(reinterpret_cast<void*>(setter)),
815 query(reinterpret_cast<void*>(query)),
816 deleter(reinterpret_cast<void*>(deleter)),
817 enumerator(enumerator),
832 : getter(reinterpret_cast<void*>(getter)),
833 setter(reinterpret_cast<void*>(setter)),
835 deleter(reinterpret_cast<void*>(deleter)),
836 enumerator(enumerator),
837 definer(reinterpret_cast<void*>(definer)),
838 descriptor(reinterpret_cast<void*>(descriptor)),
840 flags(WithNewSignatureFlag(flags)) {}
852 : getter(reinterpret_cast<void*>(getter)),
853 setter(reinterpret_cast<void*>(setter)),
855 deleter(reinterpret_cast<void*>(deleter)),
856 enumerator(enumerator),
857 definer(reinterpret_cast<void*>(definer)),
858 descriptor(reinterpret_cast<void*>(descriptor)),
878 static_cast<int>(flags) |
880 PropertyHandlerFlags::kInternalNewCallbacksSignatures));
894 : getter(reinterpret_cast<void*>(getter)),
895 setter(reinterpret_cast<void*>(setter)),
896 query(reinterpret_cast<void*>(query)),
897 deleter(reinterpret_cast<void*>(deleter)),
898 enumerator(enumerator),
899 definer(reinterpret_cast<void*>(definer)),
900 descriptor(reinterpret_cast<void*>(descriptor)),
902 flags(WithNewSignatureFlag(flags)) {}
915 : getter(reinterpret_cast<void*>(getter)),
916 setter(reinterpret_cast<void*>(setter)),
917 query(reinterpret_cast<void*>(query)),
918 deleter(reinterpret_cast<void*>(deleter)),
919 enumerator(enumerator),
920 definer(reinterpret_cast<void*>(definer)),
921 descriptor(reinterpret_cast<void*>(descriptor)),
933 : getter(reinterpret_cast<void*>(getter)),
934 setter(reinterpret_cast<void*>(setter)),
935 query(reinterpret_cast<void*>(query)),
936 deleter(reinterpret_cast<void*>(deleter)),
937 enumerator(enumerator),
941 flags(WithNewSignatureFlag(flags)) {}
952 : getter(reinterpret_cast<void*>(getter)),
953 setter(reinterpret_cast<void*>(setter)),
954 query(reinterpret_cast<void*>(query)),
955 deleter(reinterpret_cast<void*>(deleter)),
956 enumerator(enumerator),
971 : getter(reinterpret_cast<void*>(getter)),
972 setter(reinterpret_cast<void*>(setter)),
974 deleter(reinterpret_cast<void*>(deleter)),
975 enumerator(enumerator),
976 definer(reinterpret_cast<void*>(definer)),
977 descriptor(reinterpret_cast<void*>(descriptor)),
979 flags(WithNewSignatureFlag(flags)) {}
991 : getter(reinterpret_cast<void*>(getter)),
992 setter(reinterpret_cast<void*>(setter)),
994 deleter(reinterpret_cast<void*>(deleter)),
995 enumerator(enumerator),
996 definer(reinterpret_cast<void*>(definer)),
997 descriptor(reinterpret_cast<void*>(descriptor)),
1092 void SetIndexedPropertyHandler(
1100 deleter, enumerator, data));
1197 static void CheckCast(
Data* that);
1231 static void CheckCast(
Data* that);
1255 static void CheckCast(
Data* that);
1262 Set(String::NewFromUtf8(isolate, name, NewStringType::kInternalized)
1268#ifdef V8_ENABLE_CHECKS
1275#ifdef V8_ENABLE_CHECKS
1282#ifdef V8_ENABLE_CHECKS
1289#ifdef V8_ENABLE_CHECKS
1292 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)
bool HasInstance(Local< Value > object)
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)
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={})
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 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)
V8_WARN_UNUSED_RESULT MaybeLocal< Object > NewRemoteInstance()
void SetPrototypeProviderTemplate(Local< FunctionTemplate > prototype_provider)
void SetClassName(Local< String > name)
void SetAcceptAnyReceiver(bool value)
void SetInternalFieldCount(int value)
static Local< ObjectTemplate > New(Isolate *isolate, Local< FunctionTemplate > constructor=Local< 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)
int InternalFieldCount() const
static Local< Signature > New(Isolate *isolate, Local< FunctionTemplate > receiver=Local< FunctionTemplate >())
void SetPrivate(Local< Private > name, Local< Data > value, PropertyAttribute attributes=None)
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(*)(Local< Name > property, const PropertyCallbackInfo< Value > &info) AccessorNameGetterCallback
Intercepted(*)(uint32_t index, const PropertyDescriptor &desc, const PropertyCallbackInfo< void > &info) IndexedPropertyDefinerCallbackV2
void(*)(Local< Name > property, const PropertyCallbackInfo< Boolean > &info) GenericNamedPropertyDeleterCallback
void(*)(uint32_t index, const PropertyCallbackInfo< Boolean > &info) IndexedPropertyDeleterCallback
void(*)(Local< String > property, Local< Value > value, const PropertyCallbackInfo< void > &info) AccessorSetterCallback
void(*)(uint32_t index, const PropertyCallbackInfo< Value > &info) IndexedPropertyDescriptorCallback
Intercepted(*)(Local< Name > property, const PropertyDescriptor &desc, const PropertyCallbackInfo< void > &info) NamedPropertyDefinerCallback
bool(*)(Local< Context > accessing_context, Local< Object > accessed_object, Local< Value > data) AccessCheckCallback
void(*)(uint32_t index, Local< Value > value, const PropertyCallbackInfo< Value > &info) IndexedPropertySetterCallback
void(*)(const FunctionCallbackInfo< Value > &info) FunctionCallback
Intercepted(*)(Local< Name > property, const PropertyCallbackInfo< Value > &info) NamedPropertyDescriptorCallback
void(*)(uint32_t index, const PropertyCallbackInfo< Value > &info) IndexedPropertyGetterCallback
Intercepted(*)(uint32_t index, const PropertyCallbackInfo< Value > &info) IndexedPropertyGetterCallbackV2
Intercepted(*)(uint32_t index, const PropertyCallbackInfo< Integer > &info) IndexedPropertyQueryCallbackV2
void(*)(Local< Name > property, const PropertyCallbackInfo< Value > &info) GenericNamedPropertyDescriptorCallback
Intercepted(*)(Local< Name > property, Local< Value > value, const PropertyCallbackInfo< void > &info) NamedPropertySetterCallback
Intercepted(*)(Local< Name > property, const PropertyCallbackInfo< Integer > &info) NamedPropertyQueryCallback
NamedPropertyEnumeratorCallback GenericNamedPropertyEnumeratorCallback
void(*)(Local< Name > property, const PropertyCallbackInfo< Value > &info) GenericNamedPropertyGetterCallback
void(*)(Local< Name > property, Local< Value > value, const PropertyCallbackInfo< void > &info) AccessorNameSetterCallback
void(*)(Local< Name > property, const PropertyCallbackInfo< Integer > &info) GenericNamedPropertyQueryCallback
Intercepted(*)(uint32_t index, Local< Value > value, const PropertyCallbackInfo< void > &info) IndexedPropertySetterCallbackV2
Intercepted(*)(uint32_t index, const PropertyCallbackInfo< Value > &info) IndexedPropertyDescriptorCallbackV2
void(*)(Local< Name > property, Local< Value > value, const PropertyCallbackInfo< Value > &info) GenericNamedPropertySetterCallback
Intercepted(*)(Local< Name > property, const PropertyCallbackInfo< Value > &info) NamedPropertyGetterCallback
Intercepted(*)(Local< Name > property, const PropertyCallbackInfo< Boolean > &info) NamedPropertyDeleterCallback
Intercepted(*)(uint32_t index, const PropertyCallbackInfo< Boolean > &info) IndexedPropertyDeleterCallbackV2
void(*)(uint32_t index, const PropertyDescriptor &desc, const PropertyCallbackInfo< Value > &info) IndexedPropertyDefinerCallback
void(*)(const PropertyCallbackInfo< Array > &info) NamedPropertyEnumeratorCallback
void(*)(const PropertyCallbackInfo< Array > &info) IndexedPropertyEnumeratorCallback
void(*)(Local< String > property, const PropertyCallbackInfo< Value > &info) AccessorGetterCallback
void(*)(Local< Name > property, const PropertyDescriptor &desc, const PropertyCallbackInfo< Value > &info) GenericNamedPropertyDefinerCallback
@ kInternalNewCallbacksSignatures
void(*)(uint32_t index, const PropertyCallbackInfo< Integer > &info) IndexedPropertyQueryCallback
IndexedPropertyHandlerConfiguration(IndexedPropertyGetterCallback getter, IndexedPropertySetterCallback setter=nullptr, IndexedPropertyQueryCallback query=nullptr, IndexedPropertyDeleterCallback deleter=nullptr, IndexedPropertyEnumeratorCallback enumerator=nullptr, Local< Value > data=Local< Value >(), PropertyHandlerFlags flags=PropertyHandlerFlags::kNone)
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)
IndexedPropertyHandlerConfiguration(IndexedPropertyGetterCallbackV2 getter, IndexedPropertySetterCallbackV2 setter, IndexedPropertyDescriptorCallbackV2 descriptor, IndexedPropertyDeleterCallbackV2 deleter, IndexedPropertyEnumeratorCallback enumerator, IndexedPropertyDefinerCallbackV2 definer, Local< Value > data=Local< Value >(), PropertyHandlerFlags flags=PropertyHandlerFlags::kNone)
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
IndexedPropertyHandlerConfiguration(IndexedPropertyGetterCallback getter, IndexedPropertySetterCallback setter, IndexedPropertyDescriptorCallback descriptor, IndexedPropertyDeleterCallback deleter, IndexedPropertyEnumeratorCallback enumerator, IndexedPropertyDefinerCallback definer, Local< Value > data=Local< Value >(), PropertyHandlerFlags flags=PropertyHandlerFlags::kNone)
IndexedPropertyHandlerConfiguration(IndexedPropertyGetterCallback getter, IndexedPropertySetterCallback setter, IndexedPropertyQueryCallback query, IndexedPropertyDeleterCallback deleter, IndexedPropertyEnumeratorCallback enumerator, IndexedPropertyDefinerCallback definer, IndexedPropertyDescriptorCallback descriptor, Local< Value > data=Local< Value >(), PropertyHandlerFlags flags=PropertyHandlerFlags::kNone)
IndexedPropertyEnumeratorCallback enumerator
NamedPropertyHandlerConfiguration(GenericNamedPropertyGetterCallback getter, GenericNamedPropertySetterCallback setter, GenericNamedPropertyDescriptorCallback descriptor, GenericNamedPropertyDeleterCallback deleter, GenericNamedPropertyEnumeratorCallback enumerator, GenericNamedPropertyDefinerCallback definer, Local< Value > data=Local< Value >(), PropertyHandlerFlags flags=PropertyHandlerFlags::kNone)
NamedPropertyHandlerConfiguration(GenericNamedPropertyGetterCallback getter, GenericNamedPropertySetterCallback setter=nullptr, GenericNamedPropertyQueryCallback query=nullptr, GenericNamedPropertyDeleterCallback deleter=nullptr, GenericNamedPropertyEnumeratorCallback enumerator=nullptr, Local< Value > data=Local< Value >(), PropertyHandlerFlags flags=PropertyHandlerFlags::kNone)
NamedPropertyHandlerConfiguration(NamedPropertyGetterCallback getter, NamedPropertySetterCallback setter, NamedPropertyDescriptorCallback descriptor, NamedPropertyDeleterCallback deleter, NamedPropertyEnumeratorCallback enumerator, NamedPropertyDefinerCallback definer, Local< Value > data=Local< Value >(), PropertyHandlerFlags flags=PropertyHandlerFlags::kNone)
NamedPropertyEnumeratorCallback enumerator
NamedPropertyHandlerConfiguration(NamedPropertyGetterCallback getter, NamedPropertySetterCallback setter, NamedPropertyQueryCallback query, NamedPropertyDeleterCallback deleter, NamedPropertyEnumeratorCallback enumerator, NamedPropertyDefinerCallback definer, NamedPropertyDescriptorCallback descriptor, Local< Value > data=Local< Value >(), PropertyHandlerFlags flags=PropertyHandlerFlags::kNone)
PropertyHandlerFlags flags
NamedPropertyHandlerConfiguration(GenericNamedPropertyGetterCallback getter, GenericNamedPropertySetterCallback setter, GenericNamedPropertyQueryCallback query, GenericNamedPropertyDeleterCallback deleter, GenericNamedPropertyEnumeratorCallback enumerator, GenericNamedPropertyDefinerCallback definer, GenericNamedPropertyDescriptorCallback descriptor, Local< Value > data=Local< Value >(), PropertyHandlerFlags flags=PropertyHandlerFlags::kNone)
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_DEPRECATE_SOON(message)
#define V8_WARN_UNUSED_RESULT