Mercurial > hg > graal-compiler
changeset 11601:ceecc37b44d7
Merge.
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Wed, 11 Sep 2013 09:37:39 +0200 |
parents | 60f4c505993e (diff) 91e5f927af63 (current diff) |
children | 73dbd282ad3a |
files | src/gpu/ptx/vm/kernelArguments.cpp src/gpu/ptx/vm/kernelArguments.hpp |
diffstat | 4 files changed, 39 insertions(+), 17 deletions(-) [+] |
line wrap: on
line diff
--- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/GraalDebugConfig.java Tue Sep 10 22:39:50 2013 -0400 +++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/GraalDebugConfig.java Wed Sep 11 09:37:39 2013 +0200 @@ -51,7 +51,7 @@ "Partial - aggregate by partially qualified name (e.g., A.B.C.D.Counter and X.Y.Z.D.Counter will be merged to D.Counter)%n" + "Complete - aggregate by qualified name%n" + "Thread - aggregate by qualified name and thread") - public static final OptionValue<String> DebugValueSummary = new OptionValue<>("Complete"); + public static final OptionValue<String> DebugValueSummary = new OptionValue<>("Name"); @Option(help = "Send Graal IR to dump handlers on error") public static final OptionValue<Boolean> DumpOnError = new OptionValue<>(false); @Option(help = "Enable expensive assertions")
--- a/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/InliningPhase.java Tue Sep 10 22:39:50 2013 -0400 +++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/InliningPhase.java Wed Sep 11 09:37:39 2013 +0200 @@ -67,7 +67,7 @@ private static final DebugMetric metricInliningPerformed = Debug.metric("InliningPerformed"); private static final DebugMetric metricInliningConsidered = Debug.metric("InliningConsidered"); private static final DebugMetric metricInliningStoppedByMaxDesiredSize = Debug.metric("InliningStoppedByMaxDesiredSize"); - private static final DebugMetric metricInliningRuns = Debug.metric("Runs"); + private static final DebugMetric metricInliningRuns = Debug.metric("InliningRuns"); public InliningPhase(CanonicalizerPhase canonicalizer) { this(new GreedyInliningPolicy(null), canonicalizer);
--- a/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/LoweringPhase.java Tue Sep 10 22:39:50 2013 -0400 +++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/LoweringPhase.java Wed Sep 11 09:37:39 2013 +0200 @@ -167,7 +167,7 @@ private final SchedulePhase schedule; private Round(int iteration, PhaseContext context) { - super(String.format("Lowering iteration %d", iteration)); + super("LoweringIteration" + iteration); this.context = context; this.schedule = new SchedulePhase(); }
--- a/graal/com.oracle.graal.phases/src/com/oracle/graal/phases/BasePhase.java Tue Sep 10 22:39:50 2013 -0400 +++ b/graal/com.oracle.graal.phases/src/com/oracle/graal/phases/BasePhase.java Wed Sep 11 09:37:39 2013 +0200 @@ -22,7 +22,10 @@ */ package com.oracle.graal.phases; +import java.util.regex.*; + import com.oracle.graal.debug.*; +import com.oracle.graal.debug.internal.*; import com.oracle.graal.nodes.*; /** @@ -32,19 +35,35 @@ */ public abstract class BasePhase<C> { - private String name; + private final String name; + + private final DebugTimer phaseTimer; + private final DebugMetric phaseMetric; - private static final DebugMetric metricPhaseRuns = Debug.metric("Runs"); + private static final Pattern NAME_PATTERN = Pattern.compile("[A-Z][A-Za-z0-9]+"); + + private static boolean checkName(String name) { + assert NAME_PATTERN.matcher(name).matches() : "illegal phase name: " + name; + return true; + } protected BasePhase() { - this.name = this.getClass().getSimpleName(); - if (name.endsWith("Phase")) { - name = name.substring(0, name.length() - "Phase".length()); + String nm = this.getClass().getSimpleName(); + if (nm.endsWith("Phase")) { + name = nm.substring(0, nm.length() - "Phase".length()); + } else { + name = nm; } + assert checkName(name); + phaseTimer = Debug.timer("Phase_" + name); + phaseMetric = Debug.metric("Phase_" + name); } protected BasePhase(String name) { + assert checkName(name); this.name = name; + phaseTimer = Debug.timer("Phase_" + name); + phaseMetric = Debug.metric("Phase_" + name); } protected String getDetailedName() { @@ -56,17 +75,20 @@ } public final void apply(final StructuredGraph graph, final C context, final boolean dumpGraph) { - Debug.scope(name, this, new Runnable() { + try (TimerCloseable a = phaseTimer.start()) { + + Debug.scope(name, this, new Runnable() { - public void run() { - BasePhase.this.run(graph, context); - metricPhaseRuns.increment(); - if (dumpGraph) { - Debug.dump(graph, "After phase %s", name); + public void run() { + BasePhase.this.run(graph, context); + phaseMetric.increment(); + if (dumpGraph) { + Debug.dump(graph, "After phase %s", name); + } + assert graph.verify(); } - assert graph.verify(); - } - }); + }); + } } public final String getName() {