Merged revisions 7390-7406 via svnmerge from
authormichi <none@none>
Mon, 26 Feb 2007 19:12:03 +0000 (19:12 +0000)
committermichi <none@none>
Mon, 26 Feb 2007 19:12:03 +0000 (19:12 +0000)
svn+ssh://michi@c1.complang.tuwien.ac.at/ahome/cacao/svn/cacao/trunk

........
  r7395 | michi | 2007-02-23 23:57:53 +0100 (Fri, 23 Feb 2007) | 2 lines

  * src/vm/jit/replace.c: Renamed regs to abi_registers_integer_name.
........
  r7402 | twisti | 2007-02-24 15:47:12 +0100 (Sat, 24 Feb 2007) | 4 lines

  * src/vmcore/zip.c (errno.h): Added.
  (vm/vm.h): Likewise.
  (zip_get): Replaced asserts with vm_abort.
........
  r7403 | pm | 2007-02-25 22:31:58 +0100 (Sun, 25 Feb 2007) | 6 lines

  * src/vm/jit/codegen-common.c (methodtree_comparator): Fixed S390 related comment.
  * src/vm/jit/s390/codegen.h: Fixed M_JSR macro, did not store RA.
  * src/vm/jit/s390/md-asm.h: Added (LOAD|STORE)_TEMPORARY_REGISTERS and (LOAD|STORE)_ARGUMENT_REGISTERS macros.
  * src/vm/jit/s390/asmpart.S: Implemented asm_handle_exception and asm_vm_call_method_exception_handler.
  * src/vm/jit/s390/md-abi.c (abi_registers_integer_temporary): did not contain %r0, added.
........
  r7404 | pm | 2007-02-25 23:02:16 +0100 (Sun, 25 Feb 2007) | 2 lines

  * src/vm/jit/s390/asmpart.S (asm_getclassvalues_atomic, asm_criticalsections): Added.
........
  r7405 | pm | 2007-02-25 23:34:27 +0100 (Sun, 25 Feb 2007) | 3 lines

  * src/vm/jit/s390/codegen.c (codegen): Fixed ICMD_IF_ACMPNE
  * src/vm/jit/s390/asmpart.S (asm_call_jit_compiler): Handling NULL return value of jit_asm_compile.
........

--HG--
branch : exact-gc

src/vm/jit/codegen-common.c
src/vm/jit/s390/asmpart.S
src/vm/jit/s390/codegen.c
src/vm/jit/s390/codegen.h
src/vm/jit/s390/md-abi.c
src/vm/jit/s390/md-asm.h
src/vmcore/zip.c

index b9fc1e00f413f87070972f9099881a53d8c04cc1..7496334bfe433a2e565c69c267835dc137db518b 100644 (file)
@@ -39,7 +39,7 @@
    memory. All functions writing values into the data area return the offset
    relative the begin of the code area (start of procedure).   
 
-   $Id: codegen-common.c 7343 2007-02-13 02:36:29Z ajordan $
+   $Id: codegen-common.c 7407 2007-02-26 19:12:03Z michi $
 
 */
 
@@ -516,7 +516,8 @@ static s4 methodtree_comparator(const void *pc, const void *element)
           tree */
 
 #ifdef __S390__
-       /* On S390 addresses are 31 bit, and therefore are ambigue. */
+       /* On S390 addresses are 31 bit. Compare only 31 bits of value.
+        */
 #      define ADDR_MASK(a) ((a) & 0x7FFFFFFF)
 #else
 #      define ADDR_MASK(a) (a)
index 6a3ccca94aa57358a8f8fa736b6d307acb10ea6a..5fb0292ea54b79dad319c521aea94440d9c5e93b 100644 (file)
@@ -30,7 +30,7 @@
 
    Changes: Edwin Steiner
 
-   $Id: asmpart.S 7373 2007-02-18 20:16:14Z pm $
+   $Id: asmpart.S 7407 2007-02-26 19:12:03Z michi $
 
 */
 
@@ -95,28 +95,21 @@ L_##magic##_lp_end:                                         ; \
        .globl asm_getclassvalues_atomic
 
 
-#if 0
-asm_vm_call_method:
-asm_vm_call_method_int:
-asm_vm_call_method_long:
-asm_vm_call_method_float:
-asm_vm_call_method_double:
-#endif
-asm_vm_call_method_exception_handler:
-#if 0
-asm_call_jit_compiler:
-#endif
-asm_handle_exception:
 asm_handle_nat_exception:
