Commit 580980de authored by Jakob Gruber's avatar Jakob Gruber Committed by Commit Bot

[factory] Remove unneeded JSFunctionBuilder::set_map calls

.. in which the given map already matched the default map provided by
SharedFunctionInfo::function_map_index().

Bug: v8:8888,v8:11147
Change-Id: I43f51219e1c9534760c653049ac64bc6021c6a75
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2530876
Auto-Submit: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: 's avatarClemens Backes <clemensb@chromium.org>
Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71107}
parent 2d3d3821
......@@ -168,7 +168,6 @@ BUILTIN(ConsoleContext) {
Handle<JSFunction> cons =
Factory::JSFunctionBuilder{isolate, info, isolate->native_context()}
.set_map(isolate->sloppy_function_map())
.Build();
Handle<JSObject> prototype = factory->NewJSObject(isolate->object_function());
......
......@@ -3461,7 +3461,6 @@ Handle<JSFunction> Factory::NewFunctionForTesting(Handle<String> name) {
NewSharedFunctionInfoForBuiltin(name, Builtins::kIllegal);
info->set_language_mode(LanguageMode::kSloppy);
return JSFunctionBuilder{isolate(), info, isolate()->native_context()}
.set_map(isolate()->sloppy_function_map())
.Build();
}
......
......@@ -2800,9 +2800,7 @@ void Genesis::InitializeGlobal(Handle<JSGlobalObject> global_object,
info->set_language_mode(LanguageMode::kStrict);
Handle<JSFunction> cons =
Factory::JSFunctionBuilder{isolate(), info, context}
.set_map(isolate()->strict_function_map())
.Build();
Factory::JSFunctionBuilder{isolate(), info, context}.Build();
Handle<JSObject> empty = factory->NewJSObject(isolate_->object_function());
JSFunction::SetPrototype(cons, empty);
......
......@@ -2099,9 +2099,8 @@ void WasmJs::Install(Isolate* isolate, bool exposed_on_global_object) {
factory->NewSharedFunctionInfoForBuiltin(name, Builtins::kIllegal);
info->set_language_mode(LanguageMode::kStrict);
Handle<JSFunction> cons = Factory::JSFunctionBuilder{isolate, info, context}
.set_map(isolate->strict_function_map())
.Build();
Handle<JSFunction> cons =
Factory::JSFunctionBuilder{isolate, info, context}.Build();
JSFunction::SetPrototype(cons, isolate->initial_object_prototype());
Handle<JSObject> webassembly =
factory->NewJSObject(cons, AllocationType::kOld);
......
......@@ -142,9 +142,7 @@ TEST(StressJS) {
factory->function_string(), Builtins::kEmptyFunction);
info->set_language_mode(LanguageMode::kStrict);
Handle<JSFunction> function =
Factory::JSFunctionBuilder{isolate, info, context}
.set_map(isolate->sloppy_function_map())
.Build();
Factory::JSFunctionBuilder{isolate, info, context}.Build();
CHECK(!function->shared().construct_as_builtin());
// Force the creation of an initial map.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment