Mercurial > hg > graal-compiler
changeset 9037:b008f40b67d0
Merge
author | Michael Haupt <michael.haupt@oracle.com> |
---|---|
date | Fri, 12 Apr 2013 11:24:56 +0200 |
parents | 7309bde698f3 (current diff) c181a7f6311d (diff) |
children | 8802f66cba62 89e4d67fdd2a |
files | |
diffstat | 6 files changed, 23 insertions(+), 41 deletions(-) [+] |
line wrap: on
line diff
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/VMToCompilerImpl.java Fri Apr 12 09:37:56 2013 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/VMToCompilerImpl.java Fri Apr 12 11:24:56 2013 +0200 @@ -37,6 +37,7 @@ import com.oracle.graal.api.meta.*; import com.oracle.graal.debug.*; import com.oracle.graal.debug.internal.*; +import com.oracle.graal.graph.*; import com.oracle.graal.hotspot.*; import com.oracle.graal.hotspot.debug.*; import com.oracle.graal.hotspot.meta.*; @@ -205,9 +206,22 @@ t.start(); } - if (GraalOptions.BenchmarkDynamicCounters) { - System.setErr(new PrintStream(new BenchmarkCountersOutputStream(System.err, " starting =====", " PASSED in ", "\n"))); - System.setOut(new PrintStream(new BenchmarkCountersOutputStream(System.out, "Iteration ~ (~s) begins: ", "Iteration ~ (~s) ends: ", "\n"))); + if (GraalOptions.BenchmarkDynamicCounters != null) { + String[] arguments = GraalOptions.BenchmarkDynamicCounters.split(","); + if (arguments.length == 0 || (arguments.length % 3) != 0) { + throw new GraalInternalError("invalid arguments to BenchmarkDynamicCounters: (err|out),start,end,(err|out),start,end,... (~ matches multiple digits)"); + } + for (int i = 0; i < arguments.length; i += 3) { + if (arguments[i].equals("err")) { + System.setErr(new PrintStream(new BenchmarkCountersOutputStream(System.err, arguments[i + 1], arguments[i + 2]))); + } else if (arguments[i].equals("out")) { + System.setOut(new PrintStream(new BenchmarkCountersOutputStream(System.out, arguments[i + 1], arguments[i + 2]))); + } else { + throw new GraalInternalError("invalid arguments to BenchmarkDynamicCounters: err|out"); + } + // dacapo: "err, starting =====, PASSED in " + // specjvm2008: "out,Iteration ~ (~s) begins: ,Iteration ~ (~s) ends: " + } DynamicCounterNode.excludedClassPrefix = "Lcom/oracle/graal/"; DynamicCounterNode.enabled = true; } @@ -222,8 +236,8 @@ private long startTime; private boolean waitingForEnd; - private BenchmarkCountersOutputStream(PrintStream delegate, String... patterns) { - super(delegate, patterns); + private BenchmarkCountersOutputStream(PrintStream delegate, String start, String end) { + super(delegate, new String[]{start, end, "\n"}); } @Override
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/debug/DynamicCounterNode.java Fri Apr 12 09:37:56 2013 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/debug/DynamicCounterNode.java Fri Apr 12 11:24:56 2013 +0200 @@ -121,6 +121,9 @@ @Override public void lower(LoweringTool tool) { + if (!enabled) { + throw new GraalInternalError("counter nodes shouldn't exist when not enabled"); + } StructuredGraph graph = (StructuredGraph) graph(); if (excludedClassPrefix == null || !graph.method().getDeclaringClass().getName().startsWith(excludedClassPrefix)) { int index = addContext ? getIndex(name + " @ " + MetaUtil.format("%h.%n", ((StructuredGraph) graph()).method())) : getIndex(name);
--- a/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/TailDuplicationPhase.java Fri Apr 12 09:37:56 2013 +0200 +++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/TailDuplicationPhase.java Fri Apr 12 11:24:56 2013 +0200 @@ -251,7 +251,6 @@ final HashSet<Node> duplicatedNodes = buildDuplicatedNodeSet(fixedNodes, stateAfter); mergeAfter.clearEnds(); expandDuplicated(duplicatedNodes, mergeAfter); - retargetDependencies(duplicatedNodes, anchor); List<EndNode> endSnapshot = merge.forwardEnds().snapshot(); List<PhiNode> phiSnapshot = merge.phis().snapshot(); @@ -526,29 +525,6 @@ } /** - * Moves all depdendencies that point outside the duplicated area to the supplied value - * anchor node. - * - * @param duplicatedNodes The set of duplicated nodes. - * @param anchor The node that will be the new target for all dependencies that point - * outside the duplicated set of nodes. - */ - private static void retargetDependencies(HashSet<Node> duplicatedNodes, ValueAnchorNode anchor) { - for (Node node : duplicatedNodes) { - if (node instanceof ValueNode) { - NodeInputList<ValueNode> dependencies = ((ValueNode) node).dependencies(); - for (int i = 0; i < dependencies.size(); i++) { - Node dependency = dependencies.get(i); - if (dependency != null && !duplicatedNodes.contains(dependency)) { - Debug.log("retargeting dependency %s to %s on %s", dependency, anchor, node); - dependencies.set(i, anchor); - } - } - } - } - } - - /** * Checks if the given node has usages that are not within the given set of nodes. * * @param node The node whose usages are checked.
--- a/graal/com.oracle.graal.phases/src/com/oracle/graal/phases/GraalOptions.java Fri Apr 12 09:37:56 2013 +0200 +++ b/graal/com.oracle.graal.phases/src/com/oracle/graal/phases/GraalOptions.java Fri Apr 12 11:24:56 2013 +0200 @@ -128,7 +128,7 @@ public static String MethodFilter = null; public static boolean DumpOnError = ____; public static boolean GenericDynamicCounters = ____; - public static boolean BenchmarkDynamicCounters = ____; + public static String BenchmarkDynamicCounters = null; // Ideal graph visualizer output settings public static boolean PrintBinaryGraphs = true;
--- a/graal/com.oracle.graal.virtual/src/com/oracle/graal/virtual/phases/ea/PartialEscapeAnalysisPhase.java Fri Apr 12 09:37:56 2013 +0200 +++ b/graal/com.oracle.graal.virtual/src/com/oracle/graal/virtual/phases/ea/PartialEscapeAnalysisPhase.java Fri Apr 12 11:24:56 2013 +0200 @@ -30,7 +30,6 @@ import com.oracle.graal.debug.*; import com.oracle.graal.graph.*; import com.oracle.graal.nodes.*; -import com.oracle.graal.nodes.debug.*; import com.oracle.graal.nodes.java.*; import com.oracle.graal.nodes.spi.*; import com.oracle.graal.phases.*; @@ -123,14 +122,6 @@ } }); } - - if (DynamicCounterNode.enabled && readElimination) { - for (Node node : graph.getNodes()) { - if (node instanceof LoadFieldNode) { - DynamicCounterNode.addCounterBefore("load non-elim", 1, false, (FixedNode) node); - } - } - } } private static boolean matches(StructuredGraph graph, String filter) {
--- a/graal/com.oracle.graal.virtual/src/com/oracle/graal/virtual/phases/ea/PartialEscapeClosure.java Fri Apr 12 09:37:56 2013 +0200 +++ b/graal/com.oracle.graal.virtual/src/com/oracle/graal/virtual/phases/ea/PartialEscapeClosure.java Fri Apr 12 11:24:56 2013 +0200 @@ -162,7 +162,6 @@ state.killReadCache(store.field()); if (cachedValue == store.value()) { - effects.addCounterBefore("store elim", 1, false, lastFixedNode.next()); effects.deleteFixedNode(store); changed = true; } else { @@ -173,7 +172,6 @@ ValueNode cachedValue = state.getReadCache(load.object(), load.field()); if (cachedValue != null) { METRIC_LOADFIELD_ELIMINATED.increment(); - effects.addCounterBefore("load elim", 1, false, lastFixedNode.next()); effects.replaceAtUsages(load, cachedValue); state.addScalarAlias(load, cachedValue); changed = true;