Commit 8d2dad2f authored by Yang Guo's avatar Yang Guo Committed by V8 LUCI CQ

Simplify NewJSObjectWithNullProto

Change-Id: I5c8452a0fb5512a007f9b892c81711a30f65344c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3257707
Commit-Queue: Yang Guo <yangguo@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Auto-Submit: Yang Guo <yangguo@chromium.org>
Reviewed-by: 's avatarLeszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77675}
parent a7e9b8f0
......@@ -2309,12 +2309,10 @@ Handle<JSObject> Factory::NewSlowJSObjectWithNullProto() {
}
Handle<JSObject> Factory::NewJSObjectWithNullProto() {
Handle<JSObject> result = NewJSObject(isolate()->object_function());
Handle<Map> new_map = Map::Copy(
isolate(), Handle<Map>(result->map(), isolate()), "ObjectWithNullProto");
Map::SetPrototype(isolate(), new_map, null_value());
JSObject::MigrateToMap(isolate(), result, new_map);
return result;
Handle<Map> map(isolate()->object_function()->initial_map(), isolate());
Handle<Map> map_with_null_proto =
Map::TransitionToPrototype(isolate(), map, null_value());
return NewJSObjectFromMap(map_with_null_proto);
}
Handle<JSGlobalObject> Factory::NewJSGlobalObject(
......
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