# HG changeset patch # User Josef Eisl # Date 1396281920 -7200 # Node ID 162d8fe8901764aeca4d2d502cdb3be4c34f8bf7 # Parent f729be5acf8e23e586a1246f3f95a6350e5859e7 Revert 3e9a8ef2e0e1. diff -r f729be5acf8e -r 162d8fe89017 graal/com.oracle.graal.graph/src/com/oracle/graal/graph/Graph.java --- a/graal/com.oracle.graal.graph/src/com/oracle/graal/graph/Graph.java Mon Mar 31 17:51:25 2014 +0200 +++ b/graal/com.oracle.graal.graph/src/com/oracle/graal/graph/Graph.java Mon Mar 31 18:05:20 2014 +0200 @@ -135,7 +135,7 @@ /** * Creates an empty Graph with a given name. - * + * * @param name the name of the graph, used for debugging purposes */ public Graph(String name) { @@ -206,7 +206,7 @@ /** * Creates a copy of this graph. - * + * * @param newName the name of the copy, used for debugging purposes (can be null) */ public Graph copy(String newName) { @@ -223,7 +223,7 @@ /** * Gets the number of live nodes in this graph. That is the number of nodes which have been * added to the graph minus the number of deleted nodes. - * + * * @return the number of live nodes in this graph */ public int getNodeCount() { @@ -256,7 +256,7 @@ /** * Adds a new node to the graph. - * + * * @param node the node to be added * @return the node which was added to the graph */ @@ -341,11 +341,10 @@ /** * Looks for a node similar to {@code node} and returns it if found. Otherwise * {@code node} is added to this graph and returned. - * + * * @return a node similar to {@code node} if one exists, otherwise {@code node} */ - public T unique(T node) { - assert node instanceof ValueNumberable; + public T unique(T node) { return uniqueHelper(node, true); } @@ -537,7 +536,7 @@ /** * Returns an {@link Iterable} providing all the live nodes. - * + * * @return an {@link Iterable} providing all the live nodes. */ public NodeIterable getNodes() { @@ -709,7 +708,7 @@ /** * Returns an {@link Iterable} providing all the live nodes whose type is compatible with * {@code type}. - * + * * @param type the type of node to return * @return an {@link Iterable} providing all the matching nodes */ @@ -726,7 +725,7 @@ /** * Returns whether the graph contains at least one node of the given type. - * + * * @param type the type of node that is checked for occurrence * @return whether there is at least one such node */ @@ -852,7 +851,7 @@ /** * Returns the number of node ids generated so far. - * + * * @return the number of node ids generated so far */ int nodeIdCount() { @@ -865,7 +864,7 @@ * the source graph by a given node (which must already be in this graph). Edges between * duplicate and replacement nodes will also be recreated so care should be taken regarding the * matching of node types in the replacement map. - * + * * @param newNodes the nodes to be duplicated * @param replacementsMap the replacement map (can be null if no replacement is to be performed) * @return a map which associates the original nodes from {@code nodes} to their duplicates diff -r f729be5acf8e -r 162d8fe89017 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 Mon Mar 31 17:51:25 2014 +0200 +++ b/graal/com.oracle.graal.java/src/com/oracle/graal/java/GraphBuilderPhase.java Mon Mar 31 18:05:20 2014 +0200 @@ -39,6 +39,7 @@ import com.oracle.graal.bytecode.*; import com.oracle.graal.debug.*; import com.oracle.graal.graph.*; +import com.oracle.graal.graph.Node.*; import com.oracle.graal.java.BciBlockMapping.BciBlock; import com.oracle.graal.java.BciBlockMapping.ExceptionDispatchBlock; import com.oracle.graal.java.BciBlockMapping.LocalLiveness; @@ -609,7 +610,7 @@ @Override protected ValueNode genUnique(ValueNode x) { - return currentGraph.unique(x); + return (ValueNode) currentGraph.unique((Node & ValueNumberable) x); } @Override