Mercurial > hg > graal-compiler
diff graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotReturnOp.java @ 12456:f87c68d79f07
improved support for co-existing, multiple backends (GRAAL-363)
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Thu, 17 Oct 2013 01:08:17 +0200 |
parents | 7080a96be216 |
children | 1a66453f73db |
line wrap: on
line diff
--- a/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotReturnOp.java Thu Oct 17 01:05:13 2013 +0200 +++ b/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotReturnOp.java Thu Oct 17 01:08:17 2013 +0200 @@ -26,12 +26,9 @@ import static com.oracle.graal.lir.LIRInstruction.OperandFlag.*; import static com.oracle.graal.phases.GraalOptions.*; -import com.oracle.graal.amd64.*; import com.oracle.graal.api.code.*; import com.oracle.graal.api.meta.*; import com.oracle.graal.asm.amd64.*; -import com.oracle.graal.graph.*; -import com.oracle.graal.hotspot.*; import com.oracle.graal.lir.*; import com.oracle.graal.lir.asm.*; @@ -43,24 +40,14 @@ @Use({REG, ILLEGAL}) protected Value value; private final boolean isStub; + private final Register scratchForSafepointOnReturn; - AMD64HotSpotReturnOp(Value value, boolean isStub) { + AMD64HotSpotReturnOp(Value value, boolean isStub, Register scratchForSafepointOnReturn) { this.value = value; this.isStub = isStub; + this.scratchForSafepointOnReturn = scratchForSafepointOnReturn; } - private static Register findPollOnReturnScratchRegister() { - RegisterConfig config = HotSpotGraalRuntime.runtime().getProviders().getCodeCache().getRegisterConfig(); - for (Register r : config.getAllocatableRegisters(Kind.Long)) { - if (r != config.getReturnRegister(Kind.Long) && r != AMD64.rbp) { - return r; - } - } - throw GraalInternalError.shouldNotReachHere(); - } - - private static final Register scratchForSafepointOnReturn = findPollOnReturnScratchRegister(); - @Override public void emitCode(TargetMethodAssembler tasm, AMD64MacroAssembler masm) { leaveFrameAndRestoreRbp(tasm, masm);