changeset 16936:8471d4be5a95

[SPARC] Fix loading of constants and add debug messages to assertions
author Stefan Anzinger <stefan.anzinger@gmail.com>
date Mon, 25 Aug 2014 10:28:44 -0700
parents c40b258d83ab
children ae2ac90f1290
files graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCMove.java graal/com.oracle.graal.lir/src/com/oracle/graal/lir/FrameMap.java
diffstat 2 files changed, 7 insertions(+), 23 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCMove.java	Mon Aug 25 10:25:17 2014 -0700
+++ b/graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCMove.java	Mon Aug 25 10:28:44 2014 -0700
@@ -286,10 +286,11 @@
     }
 
     private static void loadEffectiveAddress(SPARCAddress address, Register result, SPARCMacroAssembler masm) {
-        if (address.getIndex() == Register.None) {
+        if (address.getIndex().equals(Register.None)) {
             if (isSimm13(address.getDisplacement())) {
                 new Add(address.getBase(), address.getDisplacement(), result).emit(masm);
             } else {
+                assert result.encoding() != address.getBase().encoding();
                 new Setx(address.getDisplacement(), result).emit(masm);
                 new Add(address.getBase(), result, result).emit(masm);
             }
@@ -473,7 +474,7 @@
      * @return a loadable SPARCAddress
      */
     public static SPARCAddress guaranueeLoadable(SPARCAddress addr, SPARCMacroAssembler masm) {
-        boolean displacementOutOfBound = addr.getIndex() == Register.None && !SPARCAssembler.isSimm13(addr.getDisplacement());
+        boolean displacementOutOfBound = addr.getIndex().equals(Register.None) && !SPARCAssembler.isSimm13(addr.getDisplacement());
         if (displacementOutOfBound) {
             Register scratch = g3;
             new Setx(addr.getDisplacement(), scratch, false).emit(masm);
@@ -551,28 +552,10 @@
         Register scratch = g5;
         switch (input.getKind().getStackKind()) {
             case Int:
-                if (crb.codeCache.needsDataPatch(input)) {
-                    crb.recordInlineDataInCode(input);
-                    new Setuw(input.asInt(), asRegister(result)).emit(masm);
-                } else {
-                    if (input.isDefaultForKind()) {
-                        new Clr(asRegister(result)).emit(masm);
-                    } else {
-                        new Setuw(input.asInt(), asRegister(result)).emit(masm);
-                    }
-                }
+                new Setx(input.asLong(), asIntReg(result)).emit(masm);
                 break;
             case Long:
-                if (crb.codeCache.needsDataPatch(input)) {
-                    crb.recordInlineDataInCode(input);
-                    new Setx(input.asLong(), asRegister(result), true).emit(masm);
-                } else {
-                    if (input.isDefaultForKind()) {
-                        new Clr(asRegister(result)).emit(masm);
-                    } else {
-                        new Setx(input.asLong(), asRegister(result)).emit(masm);
-                    }
-                }
+                new Setx(input.asLong(), asLongReg(result)).emit(masm);
                 break;
             case Float:
                 // TODO: Handle it the same way, as in the double case with Movwtos
--- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/FrameMap.java	Mon Aug 25 10:25:17 2014 -0700
+++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/FrameMap.java	Mon Aug 25 10:28:44 2014 -0700
@@ -204,7 +204,8 @@
         // @formatter:off
         assert (!slot.getRawAddFrameSize() && slot.getRawOffset() <  outgoingSize) ||
                ( slot.getRawAddFrameSize() && slot.getRawOffset() <  0 && -slot.getRawOffset() <= spillSize) ||
-               ( slot.getRawAddFrameSize() && slot.getRawOffset() >= 0);
+               ( slot.getRawAddFrameSize() && slot.getRawOffset() >= 0) :
+                   String.format("RawAddFrameSize: %b RawOffset: 0x%x spillSize: 0x%x outgoingSize: 0x%x", slot.getRawAddFrameSize(), slot.getRawOffset(), spillSize, outgoingSize);
         // @formatter:on
         if (slot.isInCallerFrame()) {
             accessesCallerFrame = true;