+       .long 0
 asm_abstractmethoderror:
+       .long 0
 asm_replacement_out:
+       .long 0
 asm_replacement_in:
+       .long 0
 asm_builtin_f2i:
+       .long 0
 asm_builtin_f2l:
+       .long 0
 asm_builtin_d2i:
+       .long 0
 asm_builtin_d2l:
-asm_criticalsections:
-asm_getclassvalues_atomic:
        .long 0
 
 /********************* function asm_calljavafunction ***************************
@@ -133,22 +126,19 @@ asm_getclassvalues_atomic:
 *                                                                              *
 *******************************************************************************/
 
-       .long   0                           /* catch type all                     */
-       .long   0                           /* handler pc                         */
-       .long   0                           /* end pc                             */
-       .long   0                           /* start pc                           */
-       .long   1                           /* extable size                       */
-       .long   0                           /* ALIGNMENT PADDING                  */
-       .long   0                           /* line number table  start           */
-       .long   0                           /* line number table  size            */
-       .long   0                           /* ALIGNMENT PADDING                  */
-       .long   0                           /* fltsave                            */
-       .long   0                           /* intsave                            */
-       .long   0                           /* isleaf                             */
-       .long   0                           /* IsSync                             */
-       .long   0                           /* frame size                         */
-       .long   0                           /* codeinfo pointer                   */
-
+       .long   0                         /* catch type all                       */
+       .long   0                         /* exception handler pc                 */
+       .long   0                         /* end pc                               */
+       .long   0                         /* start pc                             */
+       .long   1                         /* extable size                         */
+       .long   0                         /* line number table start              */
+       .long   0                         /* line number table size               */
+       .long   0                         /* fltsave                              */
+       .long   0                         /* intsave                              */
+       .long   0                         /* IsLeaf                               */
+       .long   0                         /* IsSync                               */
+       .long   0                         /* frame size                           */
+       .long   0                         /* codeinfo pointer                     */
 
 asm_vm_call_method:
 asm_vm_call_method_int:
@@ -407,6 +397,19 @@ L_asm_vm_call_method_return:
        lm    %r6, %r15, 24(sp)               /* restore callers registers */
        br    %r14                            /* return */
 
+asm_vm_call_method_exception_handler:
+       lr    a0, xptr
+
+       bras  %r14, L_avcmeh_bras
+       .long builtin_throw_exception
+L_avcmeh_bras:
+       l     %r14, 0(%r14)
+       ahi   sp, -96
+       basr  %r14, %r14
+       ahi   sp, 96
+
+       j     L_asm_vm_call_method_return
+
 /* .... */
 
 L_no_args:
@@ -519,10 +522,8 @@ L_bras_jac:
        l       %r14,96+32(sp)             /* restore return address */
        ahi     sp, ACJC_STACKFRAME        /* remove stack frame */
 
-#if 0
-       ltr     v0,v0
+       ltr     pv,pv
        je      L_asm_call_jit_compiler_exception
-#endif
 
 jit_code_entry:                        /* label to set breakpoint on */
        br      pv                         /* call the method, it will return to the caller */
@@ -551,136 +552,162 @@ L_asm_call_jit_compiler_exception:
 
 asm_handle_nat_exception:
        add     $8,sp                       /* clear return address of native stub*/
-               
+#endif
+       
 asm_handle_exception:
 L_asm_handle_exception:                 /* required for PIC code              */
-       sub     $((ARG_CNT+TMP_CNT)*8),sp   /* create maybe-leaf stackframe       */
 
-       SAVE_ARGUMENT_REGISTERS(0)          /* we save arg and temp registers in  */
-       SAVE_TEMPORARY_REGISTERS(ARG_CNT)   /* case this is a leaf method         */
+       ahi     sp, -(ARGUMENT_REGISTERS_SIZE + TEMPORARY_REGISTERS_SIZE) /* create maybe-leaf stackframe */
+       STORE_ARGUMENT_REGISTERS(0)
+       STORE_TEMPORARY_REGISTERS(ARGUMENT_REGISTERS_SIZE)      
+       lhi     a3, (ARGUMENT_REGISTERS_SIZE + TEMPORARY_REGISTERS_SIZE) /* prepare a3 for handle_exception */
 
