Index: src/x64/lithium-codegen-x64.cc |
diff --git a/src/x64/lithium-codegen-x64.cc b/src/x64/lithium-codegen-x64.cc |
index e9b056c022d459ed3eed53b2d3397639b77fd7b4..391affe60478bd4238cfee22fa09d6e2a081f792 100644 |
--- a/src/x64/lithium-codegen-x64.cc |
+++ b/src/x64/lithium-codegen-x64.cc |
@@ -3859,6 +3859,11 @@ void LCodeGen::DoCheckPrototypeMaps(LCheckPrototypeMaps* instr) { |
void LCodeGen::DoArrayLiteral(LArrayLiteral* instr) { |
+ Handle<FixedArray> constant_elements = instr->hydrogen()->constant_elements(); |
+ ASSERT_EQ(2, constant_elements->length()); |
+ ElementsKind constant_elements_kind = |
+ static_cast<ElementsKind>(Smi::cast(constant_elements->get(0))->value()); |
+ |
// Setup the parameters to the stub/runtime call. |
__ movq(rax, Operand(rbp, JavaScriptFrameConstants::kFunctionOffset)); |
__ push(FieldOperand(rax, JSFunction::kLiteralsOffset)); |
@@ -3879,7 +3884,9 @@ void LCodeGen::DoArrayLiteral(LArrayLiteral* instr) { |
CallRuntime(Runtime::kCreateArrayLiteralShallow, 3, instr); |
} else { |
FastCloneShallowArrayStub::Mode mode = |
- FastCloneShallowArrayStub::CLONE_ELEMENTS; |
+ constant_elements_kind == FAST_DOUBLE_ELEMENTS |
+ ? FastCloneShallowArrayStub::CLONE_DOUBLE_ELEMENTS |
+ : FastCloneShallowArrayStub::CLONE_ELEMENTS; |
FastCloneShallowArrayStub stub(mode, length); |
CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); |
} |