Index: src/mips/lithium-codegen-mips.cc |
diff --git a/src/mips/lithium-codegen-mips.cc b/src/mips/lithium-codegen-mips.cc |
index 2073d04d9e924e7400e3987ae78f37b9043b1295..932f6aaef662393f20c6b27ef86944e4c23dbffd 100644 |
--- a/src/mips/lithium-codegen-mips.cc |
+++ b/src/mips/lithium-codegen-mips.cc |
@@ -2510,8 +2510,13 @@ void LCodeGen::DoLoadKeyedFastElement(LLoadKeyedFastElement* instr) { |
// Check for the hole value. |
if (instr->hydrogen()->RequiresHoleCheck()) { |
- __ LoadRoot(scratch, Heap::kTheHoleValueRootIndex); |
- DeoptimizeIf(eq, instr->environment(), result, Operand(scratch)); |
+ if (IsFastSmiElementsKind(instr->hydrogen()->elements_kind())) { |
+ __ And(scratch, result, Operand(kSmiTagMask)); |
+ DeoptimizeIf(ne, instr->environment(), scratch, Operand(zero_reg)); |
+ } else { |
+ __ LoadRoot(scratch, Heap::kTheHoleValueRootIndex); |
+ DeoptimizeIf(eq, instr->environment(), result, Operand(scratch)); |
+ } |
} |
} |