| Index: src/ia32/lithium-ia32.cc
 | 
| diff --git a/src/ia32/lithium-ia32.cc b/src/ia32/lithium-ia32.cc
 | 
| index 885b2e304e3a57b8cb473a02ed61a069379ac017..e5324fc606a353c93c24e475c788403368b163bd 100644
 | 
| --- a/src/ia32/lithium-ia32.cc
 | 
| +++ b/src/ia32/lithium-ia32.cc
 | 
| @@ -1060,6 +1060,8 @@ 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();
 | 
| @@ -1068,12 +1070,17 @@ LInstruction* LChunkBuilder::DoBranch(HBranch* instr) {
 | 
|      return new(zone()) LBranch(UseRegister(value), NULL);
 | 
|    }
 | 
|  
 | 
| -  ToBooleanStub::Types expected = instr->expected_input_types();
 | 
| +  bool needs_temp = expected.NeedsMap() || expected.IsEmpty();
 | 
| +  LOperand* temp = needs_temp ? TempRegister() : NULL;
 | 
| +
 | 
| +  // The Generic stub does not have a deopt, so we need no environment.
 | 
| +  if (expected.IsGeneric()) {
 | 
| +    return new(zone()) LBranch(UseRegister(value), temp);
 | 
| +  }
 | 
| +
 | 
|    // 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).
 | 
| -  bool needs_temp = expected.NeedsMap() || expected.IsEmpty();
 | 
| -  LOperand* temp = needs_temp ? TempRegister() : NULL;
 | 
|    return AssignEnvironment(new(zone()) LBranch(UseRegister(value), temp));
 | 
|  }
 | 
|  
 | 
| 
 |