diff graal/com.oracle.graal.hotspot.hsail/src/com/oracle/graal/hotspot/hsail/HSAILHotSpotLIRGenerator.java @ 15909:e43591136d9f

Support for compressed constants.
author Roland Schatz <roland.schatz@oracle.com>
date Mon, 26 May 2014 16:09:53 +0200
parents 399aa56c6366
children 6d8c901814eb
line wrap: on
line diff
--- a/graal/com.oracle.graal.hotspot.hsail/src/com/oracle/graal/hotspot/hsail/HSAILHotSpotLIRGenerator.java	Fri May 23 17:21:37 2014 +0200
+++ b/graal/com.oracle.graal.hotspot.hsail/src/com/oracle/graal/hotspot/hsail/HSAILHotSpotLIRGenerator.java	Mon May 26 16:09:53 2014 +0200
@@ -122,6 +122,9 @@
         HSAILAddressValue storeAddress = asAddressValue(address);
         if (isConstant(inputVal)) {
             Constant c = asConstant(inputVal);
+            if (HotSpotCompressedNullConstant.COMPRESSED_NULL.equals(c)) {
+                c = Constant.INT_0;
+            }
             if (canStoreConstant(c, false)) {
                 append(new StoreConstantOp(getMemoryKind(kind), storeAddress, c, state));
                 return;
@@ -224,7 +227,9 @@
     @Override
     protected HSAILLIRInstruction createMove(AllocatableValue dst, Value src) {
         if (dst.getPlatformKind() == NarrowOopStamp.NarrowOop) {
-            if (isRegister(src) || isStackSlot(dst)) {
+            if (HotSpotCompressedNullConstant.COMPRESSED_NULL.equals(src)) {
+                return new MoveToRegOp(Kind.Int, dst, Constant.INT_0);
+            } else if (isRegister(src) || isStackSlot(dst)) {
                 return new MoveFromRegOp(Kind.Int, dst, src);
             } else {
                 return new MoveToRegOp(Kind.Int, dst, src);
@@ -291,5 +296,4 @@
         emitMove(obj, address);
         append(new HSAILMove.NullCheckOp(obj, state));
     }
-
 }