| Index: runtime/vm/intermediate_language_ia32.cc
|
| diff --git a/runtime/vm/intermediate_language_ia32.cc b/runtime/vm/intermediate_language_ia32.cc
|
| index 88fd0fc06b20ab8a73e385d3297cf70e0d804d7e..843e5cacca7d8e4b65174828595043585efb5c2c 100644
|
| --- a/runtime/vm/intermediate_language_ia32.cc
|
| +++ b/runtime/vm/intermediate_language_ia32.cc
|
| @@ -732,9 +732,9 @@ static void EmitUnboxedMintComparisonOp(FlowGraphCompiler* compiler,
|
| __ pextrd(right_tmp, right, Immediate(1));
|
| __ cmpl(left_tmp, right_tmp);
|
| if (branch != NULL) {
|
| - __ j(hi_cond, compiler->GetBlockLabel(branch->true_successor()));
|
| + __ j(hi_cond, compiler->GetJumpLabel(branch->true_successor()));
|
| __ j(FlowGraphCompiler::FlipCondition(hi_cond),
|
| - compiler->GetBlockLabel(branch->false_successor()));
|
| + compiler->GetJumpLabel(branch->false_successor()));
|
| } else {
|
| __ j(hi_cond, &is_true);
|
| __ j(FlowGraphCompiler::FlipCondition(hi_cond), &is_false);
|
| @@ -3293,8 +3293,8 @@ void GotoInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
|
|
|
| // We can fall through if the successor is the next block in the list.
|
| // Otherwise, we need a jump.
|
| - if (!compiler->IsNextBlock(successor())) {
|
| - __ jmp(compiler->GetBlockLabel(successor()));
|
| + if (!compiler->CanFallThroughTo(successor())) {
|
| + __ jmp(compiler->GetJumpLabel(successor()));
|
| }
|
| }
|
|
|
| @@ -3321,25 +3321,29 @@ static Condition NegateCondition(Condition condition) {
|
|
|
| void ControlInstruction::EmitBranchOnValue(FlowGraphCompiler* compiler,
|
| bool value) {
|
| - if (value && compiler->IsNextBlock(false_successor())) {
|
| - __ jmp(compiler->GetBlockLabel(true_successor()));
|
| - } else if (!value && compiler->IsNextBlock(true_successor())) {
|
| - __ jmp(compiler->GetBlockLabel(false_successor()));
|
| + if (value && !compiler->CanFallThroughTo(true_successor())) {
|
| + __ jmp(compiler->GetJumpLabel(true_successor()));
|
| + } else if (!value && !compiler->CanFallThroughTo(false_successor())) {
|
| + __ jmp(compiler->GetJumpLabel(false_successor()));
|
| }
|
| }
|
|
|
|
|
| void ControlInstruction::EmitBranchOnCondition(FlowGraphCompiler* compiler,
|
| Condition true_condition) {
|
| - if (compiler->IsNextBlock(false_successor())) {
|
| + if (compiler->CanFallThroughTo(false_successor())) {
|
| // If the next block is the false successor we will fall through to it.
|
| - __ j(true_condition, compiler->GetBlockLabel(true_successor()));
|
| + __ j(true_condition, compiler->GetJumpLabel(true_successor()));
|
| } else {
|
| // If the next block is the true successor we negate comparison and fall
|
| // through to it.
|
| - ASSERT(compiler->IsNextBlock(true_successor()));
|
| Condition false_condition = NegateCondition(true_condition);
|
| - __ j(false_condition, compiler->GetBlockLabel(false_successor()));
|
| + __ j(false_condition, compiler->GetJumpLabel(false_successor()));
|
| +
|
| + // Fall through or jump to the true successor.
|
| + if (!compiler->CanFallThroughTo(true_successor())) {
|
| + __ jmp(compiler->GetJumpLabel(true_successor()));
|
| + }
|
| }
|
| }
|
|
|
|
|