Index: src/crankshaft/arm/lithium-codegen-arm.cc |
diff --git a/src/crankshaft/arm/lithium-codegen-arm.cc b/src/crankshaft/arm/lithium-codegen-arm.cc |
index 5d32e1c9aed87fae4c78fbb947b52b55902a0adb..89d5e5d466a3e05410f7beeed9bcbb3d51ebc403 100644 |
--- a/src/crankshaft/arm/lithium-codegen-arm.cc |
+++ b/src/crankshaft/arm/lithium-codegen-arm.cc |
@@ -4045,13 +4045,17 @@ void LCodeGen::DoDeferredMaybeGrowElements(LMaybeGrowElements* instr) { |
if (Smi::IsValid(int_key)) { |
__ mov(r3, Operand(Smi::FromInt(int_key))); |
} else { |
- // We should never get here at runtime because there is a smi check on |
- // the key before this point. |
- __ stop("expected smi"); |
+ Abort(kArrayIndexConstantValueTooBig); |
} |
} else { |
- __ Move(r3, ToRegister(key)); |
- __ SmiTag(r3); |
+ Label is_smi; |
+ __ SmiTag(r3, ToRegister(key), SetCC); |
+ // Deopt if the key is outside Smi range. The stub expects Smi and would |
+ // bump the elements into dictionary mode (and trigger a deopt) anyways. |
+ __ b(vc, &is_smi); |
+ __ PopSafepointRegisters(); |
+ DeoptimizeIf(al, instr, DeoptimizeReason::kOverflow); |
+ __ bind(&is_smi); |
} |
GrowArrayElementsStub stub(isolate(), instr->hydrogen()->kind()); |