Index: src/ia32/lithium-codegen-ia32.cc |
diff --git a/src/ia32/lithium-codegen-ia32.cc b/src/ia32/lithium-codegen-ia32.cc |
index edcd8fc4da276ba0600e485540c4e3052fdf9319..4c8b963df98ca1f899a9ad6f9caf51f10b591f57 100644 |
--- a/src/ia32/lithium-codegen-ia32.cc |
+++ b/src/ia32/lithium-codegen-ia32.cc |
@@ -2435,8 +2435,13 @@ void LCodeGen::DoLoadKeyedFastElement(LLoadKeyedFastElement* instr) { |
// Check for the hole value. |
if (instr->hydrogen()->RequiresHoleCheck()) { |
- __ cmp(result, factory()->the_hole_value()); |
- DeoptimizeIf(equal, instr->environment()); |
+ if (IsFastSmiElementsKind(instr->hydrogen()->elements_kind())) { |
+ __ test(result, Immediate(kSmiTagMask)); |
+ DeoptimizeIf(not_equal, instr->environment()); |
+ } else { |
+ __ cmp(result, factory()->the_hole_value()); |
+ DeoptimizeIf(equal, instr->environment()); |
+ } |
} |
} |
@@ -3874,6 +3879,10 @@ void LCodeGen::DoSmiUntag(LSmiUntag* instr) { |
if (instr->needs_check()) { |
__ test(ToRegister(input), Immediate(kSmiTagMask)); |
DeoptimizeIf(not_zero, instr->environment()); |
+ } else { |
+ if (FLAG_debug_code) { |
+ __ AbortIfNotSmi(ToRegister(input)); |
+ } |
} |
__ SmiUntag(ToRegister(input)); |
} |