obsolete functions.
* src/vm/jit/i386/cygwin/md-asm.h: Likewise.
* src/vm/jit/i386/darwin/md-asm.h: Likewise.
* src/vm/jit/mips/asmpart.S: Likewise.
* src/vm/jit/powerpc/asmpart.S: Likewise.
* src/vm/jit/powerpc/darwin/md-asm.h: Likewise.
* src/vm/jit/powerpc64/asmpart.S: Likewise.
* src/vm/jit/s390/asmpart.S: Likewise.
* src/vm/jit/x86_64/asmpart.S: Likewise.
.globl asm_abstractmethoderror
-#if defined(ENABLE_REPLACEMENT)
- .globl asm_replacement_out
- .globl asm_replacement_in
-#endif
-
.globl asm_builtin_f2i
.globl asm_builtin_f2l
.globl asm_builtin_d2i
jmp L_asm_handle_exception
-#if defined(ENABLE_REPLACEMENT)
-
-/* asm_replacement_out *********************************************************
-
- This code is jumped to from the replacement-out stubs that are executed
- when a thread reaches an activated replacement point.
-
- The purpose of asm_replacement_out is to read out the parts of the
- execution state that cannot be accessed from C code, store this state,
- and then call the C function replace_me.
-
- Stack layout:
- 4 start of stack inside method to replace
- 0 rplpoint * info on the replacement point that was reached
-
-*******************************************************************************/
-
-/* some room to accomodate changes of the stack frame size during replacement */
- /* XXX we should find a cleaner solution here */
-#define REPLACEMENT_ROOM 512
-
-asm_replacement_out:
- /* create stack frame */
- sub $(sizeexecutionstate + REPLACEMENT_ROOM),sp
-
- /* save registers in execution state */
- mov %eax,(EAX*4+offes_intregs)(sp)
- mov %ebx,(EBX*4+offes_intregs)(sp)
- mov %ecx,(ECX*4+offes_intregs)(sp)
- mov %edx,(EDX*4+offes_intregs)(sp)
- mov %esi,(ESI*4+offes_intregs)(sp)
- mov %edi,(EDI*4+offes_intregs)(sp)
- mov %ebp,(EBP*4+offes_intregs)(sp)
- movl $0 ,(ESP*4+offes_intregs)(sp) /* not used */
-
- /* calculate sp of method */
- mov sp,itmp1
- add $(sizeexecutionstate + REPLACEMENT_ROOM + 4),itmp1
- mov itmp1,(offes_sp)(sp)
-
- /* pv must be looked up via AVL tree */
- movl $0,(offes_pv)(sp)
-
- /* call replace_me */
- mov -4(itmp1),itmp1 /* rplpoint * */
- push sp /* arg1: execution state */
- push itmp1 /* arg0: replacement point */
- call replace_me /* call C function replace_me */
-
-
-/* asm_replacement_in **********************************************************
-
- This code writes the given execution state and jumps to the replacement
- code.
-
- This function never returns!
-
- C prototype:
- void asm_replacement_in(executionstate *es, replace_safestack_t *st);
-
-*******************************************************************************/
-
-asm_replacement_in:
- /* get arguments */
- mov 8(sp),%esi /* replace_safestack_t *st */
- mov 4(sp),%ebp /* executionstate *es == safe stack */
-
- /* switch to the safe stack and build a stack frame */
- mov %ebp,sp
- sub $(1*4),sp
-
- /* call replace_build_execution_state(st) */
- mov %esi,(0*4)(sp)
- call replace_build_execution_state
-
- /* set new sp */
- mov (offes_sp)(%ebp),sp
-
- /* push address of new code */
- push (offes_pc)(%ebp)
-
- /* allocate an executionstate_t on the stack */
- sub $(sizeexecutionstate),sp
-
- /* call replace_free_safestack(st,& of allocated executionstate_t) */
- push sp /* tmpes */
- push %esi /* st */
- call replace_free_safestack
- add $(2*4),sp
-
- /* copy registers from execution state */
- mov (EAX*4+offes_intregs)(sp),%eax
- mov (EBX*4+offes_intregs)(sp),%ebx
- mov (ECX*4+offes_intregs)(sp),%ecx
- mov (EDX*4+offes_intregs)(sp),%edx
- mov (ESI*4+offes_intregs)(sp),%esi
- mov (EDI*4+offes_intregs)(sp),%edi
- mov (EBP*4+offes_intregs)(sp),%ebp
-
- /* pop the execution state off the stack */
- add $(sizeexecutionstate),sp
-
- /* jump to new code, hold your thumbs! ;) */
- ret
-
-#endif /* defined(ENABLE_REPLACEMENT) */
-
-
/************************ function asm_builtin_x2x *****************************
* *
* Wrapper functions for corner cases *
#define asm_patcher_wrapper _asm_patcher_wrapper
-#define asm_replacement_out _asm_replacement_out
-#define asm_replacement_in _asm_replacement_in
-
#define asm_builtin_f2i _asm_builtin_f2i
#define asm_builtin_f2l _asm_builtin_f2l
#define asm_builtin_d2i _asm_builtin_d2i
#define asm_patcher_wrapper _asm_patcher_wrapper
-#define asm_replacement_out _asm_replacement_out
-#define asm_replacement_in _asm_replacement_in
-
#define asm_builtin_f2i _asm_builtin_f2i
#define asm_builtin_f2l _asm_builtin_f2l
#define asm_builtin_d2i _asm_builtin_d2i
.globl asm_abstractmethoderror
-#if defined(ENABLE_REPLACEMENT)
- .globl asm_replacement_out
- .globl asm_replacement_in
-#endif
-
.globl compare_and_swap
.end asm_abstractmethoderror
-#if defined(ENABLE_REPLACEMENT)
-
-/* asm_replacement_out *********************************************************
-
- This code is jumped to from the replacement-out stubs that are executed
- when a thread reaches an activated replacement point.
-
- The purpose of asm_replacement_out is to read out the parts of the
- execution state that cannot be accessed from C code, store this state,
- and then call the C function replace_me.
-
- Stack layout:
- 16 start of stack inside method to replace
- 0 rplpoint * info on the replacement point that was reached
-
- NOTE: itmp3 has been clobbered by the replacement-out stub!
-
-*******************************************************************************/
-
-/* some room to accomodate changes of the stack frame size during replacement */
- /* XXX we should find a cleaner solution here */
-#define REPLACEMENT_ROOM 512
-
-#define REPLACEMENT_STACK_OFFSET ((sizeexecutionstate + REPLACEMENT_ROOM + 0xf) & ~0xf)
-
- .ent asm_replacement_out
-
-asm_replacement_out:
- /* create stack frame */
- aaddiu sp,sp,-REPLACEMENT_STACK_OFFSET
-
- /* save registers in execution state */
- ast $0 ,( 0*8+offes_intregs)(sp)
- ast $1 ,( 1*8+offes_intregs)(sp)
- ast $2 ,( 2*8+offes_intregs)(sp)
- ast $3 ,( 3*8+offes_intregs)(sp)
- ast $4 ,( 4*8+offes_intregs)(sp)
- ast $5 ,( 5*8+offes_intregs)(sp)
- ast $6 ,( 6*8+offes_intregs)(sp)
- ast $7 ,( 7*8+offes_intregs)(sp)
- ast $8 ,( 8*8+offes_intregs)(sp)
- ast $9 ,( 9*8+offes_intregs)(sp)
- ast $10,(10*8+offes_intregs)(sp)
- ast $11,(11*8+offes_intregs)(sp)
- ast $12,(12*8+offes_intregs)(sp)
- ast $13,(13*8+offes_intregs)(sp)
- ast $14,(14*8+offes_intregs)(sp)
- ast $15,(15*8+offes_intregs)(sp)
- ast $16,(16*8+offes_intregs)(sp)
- ast $17,(17*8+offes_intregs)(sp)
- ast $18,(18*8+offes_intregs)(sp)
- ast $19,(19*8+offes_intregs)(sp)
- ast $20,(20*8+offes_intregs)(sp)
- ast $21,(21*8+offes_intregs)(sp)
- ast $22,(22*8+offes_intregs)(sp)
- ast $23,(23*8+offes_intregs)(sp)
- ast $24,(24*8+offes_intregs)(sp)
- ast $25,(25*8+offes_intregs)(sp)
- ast $26,(26*8+offes_intregs)(sp)
- ast $27,(27*8+offes_intregs)(sp)
- ast $28,(28*8+offes_intregs)(sp)
- ast $29,(29*8+offes_intregs)(sp)
- ast $30,(30*8+offes_intregs)(sp)
- ast $31,(31*8+offes_intregs)(sp)
-
-#if SIZEOF_VOID_P == 8
-
- sdc1 $f0 ,( 0*8+offes_fltregs)(sp)
- sdc1 $f1 ,( 1*8+offes_fltregs)(sp)
- sdc1 $f2 ,( 2*8+offes_fltregs)(sp)
- sdc1 $f3 ,( 3*8+offes_fltregs)(sp)
- sdc1 $f4 ,( 4*8+offes_fltregs)(sp)
- sdc1 $f5 ,( 5*8+offes_fltregs)(sp)
- sdc1 $f6 ,( 6*8+offes_fltregs)(sp)
- sdc1 $f7 ,( 7*8+offes_fltregs)(sp)
- sdc1 $f8 ,( 8*8+offes_fltregs)(sp)
- sdc1 $f9 ,( 9*8+offes_fltregs)(sp)
- sdc1 $f10,(10*8+offes_fltregs)(sp)
- sdc1 $f11,(11*8+offes_fltregs)(sp)
- sdc1 $f12,(12*8+offes_fltregs)(sp)
- sdc1 $f13,(13*8+offes_fltregs)(sp)
- sdc1 $f14,(14*8+offes_fltregs)(sp)
- sdc1 $f15,(15*8+offes_fltregs)(sp)
- sdc1 $f16,(16*8+offes_fltregs)(sp)
- sdc1 $f17,(17*8+offes_fltregs)(sp)
- sdc1 $f18,(18*8+offes_fltregs)(sp)
- sdc1 $f19,(19*8+offes_fltregs)(sp)
- sdc1 $f20,(20*8+offes_fltregs)(sp)
- sdc1 $f21,(21*8+offes_fltregs)(sp)
- sdc1 $f22,(22*8+offes_fltregs)(sp)
- sdc1 $f23,(23*8+offes_fltregs)(sp)
- sdc1 $f24,(24*8+offes_fltregs)(sp)
- sdc1 $f25,(25*8+offes_fltregs)(sp)
- sdc1 $f26,(26*8+offes_fltregs)(sp)
- sdc1 $f27,(27*8+offes_fltregs)(sp)
- sdc1 $f28,(28*8+offes_fltregs)(sp)
- sdc1 $f29,(29*8+offes_fltregs)(sp)
- sdc1 $f30,(30*8+offes_fltregs)(sp)
- sdc1 $f31,(31*8+offes_fltregs)(sp)
-
-#else /* SIZEOF_VOID_P == 8 */
-
- sdc1 $f0 ,( 0*8+offes_fltregs)(sp)
- sdc1 $f2 ,( 2*8+offes_fltregs)(sp)
- sdc1 $f4 ,( 4*8+offes_fltregs)(sp)
- sdc1 $f6 ,( 6*8+offes_fltregs)(sp)
- sdc1 $f8 ,( 8*8+offes_fltregs)(sp)
- sdc1 $f10,(10*8+offes_fltregs)(sp)
- sdc1 $f12,(12*8+offes_fltregs)(sp)
- sdc1 $f14,(14*8+offes_fltregs)(sp)
- sdc1 $f16,(16*8+offes_fltregs)(sp)
- sdc1 $f18,(18*8+offes_fltregs)(sp)
- sdc1 $f20,(20*8+offes_fltregs)(sp)
- sdc1 $f22,(22*8+offes_fltregs)(sp)
- sdc1 $f24,(24*8+offes_fltregs)(sp)
- sdc1 $f26,(26*8+offes_fltregs)(sp)
- sdc1 $f28,(28*8+offes_fltregs)(sp)
- sdc1 $f30,(30*8+offes_fltregs)(sp)
-
-#endif /* SIZEOF_VOID_P == 8 */
-
- /* calculate sp of method */
- aaddiu itmp1,sp,(REPLACEMENT_STACK_OFFSET + 2*8)
- ast itmp1,(offes_sp)(sp)
-
- /* store pv */
- ast pv,(offes_pv)(sp)
-
- /* call replace_me */
- ald a0,-(2*8)(itmp1) /* arg0: rplpoint * */
- move a1,sp /* arg1: execution state */
- jal replace_me /* call C function replace_me */
- jal abort /* NEVER REACHED */
-
- .end asm_replacement_out
-
-/* asm_replacement_in **********************************************************
-
- This code writes the given execution state and jumps to the replacement
- code.
-
- This function never returns!
-
- NOTE: itmp3 is not restored!
-
- C prototype:
- void asm_replacement_in(executionstate *es);
-
-*******************************************************************************/
-
- .ent asm_replacement_in
-
-asm_replacement_in:
- /* a0 == executionstate *es */
-
- /* set new sp and pv */
- ald sp,(offes_sp)(a0)
- ald pv,(offes_pv)(a0)
-
- /* copy registers from execution state */
- /* $0 is zero */
- ald $1 ,( 1*8+offes_intregs)(a0)
- ald $2 ,( 2*8+offes_intregs)(a0)
- ald $3 ,( 2*8+offes_intregs)(a0)
- /* a0 is loaded below */
- ald $5 ,( 5*8+offes_intregs)(a0)
- ald $6 ,( 6*8+offes_intregs)(a0)
- ald $7 ,( 7*8+offes_intregs)(a0)
- ald $8 ,( 8*8+offes_intregs)(a0)
- ald $9 ,( 9*8+offes_intregs)(a0)
- ald $10,(10*8+offes_intregs)(a0)
- ald $11,(11*8+offes_intregs)(a0)
- ald $12,(12*8+offes_intregs)(a0)
- ald $13,(13*8+offes_intregs)(a0)
- ald $14,(14*8+offes_intregs)(a0)
- ald $15,(15*8+offes_intregs)(a0)
- ald $16,(16*8+offes_intregs)(a0)
- ald $17,(17*8+offes_intregs)(a0)
- ald $18,(18*8+offes_intregs)(a0)
- ald $19,(19*8+offes_intregs)(a0)
- ald $20,(20*8+offes_intregs)(a0)
- ald $21,(21*8+offes_intregs)(a0)
- ald $22,(22*8+offes_intregs)(a0)
- ald $23,(23*8+offes_intregs)(a0)
- ald $24,(24*8+offes_intregs)(a0)
- ald $25,(25*8+offes_intregs)(a0)
- ald $26,(26*8+offes_intregs)(a0)
- ald $27,(27*8+offes_intregs)(a0)
- ald $28,(28*8+offes_intregs)(a0)
- /* $29 is sp */
- /* $30 is pv */
- ald $31,(31*8+offes_intregs)(a0)
-
-#if SIZEOF_VOID_P == 8
-
- ldc1 $f0 ,( 0*8+offes_fltregs)(a0)
- ldc1 $f1 ,( 1*8+offes_fltregs)(a0)
- ldc1 $f2 ,( 2*8+offes_fltregs)(a0)
- ldc1 $f3 ,( 3*8+offes_fltregs)(a0)
- ldc1 $f4 ,( 4*8+offes_fltregs)(a0)
- ldc1 $f5 ,( 5*8+offes_fltregs)(a0)
- ldc1 $f6 ,( 6*8+offes_fltregs)(a0)
- ldc1 $f7 ,( 7*8+offes_fltregs)(a0)
- ldc1 $f8 ,( 8*8+offes_fltregs)(a0)
- ldc1 $f9 ,( 9*8+offes_fltregs)(a0)
- ldc1 $f10,(10*8+offes_fltregs)(a0)
- ldc1 $f11,(11*8+offes_fltregs)(a0)
- ldc1 $f12,(12*8+offes_fltregs)(a0)
- ldc1 $f13,(13*8+offes_fltregs)(a0)
- ldc1 $f14,(14*8+offes_fltregs)(a0)
- ldc1 $f15,(15*8+offes_fltregs)(a0)
- ldc1 $f16,(16*8+offes_fltregs)(a0)
- ldc1 $f17,(17*8+offes_fltregs)(a0)
- ldc1 $f18,(18*8+offes_fltregs)(a0)
- ldc1 $f19,(19*8+offes_fltregs)(a0)
- ldc1 $f20,(20*8+offes_fltregs)(a0)
- ldc1 $f21,(21*8+offes_fltregs)(a0)
- ldc1 $f22,(22*8+offes_fltregs)(a0)
- ldc1 $f23,(23*8+offes_fltregs)(a0)
- ldc1 $f24,(24*8+offes_fltregs)(a0)
- ldc1 $f25,(25*8+offes_fltregs)(a0)
- ldc1 $f26,(26*8+offes_fltregs)(a0)
- ldc1 $f27,(27*8+offes_fltregs)(a0)
- ldc1 $f28,(28*8+offes_fltregs)(a0)
- ldc1 $f29,(29*8+offes_fltregs)(a0)
- ldc1 $f30,(30*8+offes_fltregs)(a0)
- ldc1 $f31,(31*8+offes_fltregs)(a0)
-
-#else /* SIZEOF_VOID_P == 8 */
-
- ldc1 $f0 ,( 0*8+offes_fltregs)(a0)
- ldc1 $f2 ,( 2*8+offes_fltregs)(a0)
- ldc1 $f4 ,( 4*8+offes_fltregs)(a0)
- ldc1 $f6 ,( 6*8+offes_fltregs)(a0)
- ldc1 $f8 ,( 8*8+offes_fltregs)(a0)
- ldc1 $f10,(10*8+offes_fltregs)(a0)
- ldc1 $f12,(12*8+offes_fltregs)(a0)
- ldc1 $f14,(14*8+offes_fltregs)(a0)
- ldc1 $f16,(16*8+offes_fltregs)(a0)
- ldc1 $f18,(18*8+offes_fltregs)(a0)
- ldc1 $f20,(20*8+offes_fltregs)(a0)
- ldc1 $f22,(22*8+offes_fltregs)(a0)
- ldc1 $f24,(24*8+offes_fltregs)(a0)
- ldc1 $f26,(26*8+offes_fltregs)(a0)
- ldc1 $f28,(28*8+offes_fltregs)(a0)
- ldc1 $f30,(30*8+offes_fltregs)(a0)
-
-#endif /* SIZEOF_VOID_P == 8 */
-
- /* load new pc */
-
- ald itmp3,offes_pc(a0)
-
- /* load a0 */
-
- ald a0,(4*8+offes_intregs)(a0)
-
- /* jump to new code */
-
- jr itmp3
-
- .end asm_replacement_in
-
-#endif /* defined(ENABLE_REPLACEMENT) */
-
-
.ent compare_and_swap
compare_and_swap:
.globl asm_abstractmethoderror
-#if defined(ENABLE_REPLACEMENT)
- .globl asm_replacement_out
- .globl asm_replacement_in
-#endif
-
.globl asm_cacheflush
.globl asm_compare_and_swap
b L_asm_handle_nat_exception
-#if defined(ENABLE_REPLACEMENT)
-
-/* asm_replacement_out *********************************************************
-
- This code is jumped to from the replacement-out stubs that are executed
- when a thread reaches an activated replacement point.
-
- The purpose of asm_replacement_out is to read out the parts of the
- execution state that cannot be accessed from C code, store this state,
- and then call the C function replace_me.
-
- Stack layout:
- 16 start of stack inside method to replace
- 0 rplpoint * info on the replacement point that was reached
-
- NOTE: itmp3 has been clobbered by the replacement-out stub!
-
-*******************************************************************************/
-
-/* some room to accomodate changes of the stack frame size during replacement */
- /* XXX we should find a cleaner solution here */
-#define REPLACEMENT_ROOM 512
-
-#define sizeexecutionstate_ALIGNED ((sizeexecutionstate + 15) & ~15)
-
-asm_replacement_out:
- /* create stack frame */
- addi sp,sp,-(sizeexecutionstate_ALIGNED + REPLACEMENT_ROOM)
-
- /* save link register */
- mflr itmp3
-
- /* save registers in execution state */
- stw r0 ,( 0*4+offes_intregs)(sp)
- stw r1 ,( 1*4+offes_intregs)(sp)
- stw r2 ,( 2*4+offes_intregs)(sp)
- stw r3 ,( 3*4+offes_intregs)(sp)
- stw r4 ,( 4*4+offes_intregs)(sp)
- stw r5 ,( 5*4+offes_intregs)(sp)
- stw r6 ,( 6*4+offes_intregs)(sp)
- stw r7 ,( 7*4+offes_intregs)(sp)
- stw r8 ,( 8*4+offes_intregs)(sp)
- stw r9 ,( 9*4+offes_intregs)(sp)
- stw r10,(10*4+offes_intregs)(sp)
- stw r11,(11*4+offes_intregs)(sp)
- stw r12,(12*4+offes_intregs)(sp)
- stw r13,(13*4+offes_intregs)(sp)
- stw r14,(14*4+offes_intregs)(sp)
- stw r15,(15*4+offes_intregs)(sp)
- stw r16,(16*4+offes_intregs)(sp) /* link register stored as itmp3 */
- stw r17,(17*4+offes_intregs)(sp)
- stw r18,(18*4+offes_intregs)(sp)
- stw r19,(19*4+offes_intregs)(sp)
- stw r20,(20*4+offes_intregs)(sp)
- stw r21,(21*4+offes_intregs)(sp)
- stw r22,(22*4+offes_intregs)(sp)
- stw r23,(23*4+offes_intregs)(sp)
- stw r24,(24*4+offes_intregs)(sp)
- stw r25,(25*4+offes_intregs)(sp)
- stw r26,(26*4+offes_intregs)(sp)
- stw r27,(27*4+offes_intregs)(sp)
- stw r28,(28*4+offes_intregs)(sp)
- stw r29,(29*4+offes_intregs)(sp)
- stw r30,(30*4+offes_intregs)(sp)
- stw r31,(31*4+offes_intregs)(sp)
-
- stfd fr0 ,( 0*8+offes_fltregs)(sp)
- stfd fr1 ,( 1*8+offes_fltregs)(sp)
- stfd fr2 ,( 2*8+offes_fltregs)(sp)
- stfd fr3 ,( 3*8+offes_fltregs)(sp)
- stfd fr4 ,( 4*8+offes_fltregs)(sp)
- stfd fr5 ,( 5*8+offes_fltregs)(sp)
- stfd fr6 ,( 6*8+offes_fltregs)(sp)
- stfd fr7 ,( 7*8+offes_fltregs)(sp)
- stfd fr8 ,( 8*8+offes_fltregs)(sp)
- stfd fr9 ,( 9*8+offes_fltregs)(sp)
- stfd fr10,(10*8+offes_fltregs)(sp)
- stfd fr11,(11*8+offes_fltregs)(sp)
- stfd fr12,(12*8+offes_fltregs)(sp)
- stfd fr13,(13*8+offes_fltregs)(sp)
- stfd fr14,(14*8+offes_fltregs)(sp)
- stfd fr15,(15*8+offes_fltregs)(sp)
- stfd fr16,(16*8+offes_fltregs)(sp)
- stfd fr17,(17*8+offes_fltregs)(sp)
- stfd fr18,(18*8+offes_fltregs)(sp)
- stfd fr19,(19*8+offes_fltregs)(sp)
- stfd fr20,(20*8+offes_fltregs)(sp)
- stfd fr21,(21*8+offes_fltregs)(sp)
- stfd fr22,(22*8+offes_fltregs)(sp)
- stfd fr23,(23*8+offes_fltregs)(sp)
- stfd fr24,(24*8+offes_fltregs)(sp)
- stfd fr25,(25*8+offes_fltregs)(sp)
- stfd fr26,(26*8+offes_fltregs)(sp)
- stfd fr27,(27*8+offes_fltregs)(sp)
- stfd fr28,(28*8+offes_fltregs)(sp)
- stfd fr29,(29*8+offes_fltregs)(sp)
- stfd fr30,(30*8+offes_fltregs)(sp)
- stfd fr31,(31*8+offes_fltregs)(sp)
-
- /* calculate sp of method */
- addi itmp1,sp,(sizeexecutionstate_ALIGNED + REPLACEMENT_ROOM + 4*4)
- stw itmp1,(offes_sp)(sp)
-
- /* store pv */
- stw pv,(offes_pv)(sp)
-
- /* call replace_me */
- lwz a0,-(4*4)(itmp1) /* arg0: rplpoint * */
- mr a1,sp /* arg1: execution state */
- addi sp,sp,-(LA_SIZE_ALIGNED)
- b replace_me /* call C function replace_me */
-
-/* asm_replacement_in **********************************************************
-
- This code writes the given execution state and jumps to the replacement
- code.
-
- This function never returns!
-
- NOTE: itmp3 is not restored!
-
- C prototype:
- void asm_replacement_in(executionstate *es, replace_safestack_t *st);
-
-*******************************************************************************/
-
-asm_replacement_in:
- /* a0 == executionstate *es */
- /* a1 == replace_safestack_t *st */
-
- /* get arguments */
- mr s1,a1 /* replace_safestack_t *st */
- mr s2,a0 /* executionstate *es == safe stack */
-
- /* switch to the safe stack */
- mr sp,s2
-
- /* reserve linkage area */
- addi sp,sp,-(LA_SIZE_ALIGNED)
-
- /* call replace_build_execution_state(st) */
- mr a0,s1
- bl replace_build_execution_state
-
- /* set new sp */
- lwz sp,(offes_sp)(s2)
-
- /* build stack frame */
- addi sp,sp,-(sizeexecutionstate_ALIGNED)
-
- /* call replace_free_safestack(st,& of allocated executionstate_t) */
- mr a1,sp /* tmpes */
- mr a0,s1 /* st */
- addi sp,sp,-(LA_SIZE_ALIGNED) /* reserve linkage area */
- bl replace_free_safestack
- addi sp,sp,+(LA_SIZE_ALIGNED) /* tear down linkage area */
-
- /* set new pv */
- lwz pv,(offes_pv)(sp)
-
- /* copy registers from execution state */
- lwz r0 ,( 0*4+offes_intregs)(sp)
- /* r1 is sp */
- /* r2 is reserved */
- lwz a0 ,( 3*4+offes_intregs)(sp)
- lwz r4 ,( 4*4+offes_intregs)(sp)
- lwz r5 ,( 5*4+offes_intregs)(sp)
- lwz r6 ,( 6*4+offes_intregs)(sp)
- lwz r7 ,( 7*4+offes_intregs)(sp)
- lwz r8 ,( 8*4+offes_intregs)(sp)
- lwz r9 ,( 9*4+offes_intregs)(sp)
- lwz r10,(10*4+offes_intregs)(sp)
- lwz r11,(11*4+offes_intregs)(sp)
- lwz r12,(12*4+offes_intregs)(sp)
- /* r13 is pv */
- lwz r14,(14*4+offes_intregs)(sp)
- lwz r15,(15*4+offes_intregs)(sp)
- lwz r16,(16*4+offes_intregs)(sp) /* itmp3, later to link register */
- lwz r17,(17*4+offes_intregs)(sp)
- lwz r18,(18*4+offes_intregs)(sp)
- lwz r19,(19*4+offes_intregs)(sp)
- lwz r20,(20*4+offes_intregs)(sp)
- lwz r21,(21*4+offes_intregs)(sp)
- lwz r22,(22*4+offes_intregs)(sp)
- lwz r23,(23*4+offes_intregs)(sp)
- lwz r24,(24*4+offes_intregs)(sp)
- lwz r25,(25*4+offes_intregs)(sp)
- lwz r26,(26*4+offes_intregs)(sp)
- lwz r27,(27*4+offes_intregs)(sp)
- lwz r28,(28*4+offes_intregs)(sp)
- lwz r29,(29*4+offes_intregs)(sp)
- lwz r30,(30*4+offes_intregs)(sp)
- lwz r31,(31*4+offes_intregs)(sp)
-
- lfd fr0 ,( 0*8+offes_fltregs)(sp)
- lfd fr1 ,( 1*8+offes_fltregs)(sp)
- lfd fr2 ,( 2*8+offes_fltregs)(sp)
- lfd fr3 ,( 3*8+offes_fltregs)(sp)
- lfd fr4 ,( 4*8+offes_fltregs)(sp)
- lfd fr5 ,( 5*8+offes_fltregs)(sp)
- lfd fr6 ,( 6*8+offes_fltregs)(sp)
- lfd fr7 ,( 7*8+offes_fltregs)(sp)
- lfd fr8 ,( 8*8+offes_fltregs)(sp)
- lfd fr9 ,( 9*8+offes_fltregs)(sp)
- lfd fr10,(10*8+offes_fltregs)(sp)
- lfd fr11,(11*8+offes_fltregs)(sp)
- lfd fr12,(12*8+offes_fltregs)(sp)
- lfd fr13,(13*8+offes_fltregs)(sp)
- lfd fr14,(14*8+offes_fltregs)(sp)
- lfd fr15,(15*8+offes_fltregs)(sp)
- lfd fr16,(16*8+offes_fltregs)(sp)
- lfd fr17,(17*8+offes_fltregs)(sp)
- lfd fr18,(18*8+offes_fltregs)(sp)
- lfd fr19,(19*8+offes_fltregs)(sp)
- lfd fr20,(20*8+offes_fltregs)(sp)
- lfd fr21,(21*8+offes_fltregs)(sp)
- lfd fr22,(22*8+offes_fltregs)(sp)
- lfd fr23,(23*8+offes_fltregs)(sp)
- lfd fr24,(24*8+offes_fltregs)(sp)
- lfd fr25,(25*8+offes_fltregs)(sp)
- lfd fr26,(26*8+offes_fltregs)(sp)
- lfd fr27,(27*8+offes_fltregs)(sp)
- lfd fr28,(28*8+offes_fltregs)(sp)
- lfd fr29,(29*8+offes_fltregs)(sp)
- lfd fr30,(30*8+offes_fltregs)(sp)
- lfd fr31,(31*8+offes_fltregs)(sp)
-
- /* restore link register */
-
- mtlr itmp3
-
- /* load new pc */
-
- lwz itmp3,offes_pc(sp)
-
- /* remove stack frame */
-
- addi sp,sp,+(sizeexecutionstate_ALIGNED)
-
- /* jump to new code */
-
- mtctr itmp3
- bctr
-
-#endif /* defined(ENABLE_REPLACEMENT) */
-
/*********************************************************************/
asm_cacheflush:
#define asm_patcher_wrapper _asm_patcher_wrapper
-#define asm_replacement_out _asm_replacement_out
-#define asm_replacement_in _asm_replacement_in
-
#define asm_cacheflush _asm_cacheflush
.globl asm_abstractmethoderror
-#if defined(ENABLE_REPLACEMENT)
- .globl asm_replacement_out
- .globl .asm_replacement_in
-#endif
-
.globl asm_cacheflush
b L_asm_handle_nat_exception
-#if defined(ENABLE_REPLACEMENT)
-
-/* asm_replacement_out *********************************************************
-
- This code is jumped to from the replacement-out stubs that are executed
- when a thread reaches an activated replacement point.
-
- The purpose of asm_replacement_out is to read out the parts of the
- execution state that cannot be accessed from C code, store this state,
- and then call the C function replace_me.
-
- Stack layout:
- 16 start of stack inside method to replace
- 0 rplpoint * info on the replacement point that was reached
-
- NOTE: itmp3 has been clobbered by the replacement-out stub!
-
-*******************************************************************************/
-
-/* some room to accomodate changes of the stack frame size during replacement */
- /* XXX we should find a cleaner solution here */
-#define REPLACEMENT_ROOM 512
-
-asm_replacement_out:
- /* create stack frame */
- addi sp,sp,-(sizeexecutionstate + REPLACEMENT_ROOM) /* XXX align */
-
- /* save link register */
- mflr r16
-
- /* save registers in execution state */
- std r0 ,( 0*8+offes_intregs)(sp)
- std r1 ,( 1*8+offes_intregs)(sp)
- std r2 ,( 2*8+offes_intregs)(sp)
- std r3 ,( 3*8+offes_intregs)(sp)
- std r4 ,( 4*8+offes_intregs)(sp)
- std r5 ,( 5*8+offes_intregs)(sp)
- std r6 ,( 6*8+offes_intregs)(sp)
- std r7 ,( 7*8+offes_intregs)(sp)
- std r8 ,( 8*8+offes_intregs)(sp)
- std r9 ,( 9*8+offes_intregs)(sp)
- std r10,(10*8+offes_intregs)(sp)
- std r11,(11*8+offes_intregs)(sp)
- std r12,(12*8+offes_intregs)(sp)
- std r13,(13*8+offes_intregs)(sp)
- std r14,(14*8+offes_intregs)(sp)
- std r15,(15*8+offes_intregs)(sp)
- std r16,(16*8+offes_intregs)(sp) /* link register */
- std r17,(17*8+offes_intregs)(sp)
- std r18,(18*8+offes_intregs)(sp)
- std r19,(19*8+offes_intregs)(sp)
- std r20,(20*8+offes_intregs)(sp)
- std r21,(21*8+offes_intregs)(sp)
- std r22,(22*8+offes_intregs)(sp)
- std r23,(23*8+offes_intregs)(sp)
- std r24,(24*8+offes_intregs)(sp)
- std r25,(25*8+offes_intregs)(sp)
- std r26,(26*8+offes_intregs)(sp)
- std r27,(27*8+offes_intregs)(sp)
- std r28,(28*8+offes_intregs)(sp)
- std r29,(29*8+offes_intregs)(sp)
- std r30,(30*8+offes_intregs)(sp)
- std r31,(31*8+offes_intregs)(sp)
-
- stfd fr0 ,( 0*8+offes_fltregs)(sp)
- stfd fr1 ,( 1*8+offes_fltregs)(sp)
- stfd fr2 ,( 2*8+offes_fltregs)(sp)
- stfd fr3 ,( 3*8+offes_fltregs)(sp)
- stfd fr4 ,( 4*8+offes_fltregs)(sp)
- stfd fr5 ,( 5*8+offes_fltregs)(sp)
- stfd fr6 ,( 6*8+offes_fltregs)(sp)
- stfd fr7 ,( 7*8+offes_fltregs)(sp)
- stfd fr8 ,( 8*8+offes_fltregs)(sp)
- stfd fr9 ,( 9*8+offes_fltregs)(sp)
- stfd fr10,(10*8+offes_fltregs)(sp)
- stfd fr11,(11*8+offes_fltregs)(sp)
- stfd fr12,(12*8+offes_fltregs)(sp)
- stfd fr13,(13*8+offes_fltregs)(sp)
- stfd fr14,(14*8+offes_fltregs)(sp)
- stfd fr15,(15*8+offes_fltregs)(sp)
- stfd fr16,(16*8+offes_fltregs)(sp)
- stfd fr17,(17*8+offes_fltregs)(sp)
- stfd fr18,(18*8+offes_fltregs)(sp)
- stfd fr19,(19*8+offes_fltregs)(sp)
- stfd fr20,(20*8+offes_fltregs)(sp)
- stfd fr21,(21*8+offes_fltregs)(sp)
- stfd fr22,(22*8+offes_fltregs)(sp)
- stfd fr23,(23*8+offes_fltregs)(sp)
- stfd fr24,(24*8+offes_fltregs)(sp)
- stfd fr25,(25*8+offes_fltregs)(sp)
- stfd fr26,(26*8+offes_fltregs)(sp)
- stfd fr27,(27*8+offes_fltregs)(sp)
- stfd fr28,(28*8+offes_fltregs)(sp)
- stfd fr29,(29*8+offes_fltregs)(sp)
- stfd fr30,(30*8+offes_fltregs)(sp)
- stfd fr31,(31*8+offes_fltregs)(sp)
-
- /* calculate sp of method */
- addi itmp1,sp,(sizeexecutionstate + REPLACEMENT_ROOM + 4*4)
- stw itmp1,(offes_sp)(sp)
-
- /* store pv */
- stw pv,(offes_pv)(sp)
-
- /* call replace_me */
- lwz a0,-(4*4)(itmp1) /* arg0: rplpoint * */
- mr a1,sp /* arg1: execution state */
- addi sp,sp,-(LA_SIZE_ALIGNED)
- b replace_me /* call C function replace_me */
-
-/* asm_replacement_in **********************************************************
-
- This code writes the given execution state and jumps to the replacement
- code.
-
- This function never returns!
-
- NOTE: itmp3 is not restored!
-
- C prototype:
- void asm_replacement_in(executionstate *es);
-
-*******************************************************************************/
-
-.asm_replacement_in:
- /* a0 == executionstate *es */
-
- /* set new sp and pv */
- ld sp,(offes_sp)(a0)
- ld pv,(offes_pv)(a0)
-
- /* copy registers from execution state */
- ld r0 ,( 0*8+offes_intregs)(a0)
- /* r1 is sp */
- /* r2 is reserved */
- /* a0 is loaded below */
- ld r4 ,( 4*8+offes_intregs)(a0)
- ld r5 ,( 5*8+offes_intregs)(a0)
- ld r6 ,( 6*8+offes_intregs)(a0)
- ld r7 ,( 7*8+offes_intregs)(a0)
- ld r8 ,( 8*8+offes_intregs)(a0)
- ld r9 ,( 9*8+offes_intregs)(a0)
- ld r10,(10*8+offes_intregs)(a0)
- ld r11,(11*8+offes_intregs)(a0)
- ld r12,(12*8+offes_intregs)(a0)
- /* r13 is pv */
- ld r14,(14*8+offes_intregs)(a0)
- ld r15,(15*8+offes_intregs)(a0)
- ld r16,(16*8+offes_intregs)(a0) /* link register */
- ld r17,(17*8+offes_intregs)(a0)
- ld r18,(18*8+offes_intregs)(a0)
- ld r19,(19*8+offes_intregs)(a0)
- ld r20,(20*8+offes_intregs)(a0)
- ld r21,(21*8+offes_intregs)(a0)
- ld r22,(22*8+offes_intregs)(a0)
- ld r23,(23*8+offes_intregs)(a0)
- ld r24,(24*8+offes_intregs)(a0)
- ld r25,(25*8+offes_intregs)(a0)
- ld r26,(26*8+offes_intregs)(a0)
- ld r27,(27*8+offes_intregs)(a0)
- ld r28,(28*8+offes_intregs)(a0)
- ld r29,(29*8+offes_intregs)(a0)
- ld r30,(30*8+offes_intregs)(a0)
- ld r31,(31*8+offes_intregs)(a0)
-
- lfd fr0 ,( 0*8+offes_fltregs)(a0)
- lfd fr1 ,( 1*8+offes_fltregs)(a0)
- lfd fr2 ,( 2*8+offes_fltregs)(a0)
- lfd fr3 ,( 3*8+offes_fltregs)(a0)
- lfd fr4 ,( 4*8+offes_fltregs)(a0)
- lfd fr5 ,( 5*8+offes_fltregs)(a0)
- lfd fr6 ,( 6*8+offes_fltregs)(a0)
- lfd fr7 ,( 7*8+offes_fltregs)(a0)
- lfd fr8 ,( 8*8+offes_fltregs)(a0)
- lfd fr9 ,( 9*8+offes_fltregs)(a0)
- lfd fr10,(10*8+offes_fltregs)(a0)
- lfd fr11,(11*8+offes_fltregs)(a0)
- lfd fr12,(12*8+offes_fltregs)(a0)
- lfd fr13,(13*8+offes_fltregs)(a0)
- lfd fr14,(14*8+offes_fltregs)(a0)
- lfd fr15,(15*8+offes_fltregs)(a0)
- lfd fr16,(16*8+offes_fltregs)(a0)
- lfd fr17,(17*8+offes_fltregs)(a0)
- lfd fr18,(18*8+offes_fltregs)(a0)
- lfd fr19,(19*8+offes_fltregs)(a0)
- lfd fr20,(20*8+offes_fltregs)(a0)
- lfd fr21,(21*8+offes_fltregs)(a0)
- lfd fr22,(22*8+offes_fltregs)(a0)
- lfd fr23,(23*8+offes_fltregs)(a0)
- lfd fr24,(24*8+offes_fltregs)(a0)
- lfd fr25,(25*8+offes_fltregs)(a0)
- lfd fr26,(26*8+offes_fltregs)(a0)
- lfd fr27,(27*8+offes_fltregs)(a0)
- lfd fr28,(28*8+offes_fltregs)(a0)
- lfd fr29,(29*8+offes_fltregs)(a0)
- lfd fr30,(30*8+offes_fltregs)(a0)
- lfd fr31,(31*8+offes_fltregs)(a0)
-
- /* restore link register */
-
- mtlr r16
-
- /* load new pc */
-
- ld itmp3,offes_pc(a0)
-
- /* load a0 */
-
- ld a0,(3*8+offes_intregs)(a0)
-
- /* jump to new code */
-
- mtctr itmp3
- bctr
-
-#endif /* defined(ENABLE_REPLACEMENT) */
-
/* asm_cacheflush **************************************************************
assumes 128 byte cache line size.
All registers used may be trashed for fun and profit.
.globl asm_abstractmethoderror
- .globl asm_replacement_out
- .globl asm_replacement_in
-
.globl asm_builtin_f2i
.globl asm_builtin_f2l
.globl asm_builtin_d2i
asm_abstractmethoderror:
.long 0
-asm_replacement_out:
- .long 0
-asm_replacement_in:
- .long 0
asm_builtin_f2i:
.long 0
asm_builtin_f2l:
.globl asm_abstractmethoderror
-#if defined(ENABLE_REPLACEMENT)
- .globl asm_replacement_out
- .globl asm_replacement_in
-#endif
-
.globl asm_builtin_f2i
.globl asm_builtin_f2l
.globl asm_builtin_d2i
jmp L_asm_handle_exception
-#if defined(ENABLE_REPLACEMENT)
-
-/* asm_replacement_out *********************************************************
-
- This code is jumped to from the replacement-out stubs that are executed
- when a thread reaches an activated replacement point.
-
- The purpose of asm_replacement_out is to read out the parts of the
- execution state that cannot be accessed from C code, store this state,
- and then call the C function replace_me.
-
- Stack layout:
- 8 start of stack inside method to replace
- 0 rplpoint * info on the replacement point that was reached
-
-*******************************************************************************/
-
-/* some room to accomodate changes of the stack frame size during replacement */
- /* XXX we should find a cleaner solution here */
-#define REPLACEMENT_ROOM 512
-
-asm_replacement_out:
- /* create stack frame */
- sub $(sizeexecutionstate + REPLACEMENT_ROOM),sp
-
- /* save registers in execution state */
- mov %rax,(RAX*8+offes_intregs)(sp)
- mov %rbx,(RBX*8+offes_intregs)(sp)
- mov %rcx,(RCX*8+offes_intregs)(sp)
- mov %rdx,(RDX*8+offes_intregs)(sp)
- mov %rsi,(RSI*8+offes_intregs)(sp)
- mov %rdi,(RDI*8+offes_intregs)(sp)
- mov %rbp,(RBP*8+offes_intregs)(sp)
- movq $0 ,(RSP*8+offes_intregs)(sp) /* not used */
- mov %r8 ,(R8 *8+offes_intregs)(sp)
- mov %r9 ,(R9 *8+offes_intregs)(sp)
- mov %r10,(R10*8+offes_intregs)(sp)
- mov %r11,(R11*8+offes_intregs)(sp)
- mov %r12,(R12*8+offes_intregs)(sp)
- mov %r13,(R13*8+offes_intregs)(sp)
- mov %r14,(R14*8+offes_intregs)(sp)
- mov %r15,(R15*8+offes_intregs)(sp)
-
- movq %xmm0 ,(XMM0 *8+offes_fltregs)(sp)
- movq %xmm1 ,(XMM1 *8+offes_fltregs)(sp)
- movq %xmm2 ,(XMM2 *8+offes_fltregs)(sp)
- movq %xmm3 ,(XMM3 *8+offes_fltregs)(sp)
- movq %xmm4 ,(XMM4 *8+offes_fltregs)(sp)
- movq %xmm5 ,(XMM5 *8+offes_fltregs)(sp)
- movq %xmm6 ,(XMM6 *8+offes_fltregs)(sp)
- movq %xmm7 ,(XMM7 *8+offes_fltregs)(sp)
- movq %xmm8 ,(XMM8 *8+offes_fltregs)(sp)
- movq %xmm9 ,(XMM9 *8+offes_fltregs)(sp)
- movq %xmm10,(XMM10*8+offes_fltregs)(sp)
- movq %xmm11,(XMM11*8+offes_fltregs)(sp)
- movq %xmm12,(XMM12*8+offes_fltregs)(sp)
- movq %xmm13,(XMM13*8+offes_fltregs)(sp)
- movq %xmm14,(XMM14*8+offes_fltregs)(sp)
- movq %xmm15,(XMM15*8+offes_fltregs)(sp)
-
- /* calculate sp of method */
- mov sp,itmp1
- add $(sizeexecutionstate + REPLACEMENT_ROOM + 8),itmp1
- mov itmp1,(offes_sp)(sp)
-
- /* pv must be looked up via AVL tree */
- movq $0,(offes_pv)(sp)
-
- /* call replace_me */
- mov -8(itmp1),a0 /* rplpoint * */
- mov sp,a1 /* arg1: execution state */
- call replace_me@PLT /* call C function replace_me */
- call abort@PLT /* NEVER REACHED */
-
-/* asm_replacement_in **********************************************************
-
- This code writes the given execution state and jumps to the replacement
- code.
-
- This function never returns!
-
- C prototype:
- void asm_replacement_in(executionstate *es, replace_safestack_t *st);
-
-*******************************************************************************/
-
-asm_replacement_in:
- /* get arguments */
- mov a1,s1 /* replace_safestack_t *st */
- mov a0,%rbp /* executionstate *es == safe stack */
-
- /* switch to the safe stack */
- mov %rbp,sp
-
- /* call replace_build_execution_state(st) */
- mov s1,a0
- call replace_build_execution_state@PLT
-
- /* set new sp */
- mov (offes_sp)(%rbp),sp
-
- /* push address of new code */
- pushq (offes_pc)(%rbp)
-
- /* allocate an executionstate_t on the stack */
- sub $(sizeexecutionstate),sp
-
- /* call replace_free_safestack(st,& of allocated executionstate_t) */
- mov sp,a1
- mov s1,a0
- call replace_free_safestack@PLT
-
- /* copy registers from execution state */
- movq (XMM0 *8+offes_fltregs)(sp),%xmm0
- movq (XMM1 *8+offes_fltregs)(sp),%xmm1
- movq (XMM2 *8+offes_fltregs)(sp),%xmm2
- movq (XMM3 *8+offes_fltregs)(sp),%xmm3
- movq (XMM4 *8+offes_fltregs)(sp),%xmm4
- movq (XMM5 *8+offes_fltregs)(sp),%xmm5
- movq (XMM6 *8+offes_fltregs)(sp),%xmm6
- movq (XMM7 *8+offes_fltregs)(sp),%xmm7
- movq (XMM8 *8+offes_fltregs)(sp),%xmm8
- movq (XMM9 *8+offes_fltregs)(sp),%xmm9
- movq (XMM10*8+offes_fltregs)(sp),%xmm10
- movq (XMM11*8+offes_fltregs)(sp),%xmm11
- movq (XMM12*8+offes_fltregs)(sp),%xmm12
- movq (XMM13*8+offes_fltregs)(sp),%xmm13
- movq (XMM14*8+offes_fltregs)(sp),%xmm14
- movq (XMM15*8+offes_fltregs)(sp),%xmm15
-
- mov (RAX*8+offes_intregs)(sp),%rax
- mov (RBX*8+offes_intregs)(sp),%rbx
- mov (RCX*8+offes_intregs)(sp),%rcx
- mov (RDX*8+offes_intregs)(sp),%rdx
- mov (RSI*8+offes_intregs)(sp),%rsi
- mov (RDI*8+offes_intregs)(sp),%rdi
- mov (RBP*8+offes_intregs)(sp),%rbp
- mov (R8 *8+offes_intregs)(sp),%r8
- mov (R9 *8+offes_intregs)(sp),%r9
- mov (R10*8+offes_intregs)(sp),%r10
- mov (R11*8+offes_intregs)(sp),%r11
- mov (R12*8+offes_intregs)(sp),%r12
- mov (R13*8+offes_intregs)(sp),%r13
- mov (R14*8+offes_intregs)(sp),%r14
- mov (R15*8+offes_intregs)(sp),%r15
-
- /* pop the execution state off the stack */
- add $(sizeexecutionstate),sp
-
- /* jump to new code */
- ret
-
-#endif /* defined(ENABLE_REPLACEMENT) */
-
-
/* asm_builtin_x2x *************************************************************
* *
* Wrapper functions for float to int corner cases *