Index: src/ia32/lithium-codegen-ia32.cc |
=================================================================== |
--- src/ia32/lithium-codegen-ia32.cc (revision 8763) |
+++ src/ia32/lithium-codegen-ia32.cc (working copy) |
@@ -1393,9 +1393,13 @@ |
} else { |
ASSERT(r.IsTagged()); |
Register reg = ToRegister(instr->InputAt(0)); |
- if (instr->hydrogen()->value()->type().IsBoolean()) { |
+ HType type = instr->hydrogen()->value()->type(); |
+ if (type.IsBoolean()) { |
__ cmp(reg, factory()->true_value()); |
EmitBranch(true_block, false_block, equal); |
+ } else if (type.IsSmi()) { |
+ __ test(reg, Operand(reg)); |
+ EmitBranch(true_block, false_block, not_equal); |
} else { |
Label* true_label = chunk_->GetAssemblyLabel(true_block); |
Label* false_label = chunk_->GetAssemblyLabel(false_block); |