| Index: src/arm/lithium-arm.cc
 | 
| diff --git a/src/arm/lithium-arm.cc b/src/arm/lithium-arm.cc
 | 
| index 1b1294ff30eb15ec0c5e102cca949a7f437857f9..f222c2981f2e2bd3cca7eeddbf76dcbcf32592c1 100644
 | 
| --- a/src/arm/lithium-arm.cc
 | 
| +++ b/src/arm/lithium-arm.cc
 | 
| @@ -999,10 +999,13 @@ LInstruction* LChunkBuilder::DoBranch(HBranch* instr) {
 | 
|  
 | 
|    LBranch* result = new(zone()) LBranch(UseRegister(value));
 | 
|    // Tagged values that are not known smis or booleans require a
 | 
| -  // deoptimization environment.
 | 
| +  // deoptimization environment. If the instruction is generic no
 | 
| +  // environment is needed since all cases are handled.
 | 
|    Representation rep = value->representation();
 | 
|    HType type = value->type();
 | 
| -  if (rep.IsTagged() && !type.IsSmi() && !type.IsBoolean()) {
 | 
| +  ToBooleanStub::Types expected = instr->expected_input_types();
 | 
| +  if (rep.IsTagged() && !type.IsSmi() && !type.IsBoolean() &&
 | 
| +      !expected.IsGeneric()) {
 | 
|      return AssignEnvironment(result);
 | 
|    }
 | 
|    return result;
 | 
| 
 |