Christian Ullrich
Edwin Steiner
- $Id: codegen.c 5081 2006-07-06 13:59:01Z tbfg $
+ $Id: codegen.c 5082 2006-07-06 14:10:23Z tbfg $
*/
#endif
(void) dseg_adds4(cd, 0); /* IsSync */
- (void) dseg_adds4(cd, m->isleafmethod); /* IsLeaf */
+ (void) dseg_adds4(cd, code->isleafmethod); /* IsLeaf */
(void) dseg_adds4(cd, INT_SAV_CNT - rd->savintreguse); /* IntSave */
(void) dseg_adds4(cd, FLT_SAV_CNT - rd->savfltreguse); /* FltSave */
/* create stack frame (if necessary) */
- if (!m->isleafmethod) {
+ if (!code->isleafmethod) {
M_MFLR(REG_ZERO);
M_AST(REG_ZERO, REG_SP, LA_LR_OFFSET);
}
M_ALD(REG_ITMP2, REG_PV, disp);
M_MTCTR(REG_ITMP2);
- if (m->isleafmethod) M_MFLR(REG_ITMP3); /* save LR */
+ if (code->isleafmethod) M_MFLR(REG_ITMP3); /* save LR */
M_BL(0); /* get current PC */
M_MFLR(REG_ITMP2_XPC);
- if (m->isleafmethod) M_MTLR(REG_ITMP3); /* restore LR */
+ if (code->isleafmethod) M_MTLR(REG_ITMP3); /* restore LR */
M_RTS; /* jump to CTR */
ALIGNCODENOP;
case ICMD_JSR: /* ... ==> ... */
/* op1 = target JavaVM pc */
- if (m->isleafmethod)
+ if (code->isleafmethod)
M_MFLR(REG_ITMP2);
M_BL(0);
M_MFLR(REG_ITMP1);
- M_IADD_IMM(REG_ITMP1, m->isleafmethod ? 4*4 : 3*4, REG_ITMP1);
- if (m->isleafmethod)
+ M_IADD_IMM(REG_ITMP1, code->isleafmethod ? 4*4 : 3*4, REG_ITMP1);
+ if (code->isleafmethod)
M_MTLR(REG_ITMP2);
M_BR(0);
codegen_addreference(cd, (basicblock *) iptr->target);
/* restore return address */
- if (!m->isleafmethod) {
+ if (!code->isleafmethod) {
/* ATTENTION: Don't use REG_ZERO (r0) here, as M_ALD
may have a displacement overflow. */
} else {
savedmcodeptr = cd->mcodeptr;
- if (m->isleafmethod) {
+ if (code->isleafmethod) {
M_MFLR(REG_ZERO);
M_AST(REG_ZERO, REG_SP, stackframesize * 4 + LA_LR_OFFSET);
}
M_MOV(REG_PV, rd->argintregs[0]);
M_MOV(REG_SP, rd->argintregs[1]);
- if (m->isleafmethod)
+ if (code->isleafmethod)
M_MOV(REG_ZERO, rd->argintregs[2]);
else
M_ALD(rd->argintregs[2],
M_ALD(REG_ITMP2_XPC, REG_SP, LA_SIZE + 5 * 4);
M_IADD_IMM(REG_SP, LA_SIZE + 6 * 4, REG_SP);
- if (m->isleafmethod) {
+ if (code->isleafmethod) {
/* XXX FIXME: REG_ZERO can cause problems here! */
assert(stackframesize * 4 <= 32767);
Changes:
- $Id: md-abi.c 5081 2006-07-06 13:59:01Z tbfg $
+ $Id: md-abi.c 5082 2006-07-06 14:10:23Z tbfg $
*/
*******************************************************************************/
-void md_return_alloc(methodinfo *m, registerdata *rd, s4 return_type,
- stackptr stackslot)
+void md_return_alloc(jitdata *jd, stackptr stackslot)
{
+ methodinfo *m;
+ codeinfo *code;
+ registerdata *rd;
+ methoddesc *md;
+
+ /* get required compiler data */
+
+ m = jd->m;
+ code = jd->code;
+ rd = jd->rd;
+
+ md = m->parseddesc;
+
/* In Leafmethods Local Vars holding parameters are precolored to
their argument register -> so leafmethods with paramcount > 0
could already use R3 == a00! */
- if (!m->isleafmethod || (m->parseddesc->paramcount == 0)) {
+ if (!code->isleafmethod || (md->paramcount == 0)) {
/* Only precolor the stackslot, if it is not a SAVEDVAR <->
has not to survive method invokations. */
stackslot->varnum = -1;
stackslot->flags = 0;
- if (IS_INT_LNG_TYPE(return_type)) {
- if (!IS_2_WORD_TYPE(return_type)) {
+ if (IS_INT_LNG_TYPE(md->returntype.type)) {
+ if (!IS_2_WORD_TYPE(md->returntype.type)) {
if (rd->argintreguse < 1)
rd->argintreguse = 1;