Index: src/arm/lithium-codegen-arm.cc |
diff --git a/src/arm/lithium-codegen-arm.cc b/src/arm/lithium-codegen-arm.cc |
index f8e5192a2d8ac6f19e6060013d3ae76d1f8404bb..253c63dfbed47476acb2d01b63b43863d45a7ac0 100644 |
--- a/src/arm/lithium-codegen-arm.cc |
+++ b/src/arm/lithium-codegen-arm.cc |
@@ -4178,8 +4178,26 @@ void LCodeGen::DoCallNewArray(LCallNewArray* instr) { |
ArrayNoArgumentConstructorStub stub(kind, disable_allocation_sites); |
CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); |
} else if (instr->arity() == 1) { |
+ Label done; |
+ if (IsFastPackedElementsKind(kind)) { |
+ Label packed_case; |
+ // We might need a change here |
+ // look at the first argument |
+ __ ldr(r5, MemOperand(sp, 0)); |
+ __ cmp(r5, Operand::Zero()); |
+ __ b(eq, &packed_case); |
+ |
+ ElementsKind holey_kind = GetHoleyElementsKind(kind); |
+ ArraySingleArgumentConstructorStub stub(holey_kind, |
+ disable_allocation_sites); |
+ CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); |
+ __ jmp(&done); |
+ __ bind(&packed_case); |
+ } |
+ |
ArraySingleArgumentConstructorStub stub(kind, disable_allocation_sites); |
CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); |
+ __ bind(&done); |
} else { |
ArrayNArgumentsConstructorStub stub(kind, disable_allocation_sites); |
CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); |