changeset 14876:626b02830dfc

amd64hotspot: don't install compressed oops if -XX:-UseCompressedOops
author Bernhard Urban <bernhard.urban@jku.at>
date Fri, 28 Mar 2014 15:38:14 +0100
parents 56704532e1cd
children fdb912b1eb7b
files graal/com.oracle.graal.compiler.amd64/src/com/oracle/graal/compiler/amd64/AMD64MemoryPeephole.java graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotMemoryPeephole.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/data/OopData.java
diffstat 3 files changed, 15 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.compiler.amd64/src/com/oracle/graal/compiler/amd64/AMD64MemoryPeephole.java	Fri Mar 28 12:01:52 2014 +0100
+++ b/graal/com.oracle.graal.compiler.amd64/src/com/oracle/graal/compiler/amd64/AMD64MemoryPeephole.java	Fri Mar 28 15:38:14 2014 +0100
@@ -436,7 +436,7 @@
                 return false;
             }
             if (kind == Kind.Object) {
-                if (!access.isCompressible() && !constant.isNull()) {
+                if (!constant.isNull()) {
                     Debug.log("Skipping constant compares for Object kinds");
                     return false;
                 }
--- a/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotMemoryPeephole.java	Fri Mar 28 12:01:52 2014 +0100
+++ b/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotMemoryPeephole.java	Fri Mar 28 15:38:14 2014 +0100
@@ -29,6 +29,7 @@
 import com.oracle.graal.asm.amd64.*;
 import com.oracle.graal.compiler.amd64.*;
 import com.oracle.graal.graph.*;
+import com.oracle.graal.hotspot.*;
 import com.oracle.graal.hotspot.data.*;
 import com.oracle.graal.lir.*;
 import com.oracle.graal.lir.amd64.*;
@@ -49,6 +50,7 @@
         @State protected LIRFrameState state;
 
         public CompareMemoryCompressedOp(AMD64AddressValue x, Constant y, LIRFrameState state) {
+            assert HotSpotGraalRuntime.runtime().getConfig().useCompressedOops;
             this.x = x;
             this.y = y;
             this.state = state;
@@ -83,15 +85,17 @@
     protected boolean emitCompareBranchMemory(ValueNode left, ValueNode right, Access access, Condition cond, boolean unorderedIsTrue, LabelRef trueLabel, LabelRef falseLabel,
                     double trueLabelProbability) {
         assert left == access || right == access;
-        ValueNode other = left == access ? right : left;
-        Kind kind = access.nullCheckLocation().getValueKind();
+        if (HotSpotGraalRuntime.runtime().getConfig().useCompressedOops) {
+            ValueNode other = left == access ? right : left;
+            Kind kind = access.nullCheckLocation().getValueKind();
 
-        if (other.isConstant() && kind == Kind.Object && access.isCompressible()) {
-            ensureEvaluated(other);
-            gen.append(new CompareMemoryCompressedOp(makeAddress(access), other.asConstant(), getState(access)));
-            Condition finalCondition = right == access ? cond.mirror() : cond;
-            gen.append(new BranchOp(finalCondition, trueLabel, falseLabel, trueLabelProbability));
-            return true;
+            if (other.isConstant() && kind == Kind.Object && access.isCompressible()) {
+                ensureEvaluated(other);
+                gen.append(new CompareMemoryCompressedOp(makeAddress(access), other.asConstant(), getState(access)));
+                Condition finalCondition = right == access ? cond.mirror() : cond;
+                gen.append(new BranchOp(finalCondition, trueLabel, falseLabel, trueLabelProbability));
+                return true;
+            }
         }
 
         return super.emitCompareBranchMemory(left, right, access, cond, unorderedIsTrue, trueLabel, falseLabel, trueLabelProbability);
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/data/OopData.java	Fri Mar 28 12:01:52 2014 +0100
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/data/OopData.java	Fri Mar 28 15:38:14 2014 +0100
@@ -27,6 +27,7 @@
 import com.oracle.graal.api.code.*;
 import com.oracle.graal.api.meta.*;
 import com.oracle.graal.graph.*;
+import com.oracle.graal.hotspot.*;
 import com.oracle.graal.hotspot.nodes.type.*;
 
 /**
@@ -39,6 +40,7 @@
 
     public OopData(int alignment, Object object, boolean compressed) {
         super(alignment);
+        assert !compressed || HotSpotGraalRuntime.runtime().getConfig().useCompressedOops;
         this.object = object;
         this.compressed = compressed;
     }