* src/vm/jit/arm/asmpart.S: Designate function labels as such; required for
[cacao.git] / src / vm / jit / arm / asmpart.S
index 4e5952f2e280dd9cf8b27a3a413f1fc09fcbaa89..eaee0213d42fd83efc1dfeb14a3195fd67a11561 100644 (file)
@@ -1,9 +1,7 @@
 /* src/vm/jit/arm/asmpart.S - Java-C interface functions for ARM
 
-   Copyright (C) 1996-2005, 2006, 2007 R. Grafl, A. Krall, C. Kruegel,
-   C. Oates, R. Obermaisser, M. Platter, M. Probst, S. Ring,
-   E. Steiner, C. Thalinger, D. Thuernbeck, P. Tomsich, C. Ullrich,
-   J. Wenninger, Institut f. Computersprachen - TU Wien
+   Copyright (C) 1996-2005, 2006, 2007, 2008
+   CACAOVM - Verein zur Foerderung der freien virtuellen Maschine CACAO
 
    This file is part of CACAO.
 
 /* export functions ***********************************************************/
 
        .globl asm_vm_call_method
+       .type  asm_vm_call_method, %function
        .globl asm_vm_call_method_int
+       .type  asm_vm_call_method_int, %function
        .globl asm_vm_call_method_long
+       .type  asm_vm_call_method_long, %function
        .globl asm_vm_call_method_float
+       .type  asm_vm_call_method_float, %function
        .globl asm_vm_call_method_double
+       .type  asm_vm_call_method_double, %function
        .globl asm_vm_call_method_exception_handler
        .globl asm_vm_call_method_end
 
-       .globl asm_call_jit_compiler
-
        .globl asm_handle_exception
        .globl asm_handle_nat_exception
 
        .globl asm_abstractmethoderror
 
        .globl asm_cacheflush
+       .type  asm_cacheflush, %function
 
 
 /* asm_vm_call_method **********************************************************
 
        .align  2
 
-       .word   0                           /* catch type all                     */
-       .word   0                           /* handler pc                         */
-       .word   0                           /* end pc                             */
-       .word   0                           /* start pc                           */
-       .word   1                           /* extable size                       */
-       .word   0                           /* line number table start            */
-       .word   0                           /* line number table size             */
        .word   0                           /* FltSave                            */
        .word   0                           /* IntSave                            */
        .word   0                           /* IsLeaf                             */
-       .word   0                           /* IsSync                             */
        .word   0                           /* FrameSize                          */
        .word   0                           /* CodeinfoPointer                    */
 
 asm_vm_call_method:
 asm_vm_call_method_int:
 asm_vm_call_method_long:
