This module generates MIPS machine code for a sequence of
intermediate code commands (ICMDs).
- $Id: codegen.c 2716 2005-06-15 14:14:34Z twisti $
+ $Id: codegen.c 2764 2005-06-21 10:18:15Z twisti $
*/
functionptr createnativestub(functionptr f, methodinfo *m, codegendata *cd,
- registerdata *rd)
+ registerdata *rd, methoddesc *nmd)
{
s4 *mcodeptr; /* code generation pointer */
s4 stackframesize; /* size of stackframe if needed */
s4 disp;
methoddesc *md;
- methoddesc *nmd;
s4 nativeparams;
s4 i, j; /* count variables */
s4 t;
/* initialize variables */
- nativeparams = (m->flags & ACC_STATIC) ? 2 : 1;
-
- /* create new method descriptor with additional native parameters */
-
md = m->parseddesc;
-
- nmd = (methoddesc *) DMNEW(u1, sizeof(methoddesc) - sizeof(typedesc) +
- md->paramcount * sizeof(typedesc) +
- nativeparams * sizeof(typedesc));
-
- nmd->paramcount = md->paramcount + nativeparams;
-
- nmd->params = DMNEW(paramdesc, nmd->paramcount);
-
- nmd->paramtypes[0].type = TYPE_ADR; /* add environment pointer */
-
- if (m->flags & ACC_STATIC)
- nmd->paramtypes[1].type = TYPE_ADR; /* add class pointer */
-
- MCOPY(nmd->paramtypes + nativeparams, md->paramtypes, typedesc,
- md->paramcount);
+ nativeparams = (m->flags & ACC_STATIC) ? 2 : 1;
- md_param_alloc(nmd);
/* calculate stack frame size */