# HG changeset patch # User Josef Eisl # Date 1427705228 -7200 # Node ID 32e2857bb2bb17bada1b08d6202d29a5fe7955fe # Parent aa8e0e2c5751544982bb3c85622cfdee3d88bdd1 AMD64HotSpotLIRGenerator: insert RescueSlotDummyOp only in #beforeRegisterAllocation. diff -r aa8e0e2c5751 -r 32e2857bb2bb graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotLIRGenerator.java --- 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 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 instructions = lir.getLIRforBlock(lir.getControlFlowGraph().getStartBlock()); + instructions.add(1, op); + Debug.dump(lir, "created rescue dummy op"); } }