-/* asm_vm_call_method_float:
-asm_vm_call_method_double: */
+asm_vm_call_method_float:
+asm_vm_call_method_double:
        SAVE_SCRATCH_REGISTERS            /* save our personal scratch regs   */
        stmfd sp!, {v1}                   /* V1 is used to remember SP        */
        str   a0, [sp, #-4]!              /* store methods entrypoint         */
@@ -144,66 +138,9 @@ asm_vm_call_method_exception_handler:
        ldmfd sp!, {v1}
        RESTORE_SCRATCH_REGS_AND_RETURN   /* return to caller, restore regs   */
 
-asm_vm_call_method_float:
-       mov a0,#0x51
-       b asm_debug
-asm_vm_call_method_double:
-       mov a0,#0x52
-       b asm_debug
-
 asm_vm_call_method_end:
 
 
-/****************** function asm_call_jit_compiler *****************************
-*                                                                              *
-*   Invokes the compiler for untranslated JavaVM methods.                      *
-*   What this method does:                                                     *
-*    - save args and LR                                                        *
-*    - fire up jit_compile (pass methodinfo pointer)                           *
-*    - try to find out where to write back the new method pointer              *
-*    - restore args and LR                                                     *
-*    - check for exceptions                                                    *
-*    - eventually write back new method pointer                                *
-*    - call jit code (wich will then return to caller)                         *
-*                                                                              *
-*   These methods can call us: codegen_compilerstub & asm_calljavafunction     *
-*   ATTENTION: use REG_ITMP1 to pass methodinfo pointer to me!                 *
-*                                                                              *
-*******************************************************************************/
-
-#define MYSTACKSIZE (6*4)
-
-asm_call_jit_compiler:
-       SAVE_ARGUMENT_REGISTERS             /* save our argument registers & LR   */
-       sub   sp, sp, #4                    /* keep stack 8-byte aligned          */
-
-       mov   a0, itmp1                     /* pass methodinfo pointer            */
-       mov   a1, mptr                      /* pass method pointer                */
-       add   a2, sp, #MYSTACKSIZE          /* pass Java sp                       */
-       mov   a3, lr                        /* pass Java RA (correct for leafs)   */
-       bl    jit_asm_compile
-       mov   itmp1, res1                   /* save pointer to new jit-code       */
-
-       tst   itmp1,itmp1                   /* check for exeption                 */
-       beq   L_asm_call_jit_compiler_exception
-
-       add   sp, sp, #4                    /* keep stack 8-byte aligned          */
-       RESTORE_ARGUMENT_REGISTERS          /* load our argument registers & LR   */
-
-       mov   ip, itmp1
-       mov   pc, ip                        /* call jit-code                      */
-
-L_asm_call_jit_compiler_exception:
-       bl    exceptions_get_and_clear_exception
-       mov   xptr, res1                    /* get exception                      */
-
-       add   sp, sp, #4                    /* keep stack 8-byte aligned          */
-       RESTORE_ARGUMENT_REGISTERS          /* load LR                            */
-
-       sub   xpc, lr, #4                   /* xpc = instruction that called us   */
-       b     asm_handle_nat_exception
-
-
 /********************* function asm_handle_exception ***************************
 *                                                                              *
 *   This function handles an exception. It does not use the usual calling      *
@@ -220,7 +157,7 @@ asm_handle_nat_exception:
        /*TODO:maybe make a macro out of it!!!*/
        SAVE_ARGUMENT_REGISTERS  
        mov   a0, lr
-       bl    md_codegen_get_pv_from_pc
+       bl    md_asm_codegen_get_pv_from_pc
        mov   ip, res1
        RESTORE_ARGUMENT_REGISTERS  
        /* fall through */
@@ -277,7 +214,7 @@ asm_handle_exception_not_catched:
        /*TODO:maybe make a macro out of it!!!*/
        SAVE_ARGUMENT_REGISTERS  
        mov   a0, lr
-       bl    md_codegen_get_pv_from_pc
+       bl    md_asm_codegen_get_pv_from_pc
        mov   ip, res1
        RESTORE_ARGUMENT_REGISTERS  
 
@@ -310,7 +247,9 @@ asm_abstractmethoderror:
 *                                                                              *
 *******************************************************************************/
 
-.equ sys_cacheflush,__ARM_NR_cacheflush /* syscall number for cache flushing  */
+L___ARM_NR_cacheflush:
+       .align 2
+       .word __ARM_NR_cacheflush
 
 asm_cacheflush:
        add   a1, a0, a1
@@ -321,20 +260,17 @@ asm_cacheflush:
           see "http://wiki.debian.org/ArmEabiPort" for additional details. */
 
        stmfd sp!, {r7}
-       mov   r7, #0x0f0000
-       add   r7, r7, #0x000002
-#endif
-
-#if 0
+       ldr   r7, L___ARM_NR_cacheflush
+       swi   0x0
+       ldmfd sp!, {r7}
+#else
+# if 0
        /* TWISTI: required on iyonix, maybe a linux-2.4 bug */
        mov   a0, #0x0
        mov   a1, #0xff000000
-#endif
+# endif
 
-       swi   sys_cacheflush
-
-#if defined(__ARM_EABI__)
-       ldmfd sp!, {r7}
+       swi   __ARM_NR_cacheflush
 #endif
 
        mov   pc, lr