# HG changeset patch # User Josef Eisl # Date 1396358601 -7200 # Node ID 88dfaf6448e0f5d8c77bb3248446b56c04ba92ce # Parent dadb07012689e5a0eaf59387268b693bc371a691 Remove LIRGenerationResult from NodeLIRBuilder. diff -r dadb07012689 -r 88dfaf6448e0 graal/com.oracle.graal.compiler.amd64/src/com/oracle/graal/compiler/amd64/AMD64NodeLIRBuilder.java --- a/graal/com.oracle.graal.compiler.amd64/src/com/oracle/graal/compiler/amd64/AMD64NodeLIRBuilder.java Tue Apr 01 10:48:04 2014 +0200 +++ b/graal/com.oracle.graal.compiler.amd64/src/com/oracle/graal/compiler/amd64/AMD64NodeLIRBuilder.java Tue Apr 01 15:23:21 2014 +0200 @@ -35,8 +35,8 @@ public abstract class AMD64NodeLIRBuilder extends NodeLIRBuilder { - public AMD64NodeLIRBuilder(StructuredGraph graph, LIRGenerationResult res, LIRGenerator gen) { - super(graph, res, gen); + public AMD64NodeLIRBuilder(StructuredGraph graph, LIRGenerator gen) { + super(graph, gen); } protected MemoryArithmeticLIRLowerer memoryPeephole; @@ -97,7 +97,7 @@ sig[i] = node.arguments().get(i).stamp().javaType(gen.getMetaAccess()); } - Value[] parameters = visitInvokeArguments(res.getFrameMap().registerConfig.getCallingConvention(CallingConvention.Type.JavaCall, null, sig, gen.target(), false), node.arguments()); + Value[] parameters = visitInvokeArguments(gen.getResult().getFrameMap().registerConfig.getCallingConvention(CallingConvention.Type.JavaCall, null, sig, gen.target(), false), node.arguments()); append(new AMD64BreakpointOp(parameters)); } diff -r dadb07012689 -r 88dfaf6448e0 graal/com.oracle.graal.compiler.hsail/src/com/oracle/graal/compiler/hsail/HSAILNodeLIRBuilder.java --- a/graal/com.oracle.graal.compiler.hsail/src/com/oracle/graal/compiler/hsail/HSAILNodeLIRBuilder.java Tue Apr 01 10:48:04 2014 +0200 +++ b/graal/com.oracle.graal.compiler.hsail/src/com/oracle/graal/compiler/hsail/HSAILNodeLIRBuilder.java Tue Apr 01 15:23:21 2014 +0200 @@ -37,8 +37,8 @@ */ public abstract class HSAILNodeLIRBuilder extends NodeLIRBuilder { - public HSAILNodeLIRBuilder(StructuredGraph graph, LIRGenerationResult lirGenRes, LIRGenerator lirGen) { - super(graph, lirGenRes, lirGen); + public HSAILNodeLIRBuilder(StructuredGraph graph, LIRGenerator lirGen) { + super(graph, lirGen); } @Override diff -r dadb07012689 -r 88dfaf6448e0 graal/com.oracle.graal.compiler.ptx/src/com/oracle/graal/compiler/ptx/PTXNodeLIRBuilder.java --- a/graal/com.oracle.graal.compiler.ptx/src/com/oracle/graal/compiler/ptx/PTXNodeLIRBuilder.java Tue Apr 01 10:48:04 2014 +0200 +++ b/graal/com.oracle.graal.compiler.ptx/src/com/oracle/graal/compiler/ptx/PTXNodeLIRBuilder.java Tue Apr 01 15:23:21 2014 +0200 @@ -57,8 +57,8 @@ } } - public PTXNodeLIRBuilder(StructuredGraph graph, LIRGenerationResult lirGenRes, LIRGenerator lirGen) { - super(graph, lirGenRes, lirGen); + public PTXNodeLIRBuilder(StructuredGraph graph, LIRGenerator lirGen) { + super(graph, lirGen); } public int getNextPredRegNumber() { diff -r dadb07012689 -r 88dfaf6448e0 graal/com.oracle.graal.compiler.sparc/src/com/oracle/graal/compiler/sparc/SPARCNodeLIRBuilder.java --- a/graal/com.oracle.graal.compiler.sparc/src/com/oracle/graal/compiler/sparc/SPARCNodeLIRBuilder.java Tue Apr 01 10:48:04 2014 +0200 +++ b/graal/com.oracle.graal.compiler.sparc/src/com/oracle/graal/compiler/sparc/SPARCNodeLIRBuilder.java Tue Apr 01 15:23:21 2014 +0200 @@ -36,8 +36,8 @@ */ public abstract class SPARCNodeLIRBuilder extends NodeLIRBuilder { - public SPARCNodeLIRBuilder(StructuredGraph graph, LIRGenerationResult lirGenRes, LIRGenerator lirGen) { - super(graph, lirGenRes, lirGen); + public SPARCNodeLIRBuilder(StructuredGraph graph, LIRGenerator lirGen) { + super(graph, lirGen); } @Override @@ -58,7 +58,7 @@ sig[i] = node.arguments().get(i).stamp().javaType(gen.getMetaAccess()); } - Value[] parameters = visitInvokeArguments(res.getFrameMap().registerConfig.getCallingConvention(CallingConvention.Type.JavaCall, null, sig, gen.target(), false), node.arguments()); + Value[] parameters = visitInvokeArguments(gen.getResult().getFrameMap().registerConfig.getCallingConvention(CallingConvention.Type.JavaCall, null, sig, gen.target(), false), node.arguments()); append(new SPARCBreakpointOp(parameters)); } diff -r dadb07012689 -r 88dfaf6448e0 graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/GraalCompiler.java --- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/GraalCompiler.java Tue Apr 01 10:48:04 2014 +0200 +++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/GraalCompiler.java Tue Apr 01 15:23:21 2014 +0200 @@ -124,7 +124,7 @@ /** * Requests compilation of a given graph. - * + * * @param graph the graph to be compiled * @param cc the calling convention for calls to the code compiled for {@code graph} * @param installedCodeOwner the method the compiled code will be @@ -244,7 +244,7 @@ FrameMap frameMap = backend.newFrameMap(); LIRGenerationResult lirGenRes = backend.newLIRGenerationResult(lir, frameMap, stub); LIRGenerator lirGen = backend.newLIRGenerator(cc, lirGenRes); - NodeLIRBuilder nodeLirGen = backend.newNodeLIRGenerator(graph, lirGenRes, lirGen); + NodeLIRBuilder nodeLirGen = backend.newNodeLIRGenerator(graph, lirGen); try (Scope s = Debug.scope("LIRGen", lirGen)) { for (Block b : linearScanOrder) { diff -r dadb07012689 -r 88dfaf6448e0 graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/LIRGenerator.java --- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/LIRGenerator.java Tue Apr 01 10:48:04 2014 +0200 +++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/LIRGenerator.java Tue Apr 01 15:23:21 2014 +0200 @@ -67,8 +67,8 @@ private DebugInfoBuilder debugInfoBuilder; protected AbstractBlock currentBlock; - private final int traceLevel; - private final boolean printIRWithLIR; + public final int traceLevel; + public final boolean printIRWithLIR; /** * Handle for an operation that loads a constant into a variable. The operation starts in the @@ -141,7 +141,7 @@ Map constantLoads; - protected LIRGenerationResult res; + private LIRGenerationResult res; /** * Set this before using the LIRGenerator. @@ -621,4 +621,8 @@ void setCurrentBlock(AbstractBlock block) { currentBlock = block; } + + public LIRGenerationResult getResult() { + return res; + } } diff -r dadb07012689 -r 88dfaf6448e0 graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/NodeLIRBuilder.java --- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/NodeLIRBuilder.java Tue Apr 01 10:48:04 2014 +0200 +++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/NodeLIRBuilder.java Tue Apr 01 15:23:21 2014 +0200 @@ -60,23 +60,15 @@ private final NodeMap nodeOperands; private final DebugInfoBuilder debugInfoBuilder; - private final int traceLevel; - private final boolean printIRWithLIR; - protected final LIRGenerator gen; private ValueNode currentInstruction; private ValueNode lastInstructionPrinted; // Debugging only - protected LIRGenerationResult res; - - public NodeLIRBuilder(StructuredGraph graph, LIRGenerationResult res, LIRGenerator gen) { - this.res = res; + public NodeLIRBuilder(StructuredGraph graph, LIRGenerator gen) { + this.gen = gen; this.nodeOperands = graph.createNodeMap(); this.debugInfoBuilder = createDebugInfoBuilder(nodeOperands); - this.gen = gen; - this.traceLevel = LIRGenerator.Options.TraceLIRGeneratorLevel.getValue(); - this.printIRWithLIR = LIRGenerator.Options.PrintIRWithLIR.getValue(); gen.setDebugInfoBuilder(debugInfoBuilder); } @@ -129,17 +121,17 @@ LoadConstant load = gen.constantLoads.get(value); assert gen.getCurrentBlock() instanceof Block; if (load == null) { - int index = res.getLIR().getLIRforBlock(gen.getCurrentBlock()).size(); + int index = gen.getResult().getLIR().getLIRforBlock(gen.getCurrentBlock()).size(); loadedValue = gen.emitMove(value); - LIRInstruction op = res.getLIR().getLIRforBlock(gen.getCurrentBlock()).get(index); + LIRInstruction op = gen.getResult().getLIR().getLIRforBlock(gen.getCurrentBlock()).get(index); gen.constantLoads.put(value, new LoadConstant(loadedValue, (Block) gen.getCurrentBlock(), index, op)); } else { Block dominator = ControlFlowGraph.commonDominator(load.block, (Block) gen.getCurrentBlock()); loadedValue = load.variable; if (dominator != load.block) { - load.unpin(res.getLIR()); + load.unpin(gen.getResult().getLIR()); } else { - assert load.block != gen.getCurrentBlock() || load.index < res.getLIR().getLIRforBlock(gen.getCurrentBlock()).size(); + assert load.block != gen.getCurrentBlock() || load.index < gen.getResult().getLIR().getLIRforBlock(gen.getCurrentBlock()).size(); } load.block = dominator; } @@ -173,17 +165,17 @@ } public LabelRef getLIRBlock(FixedNode b) { - assert res.getLIR().getControlFlowGraph() instanceof ControlFlowGraph; - Block result = ((ControlFlowGraph) res.getLIR().getControlFlowGraph()).blockFor(b); + assert gen.getResult().getLIR().getControlFlowGraph() instanceof ControlFlowGraph; + Block result = ((ControlFlowGraph) gen.getResult().getLIR().getControlFlowGraph()).blockFor(b); int suxIndex = gen.getCurrentBlock().getSuccessors().indexOf(result); assert suxIndex != -1 : "Block not in successor list of current block"; assert gen.getCurrentBlock() instanceof Block; - return LabelRef.forSuccessor(res.getLIR(), (Block) gen.getCurrentBlock(), suxIndex); + return LabelRef.forSuccessor(gen.getResult().getLIR(), (Block) gen.getCurrentBlock(), suxIndex); } public final void append(LIRInstruction op) { - if (printIRWithLIR && !TTY.isSuppressed()) { + if (gen.printIRWithLIR && !TTY.isSuppressed()) { if (currentInstruction != null && lastInstructionPrinted != currentInstruction) { lastInstructionPrinted = currentInstruction; InstructionPrinter ip = new InstructionPrinter(TTY.out()); @@ -196,7 +188,7 @@ public void doBlock(Block block, StructuredGraph graph, BlockMap> blockMap) { gen.doBlockStart(block); - if (block == res.getLIR().getControlFlowGraph().getStartBlock()) { + if (block == gen.getResult().getLIR().getControlFlowGraph().getStartBlock()) { assert block.getPredecessorCount() == 0; emitPrologue(graph); } else { @@ -207,7 +199,7 @@ int instructionsFolded = 0; for (int i = 0; i < nodes.size(); i++) { Node instr = nodes.get(i); - if (traceLevel >= 3) { + if (gen.traceLevel >= 3) { TTY.println("LIRGen for " + instr); } if (instructionsFolded > 0) { @@ -252,7 +244,7 @@ gen.emitJump(getLIRBlock((FixedNode) successors.first())); } - assert verifyBlock(res.getLIR(), block); + assert verifyBlock(gen.getResult().getLIR(), block); gen.doBlockEnd(block); } @@ -393,7 +385,7 @@ protected abstract boolean peephole(ValueNode valueNode); private boolean hasBlockEnd(Block block) { - List ops = res.getLIR().getLIRforBlock(block); + List ops = gen.getResult().getLIR().getLIRforBlock(block); if (ops.size() == 0) { return false; } @@ -401,7 +393,7 @@ } private void doRoot(ValueNode instr) { - if (traceLevel >= 2) { + if (gen.traceLevel >= 2) { TTY.println("Emitting LIR for instruction " + instr); } currentInstruction = instr; @@ -418,7 +410,7 @@ if (node instanceof LIRGenLowerable) { ((LIRGenLowerable) node).generate(this); } else if (node instanceof LIRGenResLowerable) { - ((LIRGenResLowerable) node).generate(this, res); + ((LIRGenResLowerable) node).generate(this, gen.getResult()); } else if (node instanceof LIRLowerable) { ((LIRLowerable) node).generate(this); } else if (node instanceof ArithmeticLIRLowerable) { @@ -436,8 +428,8 @@ params[i] = toStackKind(incomingArguments.getArgument(i)); if (ValueUtil.isStackSlot(params[i])) { StackSlot slot = ValueUtil.asStackSlot(params[i]); - if (slot.isInCallerFrame() && !res.getLIR().hasArgInCallerFrame()) { - res.getLIR().setHasArgInCallerFrame(); + if (slot.isInCallerFrame() && !gen.getResult().getLIR().hasArgInCallerFrame()) { + gen.getResult().getLIR().setHasArgInCallerFrame(); } } } @@ -459,8 +451,8 @@ params[i] = toStackKind(incomingArguments.getArgument(i)); if (ValueUtil.isStackSlot(params[i])) { StackSlot slot = ValueUtil.asStackSlot(params[i]); - if (slot.isInCallerFrame() && !res.getLIR().hasArgInCallerFrame()) { - res.getLIR().setHasArgInCallerFrame(); + if (slot.isInCallerFrame() && !gen.getResult().getLIR().hasArgInCallerFrame()) { + gen.getResult().getLIR().setHasArgInCallerFrame(); } } } @@ -480,7 +472,7 @@ } public void emitIncomingValues(Value[] params) { - ((LabelOp) res.getLIR().getLIRforBlock(gen.getCurrentBlock()).get(0)).setIncomingValues(params); + ((LabelOp) gen.getResult().getLIR().getLIRforBlock(gen.getCurrentBlock()).get(0)).setIncomingValues(params); } @Override @@ -510,7 +502,7 @@ } private void moveToPhi(MergeNode merge, AbstractEndNode pred) { - if (traceLevel >= 1) { + if (gen.traceLevel >= 1) { TTY.println("MOVE TO PHI from " + pred + " to " + merge); } PhiResolver resolver = new PhiResolver(gen); @@ -605,9 +597,9 @@ @Override public void emitInvoke(Invoke x) { LoweredCallTargetNode callTarget = (LoweredCallTargetNode) x.callTarget(); - CallingConvention invokeCc = res.getFrameMap().registerConfig.getCallingConvention(callTarget.callType(), x.asNode().stamp().javaType(gen.getMetaAccess()), callTarget.signature(), + CallingConvention invokeCc = gen.getResult().getFrameMap().registerConfig.getCallingConvention(callTarget.callType(), x.asNode().stamp().javaType(gen.getMetaAccess()), callTarget.signature(), gen.target(), false); - res.getFrameMap().callsMethod(invokeCc); + gen.getResult().getFrameMap().callsMethod(invokeCc); Value[] parameters = visitInvokeArguments(invokeCc, callTarget.arguments()); diff -r dadb07012689 -r 88dfaf6448e0 graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/target/Backend.java --- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/target/Backend.java Tue Apr 01 10:48:04 2014 +0200 +++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/target/Backend.java Tue Apr 01 15:23:21 2014 +0200 @@ -69,7 +69,7 @@ public abstract LIRGenerationResult newLIRGenerationResult(LIR lir, FrameMap frameMap, Object stub); - public abstract NodeLIRBuilder newNodeLIRGenerator(StructuredGraph graph, LIRGenerationResult lirGenRes, LIRGenerator lirGen); + public abstract NodeLIRBuilder newNodeLIRGenerator(StructuredGraph graph, LIRGenerator lirGen); /** * Creates the assembler used to emit the machine code. @@ -85,7 +85,7 @@ /** * Emits the code for a given graph. - * + * * @param installedCodeOwner the method the compiled code will be * {@linkplain InstalledCode#getMethod() associated} with once installed. This * argument can be null. diff -r dadb07012689 -r 88dfaf6448e0 graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotBackend.java --- a/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotBackend.java Tue Apr 01 10:48:04 2014 +0200 +++ b/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotBackend.java Tue Apr 01 15:23:21 2014 +0200 @@ -82,13 +82,13 @@ } @Override - public NodeLIRBuilder newNodeLIRGenerator(StructuredGraph graph, LIRGenerationResult lirGenRes, LIRGenerator lirGen) { - return new AMD64HotSpotNodeLIRBuilder(graph, lirGenRes, lirGen); + public NodeLIRBuilder newNodeLIRGenerator(StructuredGraph graph, LIRGenerator lirGen) { + return new AMD64HotSpotNodeLIRBuilder(graph, lirGen); } /** * Emits code to do stack overflow checking. - * + * * @param afterFrameInit specifies if the stack pointer has already been adjusted to allocate * the current frame * @param isVerifiedEntryPoint specifies if the code buffer is currently at the verified entry @@ -253,7 +253,7 @@ /** * Emits the code prior to the verified entry point. - * + * * @param installedCodeOwner see {@link Backend#emitCode} */ public void emitCodePrefix(ResolvedJavaMethod installedCodeOwner, CompilationResultBuilder crb, AMD64MacroAssembler asm, RegisterConfig regConfig, HotSpotVMConfig config, Label verifiedEntry) { @@ -288,7 +288,7 @@ /** * Emits the code which starts at the verified entry point. - * + * * @param installedCodeOwner see {@link Backend#emitCode} */ public void emitCodeBody(ResolvedJavaMethod installedCodeOwner, CompilationResultBuilder crb, LIR lir) { diff -r dadb07012689 -r 88dfaf6448e0 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 Tue Apr 01 10:48:04 2014 +0200 +++ b/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotLIRGenerator.java Tue Apr 01 15:23:21 2014 +0200 @@ -84,7 +84,7 @@ public SaveRbp(NoOp placeholder) { this.placeholder = placeholder; - this.reservedSlot = res.getFrameMap().allocateSpillSlot(Kind.Long); + this.reservedSlot = getResult().getFrameMap().allocateSpillSlot(Kind.Long); assert reservedSlot.getRawOffset() == -16 : reservedSlot.getRawOffset(); } @@ -98,11 +98,11 @@ if (useStack) { dst = reservedSlot; } else { - res.getFrameMap().freeSpillSlot(reservedSlot); + getResult().getFrameMap().freeSpillSlot(reservedSlot); dst = newVariable(Kind.Long); } - placeholder.replace(res.getLIR(), new MoveFromRegOp(dst, rbp.asValue(Kind.Long))); + placeholder.replace(getResult().getLIR(), new MoveFromRegOp(dst, rbp.asValue(Kind.Long))); return dst; } } @@ -150,7 +150,7 @@ @Override protected boolean needOnlyOopMaps() { // Stubs only need oop maps - return ((AMD64HotSpotLIRGenerationResult) res).getStub() != null; + return ((AMD64HotSpotLIRGenerationResult) getResult()).getStub() != null; } @Override @@ -177,7 +177,7 @@ } public Stub getStub() { - return ((AMD64HotSpotLIRGenerationResult) res).getStub(); + return ((AMD64HotSpotLIRGenerationResult) getResult()).getStub(); } @Override @@ -189,12 +189,12 @@ if (destroysRegisters) { if (getStub() != null) { if (getStub().preservesRegisters()) { - Register[] savedRegisters = res.getFrameMap().registerConfig.getAllocatableRegisters(); + Register[] savedRegisters = getResult().getFrameMap().registerConfig.getAllocatableRegisters(); savedRegisterLocations = new StackSlot[savedRegisters.length]; for (int i = 0; i < savedRegisters.length; i++) { PlatformKind kind = target().arch.getLargestStorableKind(savedRegisters[i].getRegisterCategory()); assert kind != Kind.Illegal; - StackSlot spillSlot = res.getFrameMap().allocateSpillSlot(kind); + StackSlot spillSlot = getResult().getFrameMap().allocateSpillSlot(kind); savedRegisterLocations[i] = spillSlot; } save = emitSaveRegisters(savedRegisters, savedRegisterLocations); @@ -205,7 +205,7 @@ Variable result; if (linkage.canDeoptimize()) { - assert info != null || ((AMD64HotSpotLIRGenerationResult) res).getStub() != null; + assert info != null || ((AMD64HotSpotLIRGenerationResult) getResult()).getStub() != null; Register thread = getProviders().getRegisters().getThreadRegister(); append(new AMD64HotSpotCRuntimeCallPrologueOp(config.threadLastJavaSpOffset(), thread)); result = super.emitForeignCall(linkage, info, args); @@ -217,8 +217,8 @@ if (destroysRegisters) { if (getStub() != null) { if (getStub().preservesRegisters()) { - assert !((AMD64HotSpotLIRGenerationResult) res).getCalleeSaveInfo().containsKey(currentRuntimeCallInfo); - ((AMD64HotSpotLIRGenerationResult) res).getCalleeSaveInfo().put(currentRuntimeCallInfo, save); + assert !((AMD64HotSpotLIRGenerationResult) getResult()).getCalleeSaveInfo().containsKey(currentRuntimeCallInfo); + ((AMD64HotSpotLIRGenerationResult) getResult()).getCalleeSaveInfo().put(currentRuntimeCallInfo, save); emitRestoreRegisters(save); } else { @@ -237,14 +237,14 @@ } protected boolean zapRegisters() { - Register[] zappedRegisters = res.getFrameMap().registerConfig.getAllocatableRegisters(); + Register[] zappedRegisters = getResult().getFrameMap().registerConfig.getAllocatableRegisters(); Constant[] zapValues = new Constant[zappedRegisters.length]; for (int i = 0; i < zappedRegisters.length; i++) { PlatformKind kind = target().arch.getLargestStorableKind(zappedRegisters[i].getRegisterCategory()); assert kind != Kind.Illegal; zapValues[i] = zapValueForKind(kind); } - ((AMD64HotSpotLIRGenerationResult) res).getCalleeSaveInfo().put(currentRuntimeCallInfo, emitZapRegisters(zappedRegisters, zapValues)); + ((AMD64HotSpotLIRGenerationResult) getResult()).getCalleeSaveInfo().put(currentRuntimeCallInfo, emitZapRegisters(zappedRegisters, zapValues)); return true; } @@ -256,7 +256,7 @@ @Override public void emitCCall(long address, CallingConvention nativeCallingConvention, Value[] args, int numberOfFloatingPointArguments) { Value[] argLocations = new Value[args.length]; - res.getFrameMap().callsMethod(nativeCallingConvention); + getResult().getFrameMap().callsMethod(nativeCallingConvention); // TODO(mg): in case a native function uses floating point varargs, the ABI requires that // RAX contains the length of the varargs AllocatableValue numberOfFloatingPointArgumentsRegister = AMD64.rax.asValue(); @@ -308,10 +308,10 @@ @Override public void beforeRegisterAllocation() { super.beforeRegisterAllocation(); - boolean hasDebugInfo = res.getLIR().hasDebugInfo(); + boolean hasDebugInfo = getResult().getLIR().hasDebugInfo(); AllocatableValue savedRbp = saveRbp.finalize(hasDebugInfo); if (hasDebugInfo) { - ((AMD64HotSpotLIRGenerationResult) res).setDeoptimizationRescueSlot(res.getFrameMap().allocateSpillSlot(Kind.Long)); + ((AMD64HotSpotLIRGenerationResult) getResult()).setDeoptimizationRescueSlot(getResult().getFrameMap().allocateSpillSlot(Kind.Long)); } for (AMD64HotSpotEpilogueOp op : epilogueOps) { diff -r dadb07012689 -r 88dfaf6448e0 graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotNodeLIRBuilder.java --- a/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotNodeLIRBuilder.java Tue Apr 01 10:48:04 2014 +0200 +++ b/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotNodeLIRBuilder.java Tue Apr 01 15:23:21 2014 +0200 @@ -57,8 +57,8 @@ */ public class AMD64HotSpotNodeLIRBuilder extends AMD64NodeLIRBuilder implements HotSpotNodeLIRBuilder { - public AMD64HotSpotNodeLIRBuilder(StructuredGraph graph, LIRGenerationResult res, LIRGenerator gen) { - super(graph, res, gen); + public AMD64HotSpotNodeLIRBuilder(StructuredGraph graph, LIRGenerator gen) { + super(graph, gen); memoryPeephole = new AMD64HotSpotMemoryPeephole(this); } @@ -76,7 +76,7 @@ @Override protected DebugInfoBuilder createDebugInfoBuilder(NodeMap nodeOperands) { - HotSpotLockStack lockStack = new HotSpotLockStack(res.getFrameMap(), Kind.Long); + HotSpotLockStack lockStack = new HotSpotLockStack(gen.getResult().getFrameMap(), Kind.Long); return new HotSpotDebugInfoBuilder(nodeOperands, lockStack); } @@ -90,8 +90,8 @@ params[i] = toStackKind(incomingArguments.getArgument(i)); if (isStackSlot(params[i])) { StackSlot slot = ValueUtil.asStackSlot(params[i]); - if (slot.isInCallerFrame() && !res.getLIR().hasArgInCallerFrame()) { - res.getLIR().setHasArgInCallerFrame(); + if (slot.isInCallerFrame() && !gen.getResult().getLIR().hasArgInCallerFrame()) { + gen.getResult().getLIR().setHasArgInCallerFrame(); } } } @@ -99,7 +99,7 @@ emitIncomingValues(params); - setSaveRbp(((AMD64HotSpotLIRGenerator) gen).new SaveRbp(new NoOp(gen.getCurrentBlock(), res.getLIR().getLIRforBlock(gen.getCurrentBlock()).size()))); + setSaveRbp(((AMD64HotSpotLIRGenerator) gen).new SaveRbp(new NoOp(gen.getCurrentBlock(), gen.getResult().getLIR().getLIRforBlock(gen.getCurrentBlock()).size()))); append(getSaveRbp().placeholder); for (ParameterNode param : graph.getNodes(ParameterNode.class)) { diff -r dadb07012689 -r 88dfaf6448e0 graal/com.oracle.graal.hotspot.hsail/src/com/oracle/graal/hotspot/hsail/HSAILHotSpotBackend.java --- a/graal/com.oracle.graal.hotspot.hsail/src/com/oracle/graal/hotspot/hsail/HSAILHotSpotBackend.java Tue Apr 01 10:48:04 2014 +0200 +++ b/graal/com.oracle.graal.hotspot.hsail/src/com/oracle/graal/hotspot/hsail/HSAILHotSpotBackend.java Tue Apr 01 15:23:21 2014 +0200 @@ -375,8 +375,8 @@ } @Override - public NodeLIRBuilder newNodeLIRGenerator(StructuredGraph graph, LIRGenerationResult lirGenRes, LIRGenerator lirGen) { - return new HSAILHotSpotNodeLIRBuilder(graph, lirGenRes, lirGen); + public NodeLIRBuilder newNodeLIRGenerator(StructuredGraph graph, LIRGenerator lirGen) { + return new HSAILHotSpotNodeLIRBuilder(graph, lirGen); } class HotSpotFrameContext implements FrameContext { diff -r dadb07012689 -r 88dfaf6448e0 graal/com.oracle.graal.hotspot.hsail/src/com/oracle/graal/hotspot/hsail/HSAILHotSpotLIRGenerator.java --- a/graal/com.oracle.graal.hotspot.hsail/src/com/oracle/graal/hotspot/hsail/HSAILHotSpotLIRGenerator.java Tue Apr 01 10:48:04 2014 +0200 +++ b/graal/com.oracle.graal.hotspot.hsail/src/com/oracle/graal/hotspot/hsail/HSAILHotSpotLIRGenerator.java Tue Apr 01 15:23:21 2014 +0200 @@ -174,7 +174,7 @@ */ private void emitDeoptimizeInner(Value actionAndReason, LIRFrameState lirFrameState, String emitName) { DeoptimizeOp deopt = new DeoptimizeOp(actionAndReason, lirFrameState, emitName, getMetaAccess()); - ((HSAILHotSpotLIRGenerationResult) res).addDeopt(deopt); + ((HSAILHotSpotLIRGenerationResult) getResult()).addDeopt(deopt); append(deopt); } diff -r dadb07012689 -r 88dfaf6448e0 graal/com.oracle.graal.hotspot.hsail/src/com/oracle/graal/hotspot/hsail/HSAILHotSpotNodeLIRBuilder.java --- a/graal/com.oracle.graal.hotspot.hsail/src/com/oracle/graal/hotspot/hsail/HSAILHotSpotNodeLIRBuilder.java Tue Apr 01 10:48:04 2014 +0200 +++ b/graal/com.oracle.graal.hotspot.hsail/src/com/oracle/graal/hotspot/hsail/HSAILHotSpotNodeLIRBuilder.java Tue Apr 01 15:23:21 2014 +0200 @@ -45,8 +45,8 @@ */ public class HSAILHotSpotNodeLIRBuilder extends HSAILNodeLIRBuilder { - public HSAILHotSpotNodeLIRBuilder(StructuredGraph graph, LIRGenerationResult lirGenRes, LIRGenerator lirGen) { - super(graph, lirGenRes, lirGen); + public HSAILHotSpotNodeLIRBuilder(StructuredGraph graph, LIRGenerator lirGen) { + super(graph, lirGen); } private HSAILHotSpotLIRGenerator getGen() { diff -r dadb07012689 -r 88dfaf6448e0 graal/com.oracle.graal.hotspot.ptx/src/com/oracle/graal/hotspot/ptx/PTXHotSpotBackend.java --- a/graal/com.oracle.graal.hotspot.ptx/src/com/oracle/graal/hotspot/ptx/PTXHotSpotBackend.java Tue Apr 01 10:48:04 2014 +0200 +++ b/graal/com.oracle.graal.hotspot.ptx/src/com/oracle/graal/hotspot/ptx/PTXHotSpotBackend.java Tue Apr 01 15:23:21 2014 +0200 @@ -67,7 +67,7 @@ /** * Descriptor for the PTX runtime method for calling a kernel. The C++ signature is: - * + * *
      *     jlong (JavaThread* thread,
      *            jlong kernel,
@@ -113,7 +113,7 @@
 
     /**
      * Initializes the GPU device.
-     * 
+     *
      * @return whether or not initialization was successful
      */
     private static native boolean initialize();
@@ -167,7 +167,7 @@
 
     /**
      * Compiles a given method to PTX code.
-     * 
+     *
      * @param makeBinary specifies whether a GPU binary should also be generated for the PTX code.
      *            If true, the returned value is guaranteed to have a non-zero
      *            {@linkplain ExternalCompilationResult#getEntryPoint() entry point}.
@@ -358,8 +358,8 @@
     }
 
     @Override
-    public NodeLIRBuilder newNodeLIRGenerator(StructuredGraph graph, LIRGenerationResult lirGenRes, LIRGenerator lirGen) {
-        return new PTXHotSpotNodeLIRBuilder(graph, lirGenRes, lirGen);
+    public NodeLIRBuilder newNodeLIRGenerator(StructuredGraph graph, LIRGenerator lirGen) {
+        return new PTXHotSpotNodeLIRBuilder(graph, lirGen);
     }
 
     private static void emitKernelEntry(CompilationResultBuilder crb, LIR lir, ResolvedJavaMethod codeCacheOwner) {
diff -r dadb07012689 -r 88dfaf6448e0 graal/com.oracle.graal.hotspot.ptx/src/com/oracle/graal/hotspot/ptx/PTXHotSpotNodeLIRBuilder.java
--- a/graal/com.oracle.graal.hotspot.ptx/src/com/oracle/graal/hotspot/ptx/PTXHotSpotNodeLIRBuilder.java	Tue Apr 01 10:48:04 2014 +0200
+++ b/graal/com.oracle.graal.hotspot.ptx/src/com/oracle/graal/hotspot/ptx/PTXHotSpotNodeLIRBuilder.java	Tue Apr 01 15:23:21 2014 +0200
@@ -35,8 +35,8 @@
  */
 public class PTXHotSpotNodeLIRBuilder extends PTXNodeLIRBuilder implements HotSpotNodeLIRBuilder {
 
-    protected PTXHotSpotNodeLIRBuilder(StructuredGraph graph, LIRGenerationResult lirGenRes, LIRGenerator lirGen) {
-        super(graph, lirGenRes, lirGen);
+    protected PTXHotSpotNodeLIRBuilder(StructuredGraph graph, LIRGenerator lirGen) {
+        super(graph, lirGen);
     }
 
     public void emitPrefetchAllocate(ValueNode address, ValueNode distance) {
diff -r dadb07012689 -r 88dfaf6448e0 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	Tue Apr 01 10:48:04 2014 +0200
+++ b/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotBackend.java	Tue Apr 01 15:23:21 2014 +0200
@@ -84,13 +84,13 @@
     }
 
     @Override
-    public NodeLIRBuilder newNodeLIRGenerator(StructuredGraph graph, LIRGenerationResult lirGenRes, LIRGenerator lirGen) {
-        return new SPARCHotSpotNodeLIRBuilder(graph, lirGenRes, lirGen);
+    public NodeLIRBuilder newNodeLIRGenerator(StructuredGraph graph, LIRGenerator lirGen) {
+        return new SPARCHotSpotNodeLIRBuilder(graph, lirGen);
     }
 
     /**
      * Emits code to do stack overflow checking.
-     * 
+     *
      * @param afterFrameInit specifies if the stack pointer has already been adjusted to allocate
      *            the current frame
      */
diff -r dadb07012689 -r 88dfaf6448e0 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	Tue Apr 01 10:48:04 2014 +0200
+++ b/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotLIRGenerator.java	Tue Apr 01 15:23:21 2014 +0200
@@ -74,7 +74,7 @@
     }
 
     public Stub getStub() {
-        return ((SPARCHotSpotLIRGenerationResult) res).getStub();
+        return ((SPARCHotSpotLIRGenerationResult) getResult()).getStub();
     }
 
     @Override
diff -r dadb07012689 -r 88dfaf6448e0 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	Tue Apr 01 10:48:04 2014 +0200
+++ b/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotNodeLIRBuilder.java	Tue Apr 01 15:23:21 2014 +0200
@@ -44,13 +44,13 @@
 
 public class SPARCHotSpotNodeLIRBuilder extends SPARCNodeLIRBuilder implements HotSpotNodeLIRBuilder {
 
-    public SPARCHotSpotNodeLIRBuilder(StructuredGraph graph, LIRGenerationResult lirGenRes, LIRGenerator lirGen) {
-        super(graph, lirGenRes, lirGen);
+    public SPARCHotSpotNodeLIRBuilder(StructuredGraph graph, LIRGenerator lirGen) {
+        super(graph, lirGen);
     }
 
     @Override
     protected DebugInfoBuilder createDebugInfoBuilder(NodeMap nodeOperands) {
-        HotSpotLockStack lockStack = new HotSpotLockStack(res.getFrameMap(), Kind.Long);
+        HotSpotLockStack lockStack = new HotSpotLockStack(gen.getResult().getFrameMap(), Kind.Long);
         return new HotSpotDebugInfoBuilder(nodeOperands, lockStack);
     }