# HG changeset patch # User Lukas Stadler # Date 1352300378 -3600 # Node ID 02983279d0e60205793cc1a5cb0c12f33083d07b # Parent 10a3d06d58dced4b179e76a3679e50807ea52038 refactor StructuredGraph constructor, remove debug output diff -r 10a3d06d58dc -r 02983279d0e6 graal/com.oracle.graal.java/src/com/oracle/graal/java/FrameStateBuilder.java --- a/graal/com.oracle.graal.java/src/com/oracle/graal/java/FrameStateBuilder.java Wed Nov 07 15:59:11 2012 +0100 +++ b/graal/com.oracle.graal.java/src/com/oracle/graal/java/FrameStateBuilder.java Wed Nov 07 15:59:38 2012 +0100 @@ -28,6 +28,7 @@ import java.util.*; +import com.oracle.graal.api.code.*; import com.oracle.graal.api.meta.*; import com.oracle.graal.debug.*; import com.oracle.graal.graph.Node.Verbosity; @@ -153,8 +154,7 @@ } for (int i = 0; i < locks.length; i++) { if (GraphUtil.originalValue(locks[i]) != GraphUtil.originalValue(other.locks[i])) { - System.out.println("unbalanced monitors"); - return false; + throw new BailoutException("unbalanced monitors"); } } return true; diff -r 10a3d06d58dc -r 02983279d0e6 graal/com.oracle.graal.java/src/com/oracle/graal/java/GraphBuilderPhase.java --- a/graal/com.oracle.graal.java/src/com/oracle/graal/java/GraphBuilderPhase.java Wed Nov 07 15:59:11 2012 +0100 +++ b/graal/com.oracle.graal.java/src/com/oracle/graal/java/GraphBuilderPhase.java Wed Nov 07 15:59:38 2012 +0100 @@ -1373,7 +1373,6 @@ synchronizedEpilogue(FrameState.AFTER_BCI); if (!frameState.locksEmpty()) { - System.out.println("unbalanced monitors"); throw new BailoutException("unbalanced monitors"); } ReturnNode returnNode = currentGraph.add(new ReturnNode(x)); diff -r 10a3d06d58dc -r 02983279d0e6 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/StructuredGraph.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/StructuredGraph.java Wed Nov 07 15:59:11 2012 +0100 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/StructuredGraph.java Wed Nov 07 15:59:38 2012 +0100 @@ -57,30 +57,23 @@ /** * Creates a new Graph containing a single {@link BeginNode} as the {@link #start() start} node. */ - public StructuredGraph(String name) { - this(name, null); + public StructuredGraph(String name, ResolvedJavaMethod method) { + this(name, method, uniqueGraphIds.incrementAndGet(), INVOCATION_ENTRY_BCI); } - public StructuredGraph(String name, ResolvedJavaMethod method) { - this(name, method, uniqueGraphIds.incrementAndGet()); + public StructuredGraph(ResolvedJavaMethod method) { + this(null, method, uniqueGraphIds.incrementAndGet(), INVOCATION_ENTRY_BCI); } - private StructuredGraph(String name, ResolvedJavaMethod method, long graphId) { + public StructuredGraph(ResolvedJavaMethod method, int entryBCI) { + this(null, method, uniqueGraphIds.incrementAndGet(), entryBCI); + } + + private StructuredGraph(String name, ResolvedJavaMethod method, long graphId, int entryBCI) { super(name); this.start = add(new StartNode()); this.method = method; this.graphId = graphId; - this.entryBCI = INVOCATION_ENTRY_BCI; - } - - public StructuredGraph(ResolvedJavaMethod method) { - this(method, INVOCATION_ENTRY_BCI); - } - - public StructuredGraph(ResolvedJavaMethod method, int entryBCI) { - this.start = add(new StartNode()); - this.method = method; - this.graphId = uniqueGraphIds.incrementAndGet(); this.entryBCI = entryBCI; } @@ -128,7 +121,7 @@ @Override public StructuredGraph copy(String newName) { - StructuredGraph copy = new StructuredGraph(newName, method, graphId); + StructuredGraph copy = new StructuredGraph(newName, method, graphId, entryBCI); HashMap replacements = new HashMap<>(); replacements.put(start, copy.start); copy.addDuplicates(getNodes(), replacements); diff -r 10a3d06d58dc -r 02983279d0e6 graal/com.oracle.graal.virtual/src/com/oracle/graal/virtual/phases/ea/PartialEscapeAnalysisPhase.java --- a/graal/com.oracle.graal.virtual/src/com/oracle/graal/virtual/phases/ea/PartialEscapeAnalysisPhase.java Wed Nov 07 15:59:11 2012 +0100 +++ b/graal/com.oracle.graal.virtual/src/com/oracle/graal/virtual/phases/ea/PartialEscapeAnalysisPhase.java Wed Nov 07 15:59:38 2012 +0100 @@ -157,10 +157,10 @@ boolean success = true; for (Node node : obsoleteNodes) { if (flood.isMarked(node)) { - System.out.println("offending node path:"); + trace("offending node path:"); Node current = node; while (current != null) { - System.out.println(current); + trace(current.toString()); current = path.get(current); if (current != null && current instanceof FixedNode && !obsoleteNodes.contains(current)) { break;