Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
- $Id: asmpart.S 8127 2007-06-21 11:55:56Z michi $
-
*/
#include "config.h"
-#include "vm/jit/arm/offsets.h"
#include "vm/jit/arm/md-asm.h"
#include "vm/jit/methodheader.h"
.globl asm_abstractmethoderror
- .globl asm_patcher_wrapper
-
.globl asm_cacheflush
- .globl asm_getclassvalues_atomic
- .globl asm_criticalsections
-
-
#if !defined(ENABLE_THREADS)
asm_exceptionptr:
.word _no_threads_exceptionptr
#endif
-asm_criticalsections:
-#if defined(ENABLE_THREADS)
- .word _crit_begin
- .word _crit_end
- .word _crit_restart
-#endif
- .word 0
-
/* asm_vm_call_method **********************************************************
b asm_handle_exception_loop
-/* asm_patcher_wrapper *********************************************************
-* *
-* TODO: document me *
-* *
-* Stack layout when calling patcher function: *
-* 28 empty because stack needs to be aligned *
-* 24 saved REG_ITMP3, should be restored ( -8) *
-* 20 data segment displacement from load instructions (-12) *
-* 16 return address into JIT code (patch position) (-16) *
-* 12 pointer to virtual java_objectheader *
-* 8 machine code (which is patched back later) *
-* [ 8 result of patcher function (indicates exception) ] *
-* 4 unresolved class/method/field reference *
-* [ 0 patcher function pointer to call ] *
-* 0 saved IP of caller (caller needs it!) *
-* *
-*******************************************************************************/
-
-#define PATCHSTACKSIZE 8*4
-
-asm_patcher_wrapper:
- mov itmp3, sp /* preserve original SP in ITMP3 */
-
- SAVE_ARGUMENT_REGISTERS_IP /* save our argument registers & LR */
- SAVE_FLOAT_REGISTERS /* save our float registers here */
-
- mov a0, itmp3 /* pass SP of patcher stub */
- mov a1, ip /* pass PV */
- mov a2, lr /* pass RA (correct for leafs) */
- bl patcher_wrapper
- mov itmp3, res1 /* save return value */
-
- RESTORE_FLOAT_REGISTERS /* restore our float registers here */
- RESTORE_ARGUMENT_REGISTERS_IP /* load our argument registers & LR */
-
- add sp, sp, #PATCHSTACKSIZE /* remove patcher stack frame */
-
- tst itmp3, itmp3 /* check for an exception */
- bne L_asm_patcher_wrapper_exception
-
- ldr itmp3, [sp, #-8] /* restore ITMP3 for calling method */
- ldr pc, [sp, #-16] /* jump to new patched code */
-
-L_asm_patcher_wrapper_exception:
- mov xptr, itmp3 /* get exception */
- ldr xpc, [sp, #-16] /* RA is xpc */
-
- /* Note: A normal branch instruction could modify the PV here, */
- /* so we use this construct instead. */
- ldr pc, [pc, #-4]
- .word asm_handle_exception
-
-
/* asm_abstractmethoderror *****************************************************
Creates and throws an AbstractMethodError.
#endif
-/********************* function asm_getclassvalues_atomic *********************/
-
-asm_getclassvalues_atomic:
- stmfd sp!, {r4, r5, r6}
-_crit_restart:
-_crit_begin:
- ldr r4,[a0,#offbaseval]
- ldr r5,[a0,#offdiffval]
- ldr r6,[a1,#offbaseval]
-_crit_end:
- str r4,[a2,#offcast_super_baseval]
- str r5,[a2,#offcast_super_diffval]
- str r6,[a2,#offcast_sub_baseval]
- ldmfd sp!, {r4, r5, r6}
- mov pc, lr
-
-
/* disable exec-stacks ********************************************************/
#if defined(__linux__) && defined(__ELF__)