-       mov     $((ARG_CNT+TMP_CNT)*8),a3   /* prepare a3 for handle_exception    */
-       mov     $1,t0                       /* set maybe-leaf flag                */
+       lhi     %r0, 1                      /* set maybe-leaf flag */
 
 L_asm_handle_exception_stack_loop:
-       sub     $(6*8),sp
-       mov     xptr,0*8(sp)                /* save exception pointer             */
-       mov     xpc,1*8(sp)                 /* save exception pc                  */
-       add     sp,a3                       /* calculate Java sp into a3...       */
-       add     $(6*8),a3
-       mov     a3,3*8(sp)                  /* ...and save it                     */
-       mov     t0,4*8(sp)                  /* save maybe-leaf flag               */
-
-       mov     xpc,a0                      /* exception pc                       */
-       call    codegen_get_pv_from_pc@PLT
-       mov     v0,2*8(sp)                  /* save data segment pointer          */
-        
-       mov     0*8(sp),a0                  /* pass exception pointer             */
-       mov     1*8(sp),a1                  /* pass exception pc                  */
-       mov     v0,a2                       /* pass data segment pointer          */
-       mov     3*8(sp),a3                  /* pass Java stack pointer            */
-       call    exceptions_handle_exception@PLT
-
-       test    v0,v0
+       ahi     sp,-(6*4)
+       st      xptr,0*4(sp)                /* save exception pointer             */
+       st      xpc,1*4(sp)                 /* save exception pc                  */
+       la      a3,(6*4)(a3,sp)             /* calculate Java sp into a3...       */
+       st      a3,3*4(sp)                  /* ...and save it                     */
+       st      %r0,4*4(sp)                 /* save maybe-leaf flag               */
+
+       lr      a0,xpc                      /* exception pc                       */
+
+       ahi     sp,-96                      /* add register save area for C code */
+
+       bras    %r14,L_ahe_bras             /* call codegen_get_pv_from_pc */
+       .long   codegen_get_pv_from_pc
+L_ahe_bras:
+       l       %r14,0(%r14)
+       basr    %r14,%r14
+       st      v0,2*4+96(sp)               /* save data segment pointer          */
+    
+       lr      a2,v0                       /* pass data segment pointer          */
+       l       a0,0*4+96(sp)               /* pass exception pointer             */
+       l       a1,1*4+96(sp)               /* pass exception pc                  */
+       l       a3,3*4+96(sp)               /* pass Java stack pointer            */
+
+       bras    %r14,L_ahe_bras2            /* call exceptions_handle_exception */
+       .long   exceptions_handle_exception
+L_ahe_bras2:
+       l       %r14,0(%r14)
+       basr    %r14,%r14
+
+       ahi     sp,96                       /* remove regiser save area for C code */
+
+       ltr     v0,v0
        jz      L_asm_handle_exception_not_catched
 
-       mov     v0,xpc                      /* move handlerpc into xpc            */
-       mov     0*8(sp),xptr                /* restore exception pointer          */
-       mov     4*8(sp),t0                  /* get maybe-leaf flag                */
-       add     $(6*8),sp                   /* free stack frame                   */
+       lr      xpc,v0                      /* move handlerpc into xpc            */
+       l       xptr,0*4(sp)                /* restore exception pointer          */
+       l       %r0,4*4(sp)                 /* get maybe-leaf flag                */
+       ahi     sp,(6*4)                    /* free stack frame                   */
 
-       test    t0,t0                       /* test for maybe-leaf flag           */
+       ltr     %r0, %r0
        jz      L_asm_handle_exception_no_leaf
 
-       RESTORE_ARGUMENT_REGISTERS(0)       /* if this is a leaf method, we have  */
-       RESTORE_TEMPORARY_REGISTERS(ARG_CNT)/* to restore arg and temp registers  */
+       LOAD_ARGUMENT_REGISTERS(0)
+       LOAD_TEMPORARY_REGISTERS(ARGUMENT_REGISTERS_SIZE)       
 
-       add     $((ARG_CNT+TMP_CNT)*8),sp   /* remove maybe-leaf stackframe       */
+       ahi     sp, (ARGUMENT_REGISTERS_SIZE + TEMPORARY_REGISTERS_SIZE) /* Remove maybe-leaf stackframe */
 
 L_asm_handle_exception_no_leaf:
