Mercurial > hg > graal-compiler
changeset 23135:61094ecb90f4
Merge
author | Tom Rodriguez <tom.rodriguez@oracle.com> |
---|---|
date | Thu, 03 Dec 2015 22:23:01 -0800 |
parents | f0dad49ca665 (current diff) 252a14787fa6 (diff) |
children | 12b57821cc0b |
files | |
diffstat | 2 files changed, 15 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/graal/com.oracle.graal.graph/src/com/oracle/graal/graph/NodeStack.java Thu Dec 03 11:03:49 2015 -0800 +++ b/graal/com.oracle.graal.graph/src/com/oracle/graal/graph/NodeStack.java Thu Dec 03 22:23:01 2015 -0800 @@ -57,4 +57,17 @@ public boolean isEmpty() { return tos == 0; } + + @Override + public String toString() { + if (tos == 0) { + return "NodeStack: []"; + } + StringBuilder sb = new StringBuilder(); + for (int i = 0; i < tos; i++) { + sb.append(", "); + sb.append(values[i]); + } + return "NodeStack: [" + sb.substring(2) + "]"; + } }
--- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/InstanceOfSnippetsTemplates.java Thu Dec 03 11:03:49 2015 -0800 +++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/InstanceOfSnippetsTemplates.java Thu Dec 03 22:23:01 2015 -0800 @@ -110,7 +110,8 @@ */ protected InstanceOfUsageReplacer createReplacer(FloatingNode instanceOf, Instantiation instantiation, Node usage, final StructuredGraph graph) { InstanceOfUsageReplacer replacer; - if (usage instanceof IfNode || usage instanceof FixedGuardNode || usage instanceof ShortCircuitOrNode || usage instanceof ConditionAnchorNode) { + if ((usage instanceof ConditionalNode && !(((ConditionalNode) usage).trueValue().isConstant() && ((ConditionalNode) usage).falseValue().isConstant())) || usage instanceof IfNode || + usage instanceof FixedGuardNode || usage instanceof ShortCircuitOrNode || usage instanceof ConditionAnchorNode) { ValueNode trueValue = ConstantNode.forInt(1, graph); ValueNode falseValue = ConstantNode.forInt(0, graph); if (instantiation.isInitialized() && (trueValue != instantiation.trueValue || falseValue != instantiation.falseValue)) {