Changes: Christian Thalinger
Edwin Steiner
- $Id: asmpart.S 5279 2006-08-25 11:55:21Z tbfg $
+ $Id: asmpart.S 5282 2006-08-28 19:31:37Z tbfg $
*/
/* export functions ***********************************************************/
+#ifdef ENABLE_LIBJVM
.globl asm_vm_call_method
.globl asm_vm_call_method_int
.globl asm_vm_call_method_long
.globl asm_vm_call_method_float
.globl asm_vm_call_method_double
-
+#else
+ .globl .asm_vm_call_method
+ .globl .asm_vm_call_method_int
+ .globl .asm_vm_call_method_long
+ .globl .asm_vm_call_method_float
+ .globl .asm_vm_call_method_double
+#endif
.globl asm_vm_call_method_exception_handler
.globl asm_call_jit_compiler
.globl .asm_cacheflush /* no function descriptor needed, only called direct */
.globl asm_criticalsections
- .globl asm_getclassvalues_atomic
+ .globl .asm_getclassvalues_atomic
/* asm_vm_call_method **********************************************************
.long 0 /* frame size */
.long 0 /* codeinfo pointer */
-.section ".opd","aw"
-.align 3
-
-asm_vm_call_method:
-asm_vm_call_method_int:
-asm_vm_call_method_long:
-asm_vm_call_method_float:
-asm_vm_call_method_double:
- .quad .asm_vm_call_method,.TOC.@tocbase,0
- .previous
- .size asm_vm_call_method, 24
- .type .asm_vm_call_method,@function
- .globl .asm_vm_call_method
+#ifdef ENABLE_LIBJVM
+ .section ".opd","aw"
+ .align 3
+
+ asm_vm_call_method:
+ asm_vm_call_method_int:
+ asm_vm_call_method_long:
+ asm_vm_call_method_float:
+ asm_vm_call_method_double:
+ .quad .asm_vm_call_method,.TOC.@tocbase,0
+ .previous
+ .size asm_vm_call_method, 24
+ .type .asm_vm_call_method,@function
+ .globl .asm_vm_call_method
+#else
+ asm_vm_call_method:
+ .globl asm_vm_call_method
+#endif
.asm_vm_call_method:
+.asm_vm_call_method_int:
+.asm_vm_call_method_long:
+.asm_vm_call_method_float:
+.asm_vm_call_method_double:
mflr r0
std r0,LA_LR_OFFSET(sp)
stdu sp,-40*8(sp)
blr
-asm_getclassvalues_atomic:
-.globl .asm_getclassvalues_atomic
+.asm_getclassvalues_atomic:
_crit_restart:
_crit_begin:
lwz r6,offbaseval(r3)
Christian Ullrich
Edwin Steiner
- $Id: codegen.c 5279 2006-08-25 11:55:21Z tbfg $
+ $Id: codegen.c 5282 2006-08-28 19:31:37Z tbfg $
*/
disp = dseg_addaddress(cd, bte->fp);
d = md->returntype.type;
- M_ALD(REG_PV, REG_PV, disp); /* pointer to built-in-function */
- M_MTCTR(REG_PV);
+ M_ALD(REG_PV, REG_PV, disp); /* pointer to built-in-function descriptor */
+ M_ALD(REG_ITMP1, REG_PV, 0); /* function entry point address */
+ M_ALD(REG_ITMP2, REG_PV, 8); /* TOC of callee */
+ M_MOV(REG_TOC, REG_ITMP2); /* load TOC for callee */
+ M_MTCTR(REG_ITMP1);
M_JSR;
+ /* TODO: restore TOC */
disp = (s4) (cd->mcodeptr - cd->mcodebase);
M_MFLR(REG_ITMP1);
M_LDA(REG_PV, REG_ITMP1, -disp);
/* move data segment displacement onto stack */
disp = dseg_addaddress(cd, pref->disp);
- M_ILD(REG_ITMP3, REG_PV, disp);
+ M_LLD(REG_ITMP3, REG_PV, disp);
M_IST_INTERN(REG_ITMP3, REG_SP, 1 * 8);
/* move patcher function pointer onto stack */
/* move data segment displacement onto stack */
- disp = dseg_addaddress(cd, pref->disp);
- M_ILD(REG_ITMP3, REG_PV, disp);
+ disp = dseg_adds4(cd, pref->disp);
+ M_LLD(REG_ITMP3, REG_PV, disp);
M_IST(REG_ITMP3, REG_SP, 1 * 8);
/* move patcher function pointer onto stack */