-       jmp     *xpc                        /* jump to the handler                */
+       br      xpc                         /* jump to the handler */
 
 L_asm_handle_exception_not_catched:
-       mov     0*8(sp),xptr                /* restore exception pointer          */
-       mov     2*8(sp),itmp3               /* restore data segment pointer       */
-       mov     4*8(sp),t0                  /* get maybe-leaf flag                */
-       add     $(6*8),sp
+       l       xptr,0*4(sp)                /* restore exception pointer          */
+       l       itmp3,2*4(sp)               /* restore data segment pointer       */
+       ahi     itmp3,-0xfff                /* for negative displacements */
+       l       %r0,4*4(sp)                 /* get maybe-leaf flag                */
+       ahi     sp,(6*4)
 
-       test    t0,t0
+       ltr     %r0,%r0
        jz      L_asm_handle_exception_no_leaf_stack
 
-       add     $((ARG_CNT+TMP_CNT)*8),sp   /* remove maybe-leaf stackframe       */
-       xor     t0,t0                       /* clear the isleaf flags             */
+       ahi     sp, (ARGUMENT_REGISTERS_SIZE + TEMPORARY_REGISTERS_SIZE) /* Remove maybe-leaf stackframe */
+       lhi     %r0,0                       /* clear the isleaf flags             */
+
+       /*
+       +-----------------+-----------+---------+----+
+       | Memuse          | Float Sav | Int Sav | RA |
+       |                 | 0 ... n   | 0 ... n |    |
+       +-----------------+-----------+---------+----+
+       ^                 ^           ^
+       SP                F           I
+       */
 
 L_asm_handle_exception_no_leaf_stack:
-       mov     FrameSize(itmp3),itmp2l     /* get frame size                     */
-       add     sp,itmp2                    /* pointer to save area               */
-       
-       mov     IntSave(itmp3),a0l          /* a0l = saved int register count     */
-       test    a0l,a0l
+
+       l       itmp2,0xfff+FrameSize(itmp3)/* get frame size                     */
+       la      itmp2,0(itmp2,sp)           /* pointer to save area */
+       ahi     itmp2,-4                    /* skip RA */
+
+       l       a0,0xfff+IntSave(itmp3)     /* a0 = saved int register count  */
+
+       ltr     a0,a0
        je      noint
-       
-       cmp     $1,a0l
+
+       sll     a0,2                        /* a0 = saved int register count * 4 */
+       sr      itmp2, a0                   /* skip Int Sav */
+
+       chi     a0,1*4
        je      int1
-       cmp     $2,a0l
+       chi     a0,2*4
        je      int2
-       cmp     $3,a0l
+       chi     a0,3*4
        je      int3
-       cmp     $4,a0l
+       chi     a0,4*4
        je      int4
        
-       mov     -5*8(itmp2),s0
+       l       s0,0*4(itmp2)
 int4:   
-       mov     -4*8(itmp2),s1
+       l       s1,1*4(itmp2)
 int3:   
-       mov     -3*8(itmp2),s2
+       l       s2,2*4(itmp2)
 int2:   
-       mov     -2*8(itmp2),s3
+       l       s3,3*4(itmp2)
 int1:   
-       mov     -1*8(itmp2),s4
+       l       s4,4*4(itmp2)
 
-       shl     $3,a0l                      /* multiply by 8 bytes                */
-       sub     a0,itmp2
-               
 noint:
-#if 0
-       mov     FltSave(itmp3),a0l          /* a0l = saved flt register count     */
-       test    a0l,a0l
+
+       l       a0,0xfff+FltSave(itmp3)
+       ltr         a0,a0                       /* Number of saved floating point registers */
        je      noflt
+
+       sll     a0,3                        /* Number of saved floating point registers * 8 */
+       sr      itmp2,a0
        
-       cmpl    $1,a0l
+       chi     a0,1*8
        je      flt1
-       cmpl    $2,a0l
+       chi    a0,2*8
        je      flt2
-       cmpl    $3,a0l
-       je      flt3
-       cmpl    $4,a0l
-       je      flt4
-
-       movq    -5*8(itmp2),%xmm11
-flt4:   
-       movq    -4*8(itmp2),%xmm12
-flt3:   
-       movq    -3*8(itmp2),%xmm13
+
 flt2:   
