Minor suspend check tweak
Rearrange the suspend check branch for unconditional backwards
branches. Now, the conditional branch on rSUSPEND will go directly
to the target in the common case, and fallthrough to an
unconditional branch to the suspend launchpad in the uncommon case.
Change-Id: Ie1a2b2fe720efde6e131a8d5274b7487fb644881
diff --git a/src/compiler/codegen/MethodCodegenDriver.cc b/src/compiler/codegen/MethodCodegenDriver.cc
index fb9bdc9..5ffe3e4 100644
--- a/src/compiler/codegen/MethodCodegenDriver.cc
+++ b/src/compiler/codegen/MethodCodegenDriver.cc
@@ -364,9 +364,10 @@
case Instruction::GOTO_16:
case Instruction::GOTO_32:
if (bb->taken->startOffset <= mir->offset) {
- genSuspendTest(cUnit, mir);
+ genSuspendTestAndBranch(cUnit, mir, &labelList[bb->taken->id]);
+ } else {
+ opUnconditionalBranch(cUnit, &labelList[bb->taken->id]);
}
- opUnconditionalBranch(cUnit, &labelList[bb->taken->id]);
break;
case Instruction::PACKED_SWITCH: