saved = (interfaces[s][TYPE_INT].flags | interfaces[s][TYPE_LNG].flags |
interfaces[s][TYPE_FLT].flags | interfaces[s][TYPE_DBL].flags |
interfaces[s][TYPE_ADR].flags) & SAVEDVAR;
+
for (t = TYPE_INT; t <= TYPE_ADR; t++) {
v = &interfaces[s][t];
if (v->type >= 0) {
} /* if (type >= 0) */
} /* for t */
} /* for s */
+
maxmemuse = ifmemuse;
maxtmpintreguse = iftmpintregcnt;
maxsavintreguse = ifsavintregcnt;
maxtmpfltreguse = iftmpfltregcnt;
maxsavfltreguse = ifsavfltregcnt;
+
}
static void local_regalloc ()
{
- int s, t;
- int intalloc, fltalloc;
+ int s, t;
+ int intalloc, fltalloc;
varinfo *v;
if (isleafmethod) {
+ int arg, doublewordarg;
+ arg = 0;
+ doublewordarg = 0;
for (s = 0; s < maxlocals; s++) {
intalloc = -1; fltalloc = -1;
for (t = TYPE_INT; t <= TYPE_ADR; t++) {
v->flags = locals[s][fltalloc].flags;
v->regoff = locals[s][fltalloc].regoff;
}
- else if (s < fltreg_argnum) {
+ else if (!doublewordarg && (arg < mparamcount)
+ && (arg < fltreg_argnum)) {
v->flags = 0;
- v->regoff = argfltregs[s];
+ v->regoff = argfltregs[arg];
}
else if (maxtmpfltreguse > 0) {
maxtmpfltreguse--;
v->flags = locals[s][intalloc].flags;
v->regoff = locals[s][intalloc].regoff;
}
- else if (s < intreg_argnum) {
+ else if (!doublewordarg && (arg < mparamcount)
+ && (arg < intreg_argnum)) {
v->flags = 0;
- v->regoff = argintregs[s];
+ v->regoff = argintregs[arg];
}
else if (maxtmpintreguse > 0) {
maxtmpintreguse--;
}
}
}
+ if (arg < mparamcount) {
+ if (doublewordarg) {
+ doublewordarg = 0;
+ arg++;
+ }
+ else if (IS_2_WORD_TYPE(mparamtypes[arg]))
+ doublewordarg = 1;
+ else
+ arg++;
+ }
}
return;
}
instruction *iptr = instr;
basicblock *bptr;
- b_count = block_count;
+ /* b_count = block_count; */
+
bptr = block;
- while (--b_count >= 0) {
+ while (bptr != NULL) {
+
if (bptr->flags >= BBREACHED) {
dst = bptr->instack;
reg_init_temp();
iptr = bptr->iinstr;
len = bptr->icount;
+
while (--len >= 0) {
src = dst;
dst = iptr->dst;
opcode = iptr->opc;
+
switch (opcode) {
/* pop 0 push 0 */
case ICMD_BALOAD:
case ICMD_CALOAD:
case ICMD_SALOAD:
+
reg_free_temp(src);
reg_free_temp(src->prev);
reg_new_temp(dst);
case ICMD_BASTORE:
case ICMD_CASTORE:
case ICMD_SASTORE:
+
reg_free_temp(src);
reg_free_temp(src->prev);
reg_free_temp(src->prev->prev);
iptr++;
} /* while instructions */
} /* if */
- bptr++;
+ bptr = bptr->next;
} /* while blocks */
}