Mercurial > hg > graal-compiler
changeset 20071:32e2857bb2bb
AMD64HotSpotLIRGenerator: insert RescueSlotDummyOp only in #beforeRegisterAllocation.
author | Josef Eisl <josef.eisl@jku.at> |
---|---|
date | Mon, 30 Mar 2015 10:47:08 +0200 |
parents | aa8e0e2c5751 |
children | bd3246bc0aaa |
files | graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotLIRGenerator.java |
diffstat | 1 files changed, 12 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotLIRGenerator.java Mon Mar 30 10:08:38 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotLIRGenerator.java Mon Mar 30 10:47:08 2015 +0200 @@ -144,17 +144,16 @@ private RescueSlotDummyOp rescueSlotOp; private StackSlotValue getOrInitRescueSlot() { + RescueSlotDummyOp op = getOrInitRescueSlotOp(); + return op.getSlot(); + } + + private RescueSlotDummyOp getOrInitRescueSlotOp() { if (rescueSlotOp == null) { // create dummy instruction to keep the rescue slot alive rescueSlotOp = new RescueSlotDummyOp(getResult().getFrameMapBuilder(), getLIRKindTool().getWordKind()); - // insert dummy instruction into the start block - LIR lir = getResult().getLIR(); - List<LIRInstruction> instructions = lir.getLIRforBlock(lir.getControlFlowGraph().getStartBlock()); - // Note: we do not insert at position 1 to avoid interference with the save rpb op - instructions.add(instructions.size() - 1, rescueSlotOp); - Debug.dump(lir, "created rescue dummy op"); } - return rescueSlotOp.getSlot(); + return rescueSlotOp; } /** @@ -481,7 +480,12 @@ } if (BenchmarkCounters.enabled) { // ensure that the rescue slot is available - getOrInitRescueSlot(); + LIRInstruction op = getOrInitRescueSlotOp(); + // insert dummy instruction into the start block + LIR lir = getResult().getLIR(); + List<LIRInstruction> instructions = lir.getLIRforBlock(lir.getControlFlowGraph().getStartBlock()); + instructions.add(1, op); + Debug.dump(lir, "created rescue dummy op"); } }