Commit ab4fe69f authored by Camillo Bruni's avatar Camillo Bruni Committed by Commit Bot

[cleanup] Rename LoadObjectMap to LoadObjectFunctionInitialMap

Bug: v8:10763
Change-Id: I8e8f7924928175516e7ba2500f4660dc160158b2
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2409278Reviewed-by: 's avatarIgor Sheludko <ishell@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#69871}
parent 8a41a706
...@@ -601,7 +601,7 @@ TNode<HeapObject> ConstructorBuiltinsAssembler::CreateShallowObjectLiteral( ...@@ -601,7 +601,7 @@ TNode<HeapObject> ConstructorBuiltinsAssembler::CreateShallowObjectLiteral(
TNode<JSObject> ConstructorBuiltinsAssembler::CreateEmptyObjectLiteral( TNode<JSObject> ConstructorBuiltinsAssembler::CreateEmptyObjectLiteral(
TNode<Context> context) { TNode<Context> context) {
TNode<NativeContext> native_context = LoadNativeContext(context); TNode<NativeContext> native_context = LoadNativeContext(context);
TNode<Map> map = LoadObjectMap(native_context); TNode<Map> map = LoadObjectFunctionInitialMap(native_context);
// Ensure that slack tracking is disabled for the map. // Ensure that slack tracking is disabled for the map.
STATIC_ASSERT(Map::kNoSlackTracking == 0); STATIC_ASSERT(Map::kNoSlackTracking == 0);
CSA_ASSERT(this, IsClearWord32<Map::Bits3::ConstructionCounterBits>( CSA_ASSERT(this, IsClearWord32<Map::Bits3::ConstructionCounterBits>(
......
...@@ -1031,7 +1031,7 @@ TF_BUILTIN(ObjectCreate, ObjectBuiltinsAssembler) { ...@@ -1031,7 +1031,7 @@ TF_BUILTIN(ObjectCreate, ObjectBuiltinsAssembler) {
TNode<Object> prototype = args.GetOptionalArgumentValue(kPrototypeArg); TNode<Object> prototype = args.GetOptionalArgumentValue(kPrototypeArg);
TNode<Object> properties = args.GetOptionalArgumentValue(kPropertiesArg); TNode<Object> properties = args.GetOptionalArgumentValue(kPropertiesArg);
TNode<Context> context = CAST(Parameter(Descriptor::kContext)); TNode<NativeContext> native_context = CAST(Parameter(Descriptor::kContext));
Label call_runtime(this, Label::kDeferred), prototype_valid(this), Label call_runtime(this, Label::kDeferred), prototype_valid(this),
no_properties(this); no_properties(this);
...@@ -1067,13 +1067,13 @@ TF_BUILTIN(ObjectCreate, ObjectBuiltinsAssembler) { ...@@ -1067,13 +1067,13 @@ TF_BUILTIN(ObjectCreate, ObjectBuiltinsAssembler) {
{ {
TVARIABLE(Map, map); TVARIABLE(Map, map);
TVARIABLE(HeapObject, properties); TVARIABLE(HeapObject, properties);
Label non_null_proto(this), instantiate_map(this), good(this); Label null_proto(this), non_null_proto(this), instantiate_map(this);
Branch(IsNull(prototype), &good, &non_null_proto); Branch(IsNull(prototype), &null_proto, &non_null_proto);
BIND(&good); BIND(&null_proto);
{ {
map = LoadObjectWithNullPrototypeMap(context); map = LoadSlowObjectWithNullPrototypeMap(native_context);
properties = AllocateNameDictionary(NameDictionary::kInitialCapacity); properties = AllocateNameDictionary(NameDictionary::kInitialCapacity);
Goto(&instantiate_map); Goto(&instantiate_map);
} }
...@@ -1081,7 +1081,7 @@ TF_BUILTIN(ObjectCreate, ObjectBuiltinsAssembler) { ...@@ -1081,7 +1081,7 @@ TF_BUILTIN(ObjectCreate, ObjectBuiltinsAssembler) {
BIND(&non_null_proto); BIND(&non_null_proto);
{ {
properties = EmptyFixedArrayConstant(); properties = EmptyFixedArrayConstant();
map = LoadObjectMap(context); map = LoadObjectFunctionInitialMap(native_context);
GotoIf(TaggedEqual(prototype, LoadMapPrototype(map.value())), GotoIf(TaggedEqual(prototype, LoadMapPrototype(map.value())),
&instantiate_map); &instantiate_map);
// Try loading the prototype info. // Try loading the prototype info.
...@@ -1105,8 +1105,8 @@ TF_BUILTIN(ObjectCreate, ObjectBuiltinsAssembler) { ...@@ -1105,8 +1105,8 @@ TF_BUILTIN(ObjectCreate, ObjectBuiltinsAssembler) {
BIND(&call_runtime); BIND(&call_runtime);
{ {
TNode<Object> result = TNode<Object> result = CallRuntime(Runtime::kObjectCreate, native_context,
CallRuntime(Runtime::kObjectCreate, context, prototype, properties); prototype, properties);
args.PopAndReturn(result); args.PopAndReturn(result);
} }
} }
......
...@@ -284,7 +284,7 @@ TNode<JSRegExpResult> RegExpBuiltinsAssembler::ConstructNewResultFromMatchInfo( ...@@ -284,7 +284,7 @@ TNode<JSRegExpResult> RegExpBuiltinsAssembler::ConstructNewResultFromMatchInfo(
TNode<IntPtrT> num_properties = WordSar(names_length, 1); TNode<IntPtrT> num_properties = WordSar(names_length, 1);
TNode<NativeContext> native_context = LoadNativeContext(context); TNode<NativeContext> native_context = LoadNativeContext(context);
TNode<Map> map = LoadObjectWithNullPrototypeMap(native_context); TNode<Map> map = LoadSlowObjectWithNullPrototypeMap(native_context);
TNode<NameDictionary> properties = TNode<NameDictionary> properties =
AllocateNameDictionary(num_properties, kAllowLargeObjectAllocation); AllocateNameDictionary(num_properties, kAllowLargeObjectAllocation);
......
...@@ -2520,17 +2520,17 @@ TNode<Context> CodeStubAssembler::LoadModuleContext( ...@@ -2520,17 +2520,17 @@ TNode<Context> CodeStubAssembler::LoadModuleContext(
return UncheckedCast<Context>(cur_context.value()); return UncheckedCast<Context>(cur_context.value());
} }
TNode<Map> CodeStubAssembler::LoadObjectMap(TNode<Context> context) { TNode<Map> CodeStubAssembler::LoadObjectFunctionInitialMap(
TNode<HeapObject> object_function = TNode<NativeContext> native_context) {
CAST(LoadContextElement(context, Context::OBJECT_FUNCTION_INDEX)); TNode<JSFunction> object_function =
return LoadObjectField<Map>(object_function, CAST(LoadContextElement(native_context, Context::OBJECT_FUNCTION_INDEX));
JSFunction::kPrototypeOrInitialMapOffset); return CAST(LoadJSFunctionPrototypeOrInitialMap(object_function));
} }
TNode<Map> CodeStubAssembler::LoadObjectWithNullPrototypeMap( TNode<Map> CodeStubAssembler::LoadSlowObjectWithNullPrototypeMap(
TNode<Context> context) { TNode<NativeContext> native_context) {
TNode<Map> map = CAST(LoadContextElement( TNode<Map> map = CAST(LoadContextElement(
context, Context::SLOW_OBJECT_WITH_NULL_PROTOTYPE_MAP)); native_context, Context::SLOW_OBJECT_WITH_NULL_PROTOTYPE_MAP));
return map; return map;
} }
......
...@@ -1412,8 +1412,10 @@ class V8_EXPORT_PRIVATE CodeStubAssembler ...@@ -1412,8 +1412,10 @@ class V8_EXPORT_PRIVATE CodeStubAssembler
if_equal); if_equal);
} }
TNode<Map> LoadObjectMap(TNode<Context> context); // Loads the initial map of the the Object constructor.
TNode<Map> LoadObjectWithNullPrototypeMap(TNode<Context> context); TNode<Map> LoadObjectFunctionInitialMap(TNode<NativeContext> native_context);
TNode<Map> LoadSlowObjectWithNullPrototypeMap(
TNode<NativeContext> native_context);
TNode<Map> LoadJSArrayElementsMap(ElementsKind kind, TNode<Map> LoadJSArrayElementsMap(ElementsKind kind,
SloppyTNode<NativeContext> native_context); SloppyTNode<NativeContext> native_context);
......
...@@ -4066,7 +4066,7 @@ void AccessorAssembler::GenerateCloneObjectIC_Slow() { ...@@ -4066,7 +4066,7 @@ void AccessorAssembler::GenerateCloneObjectIC_Slow() {
// used. // used.
TNode<NativeContext> native_context = LoadNativeContext(context); TNode<NativeContext> native_context = LoadNativeContext(context);
TNode<Map> initial_map = LoadObjectMap(native_context); TNode<Map> initial_map = LoadObjectFunctionInitialMap(native_context);
TNode<JSObject> result = AllocateJSObjectFromMap(initial_map); TNode<JSObject> result = AllocateJSObjectFromMap(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