Mercurial > hg > truffle
changeset 17397:0c8442b0d4c4
Merge.
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Thu, 09 Oct 2014 16:30:49 +0200 |
parents | 83bbc0e5891a (current diff) e890b86b397d (diff) |
children | 9e1ec84d2899 |
files | |
diffstat | 3 files changed, 22 insertions(+), 13 deletions(-) [+] |
line wrap: on
line diff
--- 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) {
--- 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()));
--- 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; } /**