Index: src/crankshaft/ppc/lithium-codegen-ppc.cc |
diff --git a/src/crankshaft/ppc/lithium-codegen-ppc.cc b/src/crankshaft/ppc/lithium-codegen-ppc.cc |
index f870361144063caa6ff9c23dd8aec45869dec247..ac955613f0ebb1750a1a4996ae8533a0acd9410c 100644 |
--- a/src/crankshaft/ppc/lithium-codegen-ppc.cc |
+++ b/src/crankshaft/ppc/lithium-codegen-ppc.cc |
@@ -4354,12 +4354,21 @@ void LCodeGen::DoDeferredMaybeGrowElements(LMaybeGrowElements* instr) { |
if (Smi::IsValid(int_key)) { |
__ LoadSmiLiteral(r6, 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 { |
+ Label is_smi; |
+#if V8_TARGET_ARCH_PPC64 |
__ SmiTag(r6, ToRegister(key)); |
+#else |
+ // 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. |
+ __ SmiTagCheckOverflow(r6, ToRegister(key), r0); |
+ __ BranchOnNoOverflow(&is_smi); |
+ __ PopSafepointRegisters(); |
+ DeoptimizeIf(al, instr, DeoptimizeReason::kOverflow, cr0); |
+ __ bind(&is_smi); |
+#endif |
} |
GrowArrayElementsStub stub(isolate(), instr->hydrogen()->kind()); |