@@ -482,6 +482,53 @@ void SetFastMethodNoSideEffect(Isolate* isolate,
482
482
that->Set (name_string, t);
483
483
}
484
484
485
+ void SetFastMethod (Isolate* isolate,
486
+ Local<Template> that,
487
+ const std::string_view name,
488
+ v8::FunctionCallback slow_callback,
489
+ const v8::MemorySpan<const v8::CFunction>& methods) {
490
+ Local<v8::FunctionTemplate> t = FunctionTemplate::NewWithCFunctionOverloads (
491
+ isolate,
492
+ slow_callback,
493
+ Local<Value>(),
494
+ Local<v8::Signature>(),
495
+ 0 ,
496
+ v8::ConstructorBehavior::kThrow ,
497
+ v8::SideEffectType::kHasSideEffect ,
498
+ methods);
499
+
500
+ // kInternalized strings are created in the old space.
501
+ const v8::NewStringType type = v8::NewStringType::kInternalized ;
502
+ Local<v8::String> name_string =
503
+ v8::String::NewFromUtf8 (isolate, name.data (), type, name.size ())
504
+ .ToLocalChecked ();
505
+ that->Set (name_string, t);
506
+ }
507
+
508
+ void SetFastMethodNoSideEffect (
509
+ Isolate* isolate,
510
+ Local<Template> that,
511
+ const std::string_view name,
512
+ v8::FunctionCallback slow_callback,
513
+ const v8::MemorySpan<const v8::CFunction>& methods) {
514
+ Local<v8::FunctionTemplate> t = FunctionTemplate::NewWithCFunctionOverloads (
515
+ isolate,
516
+ slow_callback,
517
+ Local<Value>(),
518
+ Local<v8::Signature>(),
519
+ 0 ,
520
+ v8::ConstructorBehavior::kThrow ,
521
+ v8::SideEffectType::kHasNoSideEffect ,
522
+ methods);
523
+
524
+ // kInternalized strings are created in the old space.
525
+ const v8::NewStringType type = v8::NewStringType::kInternalized ;
526
+ Local<v8::String> name_string =
527
+ v8::String::NewFromUtf8 (isolate, name.data (), type, name.size ())
528
+ .ToLocalChecked ();
529
+ that->Set (name_string, t);
530
+ }
531
+
485
532
void SetMethodNoSideEffect (Local<v8::Context> context,
486
533
Local<v8::Object> that,
487
534
const std::string_view name,
0 commit comments