-       movq    -2*8(itmp2),%xmm14
+       ld    %f6,1*8(itmp2)
 flt1:   
-       movq    -1*8(itmp2),%xmm15
+       ld    %f4,0*8(itmp2)
                 
 noflt:
-#endif
-       mov     FrameSize(itmp3),itmp2l     /* get frame size                     */
-       add     itmp2,sp                    /* unwind stack                       */
+
+       l       itmp3,0xfff+FrameSize(itmp3)/* get frame size (at least 4 - RA)   */
+       ahi     itmp3,-4                    /* substract 4 */
+       l       xpc,0(itmp3,sp)             /* load the new xpc -  return address */
+       la      sp, 4(itmp3,sp)             /* unwind stack                       */
 
                                            /* exception pointer is still set     */
-       pop     xpc                         /* the new xpc is return address      */
+#if 0
        sub     $3,xpc                      /* subtract 3 bytes for call          */
+#endif
 
-       xor     a3,a3                       /* prepare a3 for handle_exception    */
+       lhi     a3,0                        /* prepare a3 for handle_exception    */
        
-       jmp             L_asm_handle_exception_stack_loop
+       j               L_asm_handle_exception_stack_loop
 
 
+#if 0
+
 /* asm_abstractmethoderror *****************************************************
 
    Creates and throws an AbstractMethodError.
@@ -959,32 +986,37 @@ asm_builtin_d2l:
        add     $(ARG_CNT*8),sp
        ret
 
+#endif /* if 0 */
+
+/* TODO use move here ? */
 
 asm_getclassvalues_atomic:
 _crit_restart:
 _crit_begin:
-       movl    offbaseval(a0),itmp1l
-       movl    offdiffval(a0),itmp2l
-       movl    offbaseval(a1),itmp3l
+       l       %r0,offbaseval(a0)
+       l       %r1,offdiffval(a0)
+       l       a3,offbaseval(a1)
 _crit_end:
-       movl    itmp1l,offcast_super_baseval(a2)
-       movl    itmp2l,offcast_super_diffval(a2)
-       movl    itmp3l,offcast_sub_baseval(a2)
-       ret
+       st      %r0,offcast_super_baseval(a2)
+       st      %r1,offcast_super_diffval(a2)
+       st      a3,offcast_sub_baseval(a2)
+       br      %r14
 
        .data
                
 asm_criticalsections:
 #if defined(ENABLE_THREADS)
-       .quad   _crit_begin
-       .quad   _crit_end
-       .quad   _crit_restart
+       .long   _crit_begin
+       .long   _crit_end
+       .long   _crit_restart
 #endif
        .quad 0
 
 
 /* Disable exec-stacks, required for Gentoo ***********************************/
 
+#if 0
+
 #if defined(__GCC__) && defined(__ELF__)
        .section .note.GNU-stack,"",@progbits
 #endif
index e6d0afeca4a80e9e9aeb39e3340ec525c912e997..87c88ade2df5957611677eba6da18855c77ef81b 100644 (file)
@@ -29,7 +29,7 @@
             Christian Ullrich
             Edwin Steiner
 
-   $Id: codegen.c 7385 2007-02-21 23:12:30Z pm $
+   $Id: codegen.c 7407 2007-02-26 19:12:03Z michi $
 
 */
 
@@ -2621,6 +2621,7 @@ bool codegen(jitdata *jd)
                        codegen_add_branch_ref(cd, iptr->dst.block);
                        break;
 
+               case ICMD_IF_ACMPNE:    /* op1 = target JavaVM pc                     */
                case ICMD_IF_ICMPNE:    /* ..., value, value ==> ...                  */
 
                        s1 = emit_load_s1(jd, iptr, REG_ITMP1);
@@ -2643,7 +2644,6 @@ bool codegen(jitdata *jd)
 #endif
                        break;
 
-               case ICMD_IF_ACMPNE:    /* op1 = target JavaVM pc                     */
                case ICMD_IF_ICMPLT:    /* ..., value, value ==> ...                  */
 
                        s1 = emit_load_s1(jd, iptr, REG_ITMP1);
index d8b3a7cd3267c7e4d21549dbbcbe63df40563fc5..d0561983d0efcdc6056f978f7f4a6e7ba9ed919b 100644 (file)
@@ -27,7 +27,7 @@
    Authors: Andreas Krall
             Christian Thalinger
 
