# HG changeset patch # User Thomas Wuerthinger # Date 1312397444 25200 # Node ID ce737132129b8a439e2aa7b979930c846cb89e3b # Parent 65981c23c1d657289cde1a703fc1f24bae34f365 Lazy calculation of detailed name in GraphBuilderPhase diff -r 65981c23c1d6 -r ce737132129b graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/phases/GraphBuilderPhase.java --- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/phases/GraphBuilderPhase.java Wed Aug 03 11:35:30 2011 -0700 +++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/phases/GraphBuilderPhase.java Wed Aug 03 11:50:44 2011 -0700 @@ -119,8 +119,6 @@ super(inline ? "BuildInlineGraph" : "BuildGraph"); this.compilation = compilation; - setDetailedName(getName() + " " + method.holder().name() + "." + method.name() + method.signature().asString()); - this.runtime = compilation.runtime; this.method = method; this.stats = compilation.stats; @@ -139,6 +137,11 @@ build(); } + @Override + protected String getDetailedName() { + return getName() + " " + method.holder().name() + "." + method.name() + method.signature().asString(); + } + /** * Builds the graph for a the specified {@code IRScope}. * diff -r 65981c23c1d6 -r ce737132129b graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/phases/Phase.java --- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/phases/Phase.java Wed Aug 03 11:35:30 2011 -0700 +++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/phases/Phase.java Wed Aug 03 11:50:44 2011 -0700 @@ -30,14 +30,12 @@ public abstract class Phase { private final String name; - private String detailedName; private static final ThreadLocal currentPhase = new ThreadLocal(); private final boolean shouldVerify; protected Phase() { this.name = this.getClass().getSimpleName(); this.shouldVerify = GraalOptions.Verify; - this.detailedName = name; } protected Phase(String name) { @@ -47,11 +45,10 @@ protected Phase(String name, boolean shouldVerify) { this.name = name; this.shouldVerify = shouldVerify; - this.detailedName = name; } - protected void setDetailedName(String detailedName) { - this.detailedName = detailedName; + protected String getDetailedName() { + return getName(); } public final void apply(Graph graph) { @@ -78,13 +75,13 @@ } catch (AssertionError t) { GraalCompilation compilation = GraalCompilation.compilation(); if (compilation.compiler.isObserved() && plotOnError) { - compilation.compiler.fireCompilationEvent(new CompilationEvent(compilation, "AssertionError in " + detailedName, graph, true, false, true)); + compilation.compiler.fireCompilationEvent(new CompilationEvent(compilation, "AssertionError in " + getDetailedName(), graph, true, false, true)); } throw t; } catch (RuntimeException t) { GraalCompilation compilation = GraalCompilation.compilation(); if (compilation.compiler.isObserved() && plotOnError) { - compilation.compiler.fireCompilationEvent(new CompilationEvent(compilation, "RuntimeException in " + detailedName, graph, true, false, true)); + compilation.compiler.fireCompilationEvent(new CompilationEvent(compilation, "RuntimeException in " + getDetailedName(), graph, true, false, true)); } throw t; } @@ -105,7 +102,7 @@ } GraalCompilation compilation = GraalCompilation.compilation(); if (compilation.compiler.isObserved() && this.getClass() != IdentifyBlocksPhase.class && (plot || GraalOptions.PlotVerbose)) { - compilation.compiler.fireCompilationEvent(new CompilationEvent(compilation, "After " + detailedName, graph, true, false)); + compilation.compiler.fireCompilationEvent(new CompilationEvent(compilation, "After " + getDetailedName(), graph, true, false)); } assert !shouldVerify || graph.verify();