@@ -392,6 +392,25 @@ void SetMethod(v8::Isolate* isolate,
392392 that->Set (name_string, t);
393393}
394394
395+ void SetFastMethod (Isolate* isolate,
396+ Local<Template> that,
397+ const char * name,
398+ v8::FunctionCallback slow_callback,
399+ const v8::CFunction* c_function) {
400+ Local<v8::FunctionTemplate> t =
401+ NewFunctionTemplate (isolate,
402+ slow_callback,
403+ Local<v8::Signature>(),
404+ v8::ConstructorBehavior::kThrow ,
405+ v8::SideEffectType::kHasSideEffect ,
406+ c_function);
407+ // kInternalized strings are created in the old space.
408+ const v8::NewStringType type = v8::NewStringType::kInternalized ;
409+ Local<v8::String> name_string =
410+ v8::String::NewFromUtf8 (isolate, name, type).ToLocalChecked ();
411+ that->Set (name_string, t);
412+ }
413+
395414void SetFastMethod (Local<v8::Context> context,
396415 Local<v8::Object> that,
397416 const char * name,
@@ -434,6 +453,25 @@ void SetFastMethodNoSideEffect(Local<v8::Context> context,
434453 that->Set (context, name_string, function).Check ();
435454}
436455
456+ void SetFastMethodNoSideEffect (Isolate* isolate,
457+ Local<Template> that,
458+ const char * name,
459+ v8::FunctionCallback slow_callback,
460+ const v8::CFunction* c_function) {
461+ Local<v8::FunctionTemplate> t =
462+ NewFunctionTemplate (isolate,
463+ slow_callback,
464+ Local<v8::Signature>(),
465+ v8::ConstructorBehavior::kThrow ,
466+ v8::SideEffectType::kHasNoSideEffect ,
467+ c_function);
468+ // kInternalized strings are created in the old space.
469+ const v8::NewStringType type = v8::NewStringType::kInternalized ;
470+ Local<v8::String> name_string =
471+ v8::String::NewFromUtf8 (isolate, name, type).ToLocalChecked ();
472+ that->Set (name_string, t);
473+ }
474+
437475void SetMethodNoSideEffect (Local<v8::Context> context,
438476 Local<v8::Object> that,
439477 const char * name,
@@ -455,6 +493,23 @@ void SetMethodNoSideEffect(Local<v8::Context> context,
455493 function->SetName (name_string); // NODE_SET_METHOD() compatibility.
456494}
457495
496+ void SetMethodNoSideEffect (Isolate* isolate,
497+ Local<v8::Template> that,
498+ const char * name,
499+ v8::FunctionCallback callback) {
500+ Local<v8::FunctionTemplate> t =
501+ NewFunctionTemplate (isolate,
502+ callback,
503+ Local<v8::Signature>(),
504+ v8::ConstructorBehavior::kThrow ,
505+ v8::SideEffectType::kHasNoSideEffect );
506+ // kInternalized strings are created in the old space.
507+ const v8::NewStringType type = v8::NewStringType::kInternalized ;
508+ Local<v8::String> name_string =
509+ v8::String::NewFromUtf8 (isolate, name, type).ToLocalChecked ();
510+ that->Set (name_string, t);
511+ }
512+
458513void SetProtoMethod (v8::Isolate* isolate,
459514 Local<v8::FunctionTemplate> that,
460515 const char * name,
0 commit comments