-   $Id: codegen.h 7367 2007-02-16 07:17:01Z pm $
+   $Id: codegen.h 7407 2007-02-26 19:12:03Z michi $
 
 */
 
 #define _CODE2(code) _CODE(u2, code)
 #define _CODE4(code) _CODE(u4, code)
 
-#define _IFNEG(val, neg, pos) \
-       do { if ((val) < 0) { neg ; } else { pos ; } } while (0)
+#define _IF(cond, t, f) \
+       do { if (cond) { t ; } else { f ; } } while (0)
+
+#define _IFNEG(val, neg, pos) _IF((val) < 0, neg, pos)
 
 #define N_RR(op, r1, r2) \
        _CODE2( (_OP(op) << 8) | (_R(r1) << 4) | _R(r2) )
 #define M_RET N_BCR(DD_ANY, R14)
 #define M_BSR(ret_reg, disp) N_BRAS(ret_reg, disp)
 #define M_BR(disp) N_BRC(DD_ANY, disp)
-#define M_JMP(rd, rs) N_BCR(DD_ANY, rs)
+#define M_JMP(rs, rd) _IF(rs == RN, N_BCR(DD_ANY, rd), N_BASR(rs, rd))
 #define M_NOP N_BC(0, 0, RN, RN)
 #define M_JSR(reg_ret, reg_addr) N_BASR(reg_ret, reg_addr)
 #define M_ICMP(a, b) N_CR(a, b)
index 97d5e532a0d15d42d451976c9df32779224214e9..a644ef7e81a6d461f3ae4d96bfe845f4003c40ad 100644 (file)
@@ -28,7 +28,7 @@
 
    Changes:
 
-   $Id: md-abi.c 7367 2007-02-16 07:17:01Z pm $
+   $Id: md-abi.c 7407 2007-02-26 19:12:03Z michi $
 
 */
 
