changeset 9996:d9a331e2fd61

Compressed Oop support for heab base > 32g
author Christos Kotselidis <christos.kotselidis@oracle.com>
date Tue, 11 Jun 2013 17:32:38 +0200
parents 13384d19fec0
children 4abd6387a612
files graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64Move.java
diffstat 1 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64Move.java	Tue Jun 11 00:00:40 2013 +0200
+++ b/graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64Move.java	Tue Jun 11 17:32:38 2013 +0200
@@ -33,6 +33,7 @@
 import com.oracle.graal.api.meta.*;
 import com.oracle.graal.asm.*;
 import com.oracle.graal.asm.amd64.*;
+import com.oracle.graal.asm.amd64.AMD64Assembler.ConditionFlag;
 import com.oracle.graal.graph.*;
 import com.oracle.graal.lir.*;
 import com.oracle.graal.lir.StandardOp.MoveOp;
@@ -667,6 +668,8 @@
         } else {
             // Otherwise the narrow heap base, which resides always in register 12, is subtracted
             // followed by right shift.
+            masm.testq(scratchRegister, scratchRegister);
+            masm.cmovq(ConditionFlag.Equal, scratchRegister, AMD64.r12);
             masm.subq(scratchRegister, AMD64.r12);
             masm.shrq(scratchRegister, logMinObjAlignment);
         }
@@ -681,9 +684,12 @@
                 masm.shlq(resRegister, logMinObjAlignment);
             }
         } else {
-            // Otherwise the narrow heap base is added to the shifted address.
+            Label done = new Label();
             masm.shlq(resRegister, logMinObjAlignment);
+            masm.jccb(ConditionFlag.Equal, done);
+            // Otherwise the narrow heap base is added to the shifted address.
             masm.addq(resRegister, AMD64.r12);
+            masm.bind(done);
         }
     }