* Removed all Id tags.
[cacao.git] / src / vm / jit / m68k / emit.c
index 94d1926b3f4ce1f2be1b5a2e11af3b34d524c0e8..9a689282207bbb926a2de42ecc86a4990203b2ad 100644 (file)
@@ -22,8 +22,6 @@
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
-   $Id: arch.h 5330 2006-09-05 18:43:12Z edwin $
-
 */
 
 
@@ -166,23 +164,23 @@ inline void emit_store(jitdata *jd, instruction *iptr, varinfo *dst, s4 d)
                        case TYPE_DBL:
 #endif
                        case TYPE_LNG:
-                               M_LST(d, REG_SP, dst->vv.regoff * 4);
+                               M_LST(d, REG_SP, dst->vv.regoff);
                                break;
 #if defined(ENABLE_SOFTFLOAT)
                        case TYPE_FLT:
 #endif
                        case TYPE_INT:
-                               M_IST(d, REG_SP, dst->vv.regoff * 4);
+                               M_IST(d, REG_SP, dst->vv.regoff);
                                break;
                        case TYPE_ADR:
-                               M_AST(d, REG_SP, dst->vv.regoff * 4);
+                               M_AST(d, REG_SP, dst->vv.regoff);
                                break;
 #if !defined(ENABLE_SOFTFLOAT)
                        case TYPE_DBL:
-                               M_DST(d, REG_SP, dst->vv.regoff * 4);
+                               M_DST(d, REG_SP, dst->vv.regoff);
                                break;
                        case TYPE_FLT:
-                               M_FST(d, REG_SP, dst->vv.regoff * 4);
+                               M_FST(d, REG_SP, dst->vv.regoff);
                                break;
 #endif
                        default:
@@ -211,7 +209,7 @@ s4 emit_load(jitdata *jd, instruction *iptr, varinfo *src, s4 tempreg)
        if (IS_INMEMORY(src->flags)) {
                COUNT_SPILLS;
 
-               disp = src->vv.regoff * 4;
+               disp = src->vv.regoff;
        
                switch (src->type)      {
 #if defined(ENABLE_SOFTFLOAT)
@@ -354,7 +352,7 @@ s4 emit_load_low(jitdata *jd, instruction *iptr, varinfo *src, s4 tempreg)
        if (IS_INMEMORY(src->flags)) {
                COUNT_SPILLS;
 
-               disp = src->vv.regoff * 4;
+               disp = src->vv.regoff;
                M_ILD(tempreg, REG_SP, disp + 4);
                reg = tempreg;
        } else {
@@ -378,7 +376,7 @@ s4 emit_load_high(jitdata *jd, instruction *iptr, varinfo *src, s4 tempreg)
 
        if (IS_INMEMORY(src->flags)) {
                COUNT_SPILLS;
-               disp = src->vv.regoff * 4;
+               disp = src->vv.regoff;
                M_ILD(tempreg, REG_SP, disp);
                reg = tempreg;
        } else {
@@ -529,10 +527,7 @@ void emit_verbosecall_enter(jitdata* jd)
 
        /* travel up stack to the first argument of the function which needs to be copied */
        for (i=0; (i < md->paramcount) && (i < TRACE_ARGS_NUM); i++)    {
-               disp += 4;
-               if (IS_2_WORD_TYPE(md->paramtypes[i].type)) {   
-                       disp += 4;
-               }
+               disp += 8;
        }
 
        /* disp now points to the first arg which gets copied to the trace stack, relative to REG_SP! */
@@ -541,19 +536,11 @@ void emit_verbosecall_enter(jitdata* jd)
                        /* traced function has such an argument */
                        t = md->paramtypes[i].type;
                        
-                       if (IS_2_WORD_TYPE(t))  {
-                               /* copy from original argument stack */
-                               M_ILD(REG_ITMP1, REG_SP, disp);
-                               M_IPUSH(REG_ITMP1);
-                               M_ILD(REG_ITMP1, REG_SP, disp);
-                               M_IPUSH(REG_ITMP1);
-                       } else  {
-                               /* displacment is increased as 4 byte on original stack but 8 byte on trace stack */
-                               M_ILD(REG_ITMP1, REG_SP, disp);
-                               M_IPUSH(REG_ITMP1);
-                               M_IPUSH_IMM(0);
-                               disp += 4;
-                       }
+                       /* copy from original argument stack */
+                       M_ILD(REG_ITMP1, REG_SP, disp);
+                       M_ILD(REG_ITMP2, REG_SP, disp-4);
+                       M_IPUSH(REG_ITMP2);
+                       M_IPUSH(REG_ITMP1);
                } else  {
                        /* function has no arg here, push nothing and adapt displacement */
                        M_IPUSH_IMM(0);
@@ -602,7 +589,7 @@ void emit_verbosecall_exit(jitdata* jd)
 
 #if !defined(ENABLE_SOFTFLOAT)
        M_AADD_IMM(-8, REG_SP);
-       M_FSTORE(REG_F1, REG_SP, 0);
+       M_FSTORE(REG_D1, REG_SP, 0);
 #endif
 
        M_IPUSH_IMM(m);                                 /* push methodinfo */
@@ -634,7 +621,7 @@ void emit_verbosecall_exit(jitdata* jd)
        M_AADD_IMM(3*4 + 4, REG_SP);
 
 #if !defined(ENABLE_SOFTFLOAT)
-       M_FLOAD(REG_F1, REG_SP, 0)
+       M_FLOAD(REG_D1, REG_SP, 0)
        M_AADD_IMM(8, REG_SP);
 #endif
 
@@ -680,7 +667,7 @@ void emit_classcast_check(codegendata *cd, instruction *iptr, s4 condition, s4 r
 void emit_arrayindexoutofbounds_check(codegendata *cd, instruction *iptr, s4 s1, s4 s2)
 {
        if (INSTRUCTION_MUST_CHECK(iptr)) {
-               M_ILD(REG_ITMP3, s1, OFFSET(java_arrayheader, size));
+               M_ILD(REG_ITMP3, s1, OFFSET(java_array_t, size));
                M_ICMP(s2, REG_ITMP3);
                M_BHI(4);
                M_TRAP_SETREGISTER(s2);