@@ -76,7 +76,7 @@ const s4 abi_registers_integer_saved[] = {
 };
 
 const s4 abi_registers_integer_temporary[] = {
-       -1 /* NONE */
+       0, /* r0 */
 };
 
 s4 nregdescfloat[] = {
index 41447ae18594c49ea78103499e28ab5a44058dbf..d0158d260938e581edfc62617566d0d9e98e7e95 100644 (file)
@@ -28,7 +28,7 @@
 
    Changes:
 
-   $Id: md-asm.h 7300 2007-02-07 22:06:53Z pm $
+   $Id: md-asm.h 7407 2007-02-26 19:12:03Z michi $
 
 */
 
 #define pv       %r13
 
 #define mptr     itmp2
+#define xptr     itmp1
+#define xpc      itmp2
 
 #define s0 %r7
 #define s1 %r8
        movq    (3+(off))*8(sp),ft2  ; \
        movq    (4+(off))*8(sp),ft3  ;
 
+/* Volatile float registers (all volatile in terms of C abi) */
+
 #define LOAD_STORE_VOLATILE_FLOAT_REGISTERS(inst, off) \
        inst    %f0, ((0 * 8) + (off))(sp); \
        inst    %f2, ((1 * 8) + (off))(sp); \
 #define LOAD_VOLATILE_FLOAT_REGISTERS(off) LOAD_STORE_VOLATILE_FLOAT_REGISTERS(ld, off)
 #define STORE_VOLATILE_FLOAT_REGISTERS(off) LOAD_STORE_VOLATILE_FLOAT_REGISTERS(std, off)
 
+/* Volatile integer registers (all volatile in terms of C abi) */
+
 #define LOAD_STORE_VOLATILE_INTEGER_REGISTERS(instm, inst, off) \
        instm   %r0, %r5, ((0 * 4) + (off))(sp); \
        inst    %r14, ((6 * 4) + (off))(sp);
+
 #define VOLATILE_INTEGER_REGISTERS_SIZE (7 * 4)
 
 #define LOAD_VOLATILE_INTEGER_REGISTERS(off) LOAD_STORE_VOLATILE_INTEGER_REGISTERS(lm, l, off)
 #define STORE_VOLATILE_INTEGER_REGISTERS(off) LOAD_STORE_VOLATILE_INTEGER_REGISTERS(stm, st, off)
 
+/* Argument registers (in terms of JAVA an C abi) */
+
+#define ARGUMENT_REGISTERS_SIZE ((5 * 4) + (2 * 8))
+
+#define LOAD_STORE_ARGUMENT_REGISTERS(iinst, finst, off) \
+       iinst %r2, %r6, (off)(sp) ; \
+       finst %f0, (off +  (5 * 4))(sp) ; \
+       finst %f2, (off + (5 * 4) + 8)(sp)
+
+#define STORE_ARGUMENT_REGISTERS(off) LOAD_STORE_ARGUMENT_REGISTERS(stm, std, off)
+#define LOAD_ARGUMENT_REGISTERS(off) LOAD_STORE_ARGUMENT_REGISTERS(lm, ld, off)
+
+/* Temporary registers (in terms of JAVA abi) */
+
+#define TEMPORARY_REGISTERS_SIZE ((1 * 4) + (12 * 8))
+
+#define LOAD_STORE_TEMPORARY_REGISTERS(iinst, finst, off) \
+       finst    %f1, ((0 * 8) + (off))(sp); \
+       finst    %f3, ((1 * 8) + (off))(sp); \
+       finst    %f5, ((2 * 8) + (off))(sp); \
+       finst    %f7, ((3 * 8) + (off))(sp); \
+       finst    %f8, ((4 * 8) + (off))(sp); \
+       finst    %f9, ((5 * 8) + (off))(sp); \
+       finst    %f10, ((6 * 8) + (off))(sp); \
+       finst    %f11, ((7 * 8) + (off))(sp); \
+       finst    %f12, ((8 * 8) + (off))(sp); \
+       finst    %f13, ((9 * 8) + (off))(sp); \
+       finst    %f14, ((10 * 8) + (off))(sp); \
+       finst    %f15, ((11 * 8) + (off))(sp); \
+       iinst    %r0, ((12 * 8) + (off))(sp);
+
+#define LOAD_TEMPORARY_REGISTERS(off) LOAD_STORE_TEMPORARY_REGISTERS(l, ld, off)
+#define STORE_TEMPORARY_REGISTERS(off) LOAD_STORE_TEMPORARY_REGISTERS(st, sd, off)
 
 #endif /* _MD_ASM_H */
 
index 6aa5eec29029cbe5fa785bd4264fcbfc695fbd20..2ee7f2b60a606bdd9f81c9562deff5a7af61f670 100644 (file)
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
-   Contact: cacao@cacaojvm.org
-
-   Authors: Christian Thalinger
-            Edwin Steiner
-
-   $Id: zip.c 7246 2007-01-29 18:49:05Z twisti $
+   $Id: zip.c 7407 2007-02-26 19:12:03Z michi $
 
 */
 
@@ -35,6 +30,7 @@
 #include "config.h"
 
 #include <assert.h>
+#include <errno.h>
 #include <fcntl.h>
 #include <unistd.h>
 #include <zlib.h>
 #include "vm/types.h"
 
 #include "toolbox/hashtable.h"
+
 #include "mm/memory.h"
+
 #include "vm/global.h"
+#include "vm/vm.h"
+
 #include "vmcore/suck.h"
 #include "vmcore/utf8.h"
 #include "vmcore/zip.h"
@@ -443,19 +443,19 @@ classbuffer *zip_get(list_classpath_entry *lce, classinfo *c)
                /* initialize this inflate run */
 
                if (inflateInit2(&zs, -MAX_WBITS) != Z_OK)
-                       assert(0);
+                       vm_abort("zip_get: inflateInit2 failed: %s", strerror(errno));
 
                /* decompress the file into buffer */
 
                err = inflate(&zs, Z_SYNC_FLUSH);
 
                if ((err != Z_STREAM_END) && (err != Z_OK))
-                       assert(0);
+                       vm_abort("zip_get: inflate failed: %s", strerror(errno));
 
                /* finish this inflate run */
 
                if (inflateEnd(&zs) != Z_OK)
-                       assert(0);
+                       vm_abort("zip_get: inflateEnd failed: %s", strerror(errno));
                break;
 
        case 0:
@@ -464,7 +464,8 @@ classbuffer *zip_get(list_classpath_entry *lce, classinfo *c)
                break;
 
        default:
-               assert(0);
+               vm_abort("zip_get: unknown compression method %d",
+                                htzfe->compressionmethod);
        }
        
        /* allocate classbuffer */