Index: src/x64/lithium-codegen-x64.cc |
diff --git a/src/x64/lithium-codegen-x64.cc b/src/x64/lithium-codegen-x64.cc |
index d5cbab4fab4565a9f29dd52ebca50cdc5757842f..2f0816226f88ee24c43380553f858abe78bcae77 100644 |
--- a/src/x64/lithium-codegen-x64.cc |
+++ b/src/x64/lithium-codegen-x64.cc |
@@ -2389,8 +2389,13 @@ void LCodeGen::DoLoadKeyedFastElement(LLoadKeyedFastElement* instr) { |
// Check for the hole value. |
if (instr->hydrogen()->RequiresHoleCheck()) { |
- __ CompareRoot(result, Heap::kTheHoleValueRootIndex); |
- DeoptimizeIf(equal, instr->environment()); |
+ if (IsFastSmiElementsKind(instr->hydrogen()->elements_kind())) { |
+ Condition smi = __ CheckSmi(result); |
+ DeoptimizeIf(NegateCondition(smi), instr->environment()); |
+ } else { |
+ __ CompareRoot(result, Heap::kTheHoleValueRootIndex); |
+ DeoptimizeIf(equal, instr->environment()); |
+ } |
} |
} |
@@ -3790,6 +3795,14 @@ void LCodeGen::DoSmiUntag(LSmiUntag* instr) { |
if (instr->needs_check()) { |
Condition is_smi = __ CheckSmi(input); |
DeoptimizeIf(NegateCondition(is_smi), instr->environment()); |
+ } else { |
+#if DEBUG |
+ Label ok; |
+ Condition is_smi = __ CheckSmi(input); |
+ __ j(is_smi, &ok, Label::kNear); |
+ __ int3(); |
+ __ bind(&ok); |
+#endif |
} |
__ SmiToInteger32(input, input); |
} |