# HG changeset patch # User Mick Jordan # Date 1378243132 25200 # Node ID 9ea3658e7c5d28079763c6801eb3ae0048fcdd8d # Parent 65d2f38c0aa582ded2906451cf82aab7536aaf09# Parent 1f03076a121b1b58f6b880c27af1041d2421668c Merge diff -r 1f03076a121b -r 9ea3658e7c5d 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 14:09:56 2013 -0700 +++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/TruffleCompilerImpl.java Tue Sep 03 14:18:52 2013 -0700 @@ -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; } });