# HG changeset patch # User Doug Simon # Date 1417003698 -3600 # Node ID ab86fa95275004e7abebdff986294118bdc348ce # Parent c240024b32b3fc89979c3c0e5207e62fbad4ef6b removed static access to HotSpotGraalRuntime from some SPARC HotSpot classes diff -r c240024b32b3 -r ab86fa952750 graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotBackend.java --- a/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotBackend.java Wed Nov 26 13:01:29 2014 +0100 +++ b/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotBackend.java Wed Nov 26 13:08:18 2014 +0100 @@ -95,7 +95,7 @@ @Override public NodeLIRBuilderTool newNodeLIRBuilder(StructuredGraph graph, LIRGeneratorTool lirGen) { - return new SPARCHotSpotNodeLIRBuilder(graph, lirGen); + return new SPARCHotSpotNodeLIRBuilder(getRuntime(), graph, lirGen); } /** diff -r c240024b32b3 -r ab86fa952750 graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotLIRGenerator.java --- a/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotLIRGenerator.java Wed Nov 26 13:01:29 2014 +0100 +++ b/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotLIRGenerator.java Wed Nov 26 13:08:18 2014 +0100 @@ -144,7 +144,7 @@ operand = resultOperandFor(input.getLIRKind()); emitMove(operand, input); } - append(new SPARCHotSpotReturnOp(operand, getStub() != null)); + append(new SPARCHotSpotReturnOp(operand, getStub() != null, runtime().getConfig())); } @Override @@ -164,8 +164,8 @@ } private void moveDeoptValuesToThread(Value actionAndReason, Value speculation) { - moveValueToThread(actionAndReason, runtime().getConfig().pendingDeoptimizationOffset); - moveValueToThread(speculation, runtime().getConfig().pendingFailedSpeculationOffset); + moveValueToThread(actionAndReason, config.pendingDeoptimizationOffset); + moveValueToThread(speculation, config.pendingFailedSpeculationOffset); } private void moveValueToThread(Value v, int offset) { diff -r c240024b32b3 -r ab86fa952750 graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotNodeLIRBuilder.java --- a/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotNodeLIRBuilder.java Wed Nov 26 13:01:29 2014 +0100 +++ b/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotNodeLIRBuilder.java Wed Nov 26 13:08:18 2014 +0100 @@ -44,8 +44,11 @@ public class SPARCHotSpotNodeLIRBuilder extends SPARCNodeLIRBuilder implements HotSpotNodeLIRBuilder { - public SPARCHotSpotNodeLIRBuilder(StructuredGraph graph, LIRGeneratorTool lirGen) { + private HotSpotGraalRuntimeProvider runtime; + + public SPARCHotSpotNodeLIRBuilder(HotSpotGraalRuntimeProvider runtime, StructuredGraph graph, LIRGeneratorTool lirGen) { super(graph, lirGen); + this.runtime = runtime; assert gen instanceof SPARCHotSpotLIRGenerator; assert getDebugInfoBuilder() instanceof HotSpotDebugInfoBuilder; ((SPARCHotSpotLIRGenerator) gen).setLockStack(((HotSpotDebugInfoBuilder) getDebugInfoBuilder()).lockStack()); @@ -97,7 +100,7 @@ protected void emitDirectCall(DirectCallTargetNode callTarget, Value result, Value[] parameters, Value[] temps, LIRFrameState callState) { InvokeKind invokeKind = ((HotSpotDirectCallTargetNode) callTarget).invokeKind(); if (invokeKind == InvokeKind.Interface || invokeKind == InvokeKind.Virtual) { - append(new SPARCHotspotDirectVirtualCallOp(callTarget.targetMethod(), result, parameters, temps, callState, invokeKind)); + append(new SPARCHotspotDirectVirtualCallOp(callTarget.targetMethod(), result, parameters, temps, callState, invokeKind, runtime.getConfig())); } else { assert invokeKind == InvokeKind.Static || invokeKind == InvokeKind.Special; HotSpotResolvedJavaMethod resolvedMethod = (HotSpotResolvedJavaMethod) callTarget.targetMethod(); diff -r c240024b32b3 -r ab86fa952750 graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotReturnOp.java --- a/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotReturnOp.java Wed Nov 26 13:01:29 2014 +0100 +++ b/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotReturnOp.java Wed Nov 26 13:08:18 2014 +0100 @@ -22,11 +22,11 @@ */ package com.oracle.graal.hotspot.sparc; -import static com.oracle.graal.hotspot.HotSpotGraalRuntime.*; import static com.oracle.graal.lir.LIRInstruction.OperandFlag.*; import com.oracle.graal.api.meta.*; import com.oracle.graal.asm.sparc.*; +import com.oracle.graal.hotspot.*; import com.oracle.graal.lir.*; import com.oracle.graal.lir.asm.*; import com.oracle.graal.lir.sparc.SPARCControlFlow.ReturnOp; @@ -40,10 +40,12 @@ @Use({REG, ILLEGAL}) protected Value value; private final boolean isStub; + private final HotSpotVMConfig config; - SPARCHotSpotReturnOp(Value value, boolean isStub) { + SPARCHotSpotReturnOp(Value value, boolean isStub, HotSpotVMConfig config) { this.value = value; this.isStub = isStub; + this.config = config; } @Override @@ -52,7 +54,7 @@ // Every non-stub compile method must have a poll before the return. // Using the same scratch register as LIR_Assembler::return_op // in c1_LIRAssembler_sparc.cpp - SPARCHotSpotSafepointOp.emitCode(crb, masm, runtime().getConfig(), true, null, SPARC.l0); + SPARCHotSpotSafepointOp.emitCode(crb, masm, config, true, null, SPARC.l0); } ReturnOp.emitCodeHelper(crb, masm); } diff -r c240024b32b3 -r ab86fa952750 graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotspotDirectVirtualCallOp.java --- a/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotspotDirectVirtualCallOp.java Wed Nov 26 13:01:29 2014 +0100 +++ b/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotspotDirectVirtualCallOp.java Wed Nov 26 13:08:18 2014 +0100 @@ -43,10 +43,12 @@ final class SPARCHotspotDirectVirtualCallOp extends DirectCallOp { private final InvokeKind invokeKind; + private final HotSpotVMConfig config; - SPARCHotspotDirectVirtualCallOp(ResolvedJavaMethod target, Value result, Value[] parameters, Value[] temps, LIRFrameState state, InvokeKind invokeKind) { + SPARCHotspotDirectVirtualCallOp(ResolvedJavaMethod target, Value result, Value[] parameters, Value[] temps, LIRFrameState state, InvokeKind invokeKind, HotSpotVMConfig config) { super(target, result, parameters, temps, state); this.invokeKind = invokeKind; + this.config = config; assert invokeKind == InvokeKind.Interface || invokeKind == InvokeKind.Virtual; } @@ -56,6 +58,6 @@ // instruction that loads the Klass from the inline cache. MarkId.recordMark(crb, invokeKind == InvokeKind.Virtual ? MarkId.INVOKEVIRTUAL : MarkId.INVOKEINTERFACE); Register scratchRegister = g5; - new Setx(HotSpotGraalRuntime.runtime().getConfig().nonOopBits, scratchRegister, true).emit(masm); + new Setx(config.nonOopBits, scratchRegister, true).emit(masm); } }