Changes: Christian Thalinger
- $Id: asmpart.S 3234 2005-09-21 12:11:58Z twisti $
+ $Id: asmpart.S 3556 2005-11-03 21:39:25Z twisti $
*/
ble calljava_argsloaded
addi itmp2,itmp2,-1
- lwz r3,offjniitem+4(itmp1)
+ lwz a0,offjniitem+4(itmp1)
mr. itmp2,itmp2
ble calljava_argsloaded
addi itmp2,itmp2,-1
- lwz r4,offjniitem+sizejniblock*1+4(itmp1)
+ lwz a1,offjniitem+sizejniblock*1+4(itmp1)
mr. itmp2,itmp2
ble calljava_argsloaded
+
addi itmp2,itmp2,-1
+ lwz a2,offjniitem+sizejniblock*2+4(itmp1)
+ mr. itmp2,itmp2
+ ble calljava_argsloaded
addi itmp2,itmp2,-1
- lwz r5,offjniitem+sizejniblock*2+4(itmp1)
+ lwz a3,offjniitem+sizejniblock*3+4(itmp1)
mr. itmp2,itmp2
ble calljava_argsloaded
+
addi itmp2,itmp2,-1
+ lwz a4,offjniitem+sizejniblock*4+4(itmp1)
+ mr. itmp2,itmp2
+ ble calljava_argsloaded
addi itmp2,itmp2,-1
- lwz r6,offjniitem+sizejniblock*3+4(itmp1)
+ lwz a5,offjniitem+sizejniblock*5+4(itmp1)
mr. itmp2,itmp2
ble calljava_argsloaded
+
addi itmp2,itmp2,-1
+ lwz a6,offjniitem+sizejniblock*6+4(itmp1)
+ mr. itmp2,itmp2
+ ble calljava_argsloaded
+
+ addi itmp2,itmp2,-1
+ lwz a7,offjniitem+sizejniblock*7+4(itmp1)
+ mr. itmp2,itmp2
+ ble calljava_argsloaded
calljava_argsloaded:
addi itmp1,r1,36
mflr r0
stw r0,8*4+LA_LR_OFFSET(r1) /* skip stack frame of patcher stub */
/* keep stack 16-bytes aligned: 6+1+37 = 44 */
- stwu r1,-(LA_SIZE+(5+38)*4+sizestackframeinfo)(r1)
+ stwu sp,-(LA_SIZE+(5+38)*4+sizestackframeinfo)(sp)
#if 1
stw a0,LA_SIZE+(5+0)*4(r1) /* save argument registers */
mr a1,pv
addi a2,sp,(8+LA_WORD_SIZE+5+38)*4+sizestackframeinfo
mr a3,r0 /* this is correct for leafs */
- mr a4,a3 /* pass xpc */
+ lwz a4,((5+LA_WORD_SIZE+5+38)*4+sizestackframeinfo)(sp) /* pass xpc */
bl stacktrace_create_extern_stackframeinfo
addi a0,sp,(0+LA_WORD_SIZE+5+38)*4+sizestackframeinfo /* pass sp */
addi a0,sp,LA_SIZE+(5+38)*4
bl stacktrace_remove_stackframeinfo /* remove stackframe info */
- lwz itmp3,LA_SIZE+(5+37)*4(sp) /* restore return value into temp reg.*/
-
#if 1
lwz a0,LA_SIZE+(5+0)*4(r1)
lwz a1,LA_SIZE+(5+1)*4(r1)
/* get return address (into JIT code) */
lwz itmp1,(5+LA_WORD_SIZE+5+38)*4+sizestackframeinfo(sp)
- mtlr itmp1
+ mtctr itmp1
lwz itmp1,LA_SIZE+(5+34)*4(sp)
lwz itmp2,LA_SIZE+(5+35)*4(sp)
lwz pv,LA_SIZE+(5+36)*4(sp)
- /* remove stack frame + patcher stub stack */
- addi r1,r1,(8+LA_WORD_SIZE+5+38)*4+sizestackframeinfo
+ lwz itmp3,LA_SIZE+(5+37)*4(sp) /* restore return value into temp reg.*/
mr. itmp3,itmp3 /* check for an exception */
beq L_asm_wrapper_patcher_exception
- blr /* jump to new patched code */
+ /* remove stack frame + patcher stub stack */
+ addi sp,sp,(8+LA_WORD_SIZE+5+38)*4+sizestackframeinfo
+
+ bctr /* jump to new patched code */
L_asm_wrapper_patcher_exception:
#if defined(USE_THREADS) && defined(NATIVE_THREADS)
li itmp3,0
stw itmp3,0(v0) /* clear the exception pointer */
- mflr xpc
+ mfctr xpc
b asm_handle_exception
Changes: Christian Thalinger
Christian Ullrich
- $Id: codegen.c 3485 2005-10-21 13:44:43Z twisti $
+ $Id: codegen.c 3556 2005-11-03 21:39:25Z twisti $
*/
#include "vm/jit/reg.inc"
-/* #include <architecture/ppc/cframe.h> */
-
-#if defined(USE_THREADS) && defined(NATIVE_THREADS)
-void thread_restartcriticalsection(void *u)
-{
- /* XXX set pc to restart address */
-}
-#endif
-
s4 *codegen_trace_args( methodinfo *m, codegendata *cd, registerdata *rd,
s4 *mcodeptr, s4 parentargs_base, bool nativestub);
tmpmcodeptr = mcodeptr; /* save current mcodeptr */
mcodeptr = xcodeptr; /* set mcodeptr to patch position */
- M_BL(tmpmcodeptr - (xcodeptr + 1));
+ M_BR(tmpmcodeptr - (xcodeptr + 1));
mcodeptr = tmpmcodeptr; /* restore the current mcodeptr */
M_AADD_IMM(REG_SP, -8 * 4, REG_SP);
- /* move return address onto stack */
+ /* calculate return address and move it onto the stack */
- M_MFLR(REG_ZERO);
- M_AST_INTERN(REG_ZERO, REG_SP, 5 * 4);
+ M_LDA(REG_ITMP3, REG_PV, pref->branchpos);
+ M_AST_INTERN(REG_ITMP3, REG_SP, 5 * 4);
/* move pointer to java_objectheader onto stack */
M_LDA(REG_ITMP3, REG_PV, disp);
M_AST_INTERN(REG_ITMP3, REG_SP, 4 * 4);
#else
- M_CLR(REG_ITMP3);
- M_AST_INTERN(REG_ITMP3, REG_SP, 4 * 4);
+ /* do nothing */
#endif
/* move machine code onto stack */
M_LDA(REG_ITMP3, REG_PV, disp);
M_AST(REG_ITMP3, REG_SP, 4 * 4);
#else
- M_CLR(REG_ITMP3);
- M_AST(REG_ITMP3, REG_SP, 4 * 4);
+ /* do nothing */
#endif
/* move machine code onto stack */
Changes:
- $Id: patcher.c 3484 2005-10-21 13:43:51Z twisti $
+ $Id: patcher.c 3556 2005-11-03 21:39:25Z twisti $
*/
disp = *((s4 *) (sp + 1 * 4));
pv = (u1 *) *((ptrint *) (sp + 0 * 4));
- /* calculate and set the new return address */
-
- ra = ra - 4;
- *((ptrint *) (sp + 5 * 4)) = (ptrint) ra;
-
PATCHER_MONITORENTER;
/* get the fieldinfo */
uf = (unresolved_field *) *((ptrint *) (sp + 2 * 4));
pv = (u1 *) *((ptrint *) (sp + 1 * 4));
- /* calculate and set the new return address */
-
- ra = ra - 4;
- *((ptrint *) (sp + 5 * 4)) = (ptrint) ra;
-
PATCHER_MONITORENTER;
/* get the fieldinfo */
/* calculate and set the new return address */
- ra = ra - (2 * 4);
+ ra = ra - 1 * 4;
*((ptrint *) (sp + 5 * 4)) = (ptrint) ra;
PATCHER_MONITORENTER;
/* calculate and set the new return address */
- ra = ra - 2 * 4;
+ ra = ra - 1 * 4;
*((ptrint *) (sp + 5 * 4)) = (ptrint) ra;
PATCHER_MONITORENTER;
disp = *((s4 *) (sp + 1 * 4));
pv = (u1 *) *((ptrint *) (sp + 0 * 4));
- /* calculate and set the new return address */
-
- ra = ra - 4;
- *((ptrint *) (sp + 5 * 4)) = (ptrint) ra;
-
PATCHER_MONITORENTER;
/* get the classinfo */
disp = *((s4 *) (sp + 1 * 4));
pv = (u1 *) *((ptrint *) (sp + 0 * 4));
- /* calculate and set the new return address */
-
- ra = ra - 1 * 4;
- *((ptrint *) (sp + 5 * 4)) = (ptrint) ra;
-
PATCHER_MONITORENTER;
/* get the classinfo */
/* calculate and set the new return address */
- ra = ra - 2 * 4;
+ ra = ra - 1 * 4;
*((ptrint *) (sp + 5 * 4)) = (ptrint) ra;
PATCHER_MONITORENTER;
disp = *((s4 *) (sp + 1 * 4));
pv = (u1 *) *((ptrint *) (sp + 0 * 4));
- /* calculate and set the new return address */
-
- ra = ra - 4;
- *((ptrint *) (sp + 5 * 4)) = (ptrint) ra;
-
PATCHER_MONITORENTER;
/* get the fieldinfo */
mcode = *((u4 *) (sp + 3 * 4));
um = (unresolved_method *) *((ptrint *) (sp + 2 * 4));
- /* calculate and set the new return address */
-
- ra = ra - 4;
- *((ptrint *) (sp + 5 * 4)) = (ptrint) ra;
-
PATCHER_MONITORENTER;
/* get the fieldinfo */
mcode = *((u4 *) (sp + 3 * 4));
um = (unresolved_method *) *((ptrint *) (sp + 2 * 4));
- /* calculate and set the new return address */
-
- ra = ra - 4;
- *((ptrint *) (sp + 5 * 4)) = (ptrint) ra;
-
PATCHER_MONITORENTER;
/* get the fieldinfo */
disp = *((s4 *) (sp + 1 * 4));
pv = (u1 *) *((ptrint *) (sp + 0 * 4));
- /* calculate and set the new return address */
-
- ra = ra - 4;
- *((ptrint *) (sp + 5 * 4)) = (ptrint) ra;
-
PATCHER_MONITORENTER;
/* get the fieldinfo */
mcode = *((u4 *) (sp + 3 * 4));
cr = (constant_classref *) *((ptrint *) (sp + 2 * 4));
- /* calculate and set the new return address */
-
- ra = ra - 4;
- *((ptrint *) (sp + 5 * 4)) = (ptrint) ra;
-
PATCHER_MONITORENTER;
/* get the fieldinfo */
disp = *((s4 *) (sp + 1 * 4));
pv = (u1 *) *((ptrint *) (sp + 0 * 4));
- /* calculate and set the new return address */
-
- ra = ra - 4;
- *((ptrint *) (sp + 5 * 4)) = (ptrint) ra;
-
PATCHER_MONITORENTER;
/* get the fieldinfo */
disp = *((s4 *) (sp + 1 * 4));
pv = (u1 *) *((ptrint *) (sp + 0 * 4));
- /* calculate and set the new return address */
-
- ra = ra - 4;
- *((ptrint *) (sp + 5 * 4)) = (ptrint) ra;
-
PATCHER_MONITORENTER;
/* get the fieldinfo */
mcode = *((u4 *) (sp + 3 * 4));
c = (classinfo *) *((ptrint *) (sp + 2 * 4));
- /* calculate and set the new return address */
-
- ra = ra - 4;
- *((ptrint *) (sp + 5 * 4)) = (ptrint) ra;
-
PATCHER_MONITORENTER;
/* check if the class is initialized */
mcode = *((u4 *) (sp + 3 * 4));
uc = (unresolved_class *) *((ptrint *) (sp + 2 * 4));
- /* calculate and set the new return address */
-
- ra = ra - 4;
- *((ptrint *) (sp + 5 * 4)) = (ptrint) ra;
-
PATCHER_MONITORENTER;
/* resolve the class */
/* calculate and set the new return address */
- ra = ra - 4;
+ ra = ra - 1 * 4;
*((ptrint *) (sp + 5 * 4)) = (ptrint) ra;
PATCHER_MONITORENTER;