# HG changeset patch # User Christian Wimmer # Date 1326216900 28800 # Node ID 81dc77ed0695f0899c093f76bb9f95296c877fa9 # Parent 1e62f742f0b3d12e047c6de0b881c79888aedf8c# Parent fc2f14acd5a559deeb9ae9c54c502d37ad8e0b4b Merge diff -r 1e62f742f0b3 -r 81dc77ed0695 graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/GraalCompilation.java --- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/GraalCompilation.java Tue Jan 10 09:07:56 2012 -0800 +++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/GraalCompilation.java Tue Jan 10 09:35:00 2012 -0800 @@ -71,11 +71,12 @@ * @param context the compilation context * @param compiler the compiler * @param method the method to be compiled or {@code null} if generating code for a stub + * @param graph the initial graph * @param osrBCI the bytecode index for on-stack replacement, if requested * @param stats externally supplied statistics object to be used if not {@code null} * @param debugInfoLevel TODO */ - private GraalCompilation(GraalContext context, GraalCompiler compiler, RiResolvedMethod method, StructuredGraph graph, int osrBCI, CiStatistics stats, DebugInfoLevel debugInfoLevel) { + public GraalCompilation(GraalContext context, GraalCompiler compiler, RiResolvedMethod method, StructuredGraph graph, int osrBCI, CiStatistics stats, DebugInfoLevel debugInfoLevel) { if (osrBCI != -1) { throw new CiBailout("No OSR supported"); } @@ -91,11 +92,6 @@ } } - public GraalCompilation(GraalContext context, GraalCompiler compiler, RiResolvedMethod method, int osrBCI, CiStatistics stats, DebugInfoLevel debugInfoLevel) { - this(context, compiler, method, new StructuredGraph(method), osrBCI, stats, debugInfoLevel); - } - - public void close() { // TODO(tw): Check if we can delete this method. } diff -r 1e62f742f0b3 -r 81dc77ed0695 graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/GraalCompiler.java --- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/GraalCompiler.java Tue Jan 10 09:07:56 2012 -0800 +++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/GraalCompiler.java Tue Jan 10 09:35:00 2012 -0800 @@ -32,6 +32,7 @@ import com.oracle.max.graal.compiler.stub.*; import com.oracle.max.graal.compiler.target.*; import com.oracle.max.graal.cri.*; +import com.oracle.max.graal.nodes.*; public class GraalCompiler { @@ -76,6 +77,10 @@ } public CiTargetMethod compileMethod(RiResolvedMethod method, int osrBCI, CiStatistics stats, CiCompiler.DebugInfoLevel debugInfoLevel, PhasePlan plan) { + return compileMethod(method, new StructuredGraph(method), osrBCI, stats, debugInfoLevel, plan); + } + + public CiTargetMethod compileMethod(RiResolvedMethod method, StructuredGraph graph, int osrBCI, CiStatistics stats, CiCompiler.DebugInfoLevel debugInfoLevel, PhasePlan plan) { context.timers.startScope(getClass()); try { long startTime = 0; @@ -92,7 +97,7 @@ CiTargetMethod result = null; TTY.Filter filter = new TTY.Filter(GraalOptions.PrintFilter, method); - GraalCompilation compilation = new GraalCompilation(context, this, method, osrBCI, stats, debugInfoLevel); + GraalCompilation compilation = new GraalCompilation(context, this, method, graph, osrBCI, stats, debugInfoLevel); try { result = compilation.compile(plan); } finally { diff -r 1e62f742f0b3 -r 81dc77ed0695 graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/target/amd64/AMD64Backend.java --- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/target/amd64/AMD64Backend.java Tue Jan 10 09:07:56 2012 -0800 +++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/target/amd64/AMD64Backend.java Tue Jan 10 09:35:00 2012 -0800 @@ -34,6 +34,7 @@ import com.oracle.max.graal.compiler.stub.*; import com.oracle.max.graal.compiler.stub.CompilerStub.Id; import com.oracle.max.graal.compiler.target.*; +import com.oracle.max.graal.nodes.*; /** * The {@code X86Backend} class represents the backend for the AMD64 architecture. @@ -70,7 +71,7 @@ @Override public CompilerStub emit(GraalContext context, Id stub) { - final GraalCompilation comp = new GraalCompilation(context, compiler, null, -1, null, DebugInfoLevel.FULL); + final GraalCompilation comp = new GraalCompilation(context, compiler, null, new StructuredGraph(), -1, null, DebugInfoLevel.FULL); try { return new AMD64CompilerStubEmitter(comp, stub.arguments, stub.resultKind).emit(stub); } finally { @@ -80,7 +81,7 @@ @Override public CompilerStub emit(GraalContext context, CiRuntimeCall rtCall) { - final GraalCompilation comp = new GraalCompilation(context, compiler, null, -1, null, DebugInfoLevel.FULL); + final GraalCompilation comp = new GraalCompilation(context, compiler, null, new StructuredGraph(), -1, null, DebugInfoLevel.FULL); try { return new AMD64CompilerStubEmitter(comp, rtCall.arguments, rtCall.resultKind).emit(rtCall); } finally { @@ -100,7 +101,7 @@ @Override public CompilerStub emit(GraalContext context, XirTemplate t) { - final GraalCompilation comp = new GraalCompilation(context, compiler, null, -1, null, DebugInfoLevel.FULL); + final GraalCompilation comp = new GraalCompilation(context, compiler, null, new StructuredGraph(), -1, null, DebugInfoLevel.FULL); try { return new AMD64CompilerStubEmitter(comp, getArgumentKinds(t), t.resultOperand.kind).emit(t); } finally {