| Index: src/arm/lithium-arm.cc
|
| diff --git a/src/arm/lithium-arm.cc b/src/arm/lithium-arm.cc
|
| index ea06064e5ebf2a0827594bc1389ee0bf7e7c9112..1eb4aff2bc7198187e1c36230e9cf6411f0cb10d 100644
|
| --- a/src/arm/lithium-arm.cc
|
| +++ b/src/arm/lithium-arm.cc
|
| @@ -1039,7 +1039,13 @@ LInstruction* LChunkBuilder::DoBranch(HBranch* instr) {
|
| : instr->SecondSuccessor();
|
| return new LGoto(successor->block_id());
|
| }
|
| - return new LBranch(UseRegisterAtStart(v));
|
| + LInstruction* branch = new LBranch(UseRegister(v));
|
| + // When we handle all cases, we never deopt, so we don't need to assign the
|
| + // environment then. Note that we map the "empty" case to the "all" case in
|
| + // the code generator.
|
| + ToBooleanStub::Types types = instr->expected_input_types();
|
| + bool all_cases_handled = types.IsAll() || types.IsEmpty();
|
| + return all_cases_handled ? branch : AssignEnvironment(branch);
|
| }
|
|
|
|
|
|
|