| Index: src/x64/lithium-x64.cc
|
| diff --git a/src/x64/lithium-x64.cc b/src/x64/lithium-x64.cc
|
| index 980cb2112825a5d2969a1ea024120946efbf3c72..19b4945e8cc3738218db4361dee7f34db283f638 100644
|
| --- a/src/x64/lithium-x64.cc
|
| +++ b/src/x64/lithium-x64.cc
|
| @@ -1014,10 +1014,12 @@ 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. Except in the Generic case.
|
| + 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;
|
|
|