| Index: src/compiler/ia32/code-generator-ia32.cc
|
| diff --git a/src/compiler/ia32/code-generator-ia32.cc b/src/compiler/ia32/code-generator-ia32.cc
|
| index e226aafb908b5f9f32166e794afffa524267db1a..8c619f826c53900e625f80b156e9a46d56835658 100644
|
| --- a/src/compiler/ia32/code-generator-ia32.cc
|
| +++ b/src/compiler/ia32/code-generator-ia32.cc
|
| @@ -195,7 +195,7 @@ void CodeGenerator::AssembleArchInstruction(Instruction* instr) {
|
| break;
|
| }
|
| case kArchJmp:
|
| - __ jmp(GetLabel(i.InputRpo(0)));
|
| + AssembleArchJump(i.InputRpo(0));
|
| break;
|
| case kArchNop:
|
| // don't emit code for nops.
|
| @@ -485,23 +485,14 @@ void CodeGenerator::AssembleArchInstruction(Instruction* instr) {
|
| }
|
|
|
|
|
| -// Assembles branches after an instruction.
|
| -void CodeGenerator::AssembleArchBranch(Instruction* instr,
|
| - FlagsCondition condition) {
|
| +// Assembles a branch after an instruction.
|
| +void CodeGenerator::AssembleArchBranch(Instruction* instr, BranchInfo* branch) {
|
| IA32OperandConverter i(this, instr);
|
| - Label done;
|
| -
|
| - // Emit a branch. The true and false targets are always the last two inputs
|
| - // to the instruction.
|
| - BasicBlock::RpoNumber tblock =
|
| - i.InputRpo(static_cast<int>(instr->InputCount()) - 2);
|
| - BasicBlock::RpoNumber fblock =
|
| - i.InputRpo(static_cast<int>(instr->InputCount()) - 1);
|
| - bool fallthru = IsNextInAssemblyOrder(fblock);
|
| - Label* tlabel = GetLabel(tblock);
|
| - Label* flabel = fallthru ? &done : GetLabel(fblock);
|
| - Label::Distance flabel_distance = fallthru ? Label::kNear : Label::kFar;
|
| - switch (condition) {
|
| + Label::Distance flabel_distance =
|
| + branch->fallthru ? Label::kNear : Label::kFar;
|
| + Label* tlabel = branch->true_label;
|
| + Label* flabel = branch->false_label;
|
| + switch (branch->condition) {
|
| case kUnorderedEqual:
|
| __ j(parity_even, flabel, flabel_distance);
|
| // Fall through.
|
| @@ -557,8 +548,13 @@ void CodeGenerator::AssembleArchBranch(Instruction* instr,
|
| __ j(no_overflow, tlabel);
|
| break;
|
| }
|
| - if (!fallthru) __ jmp(flabel, flabel_distance); // no fallthru to flabel.
|
| - __ bind(&done);
|
| + // Add a jump if not falling through to the next block.
|
| + if (!branch->fallthru) __ jmp(flabel);
|
| +}
|
| +
|
| +
|
| +void CodeGenerator::AssembleArchJump(BasicBlock::RpoNumber target) {
|
| + if (!IsNextInAssemblyOrder(target)) __ jmp(GetLabel(target));
|
| }
|
|
|
|
|
|
|