# HG changeset patch # User Doug Simon # Date 1412594107 -7200 # Node ID 97198814de417ceeb61e5b3aa4c9314c20211556 # Parent 3152f72f5cdae439bd5c70e843b36cbbb4db89c6 re-enabled use of Unsafe.allocateInstance based mechanism for Node cloning (based on JMH benchmarks) diff -r 3152f72f5cda -r 97198814de41 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 12:02:30 2014 +0200 +++ b/graal/com.oracle.graal.graph/src/com/oracle/graal/graph/Node.java Mon Oct 06 13:15:07 2014 +0200 @@ -60,7 +60,7 @@ 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", "false")); + public final static boolean USE_UNSAFE_TO_CLONE = Boolean.parseBoolean(System.getProperty("graal.useUnsafeToClone", "true")); static final int DELETED_ID_START = -1000000000; static final int INITIAL_ID = -1; @@ -772,7 +772,8 @@ */ final Node clone(Graph into, EnumSet edgesToCopy) { NodeClass nodeClass = getNodeClass(); - if (nodeClass.valueNumberable() && nodeClass.isLeafNode()) { + boolean isValueNumberableLeaf = nodeClass.valueNumberable() && nodeClass.isLeafNode(); + if (isValueNumberableLeaf) { Node otherNode = into.findNodeInCache(this); if (otherNode != null) { return otherNode; @@ -803,7 +804,7 @@ into.register(newNode); newNode.extraUsages = NO_NODES; - if (nodeClass.valueNumberable() && nodeClass.isLeafNode()) { + if (isValueNumberableLeaf) { into.putNodeIntoCache(newNode); } newNode.afterClone(this);