# HG changeset patch # User Doug Simon # Date 1386060502 -3600 # Node ID 7086a2fe73703f50ad0c6a6fac732351001be454 # Parent 78c808233ff1d79c06c407e1b4e52672a0083ce6 renamed TargetMethodAssembler.finishTargetMethod to finalize and made its return type void diff -r 78c808233ff1 -r 7086a2fe7370 graal/com.oracle.graal.compiler.ptx/src/com/oracle/graal/compiler/ptx/PTXTargetMethodAssembler.java --- a/graal/com.oracle.graal.compiler.ptx/src/com/oracle/graal/compiler/ptx/PTXTargetMethodAssembler.java Mon Dec 02 17:03:22 2013 +0100 +++ b/graal/com.oracle.graal.compiler.ptx/src/com/oracle/graal/compiler/ptx/PTXTargetMethodAssembler.java Tue Dec 03 09:48:22 2013 +0100 @@ -46,26 +46,24 @@ // detach ?? public PTXTargetMethodAssembler(CodeCacheProvider codeCache, ForeignCallsProvider foreignCalls, FrameMap frameMap, AbstractAssembler asm, FrameContext frameContext, - CompilationResult compilationResult) { + ExternalCompilationResult compilationResult) { super(codeCache, foreignCalls, frameMap, asm, frameContext, compilationResult); } @Override - public CompilationResult finishTargetMethod(StructuredGraph graph) { + public void finalize(StructuredGraph graph) { ResolvedJavaMethod method = graph.method(); assert method != null : graph + " is not associated wth a method"; - - ExternalCompilationResult graalCompile = (ExternalCompilationResult) super.finishTargetMethod(graph); + super.finalize(graph); + ExternalCompilationResult result = (ExternalCompilationResult) compilationResult; try { - if ((validDevice) && (graalCompile.getTargetCode() != null)) { - long kernel = toGPU.generateKernel(graalCompile.getTargetCode(), method.getName()); - graalCompile.setEntryPoint(kernel); + if ((validDevice) && (result.getTargetCode() != null)) { + long kernel = toGPU.generateKernel(result.getTargetCode(), method.getName()); + result.setEntryPoint(kernel); } } catch (Throwable th) { th.printStackTrace(); } - - return graalCompile; } } diff -r 78c808233ff1 -r 7086a2fe7370 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 Mon Dec 02 17:03:22 2013 +0100 +++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/GraalCompiler.java Tue Dec 03 09:48:22 2013 +0100 @@ -282,16 +282,16 @@ public static void emitCode(Backend backend, long[] leafGraphIds, Assumptions assumptions, LIRGenerator lirGen, CompilationResult compilationResult, ResolvedJavaMethod installedCodeOwner) { TargetMethodAssembler tasm = backend.newAssembler(lirGen, compilationResult); backend.emitCode(tasm, lirGen, installedCodeOwner); - CompilationResult result = tasm.finishTargetMethod(lirGen.getGraph()); + tasm.finalize(lirGen.getGraph()); if (!assumptions.isEmpty()) { - result.setAssumptions(assumptions); + compilationResult.setAssumptions(assumptions); } - result.setLeafGraphIds(leafGraphIds); + compilationResult.setLeafGraphIds(leafGraphIds); if (Debug.isLogEnabled()) { - Debug.log("%s", backend.getProviders().getCodeCache().disassemble(result, null)); + Debug.log("%s", backend.getProviders().getCodeCache().disassemble(compilationResult, null)); } - Debug.dump(result, "After code generation"); + Debug.dump(compilationResult, "After code generation"); } } diff -r 78c808233ff1 -r 7086a2fe7370 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 Mon Dec 02 17:03:22 2013 +0100 +++ b/graal/com.oracle.graal.hotspot.ptx/src/com/oracle/graal/hotspot/ptx/PTXHotSpotBackend.java Tue Dec 03 09:48:22 2013 +0100 @@ -176,7 +176,7 @@ FrameMap frameMap = lirGen.frameMap; AbstractAssembler masm = createAssembler(frameMap); PTXFrameContext frameContext = new PTXFrameContext(); - TargetMethodAssembler tasm = new PTXTargetMethodAssembler(getCodeCache(), getForeignCalls(), frameMap, masm, frameContext, compilationResult); + TargetMethodAssembler tasm = new PTXTargetMethodAssembler(getCodeCache(), getForeignCalls(), frameMap, masm, frameContext, (ExternalCompilationResult) compilationResult); tasm.setFrameSize(0); return tasm; } diff -r 78c808233ff1 -r 7086a2fe7370 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/asm/TargetMethodAssembler.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/asm/TargetMethodAssembler.java Mon Dec 02 17:03:22 2013 +0100 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/asm/TargetMethodAssembler.java Tue Dec 03 09:48:22 2013 +0100 @@ -92,7 +92,7 @@ compilationResult.addAnnotation(new CompilationResult.CodeComment(asm.codeBuffer.position(), s)); } - public CompilationResult finishTargetMethod(StructuredGraph graph) { + public void finalize(StructuredGraph graph) { // Install code, data and frame size compilationResult.setTargetCode(asm.codeBuffer.close(false), asm.codeBuffer.position()); @@ -120,14 +120,13 @@ } } - Debug.metric("TargetMethods").increment(); + Debug.metric("CompilationResults").increment(); Debug.metric("CodeBytesEmitted").add(compilationResult.getTargetCodeSize()); Debug.metric("InfopointsEmitted").add(compilationResult.getInfopoints().size()); Debug.metric("DataPatches").add(ldp.size()); Debug.metric("ExceptionHandlersEmitted").add(compilationResult.getExceptionHandlers().size()); } Debug.log("Finished compiling %s", graph); - return compilationResult; } public void recordExceptionHandlers(int pcOffset, LIRFrameState info) {