Index: src/code-stubs.cc |
diff --git a/src/code-stubs.cc b/src/code-stubs.cc |
index e60e5610224eb2554ba1db02ddb8351750e8ad78..72e99263f19c3e61b533a33102849c586280183f 100644 |
--- a/src/code-stubs.cc |
+++ b/src/code-stubs.cc |
@@ -4265,12 +4265,27 @@ void ArrayNoArgumentConstructorStub::GenerateAssembly( |
? assembler->Parameter( |
ArrayNoArgumentConstructorDescriptor::kAllocationSiteIndex) |
: nullptr; |
- Node* array = assembler->AllocateJSArray(elements_kind(), native_context, |
+ Node* array_map = |
+ assembler->LoadJSArrayElementsMap(elements_kind(), native_context); |
+ Node* array = assembler->AllocateJSArray(elements_kind(), array_map, |
JSArray::kPreallocatedArrayElements, |
0, allocation_site); |
assembler->Return(array); |
} |
+void InternalArrayNoArgumentConstructorStub::GenerateAssembly( |
+ CodeStubAssembler* assembler) const { |
+ typedef compiler::Node Node; |
+ Node* array_map = assembler->LoadObjectField( |
+ assembler->Parameter( |
+ ArrayNoArgumentConstructorDescriptor::kFunctionIndex), |
+ JSFunction::kPrototypeOrInitialMapOffset); |
+ Node* array = assembler->AllocateJSArray(elements_kind(), array_map, |
+ JSArray::kPreallocatedArrayElements, |
+ 0, nullptr); |
+ assembler->Return(array); |
+} |
+ |
ArrayConstructorStub::ArrayConstructorStub(Isolate* isolate) |
: PlatformCodeStub(isolate) { |
minor_key_ = ArgumentCountBits::encode(ANY); |