Mercurial > hg > graal-compiler
changeset 17346:97198814de41
re-enabled use of Unsafe.allocateInstance based mechanism for Node cloning (based on JMH benchmarks)
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Mon, 06 Oct 2014 13:15:07 +0200 |
parents | 3152f72f5cda |
children | 63780e37b7b9 |
files | graal/com.oracle.graal.graph/src/com/oracle/graal/graph/Node.java |
diffstat | 1 files changed, 4 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- 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<Edges.Type> 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);