| Index: src/x64/lithium-x64.cc
|
| diff --git a/src/x64/lithium-x64.cc b/src/x64/lithium-x64.cc
|
| index b1bc5479bd889adad729cfb1d50e59004b87ad23..5b15cec09f11f2898bcfb6e30ac237b14a4f11b4 100644
|
| --- a/src/x64/lithium-x64.cc
|
| +++ b/src/x64/lithium-x64.cc
|
| @@ -1014,10 +1014,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.
|
| + ToBooleanStub::Types expected = instr->expected_input_types();
|
| Representation rep = value->representation();
|
| HType type = value->type();
|
| - if (rep.IsTagged() && !type.IsSmi() && !type.IsBoolean()) {
|
| + if (rep.IsTagged() && !type.IsSmi() && !type.IsBoolean() &&
|
| + !expected.IsGeneric()) {
|
| return AssignEnvironment(result);
|
| }
|
| return result;
|
|
|