# HG changeset patch # User Doug Simon # Date 1378240562 -7200 # Node ID 65d2f38c0aa582ded2906451cf82aab7536aaf09 # Parent dc3c8df5590565dabbc8b30a64fa09146ab6c8a0 added timers for Truffle compilation pipeline diff -r dc3c8df55905 -r 65d2f38c0aa5 graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/TruffleCompilerImpl.java --- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/TruffleCompilerImpl.java Tue Sep 03 16:33:41 2013 +0200 +++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/TruffleCompilerImpl.java Tue Sep 03 22:36:02 2013 +0200 @@ -36,6 +36,7 @@ import com.oracle.graal.compiler.*; import com.oracle.graal.compiler.target.*; import com.oracle.graal.debug.*; +import com.oracle.graal.debug.internal.*; import com.oracle.graal.hotspot.*; import com.oracle.graal.java.*; import com.oracle.graal.nodes.*; @@ -107,6 +108,10 @@ }); } + public static final DebugTimer PartialEvaluationTime = Debug.timer("PartialEvaluationTime"); + public static final DebugTimer CompilationTime = Debug.timer("CompilationTime"); + public static final DebugTimer CodeInstallationTime = Debug.timer("CodeInstallation"); + private InstalledCode compileMethodImpl(final OptimizedCallTarget compilable) { final StructuredGraph graph; final GraphBuilderConfiguration config = GraphBuilderConfiguration.getDefault(); @@ -115,7 +120,9 @@ compilable.timeCompilationStarted = System.nanoTime(); Assumptions assumptions = new Assumptions(true); - graph = partialEvaluator.createGraph(compilable, assumptions); + try (TimerCloseable a = PartialEvaluationTime.start()) { + graph = partialEvaluator.createGraph(compilable, assumptions); + } compilable.timePartialEvaluationFinished = System.nanoTime(); compilable.nodeCountPartialEval = graph.getNodeCount(); InstalledCode compiledMethod = compileMethodHelper(graph, config, compilable, assumptions); @@ -143,9 +150,11 @@ @Override public CompilationResult call() { - CallingConvention cc = getCallingConvention(runtime, Type.JavaCallee, graph.method(), false); - return GraalCompiler.compileGraph(graph, cc, graph.method(), runtime, replacements, backend, runtime.getTarget(), null, plan, OptimisticOptimizations.ALL, new SpeculationLog(), - suites, new CompilationResult()); + try (TimerCloseable a = CompilationTime.start()) { + CallingConvention cc = getCallingConvention(runtime, Type.JavaCallee, graph.method(), false); + return GraalCompiler.compileGraph(graph, cc, graph.method(), runtime, replacements, backend, runtime.getTarget(), null, plan, OptimisticOptimizations.ALL, new SpeculationLog(), + suites, new CompilationResult()); + } } }); @@ -169,11 +178,13 @@ @Override public InstalledCode call() throws Exception { - InstalledCode installedCode = runtime.addMethod(graph.method(), result); - if (installedCode != null) { - Debug.dump(new Object[]{result, installedCode}, "After code installation"); + try (TimerCloseable a = CodeInstallationTime.start()) { + InstalledCode installedCode = runtime.addMethod(graph.method(), result); + if (installedCode != null) { + Debug.dump(new Object[]{result, installedCode}, "After code installation"); + } + return installedCode; } - return installedCode; } });