@@ -359,10 +359,10 @@ namespace {
359359// Non-construct case.
360360V8_NOINLINE Handle<SharedFunctionInfo> SimpleCreateSharedFunctionInfo (
361361 Isolate* isolate, Builtins::Name builtin_id, Handle<String> name, int len) {
362- Handle<Code> code = isolate->builtins ()->builtin_handle (builtin_id);
363362 const bool kNotConstructor = false ;
364- Handle<SharedFunctionInfo> shared = isolate->factory ()->NewSharedFunctionInfo (
365- name, code, kNotConstructor , kNormalFunction , builtin_id);
363+ Handle<SharedFunctionInfo> shared =
364+ isolate->factory ()->NewSharedFunctionInfoForBuiltin (
365+ name, builtin_id, kNotConstructor , kNormalFunction );
366366 shared->set_internal_formal_parameter_count (len);
367367 shared->set_length (len);
368368 return shared;
@@ -373,10 +373,10 @@ V8_NOINLINE Handle<SharedFunctionInfo>
373373SimpleCreateConstructorSharedFunctionInfo (Isolate* isolate,
374374 Builtins::Name builtin_id,
375375 Handle<String> name, int len) {
376- Handle<Code> code = isolate->builtins ()->builtin_handle (builtin_id);
377376 const bool kIsConstructor = true ;
378- Handle<SharedFunctionInfo> shared = isolate->factory ()->NewSharedFunctionInfo (
379- name, code, kIsConstructor , kNormalFunction , builtin_id);
377+ Handle<SharedFunctionInfo> shared =
378+ isolate->factory ()->NewSharedFunctionInfoForBuiltin (
379+ name, builtin_id, kIsConstructor , kNormalFunction );
380380 shared->SetConstructStub (*BUILTIN_CODE (isolate, JSBuiltinsConstructStub));
381381 shared->set_internal_formal_parameter_count (len);
382382 shared->set_length (len);
@@ -402,22 +402,21 @@ V8_NOINLINE Handle<JSFunction> CreateFunction(
402402 Isolate* isolate, Handle<String> name, InstanceType type, int instance_size,
403403 int inobject_properties, MaybeHandle<Object> maybe_prototype,
404404 Builtins::Name builtin_id) {
405- Handle<Code> code (isolate->builtins ()->builtin (builtin_id));
406405 Handle<Object> prototype;
407406 Handle<JSFunction> result;
408407
409408 if (maybe_prototype.ToHandle (&prototype)) {
410409 NewFunctionArgs args = NewFunctionArgs::ForBuiltinWithPrototype (
411- name, code, prototype, type, instance_size, inobject_properties,
412- builtin_id, IMMUTABLE);
410+ name, prototype, type, instance_size, inobject_properties, builtin_id ,
411+ IMMUTABLE);
413412
414413 result = isolate->factory ()->NewFunction (args);
415414 // Make the JSFunction's prototype object fast.
416415 JSObject::MakePrototypesFast (handle (result->prototype (), isolate),
417416 kStartAtReceiver , isolate);
418417 } else {
419418 NewFunctionArgs args = NewFunctionArgs::ForBuiltinWithoutPrototype (
420- name, code, builtin_id, LanguageMode::kStrict );
419+ name, builtin_id, LanguageMode::kStrict );
421420 result = isolate->factory ()->NewFunction (args);
422421 }
423422
@@ -608,10 +607,8 @@ Handle<JSFunction> Genesis::CreateEmptyFunction(Isolate* isolate) {
608607
609608 // Allocate the empty function as the prototype for function according to
610609 // ES#sec-properties-of-the-function-prototype-object
611- Handle<Code> code (BUILTIN_CODE (isolate, EmptyFunction));
612- NewFunctionArgs args =
613- NewFunctionArgs::ForBuiltin (factory->empty_string (), code,
614- empty_function_map, Builtins::kEmptyFunction );
610+ NewFunctionArgs args = NewFunctionArgs::ForBuiltin (
611+ factory->empty_string (), empty_function_map, Builtins::kEmptyFunction );
615612 Handle<JSFunction> empty_function = factory->NewFunction (args);
616613
617614 // --- E m p t y ---
@@ -663,9 +660,8 @@ Handle<JSFunction> Genesis::GetThrowTypeErrorIntrinsic() {
663660 return restricted_properties_thrower_;
664661 }
665662 Handle<String> name (factory ()->empty_string ());
666- Handle<Code> code = BUILTIN_CODE (isolate (), StrictPoisonPillThrower);
667663 NewFunctionArgs args = NewFunctionArgs::ForBuiltinWithoutPrototype (
668- name, code, Builtins::kStrictPoisonPillThrower , i::LanguageMode::kStrict );
664+ name, Builtins::kStrictPoisonPillThrower , i::LanguageMode::kStrict );
669665 Handle<JSFunction> function = factory ()->NewFunction (args);
670666 function->shared ()->DontAdaptArguments ();
671667
@@ -1228,11 +1224,10 @@ Handle<JSGlobalObject> Genesis::CreateNewGlobals(
12281224
12291225 if (js_global_object_template.is_null ()) {
12301226 Handle<String> name (factory ()->empty_string ());
1231- Handle<Code> code = BUILTIN_CODE (isolate (), Illegal);
12321227 Handle<JSObject> prototype =
12331228 factory ()->NewFunctionPrototype (isolate ()->object_function ());
12341229 NewFunctionArgs args = NewFunctionArgs::ForBuiltinWithPrototype (
1235- name, code, prototype, JS_GLOBAL_OBJECT_TYPE, JSGlobalObject::kSize , 0 ,
1230+ name, prototype, JS_GLOBAL_OBJECT_TYPE, JSGlobalObject::kSize , 0 ,
12361231 Builtins::kIllegal , MUTABLE);
12371232 js_global_object_function = factory ()->NewFunction (args);
12381233#ifdef DEBUG
@@ -1261,9 +1256,8 @@ Handle<JSGlobalObject> Genesis::CreateNewGlobals(
12611256 Handle<JSFunction> global_proxy_function;
12621257 if (global_proxy_template.IsEmpty ()) {
12631258 Handle<String> name (factory ()->empty_string ());
1264- Handle<Code> code = BUILTIN_CODE (isolate (), Illegal);
12651259 NewFunctionArgs args = NewFunctionArgs::ForBuiltinWithPrototype (
1266- name, code, factory ()->the_hole_value (), JS_GLOBAL_PROXY_TYPE,
1260+ name, factory ()->the_hole_value (), JS_GLOBAL_PROXY_TYPE,
12671261 JSGlobalProxy::SizeWithEmbedderFields (0 ), 0 , Builtins::kIllegal ,
12681262 MUTABLE);
12691263 global_proxy_function = factory ()->NewFunction (args);
@@ -1399,11 +1393,9 @@ static void InstallError(Isolate* isolate, Handle<JSObject> global,
13991393namespace {
14001394
14011395void InstallMakeError (Isolate* isolate, int builtin_id, int context_index) {
1402- Handle<Code> code (isolate->builtins ()->builtin (builtin_id));
14031396 NewFunctionArgs args = NewFunctionArgs::ForBuiltinWithPrototype (
1404- isolate->factory ()->empty_string (), code,
1405- isolate->factory ()->the_hole_value (), JS_OBJECT_TYPE,
1406- JSObject::kHeaderSize , 0 , builtin_id, MUTABLE);
1397+ isolate->factory ()->empty_string (), isolate->factory ()->the_hole_value (),
1398+ JS_OBJECT_TYPE, JSObject::kHeaderSize , 0 , builtin_id, MUTABLE);
14071399
14081400 Handle<JSFunction> function = isolate->factory ()->NewFunction (args);
14091401 function->shared ()->DontAdaptArguments ();
@@ -3281,10 +3273,9 @@ void Genesis::InitializeGlobal(Handle<JSGlobalObject> global_object,
32813273 proxy_function_map->SetInObjectUnusedPropertyFields (unused_property_fields);
32823274
32833275 Handle<String> name = factory->Proxy_string ();
3284- Handle<Code> code (BUILTIN_CODE (isolate, ProxyConstructor));
32853276
32863277 NewFunctionArgs args = NewFunctionArgs::ForBuiltin (
3287- name, code, proxy_function_map, Builtins::kProxyConstructor );
3278+ name, proxy_function_map, Builtins::kProxyConstructor );
32883279 Handle<JSFunction> proxy_function = factory->NewFunction (args);
32893280
32903281 JSFunction::SetInitialMap (proxy_function, isolate->proxy_map (),
@@ -3388,9 +3379,9 @@ void Genesis::InitializeGlobal(Handle<JSGlobalObject> global_object,
33883379 { // --- sloppy arguments map
33893380 Handle<String> arguments_string = factory->Arguments_string ();
33903381 NewFunctionArgs args = NewFunctionArgs::ForBuiltinWithPrototype (
3391- arguments_string, BUILTIN_CODE ( isolate, Illegal ),
3392- isolate-> initial_object_prototype (), JS_ARGUMENTS_TYPE ,
3393- JSSloppyArgumentsObject:: kSize , 2 , Builtins::kIllegal , MUTABLE);
3382+ arguments_string, isolate-> initial_object_prototype ( ),
3383+ JS_ARGUMENTS_TYPE, JSSloppyArgumentsObject:: kSize , 2 ,
3384+ Builtins::kIllegal , MUTABLE);
33943385 Handle<JSFunction> function = factory->NewFunction (args);
33953386 Handle<Map> map (function->initial_map ());
33963387
0 commit comments