# HG changeset patch # User Doug Simon # Date 1412865049 -7200 # Node ID 0c8442b0d4c45f395dab08f913f8cd881070fb16 # Parent 83bbc0e5891a1c731e9155b1b4641f91f8cdb705# Parent e890b86b397d416e7b58e93bd0812f1aa354f427 Merge. diff -r 83bbc0e5891a -r 0c8442b0d4c4 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/NewObjectSnippets.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/NewObjectSnippets.java Thu Oct 09 16:18:14 2014 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/NewObjectSnippets.java Thu Oct 09 16:30:49 2014 +0200 @@ -80,7 +80,7 @@ Total } - public static final ProfileMode PROFILE_MODE = ProfileMode.Total; + public static final ProfileMode PROFILE_MODE = ProfileMode.AllocatedTypes; @Fold private static String createName(String path, String typeContext) { diff -r 83bbc0e5891a -r 0c8442b0d4c4 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/ObjectEqualsNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/ObjectEqualsNode.java Thu Oct 09 16:18:14 2014 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/ObjectEqualsNode.java Thu Oct 09 16:30:49 2014 +0200 @@ -122,13 +122,18 @@ */ tool.replaceWithValue(LogicConstantNode.contradiction(graph())); } else if (!xIdentity && !yIdentity) { - // both are virtual without identity: check contents - assert stateX.getVirtualObject().entryCount() == 1 && stateY.getVirtualObject().entryCount() == 1; - assert stateX.getVirtualObject().type().equals(stateY.getVirtualObject().type()); - assert stateX.getVirtualObject().entryKind(0).getStackKind() == Kind.Int || stateX.getVirtualObject().entryKind(0) == Kind.Long; - IntegerEqualsNode equals = IntegerEqualsNode.create(stateX.getEntry(0), stateY.getEntry(0)); - tool.addNode(equals); - tool.replaceWithValue(equals); + ResolvedJavaType type = stateX.getVirtualObject().type(); + if (type.equals(stateY.getVirtualObject().type())) { + MetaAccessProvider metaAccess = tool.getMetaAccessProvider(); + if (type.equals(metaAccess.lookupJavaType(Integer.class)) || type.equals(metaAccess.lookupJavaType(Long.class))) { + // both are virtual without identity: check contents + assert stateX.getVirtualObject().entryCount() == 1 && stateY.getVirtualObject().entryCount() == 1; + assert stateX.getVirtualObject().entryKind(0).getStackKind() == Kind.Int || stateX.getVirtualObject().entryKind(0) == Kind.Long; + IntegerEqualsNode equals = IntegerEqualsNode.create(stateX.getEntry(0), stateY.getEntry(0)); + tool.addNode(equals); + tool.replaceWithValue(equals); + } + } } else { // both are virtual with identity: check if they refer to the same object tool.replaceWithValue(LogicConstantNode.forBoolean(stateX == stateY, graph())); diff -r 83bbc0e5891a -r 0c8442b0d4c4 graal/com.oracle.truffle.api/src/com/oracle/truffle/api/nodes/Node.java --- a/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/nodes/Node.java Thu Oct 09 16:18:14 2014 +0200 +++ b/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/nodes/Node.java Thu Oct 09 16:30:49 2014 +0200 @@ -38,7 +38,7 @@ */ public abstract class Node implements Cloneable { - private Node parent; + @CompilationFinal private Node parent; @CompilationFinal private SourceSection sourceSection; @@ -124,12 +124,16 @@ * * @return the assigned source code section */ - @CompilerDirectives.SlowPath + @ExplodeLoop public final SourceSection getEncapsulatingSourceSection() { - if (sourceSection == null && getParent() != null) { - return getParent().getEncapsulatingSourceSection(); + Node current = this; + while (current != null) { + if (current.sourceSection != null) { + return current.sourceSection; + } + current = current.parent; } - return sourceSection; + return null; } /**