# HG changeset patch # User Doug Simon # Date 1412610694 -7200 # Node ID 3457f147a24f717cf5eff26e697b1dde849865ac # Parent ea7b8c7a6e5c6361671de7d4d6c5e1f96abf7c52 made selectability of using generated node functionality more fine grained diff -r ea7b8c7a6e5c -r 3457f147a24f 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 Oct 06 17:32:55 2014 +0200 +++ b/graal/com.oracle.graal.graph/src/com/oracle/graal/graph/Graph.java Mon Oct 06 17:51:34 2014 +0200 @@ -107,7 +107,7 @@ @Override public int hashCode() { - return Node.USE_GENERATED_NODES ? node.valueNumberLeaf() : node.getNodeClass().valueNumber(node); + return Node.USE_GENERATED_VALUE_NUMBER ? node.valueNumberLeaf() : node.getNodeClass().valueNumber(node); } @Override diff -r ea7b8c7a6e5c -r 3457f147a24f graal/com.oracle.graal.graph/src/com/oracle/graal/graph/Node.java --- a/graal/com.oracle.graal.graph/src/com/oracle/graal/graph/Node.java Mon Oct 06 17:32:55 2014 +0200 +++ b/graal/com.oracle.graal.graph/src/com/oracle/graal/graph/Node.java Mon Oct 06 17:51:34 2014 +0200 @@ -59,8 +59,13 @@ @NodeInfo public abstract class Node implements Cloneable, Formattable { - public final static boolean USE_GENERATED_NODES = Boolean.parseBoolean(System.getProperty("graal.useGeneratedNodes", "true")); - public final static boolean USE_UNSAFE_TO_CLONE = Boolean.parseBoolean(System.getProperty("graal.useUnsafeToClone", "true")); + public final static boolean USE_GENERATED_VALUE_NUMBER = Boolean.parseBoolean(System.getProperty("graal.node.useGeneratedValueNumber", "true")); + + public final static boolean USE_GENERATED_VALUE_EQUALS = Boolean.parseBoolean(System.getProperty("graal.node.useGeneratedValueEquals", "false")); + + public final static boolean USE_UNSAFE_TO_CLONE = Boolean.parseBoolean(System.getProperty("graal.node.useUnsafeToClone", "true")); + + public final static boolean USE_GENERATED_NODES = USE_GENERATED_VALUE_NUMBER || USE_GENERATED_VALUE_EQUALS; static final int DELETED_ID_START = -1000000000; static final int INITIAL_ID = -1; @@ -1032,14 +1037,17 @@ } /** - * If this node is a {@linkplain NodeClass#isLeafNode() leaf} node, returns a hash for this node - * based on its {@linkplain NodeClass#getData() data} fields otherwise return 0. + * Gets a hash for this {@linkplain NodeClass#valueNumberable() value numberable} + * {@linkplain NodeClass#isLeafNode() leaf} node based on its {@linkplain NodeClass#getData() + * data} fields. + * + * This method must only be called if {@link #USE_GENERATED_VALUE_NUMBER} is true and this is a + * value numberable leaf node. * * Overridden by a method generated for leaf nodes. */ public int valueNumberLeaf() { - assert !getNodeClass().isLeafNode(); - return 0; + throw new GraalInternalError("Node is not a value numberable leaf", this); } /** @@ -1062,6 +1070,6 @@ * @return true if the data fields of this object and {@code other} are equal */ public boolean valueEquals(Node other) { - return USE_GENERATED_NODES ? dataEquals(other) : getNodeClass().dataEquals(this, other); + return USE_GENERATED_VALUE_EQUALS ? dataEquals(other) : getNodeClass().dataEquals(this, other); } }