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
48
49
53
54
55
56
65
66
67
68
69
70
71
72
73
74
75
76
77
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
105 Local<
Name> name, AccessorNameGetterCallback getter,
106 AccessorNameSetterCallback setter =
nullptr,
112
113
114
116 Local<
Name> name, AccessorNameGetterCallback getter,
122
123
124
136
137
138
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
192 "Use NamedPropertyGetterCallback instead") =
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214using NamedPropertySetterCallback =
226 "Use NamedPropertySetterCallback instead") =
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
265 "Use NamedPropertyQueryCallback instead") =
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
303 "Use NamedPropertyDeleterCallback instead") =
307
308
309
310
311
312using NamedPropertyEnumeratorCallback =
317 "Use NamedPropertyEnumeratorCallback instead") =
318 NamedPropertyEnumeratorCallback;
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339using NamedPropertyDefinerCallback =
351 "Use NamedPropertyDefinerCallback instead") =
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
388 "Use NamedPropertyDescriptorCallback instead") =
396
397
398using IndexedPropertyGetterCallbackV2 =
402 "Use IndexedPropertyGetterCallbackV2 instead") =
406
407
412 "Use IndexedPropertySetterCallbackV2 instead") =
417
418
419using IndexedPropertyQueryCallbackV2 =
423 "Use IndexedPropertyQueryCallbackV2 instead") =
427
428
429using IndexedPropertyDeleterCallbackV2 =
433 "Use IndexedPropertyDeleterCallbackV2 instead") =
437
438
439
440
441
442using IndexedPropertyEnumeratorCallback =
446
447
448using IndexedPropertyDefinerCallbackV2 =
453 "Use IndexedPropertyDefinerCallbackV2 instead") =
458
459
460using IndexedPropertyDescriptorCallbackV2 =
464 "Use IndexedPropertyDescriptorCallbackV2 instead") =
468
469
470
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
588 Isolate* isolate, FunctionCallback callback =
nullptr,
593 const CFunction* c_function =
nullptr, uint16_t instance_type = 0,
594 uint16_t allowed_receiver_instance_type_range_start = 0,
595 uint16_t allowed_receiver_instance_type_range_end = 0);
599 Isolate* isolate, FunctionCallback callback =
nullptr,
607
608
610 Isolate* isolate, FunctionCallback callback,
620
621
622
623
624
625
629
630
631
632
633
635 FunctionCallback callback,
Local<
Value> data = Local<Value>(),
646
647
648
649
653
654
655
659
660
661
662
663
667
668
669
670
674
675
676
680
681
682
686
687
688
692
693
694
698
699
700
704
705
706
710
711
712
713
714
715
719
720
721
722
723
731 static void CheckCast(
Data* that);
737
738
739
742
743
747
748
749
750
754
755
756
760
761
765
766
767
768
769
770
779 static_cast<
int>(flags) |
786 NamedPropertyGetterCallback getter,
787 NamedPropertySetterCallback setter,
788 NamedPropertyQueryCallback query,
789 NamedPropertyDeleterCallback deleter,
790 NamedPropertyEnumeratorCallback enumerator,
791 NamedPropertyDefinerCallback definer,
792 NamedPropertyDescriptorCallback descriptor,
806 NamedPropertyGetterCallback getter,
807 NamedPropertySetterCallback setter =
nullptr,
808 NamedPropertyQueryCallback query =
nullptr,
809 NamedPropertyDeleterCallback deleter =
nullptr,
810 NamedPropertyEnumeratorCallback enumerator =
nullptr,
824 NamedPropertyGetterCallback getter,
825 NamedPropertySetterCallback setter,
826 NamedPropertyDescriptorCallback descriptor,
827 NamedPropertyDeleterCallback deleter,
828 NamedPropertyEnumeratorCallback enumerator,
829 NamedPropertyDefinerCallback definer,
858 static_cast<
int>(flags) |
865 IndexedPropertyGetterCallbackV2 getter,
866 IndexedPropertySetterCallbackV2 setter,
867 IndexedPropertyQueryCallbackV2 query,
868 IndexedPropertyDeleterCallbackV2 deleter,
869 IndexedPropertyEnumeratorCallback enumerator,
870 IndexedPropertyDefinerCallbackV2 definer,
871 IndexedPropertyDescriptorCallbackV2 descriptor,
885 IndexedPropertyGetterCallbackV2 getter =
nullptr,
886 IndexedPropertySetterCallbackV2 setter =
nullptr,
887 IndexedPropertyQueryCallbackV2 query =
nullptr,
888 IndexedPropertyDeleterCallbackV2 deleter =
nullptr,
889 IndexedPropertyEnumeratorCallback enumerator =
nullptr,
903 IndexedPropertyGetterCallbackV2 getter,
904 IndexedPropertySetterCallbackV2 setter,
905 IndexedPropertyDescriptorCallbackV2 descriptor,
906 IndexedPropertyDeleterCallbackV2 deleter,
907 IndexedPropertyEnumeratorCallback enumerator,
908 IndexedPropertyDefinerCallbackV2 definer,
923 IndexedPropertyQueryCallbackV2
query;
933
934
935
936
937
946
947
948
949
953
954
955
956
957
958
959
960
961
962
966
967
968
969
970
971
972
973
974
978
979
980
981
982
987
988
989
990
991
992
993
997
998
999
1000
1001
1002
1003
1008
1009
1010
1011
1012
1014 AccessCheckCallback callback,
1020
1021
1022
1026
1027
1028
1032
1033
1037
1038
1039
1043
1044
1045
1046
1047
1048
1049
1050
1055
1056
1057
1058
1059
1067 static void CheckCast(
Data* that);
1072
1073
1077
1078
1079
1080
1081
1082
1084 Isolate* isolate, MemorySpan<
const std::string_view> names);
1087
1088
1089
1090
1091
1092
1093
1094
1101 static void CheckCast(
Data* that);
1103 DictionaryTemplate();
1107
1108
1109
1110
1111
1112
1113
1125 static void CheckCast(
Data* that);
1138#ifdef V8_ENABLE_CHECKS
1145#ifdef V8_ENABLE_CHECKS
1151DictionaryTemplate* DictionaryTemplate::
Cast(
Data* data) {
1152#ifdef V8_ENABLE_CHECKS
1155 return reinterpret_cast<DictionaryTemplate*>(data);
1159#ifdef V8_ENABLE_CHECKS
1162 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)
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 >())
void SetCallAsFunctionHandler(FunctionCallback callback, Local< Value > data=Local< Value >())
void SealAndPrepareForPromotionToReadOnly()
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)
V8_INLINE void Set(Isolate *isolate, const char *name, Local< Data > value, PropertyAttribute attributes=None)
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)
@ 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_DEPRECATE_SOON(message)
#define V8_WARN_UNUSED_RESULT