changeset 23059:6c5f70cd3ed8

Improve memory compare match operation.
author Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
date Sun, 22 Nov 2015 19:52:42 +0100
parents 2b27fb937568
children 4e72c50bb9c1
files graal/com.oracle.graal.compiler.amd64/src/com/oracle/graal/compiler/amd64/AMD64NodeMatchRules.java
diffstat 1 files changed, 2 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.compiler.amd64/src/com/oracle/graal/compiler/amd64/AMD64NodeMatchRules.java	Sun Nov 22 14:53:59 2015 +0100
+++ b/graal/com.oracle.graal.compiler.amd64/src/com/oracle/graal/compiler/amd64/AMD64NodeMatchRules.java	Sun Nov 22 19:52:42 2015 +0100
@@ -126,7 +126,7 @@
 
         if (value.isConstant()) {
             JavaConstant constant = value.asJavaConstant();
-            if (constant != null && kind == AMD64Kind.QWORD && (constant.getJavaKind().isObject() || !NumUtil.isInt(constant.asLong()))) {
+            if (constant != null && kind == AMD64Kind.QWORD && !constant.getJavaKind().isObject() && !NumUtil.isInt(constant.asLong())) {
                 // Only imm32 as long
                 return null;
             }
@@ -146,14 +146,7 @@
                 LabelRef falseLabel = getLIRBlock(ifNode.falseSuccessor());
                 boolean unorderedIsTrue = compare.unorderedIsTrue();
                 double trueLabelProbability = ifNode.probability(ifNode.trueSuccessor());
-                Value other;
-                JavaConstant constant = value.asJavaConstant();
-                if (constant != null) {
-                    other = gen.emitJavaConstant(constant);
-                } else {
-                    other = operand(value);
-                }
-
+                Value other = operand(value);
                 AMD64AddressValue address = (AMD64AddressValue) operand(access.getAddress());
                 getLIRGeneratorTool().emitCompareBranchMemory(kind, other, address, getState(access), finalCondition, unorderedIsTrue, trueLabel, falseLabel, trueLabelProbability);
                 return null;