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..679a0a409493936d22018074e8f9bbd0bcf6574f 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,14 @@ void LCodeGen::DoSmiUntag(LSmiUntag* instr) { |
if (instr->needs_check()) { |
__ test(ToRegister(input), Immediate(kSmiTagMask)); |
DeoptimizeIf(not_zero, instr->environment()); |
+ } else { |
+#if DEBUG |
Florian Schneider
2012/06/12 09:01:13
We usually use FLAG_debug_code to emit assertion i
danno
2012/06/12 09:59:22
Done.
|
+ Label ok; |
+ __ test(ToRegister(input), Immediate(kSmiTagMask)); |
+ __ j(zero, &ok, Label::kNear); |
+ __ int3(); |
+ __ bind(&ok); |
Florian Schneider
2012/06/12 09:01:13
You could replace this block of instructions with:
danno
2012/06/12 09:59:22
Done.
|
+#endif |
} |
__ SmiUntag(ToRegister(input)); |
} |