Index: src/arm/lithium-codegen-arm.cc |
diff --git a/src/arm/lithium-codegen-arm.cc b/src/arm/lithium-codegen-arm.cc |
index 1e4f5f50d7f9c85658c08c4ddd06697476150f4b..683853faa181084d94af1f18a5a88ddf24177ee8 100644 |
--- a/src/arm/lithium-codegen-arm.cc |
+++ b/src/arm/lithium-codegen-arm.cc |
@@ -4235,10 +4235,15 @@ 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()); |
+ |
__ ldr(r3, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); |
__ ldr(r3, FieldMemOperand(r3, JSFunction::kLiteralsOffset)); |
__ mov(r2, Operand(Smi::FromInt(instr->hydrogen()->literal_index()))); |
- __ mov(r1, Operand(instr->hydrogen()->constant_elements())); |
+ __ mov(r1, Operand(constant_elements)); |
__ Push(r3, r2, r1); |
// Pick the right runtime function or stub to call. |
@@ -4255,7 +4260,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); |
} |