Index: src/ia32/lithium-ia32.cc |
diff --git a/src/ia32/lithium-ia32.cc b/src/ia32/lithium-ia32.cc |
index 706e031d9f21fd13498974c85220dee0402b935d..901b2f2258c8f8d9375d042645a264474d433e45 100644 |
--- a/src/ia32/lithium-ia32.cc |
+++ b/src/ia32/lithium-ia32.cc |
@@ -1060,15 +1060,17 @@ LInstruction* LChunkBuilder::DoBranch(HBranch* instr) { |
return new(zone()) LGoto(successor->block_id()); |
} |
+ ToBooleanStub::Types expected = instr->expected_input_types(); |
+ |
// Untagged integers or doubles, smis and booleans don't require a |
// deoptimization environment nor a temp register. |
Representation rep = value->representation(); |
HType type = value->type(); |
- if (!rep.IsTagged() || type.IsSmi() || type.IsBoolean()) { |
+ if (!rep.IsTagged() || type.IsSmi() || type.IsBoolean() || |
+ expected == ToBooleanStub::all_types()) { |
return new(zone()) LBranch(UseRegister(value), NULL); |
} |
- ToBooleanStub::Types expected = instr->expected_input_types(); |
// We need a temporary register when we have to access the map *or* we have |
// no type info yet, in which case we handle all cases (including the ones |
// involving maps). |