changeset 13542:da9d9823628f

Enable more constant stores
author Tom Rodriguez <tom.rodriguez@oracle.com>
date Tue, 07 Jan 2014 16:32:30 -0800
parents 63bb635911ab
children 9cd47b39b0ef
files graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotLIRGenerator.java
diffstat 1 files changed, 16 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotLIRGenerator.java	Tue Jan 07 14:59:18 2014 -0800
+++ b/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotLIRGenerator.java	Tue Jan 07 16:32:30 2014 -0800
@@ -506,19 +506,24 @@
         boolean isCompressed = isCompressedOperation(kind, access);
         if (isConstant(inputVal)) {
             Constant c = asConstant(inputVal);
-            if (isCompressed && canStoreConstant(c, isCompressed)) {
-                if (c.getKind() == Kind.Object) {
-                    Constant value = c.isNull() ? c : compress(c, config.getOopEncoding());
-                    append(new StoreCompressedConstantOp(kind, storeAddress, value, state));
-                } else if (c.getKind() == Kind.Long) {
-                    // It's always a good idea to directly store compressed constants since they
-                    // have to be materialized as 64 bits encoded otherwise.
-                    Constant value = compress(c, config.getKlassEncoding());
-                    append(new StoreCompressedConstantOp(kind, storeAddress, value, state));
+            if (canStoreConstant(c, isCompressed)) {
+                if (isCompressed) {
+                    if (c.getKind() == Kind.Object) {
+                        Constant value = c.isNull() ? c : compress(c, config.getOopEncoding());
+                        append(new StoreCompressedConstantOp(kind, storeAddress, value, state));
+                    } else if (c.getKind() == Kind.Long) {
+                        // It's always a good idea to directly store compressed constants since they
+                        // have to be materialized as 64 bits encoded otherwise.
+                        Constant value = compress(c, config.getKlassEncoding());
+                        append(new StoreCompressedConstantOp(kind, storeAddress, value, state));
+                    } else {
+                        throw GraalInternalError.shouldNotReachHere("can't handle: " + access);
+                    }
+                    return;
                 } else {
-                    throw GraalInternalError.shouldNotReachHere("can't handle: " + access);
+                    append(new StoreConstantOp(kind, storeAddress, c, state));
+                    return;
                 }
-                return;
             }
         }
         Variable input = load(inputVal);