# HG changeset patch # User Christian Wimmer # Date 1400637753 25200 # Node ID 15771ff797b45e1120c9cf73df00c45b0a4d10f3 # Parent 6fe57ff3f02cf9d53ab5ddbb98cae98e6c35dd79 Pass the compiled method to LIR factory diff -r 6fe57ff3f02c -r 15771ff797b4 graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CompilationResult.java --- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CompilationResult.java Tue May 20 19:01:08 2014 -0700 +++ b/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CompilationResult.java Tue May 20 19:02:33 2014 -0700 @@ -460,7 +460,6 @@ private int totalFrameSize = -1; private int customStackAreaOffset = -1; - private int registerRestoreEpilogueOffset = -1; private final String name; @@ -641,26 +640,6 @@ } /** - * Allows a method to specify the offset of the epilogue that restores the callee saved - * registers. Must be called iff the method is a callee saved method and stores callee registers - * on the stack. - * - * @param registerRestoreEpilogueOffset the offset in the machine code where the epilogue begins - */ - public void setRegisterRestoreEpilogueOffset(int registerRestoreEpilogueOffset) { - assert this.registerRestoreEpilogueOffset == -1; - this.registerRestoreEpilogueOffset = registerRestoreEpilogueOffset; - } - - /** - * @return the code offset of the start of the epilogue that restores all callee saved - * registers, or -1 if this is not a callee saved method - */ - public int getRegisterRestoreEpilogueOffset() { - return registerRestoreEpilogueOffset; - } - - /** * Offset in bytes for the custom stack area (relative to sp). * * @return the offset in bytes diff -r 6fe57ff3f02c -r 15771ff797b4 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 May 20 19:01:08 2014 -0700 +++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/GraalCompiler.java Tue May 20 19:02:33 2014 -0700 @@ -241,7 +241,7 @@ } try (Scope ds = Debug.scope("BackEnd", lir)) { FrameMap frameMap = backend.newFrameMap(registerConfig); - LIRGenerationResult lirGenRes = backend.newLIRGenerationResult(lir, frameMap, stub); + LIRGenerationResult lirGenRes = backend.newLIRGenerationResult(lir, frameMap, graph.method(), stub); LIRGeneratorTool lirGen = backend.newLIRGenerator(cc, lirGenRes); NodeLIRBuilderTool nodeLirGen = backend.newNodeLIRBuilder(graph, lirGen); diff -r 6fe57ff3f02c -r 15771ff797b4 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 May 20 19:01:08 2014 -0700 +++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/NodeLIRBuilder.java Tue May 20 19:02:33 2014 -0700 @@ -101,14 +101,14 @@ public NodeLIRBuilder(StructuredGraph graph, LIRGeneratorTool gen) { this.gen = gen; this.nodeOperands = graph.createNodeMap(); - this.debugInfoBuilder = createDebugInfoBuilder(nodeOperands); + this.debugInfoBuilder = createDebugInfoBuilder(graph, nodeOperands); if (MatchExpressions.getValue()) { matchRules = MatchRuleRegistry.lookup(getClass()); } } - @SuppressWarnings("hiding") - protected DebugInfoBuilder createDebugInfoBuilder(NodeMap nodeOperands) { + @SuppressWarnings({"unused", "hiding"}) + protected DebugInfoBuilder createDebugInfoBuilder(StructuredGraph graph, NodeMap nodeOperands) { return new DebugInfoBuilder(nodeOperands); } diff -r 6fe57ff3f02c -r 15771ff797b4 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 May 20 19:01:08 2014 -0700 +++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/target/Backend.java Tue May 20 19:02:33 2014 -0700 @@ -75,7 +75,7 @@ public abstract LIRGeneratorTool newLIRGenerator(CallingConvention cc, LIRGenerationResult lirGenRes); - public abstract LIRGenerationResult newLIRGenerationResult(LIR lir, FrameMap frameMap, Object stub); + public abstract LIRGenerationResult newLIRGenerationResult(LIR lir, FrameMap frameMap, ResolvedJavaMethod method, Object stub); public abstract NodeLIRBuilderTool newNodeLIRBuilder(StructuredGraph graph, LIRGeneratorTool lirGen); diff -r 6fe57ff3f02c -r 15771ff797b4 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 May 20 19:01:08 2014 -0700 +++ b/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotBackend.java Tue May 20 19:02:33 2014 -0700 @@ -26,6 +26,7 @@ import static com.oracle.graal.api.code.CallingConvention.Type.*; import static com.oracle.graal.api.code.ValueUtil.*; import static com.oracle.graal.compiler.common.GraalOptions.*; + import java.util.*; import sun.misc.*; @@ -77,7 +78,7 @@ } @Override - public LIRGenerationResult newLIRGenerationResult(LIR lir, FrameMap frameMap, Object stub) { + public LIRGenerationResult newLIRGenerationResult(LIR lir, FrameMap frameMap, ResolvedJavaMethod method, Object stub) { return new AMD64HotSpotLIRGenerationResult(lir, frameMap, stub); } @@ -190,7 +191,6 @@ CalleeSaveLayout csl = crb.frameMap.registerConfig.getCalleeSaveLayout(); if (csl != null && csl.size != 0) { - crb.compilationResult.setRegisterRestoreEpilogueOffset(asm.position()); // saved all registers, restore all registers int frameToCSA = crb.frameMap.offsetToCalleeSaveArea(); asm.restore(csl, frameToCSA); diff -r 6fe57ff3f02c -r 15771ff797b4 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 May 20 19:01:08 2014 -0700 +++ b/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotNodeLIRBuilder.java Tue May 20 19:02:33 2014 -0700 @@ -131,7 +131,7 @@ } @Override - protected DebugInfoBuilder createDebugInfoBuilder(NodeMap nodeOperands) { + protected DebugInfoBuilder createDebugInfoBuilder(StructuredGraph graph, NodeMap nodeOperands) { HotSpotLockStack lockStack = new HotSpotLockStack(gen.getResult().getFrameMap(), Kind.Long); return new HotSpotDebugInfoBuilder(nodeOperands, lockStack); } diff -r 6fe57ff3f02c -r 15771ff797b4 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 May 20 19:01:08 2014 -0700 +++ b/graal/com.oracle.graal.hotspot.hsail/src/com/oracle/graal/hotspot/hsail/HSAILHotSpotBackend.java Tue May 20 19:02:33 2014 -0700 @@ -316,7 +316,6 @@ // from host code result.setTotalFrameSize(hostCode.getTotalFrameSize()); result.setCustomStackAreaOffset(hostCode.getCustomStackAreaOffset()); - result.setRegisterRestoreEpilogueOffset(hostCode.getRegisterRestoreEpilogueOffset()); result.setTargetCode(hostCode.getTargetCode(), hostCode.getTargetCodeSize()); for (CodeAnnotation annotation : hostCode.getAnnotations()) { result.addAnnotation(annotation); @@ -409,7 +408,7 @@ } @Override - public LIRGenerationResult newLIRGenerationResult(LIR lir, FrameMap frameMap, Object stub) { + public LIRGenerationResult newLIRGenerationResult(LIR lir, FrameMap frameMap, ResolvedJavaMethod method, Object stub) { return new HSAILHotSpotLIRGenerationResult(lir, frameMap); } diff -r 6fe57ff3f02c -r 15771ff797b4 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 May 20 19:01:08 2014 -0700 +++ b/graal/com.oracle.graal.hotspot.ptx/src/com/oracle/graal/hotspot/ptx/PTXHotSpotBackend.java Tue May 20 19:02:33 2014 -0700 @@ -346,7 +346,7 @@ } @Override - public LIRGenerationResult newLIRGenerationResult(LIR lir, FrameMap frameMap, Object stub) { + public LIRGenerationResult newLIRGenerationResult(LIR lir, FrameMap frameMap, ResolvedJavaMethod method, Object stub) { return new LIRGenerationResultBase(lir, frameMap); } diff -r 6fe57ff3f02c -r 15771ff797b4 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 May 20 19:01:08 2014 -0700 +++ b/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotBackend.java Tue May 20 19:02:33 2014 -0700 @@ -26,6 +26,7 @@ import static com.oracle.graal.api.code.ValueUtil.*; import static com.oracle.graal.compiler.common.GraalOptions.*; import static com.oracle.graal.sparc.SPARC.*; + import java.util.*; import sun.misc.*; @@ -83,7 +84,7 @@ } @Override - public LIRGenerationResult newLIRGenerationResult(LIR lir, FrameMap frameMap, Object stub) { + public LIRGenerationResult newLIRGenerationResult(LIR lir, FrameMap frameMap, ResolvedJavaMethod method, Object stub) { return new SPARCHotSpotLIRGenerationResult(lir, frameMap, stub); } diff -r 6fe57ff3f02c -r 15771ff797b4 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 May 20 19:01:08 2014 -0700 +++ b/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotNodeLIRBuilder.java Tue May 20 19:02:33 2014 -0700 @@ -51,7 +51,7 @@ } @Override - protected DebugInfoBuilder createDebugInfoBuilder(NodeMap nodeOperands) { + protected DebugInfoBuilder createDebugInfoBuilder(StructuredGraph graph, NodeMap nodeOperands) { HotSpotLockStack lockStack = new HotSpotLockStack(gen.getResult().getFrameMap(), Kind.Long); return new HotSpotDebugInfoBuilder(nodeOperands, lockStack); }