Index: src/builtins/builtins-object.cc |
diff --git a/src/builtins/builtins-object.cc b/src/builtins/builtins-object.cc |
index 4536fc9b8a23e81bafafb8ad354d3ebac68b38f6..01f5ad45863df21f67a1fbae052206e74cc150db 100644 |
--- a/src/builtins/builtins-object.cc |
+++ b/src/builtins/builtins-object.cc |
@@ -494,6 +494,7 @@ void Builtins::Generate_ObjectCreate(CodeStubAssembler* a) { |
a->Bind(&no_properties); |
{ |
Variable map(a, MachineRepresentation::kTagged); |
+ Variable properties(a, MachineRepresentation::kTagged); |
Label non_null_proto(a), instantiate_map(a), good(a); |
a->Branch(a->WordEqual(prototype, a->NullConstant()), &good, |
@@ -501,13 +502,16 @@ void Builtins::Generate_ObjectCreate(CodeStubAssembler* a) { |
a->Bind(&good); |
{ |
- map.Bind(a->LoadContextElement(context, |
- Context::OBJECT_WITH_NULL_PROTOTYPE_MAP)); |
+ map.Bind(a->LoadContextElement( |
+ context, Context::SLOW_OBJECT_WITH_NULL_PROTOTYPE_MAP)); |
+ properties.Bind( |
+ a->AllocateNameDictionary(NameDictionary::kInitialCapacity)); |
a->Goto(&instantiate_map); |
} |
a->Bind(&non_null_proto); |
{ |
+ properties.Bind(a->EmptyFixedArrayConstant()); |
Node* object_function = |
a->LoadContextElement(context, Context::OBJECT_FUNCTION_INDEX); |
Node* object_function_map = a->LoadObjectField( |
@@ -528,7 +532,8 @@ void Builtins::Generate_ObjectCreate(CodeStubAssembler* a) { |
a->Bind(&instantiate_map); |
{ |
- Node* instance = a->AllocateJSObjectFromMap(map.value()); |
+ Node* instance = |
+ a->AllocateJSObjectFromMap(map.value(), properties.value()); |
a->Return(instance); |
} |
} |