# HG changeset patch # User Doug Simon # Date 1377804774 -7200 # Node ID 78d96d41196554af337215f88b4d5ccc2619da98 # Parent 0cb481a623847e115ac0c87a15450c4022f790c8# Parent 93c63975217e2cff3f45d901e205ad1ff6b5e164 Merge. diff -r 93c63975217e -r 78d96d411965 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 Thu Aug 29 19:09:09 2013 +0200 +++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/GraalCompiler.java Thu Aug 29 21:32:54 2013 +0200 @@ -34,6 +34,7 @@ import com.oracle.graal.compiler.gen.*; import com.oracle.graal.compiler.target.*; import com.oracle.graal.debug.*; +import com.oracle.graal.debug.internal.*; import com.oracle.graal.lir.*; import com.oracle.graal.lir.asm.*; import com.oracle.graal.nodes.*; @@ -52,6 +53,9 @@ */ public class GraalCompiler { + private static final DebugTimer FrontEnd = Debug.timer("FrontEnd"); + private static final DebugTimer BackEnd = Debug.timer("BackEnd"); + /** * Requests compilation of a given graph. * @@ -62,13 +66,9 @@ * argument can be null. * @return the result of the compilation */ - public static CompilationResult compileGraph(final StructuredGraph graph, final CallingConvention cc, - final ResolvedJavaMethod installedCodeOwner, final GraalCodeCacheProvider runtime, - final Replacements replacements, final Backend backend, - final TargetDescription target, final GraphCache cache, - final PhasePlan plan, final OptimisticOptimizations optimisticOpts, - final SpeculationLog speculationLog, final Suites suites, - final CompilationResult compilationResult) { + public static CompilationResult compileGraph(final StructuredGraph graph, final CallingConvention cc, final ResolvedJavaMethod installedCodeOwner, final GraalCodeCacheProvider runtime, + final Replacements replacements, final Backend backend, final TargetDescription target, final GraphCache cache, final PhasePlan plan, final OptimisticOptimizations optimisticOpts, + final SpeculationLog speculationLog, final Suites suites, final CompilationResult compilationResult) { Debug.scope("GraalCompiler", new Object[]{graph, runtime}, new Runnable() { public void run() { @@ -76,22 +76,26 @@ final LIR lir = Debug.scope("FrontEnd", new Callable() { public LIR call() { - return emitHIR(runtime, target, graph, replacements, assumptions, cache, plan, optimisticOpts, speculationLog, suites); + try (TimerCloseable a = FrontEnd.start()) { + return emitHIR(runtime, target, graph, replacements, assumptions, cache, plan, optimisticOpts, speculationLog, suites); + } } }); - final LIRGenerator lirGen = Debug.scope("BackEnd", lir, new Callable() { + try (TimerCloseable a = BackEnd.start()) { + final LIRGenerator lirGen = Debug.scope("BackEnd", lir, new Callable() { - public LIRGenerator call() { - return emitLIR(backend, target, lir, graph, cc); - } - }); - Debug.scope("CodeGen", lirGen, new Runnable() { + public LIRGenerator call() { + return emitLIR(backend, target, lir, graph, cc); + } + }); + Debug.scope("CodeGen", lirGen, new Runnable() { - public void run() { - emitCode(backend, getLeafGraphIdArray(graph), assumptions, lirGen, compilationResult, installedCodeOwner); - } + public void run() { + emitCode(backend, getLeafGraphIdArray(graph), assumptions, lirGen, compilationResult, installedCodeOwner); + } - }); + }); + } } }); diff -r 93c63975217e -r 78d96d411965 graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/GraalDebugConfig.java --- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/GraalDebugConfig.java Thu Aug 29 19:09:09 2013 +0200 +++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/GraalDebugConfig.java Thu Aug 29 21:32:54 2013 +0200 @@ -38,15 +38,15 @@ // @formatter:off @Option(help = "Enable scope-based debugging", name = "Debug") public static final OptionValue DebugEnabled = new OptionValue<>(true); - @Option(help = "Scopes to be dumped") + @Option(help = "Pattern for scope(s) to in which dumping is enabled (see DebugFilter and Debug.dump)") public static final OptionValue Dump = new OptionValue<>(null); - @Option(help = "Scopes to be metered") + @Option(help = "Pattern for scope(s) to in which metering is enabled (see DebugFilter and Debug.metric)") public static final OptionValue Meter = new OptionValue<>(null); - @Option(help = "Scopes to be timed") + @Option(help = "Pattern for scope(s) to in which timing is enabled (see DebugFilter and Debug.timer)") public static final OptionValue Time = new OptionValue<>(null); - @Option(help = "Scopes to be logged") + @Option(help = "Pattern for scope(s) to in which logging is enabled (see DebugFilter and Debug.log)") public static final OptionValue Log = new OptionValue<>(null); - @Option(help = "Filters debug scope output by method name/pattern") + @Option(help = "Pattern for filtering debug scope output based on method context (see MethodFilter)") public static final OptionValue MethodFilter = new OptionValue<>(null); @Option(help = "How to print metric and timing values:%n" + "Name - aggregate by unqualified name%n" + diff -r 93c63975217e -r 78d96d411965 graal/com.oracle.graal.graph/src/com/oracle/graal/graph/Node.java --- a/graal/com.oracle.graal.graph/src/com/oracle/graal/graph/Node.java Thu Aug 29 19:09:09 2013 +0200 +++ b/graal/com.oracle.graal.graph/src/com/oracle/graal/graph/Node.java Thu Aug 29 21:32:54 2013 +0200 @@ -25,8 +25,10 @@ import java.lang.annotation.*; import java.util.*; +import com.oracle.graal.debug.*; import com.oracle.graal.graph.Graph.NodeChangedListener; -import com.oracle.graal.graph.NodeClass.*; +import com.oracle.graal.graph.NodeClass.NodeClassIterator; +import com.oracle.graal.graph.NodeClass.Position; import com.oracle.graal.graph.iterators.*; /** @@ -122,7 +124,10 @@ private Node predecessor; private int modCount; + private static final DebugMetric NODE_COUNT = Debug.metric("HIRNodes"); + public Node() { + NODE_COUNT.increment(); this.graph = null; this.id = INITIAL_ID; } diff -r 93c63975217e -r 78d96d411965 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 Thu Aug 29 19:09:09 2013 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/CompilationTask.java Thu Aug 29 21:32:54 2013 +0200 @@ -113,6 +113,8 @@ */ public static final DebugTimer CompilationTime = Debug.timer("CompilationTime"); + public static final DebugTimer CodeInstallationTime = Debug.timer("CodeInstallation"); + public void runCompilation() { /* * no code must be outside this try/finally because it could happen otherwise that @@ -164,7 +166,9 @@ } } - installMethod(result); + try (TimerCloseable b = CodeInstallationTime.start()) { + installMethod(result); + } stats.finish(method); } catch (BailoutException bailout) { Debug.metric("Bailouts").increment(); diff -r 93c63975217e -r 78d96d411965 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/CompositeValue.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/CompositeValue.java Thu Aug 29 19:09:09 2013 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/CompositeValue.java Thu Aug 29 21:32:54 2013 +0200 @@ -25,6 +25,7 @@ import java.lang.annotation.*; import com.oracle.graal.api.meta.*; +import com.oracle.graal.debug.*; import com.oracle.graal.lir.LIRInstruction.OperandFlag; import com.oracle.graal.lir.LIRInstruction.OperandMode; import com.oracle.graal.lir.LIRInstruction.ValueProcedure; @@ -45,8 +46,11 @@ private final CompositeValueClass valueClass; + private static final DebugMetric COMPOSITE_VALUE_COUNT = Debug.metric("CompositeValues"); + public CompositeValue(PlatformKind kind) { super(kind); + COMPOSITE_VALUE_COUNT.increment(); valueClass = CompositeValueClass.get(getClass()); } diff -r 93c63975217e -r 78d96d411965 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/LIRInstruction.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/LIRInstruction.java Thu Aug 29 19:09:09 2013 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/LIRInstruction.java Thu Aug 29 21:32:54 2013 +0200 @@ -30,6 +30,7 @@ import com.oracle.graal.api.code.*; import com.oracle.graal.api.meta.*; +import com.oracle.graal.debug.*; import com.oracle.graal.graph.*; import com.oracle.graal.lir.asm.*; @@ -211,10 +212,13 @@ */ private int id; + private static final DebugMetric LIR_NODE_COUNT = Debug.metric("LIRNodes"); + /** * Constructs a new LIR instruction. */ public LIRInstruction() { + LIR_NODE_COUNT.increment(); instructionClass = LIRInstructionClass.get(getClass()); id = -1; } diff -r 93c63975217e -r 78d96d411965 graal/com.oracle.graal.phases/src/com/oracle/graal/phases/GraalOptions.java --- a/graal/com.oracle.graal.phases/src/com/oracle/graal/phases/GraalOptions.java Thu Aug 29 19:09:09 2013 +0200 +++ b/graal/com.oracle.graal.phases/src/com/oracle/graal/phases/GraalOptions.java Thu Aug 29 21:32:54 2013 +0200 @@ -89,12 +89,12 @@ @Option(help = "") public static final OptionValue DeoptsToDisableOptimisticOptimization = new OptionValue<>(40); - // comilation queue - @Option(help = "") + // compilation queue + @Option(help = "Compile all methods in all classes on given class path") public static final OptionValue CompileTheWorld = new OptionValue<>(null); - @Option(help = "") + @Option(help = "First class to consider when using CompileTheWorld") public static final OptionValue CompileTheWorldStartAt = new OptionValue<>(1); - @Option(help = "") + @Option(help = "Last class to consider when using CompileTheWorld") public static final OptionValue CompileTheWorldStopAt = new OptionValue<>(Integer.MAX_VALUE); // graph caching diff -r 93c63975217e -r 78d96d411965 mx/projects --- a/mx/projects Thu Aug 29 19:09:09 2013 +0200 +++ b/mx/projects Thu Aug 29 21:32:54 2013 +0200 @@ -177,7 +177,7 @@ # graal.graph project@com.oracle.graal.graph@subDir=graal project@com.oracle.graal.graph@sourceDirs=src -project@com.oracle.graal.graph@dependencies= +project@com.oracle.graal.graph@dependencies=com.oracle.graal.debug project@com.oracle.graal.graph@javaCompliance=1.7 project@com.oracle.graal.graph@workingSets=Graal,Graph @@ -288,7 +288,7 @@ # graal.nodes project@com.oracle.graal.nodes@subDir=graal project@com.oracle.graal.nodes@sourceDirs=src -project@com.oracle.graal.nodes@dependencies=com.oracle.graal.api.code,com.oracle.graal.graph,com.oracle.graal.debug,com.oracle.graal.api.replacements +project@com.oracle.graal.nodes@dependencies=com.oracle.graal.graph,com.oracle.graal.api.replacements,com.oracle.graal.api.code project@com.oracle.graal.nodes@checkstyle=com.oracle.graal.graph project@com.oracle.graal.nodes@javaCompliance=1.7 project@com.oracle.graal.nodes@workingSets=Graal,Graph