changeset 3496:ef79e8b2c437

Stop trying to be smart and use createAnchor in ConverConditionalPhase
author Gilles Duboscq <gilles.duboscq@oracle.com>
date Mon, 08 Aug 2011 12:16:19 +0200
parents a6210c7dadde
children dd3ecadecc60 27ccc1cb3748
files graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/phases/ConvertConditionalPhase.java graal/com.oracle.max.graal.runtime/src/com/oracle/max/graal/runtime/HotSpotRuntime.java
diffstat 2 files changed, 2 insertions(+), 29 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/phases/ConvertConditionalPhase.java	Sun Aug 07 18:05:52 2011 +0200
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/phases/ConvertConditionalPhase.java	Mon Aug 08 12:16:19 2011 +0200
@@ -93,34 +93,7 @@
                 }
                 schedule.assignBlockToNode(conditional);
                 Block block = schedule.getNodeToBlock().get(conditional);
-                FixedNodeWithNext prev;
-                Node firstNode = block.firstNode();
-                if (firstNode instanceof Merge) {
-                    prev = (Merge) firstNode;
-                } else if (firstNode instanceof EndNode) {
-                    EndNode end = (EndNode) firstNode;
-                    Node pred = end.predecessor();
-                    Anchor anchor = new Anchor(graph);
-                    pred.replaceFirstSuccessor(end, anchor);
-                    anchor.setNext(end);
-                    prev = anchor;
-                } else if (firstNode instanceof StartNode) {
-                    StartNode start = (StartNode) firstNode;
-                    Anchor anchor = new Anchor(graph);
-                    Node next = start.next();
-                    start.setNext(null);
-                    anchor.setNext((FixedNode) next);
-                    start.setNext(anchor);
-                    prev = anchor;
-                } else if (firstNode instanceof If) {
-                    Node pred = firstNode.predecessor();
-                    Anchor anchor = new Anchor(graph);
-                    pred.replaceFirstSuccessor(firstNode, anchor);
-                    anchor.setNext((If) firstNode);
-                    prev = anchor;
-                } else {
-                    prev = (FixedNodeWithNext) firstNode;
-                }
+                Anchor prev = block.createAnchor();
                 FixedNode next = prev.next();
                 prev.setNext(null);
                 merge.setNext(next);
--- a/graal/com.oracle.max.graal.runtime/src/com/oracle/max/graal/runtime/HotSpotRuntime.java	Sun Aug 07 18:05:52 2011 +0200
+++ b/graal/com.oracle.max.graal.runtime/src/com/oracle/max/graal/runtime/HotSpotRuntime.java	Mon Aug 08 12:16:19 2011 +0200
@@ -514,7 +514,7 @@
                     graph.setReturn(ret);
                     return graph;
                 }
-            } else if (holderName.equals("Ljava/lang/Float;")) { //XXX (gd) the non-raw versions of (F/D)2(I/L) should return a sanitized NaN in the NaN case. also check NaN case for (I/L)2(F/D)
+            } else if (holderName.equals("Ljava/lang/Float;")) { //XXX (gd) the non-raw versions of (F/D)2(I/L) should return a sanitized NaN in the NaN case.
                 if (fullName.equals("floatToRawIntBits(F)I") || fullName.equals("floatToIntBits(F)I")) {
                     CompilerGraph graph = new CompilerGraph(this);
                     Return ret = new Return(new FPConversionNode(CiKind.Int, new Local(CiKind.Float, 0, graph), graph), graph);