# HG changeset patch # User Doug Simon # Date 1368820931 -7200 # Node ID e415e58e0db2164a65f4dab64f6735e962b07aa2 # Parent a2074a73aeefccd4592d6ea2b79a81ca7f325d94 changed location of debug scope so that a subclass that overrides 'addMethod' still matches -G:Dump=CodeInstall option diff -r a2074a73aeef -r e415e58e0db2 graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/GraalCompilerTest.java --- a/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/GraalCompilerTest.java Fri May 17 16:45:16 2013 +0200 +++ b/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/GraalCompilerTest.java Fri May 17 22:02:11 2013 +0200 @@ -426,18 +426,29 @@ } long start = System.currentTimeMillis(); PhasePlan phasePlan = new PhasePlan(); - StructuredGraph graphCopy = graph.copy(); + final StructuredGraph graphCopy = graph.copy(); GraphBuilderPhase graphBuilderPhase = new GraphBuilderPhase(runtime, GraphBuilderConfiguration.getDefault(), OptimisticOptimizations.ALL); phasePlan.addPhase(PhasePosition.AFTER_PARSING, graphBuilderPhase); phasePlan.addPhase(PhasePosition.LOW_LEVEL, new WriteBarrierAdditionPhase()); editPhasePlan(method, graph, phasePlan); CallingConvention cc = getCallingConvention(runtime, Type.JavaCallee, graph.method(), false); - CompilationResult compResult = GraalCompiler.compileGraph(graph, cc, method, runtime, replacements, backend, runtime().getTarget(), null, phasePlan, OptimisticOptimizations.ALL, + final CompilationResult compResult = GraalCompiler.compileGraph(graph, cc, method, runtime, replacements, backend, runtime().getTarget(), null, phasePlan, OptimisticOptimizations.ALL, new SpeculationLog()); if (printCompilation) { TTY.println(String.format("@%-6d Graal %-70s %-45s %-50s | %4dms %5dB", id, "", "", "", System.currentTimeMillis() - start, compResult.getTargetCodeSize())); } - return addMethod(method, compResult, graphCopy); + return Debug.scope("CodeInstall", new Object[]{runtime, method}, new Callable() { + + @Override + public InstalledCode call() throws Exception { + InstalledCode code = addMethod(method, compResult, graphCopy); + if (Debug.isDumpEnabled()) { + Debug.dump(new Object[]{compResult, code}, "After code installation"); + } + + return code; + } + }); } }); @@ -448,18 +459,7 @@ } protected InstalledCode addMethod(final ResolvedJavaMethod method, final CompilationResult compResult, final StructuredGraph graph) { - return Debug.scope("CodeInstall", new Object[]{runtime, method}, new Callable() { - - @Override - public InstalledCode call() throws Exception { - InstalledCode installedCode = runtime.addMethod(method, compResult, graph); - if (Debug.isDumpEnabled()) { - Debug.dump(new Object[]{compResult, installedCode}, "After code installation"); - } - - return installedCode; - } - }); + return runtime.addMethod(method, compResult, graph); } /** diff -r a2074a73aeef -r e415e58e0db2 graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/HotSpotCryptoSubstitutionTest.java --- a/graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/HotSpotCryptoSubstitutionTest.java Fri May 17 16:45:16 2013 +0200 +++ b/graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/HotSpotCryptoSubstitutionTest.java Fri May 17 22:02:11 2013 +0200 @@ -35,14 +35,13 @@ import com.oracle.graal.api.code.*; import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.test.*; -import com.oracle.graal.debug.*; import com.oracle.graal.hotspot.*; import com.oracle.graal.hotspot.bridge.CompilerToVM.CodeInstallResult; import com.oracle.graal.hotspot.meta.*; import com.oracle.graal.nodes.*; /** - * Tests the intrinsicification of certain crypto methods. + * Tests the intrinsification of certain crypto methods. */ public class HotSpotCryptoSubstitutionTest extends GraalCompilerTest { @@ -53,9 +52,6 @@ HotSpotCompiledNmethod compiledNmethod = new HotSpotCompiledNmethod(hsMethod, StructuredGraph.INVOCATION_ENTRY_BCI, compResult); CodeInstallResult result = graalRuntime().getCompilerToVM().installCode(compiledNmethod, installedCode, null); Assert.assertEquals("Error installing method " + method + ": " + result, result, CodeInstallResult.OK); - if (Debug.isDumpEnabled()) { - Debug.dump(new Object[]{compResult, installedCode}, "After code installation"); - } // HotSpotRuntime hsRuntime = (HotSpotRuntime) runtime; // TTY.println(hsMethod.toString());