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 425ac7ea80f6b50c521b18e95af75fc03b527c9d..b273fd516bb54d0005bbf5711168968501ae034f 100644 |
--- a/src/crankshaft/ppc/lithium-codegen-ppc.cc |
+++ b/src/crankshaft/ppc/lithium-codegen-ppc.cc |
@@ -4429,7 +4429,15 @@ void LCodeGen::DoDeferredMaybeGrowElements(LMaybeGrowElements* instr) { |
LOperand* key = instr->key(); |
if (key->IsConstantOperand()) { |
- __ LoadSmiLiteral(r6, ToSmi(LConstantOperand::cast(key))); |
+ LConstantOperand* constant_key = LConstantOperand::cast(key); |
+ int32_t int_key = ToInteger32(constant_key); |
+ 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"); |
+ } |
} else { |
__ SmiTag(r6, ToRegister(key)); |
} |