# HG changeset patch # User Doug Simon # Date 1369389750 -7200 # Node ID c010c12ab682cd8f29b898103237c1bac55f7871 # Parent 8a3242d497869c4c2714ebcf48f64a014b022f4d put disassembling of installed code under the control of Debug.log(); use -G:Log=CodeInstall to show disassembly for all installed code diff -r 8a3242d49786 -r c010c12ab682 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/CompilationTask.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/CompilationTask.java Fri May 24 11:38:07 2013 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/CompilationTask.java Fri May 24 12:02:30 2013 +0200 @@ -25,16 +25,15 @@ import static com.oracle.graal.api.code.CodeUtil.*; import static com.oracle.graal.nodes.StructuredGraph.*; -import java.lang.reflect.Modifier; +import java.lang.reflect.*; import java.util.concurrent.*; import com.oracle.graal.api.code.*; -import com.oracle.graal.api.code.CallingConvention.*; +import com.oracle.graal.api.code.CallingConvention.Type; import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.*; import com.oracle.graal.debug.*; import com.oracle.graal.debug.internal.*; -import com.oracle.graal.graph.*; import com.oracle.graal.hotspot.meta.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.spi.*; @@ -62,6 +61,8 @@ private final int id; private final int priority; + private StructuredGraph graph; + public static CompilationTask create(HotSpotGraalRuntime graalRuntime, PhasePlan plan, OptimisticOptimizations optimisticOpts, HotSpotResolvedJavaMethod method, int entryBCI, int id, int priority) { return new CompilationTask(graalRuntime, plan, optimisticOpts, method, entryBCI, id, priority); } @@ -151,7 +152,7 @@ public CompilationResult call() throws Exception { graalRuntime.evictDeoptedGraphs(); Replacements replacements = graalRuntime.getReplacements(); - StructuredGraph graph = replacements.getMethodSubstitution(method); + graph = replacements.getMethodSubstitution(method); if (graph == null || entryBCI != INVOCATION_ENTRY_BCI) { graph = new StructuredGraph(method, entryBCI); } else { @@ -172,7 +173,7 @@ } } - installMethod(result, null); + installMethod(result); } catch (BailoutException bailout) { Debug.metric("Bailouts").increment(); if (GraalOptions.ExitVMOnBailout) { @@ -204,7 +205,7 @@ MetaUtil.format("%H::%n(%p)", method), isOSR ? "@ " + entryBCI + " " : "", method.getCodeSize())); } - private void installMethod(final CompilationResult compResult, final Graph graph) { + private void installMethod(final CompilationResult compResult) { Debug.scope("CodeInstall", new Object[]{new DebugDumpScope(String.valueOf(id), true), graalRuntime.getRuntime(), method}, new Runnable() { @Override @@ -213,8 +214,9 @@ if (Debug.isDumpEnabled()) { Debug.dump(new Object[]{compResult, installedCode}, "After code installation"); } - // TTY.println(String.valueOf(graph)); - // TTY.println(graalRuntime.getRuntime().disassemble(installedCode)); + if (Debug.isLogEnabled()) { + Debug.log("%s", graalRuntime.getRuntime().disassemble(installedCode)); + } } }); diff -r 8a3242d49786 -r c010c12ab682 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/stubs/Stub.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/stubs/Stub.java Fri May 24 11:38:07 2013 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/stubs/Stub.java Fri May 24 12:02:30 2013 +0200 @@ -173,8 +173,9 @@ if (Debug.isDumpEnabled()) { Debug.dump(new Object[]{compResult, installedCode}, "After code installation"); } - // TTY.println(stub.toString()); - // TTY.println(runtime.disassemble(installedCode)); + if (Debug.isLogEnabled()) { + Debug.log("%s", runtime.disassemble(installedCode)); + } return installedCode; } });