Changes:
- $Id: md-abi.c 8123 2007-06-20 23:50:55Z michi $
+ $Id: md-abi.c 8298 2007-08-12 18:49:16Z pm $
*/
};
s4 nregdescfloat[] = {
- REG_ARG, REG_TMP, REG_ARG, REG_TMP, REG_RES, REG_TMP, REG_RES, REG_TMP,
+ REG_ARG, REG_TMP, REG_ARG, REG_TMP, REG_SAV, REG_TMP, REG_SAV, REG_TMP,
REG_TMP, REG_TMP, REG_TMP, REG_TMP, REG_TMP, REG_TMP, REG_TMP, REG_TMP,
REG_END
};
};
const s4 abi_registers_float_saved[] = {
- /* nothing */
- -1
+ 4, /* f4 */
+ 6 /* f6 */
};
const s4 abi_registers_float_temporary[] = {
15 /* f15/ft11 */
};
-/* md_param_alloc **************************************************************
+/* md_param_alloc_intern *******************************************************
- XXX
+ Allocates parameters to registers or stackslots for both native and java
+ methods.
+
+ --- in:
+ slot: size in bytes of a stack slot
+ slots1w: number of stack slots used by a 1 word type parameter
+ slots2w: number of stack slots used by a 2 word type parameter
*******************************************************************************/
-void md_param_alloc(methoddesc *md)
+static void md_param_alloc_intern(methoddesc *md, s4 slot, s4 slots1w, s4 slots2w)
{
paramdesc *pd;
s4 i;
if (iarg < INT_ARG_CNT) {
pd->inmemory = false;
pd->regoff = abi_registers_integer_argument[iarg];
+ pd->index = iarg;
iarg++;
}
else {
pd->inmemory = true;
- pd->regoff = stacksize * 4;
- stacksize++;
+ pd->regoff = stacksize * slot;
+ pd->index = stacksize;
+ stacksize += slots1w;
}
break;
pd->regoff =
PACK_REGS(abi_registers_integer_argument[iarg + 1],
abi_registers_integer_argument[iarg]);
+ pd->index = PACK_REGS(iarg + 1, iarg);
iarg += 2;
}
else {
/* _ALIGN(stacksize); */
pd->inmemory = true;
- pd->regoff = stacksize * 4;
+ pd->regoff = stacksize * slot;
+ pd->index = stacksize;
iarg = INT_ARG_CNT;
- stacksize += 2;
+ stacksize += slots2w;
}
break;
if (farg < FLT_ARG_CNT) {
pd->inmemory = false;
pd->regoff = abi_registers_float_argument[farg];
+ pd->index = farg;
farg++;
}
else {
pd->inmemory = true;
- pd->regoff = stacksize * 4;
- stacksize++;
+ pd->regoff = stacksize * slot;
+ pd->index = stacksize;
+ stacksize += slots1w;
}
break;
if (farg < FLT_ARG_CNT) {
pd->inmemory = false;
pd->regoff = abi_registers_float_argument[farg];
+ pd->index = farg;
farg++;
}
else {
/* _ALIGN(stacksize); */
pd->inmemory = true;
- pd->regoff = stacksize * 4;
- stacksize += 2;
+ pd->regoff = stacksize * slot;
+ pd->index = stacksize;
+ stacksize += slots2w;
}
break;
md->memuse = stacksize;
}
-void md_param_alloc_native(methoddesc *md)
+void md_param_alloc(methoddesc *md)
{
- /* On PowerPC we use the same ABI for JIT method calls as for
- * native method calls. */
+ md_param_alloc_intern(md, 8, 1, 1);
+}
- md_param_alloc(md);
+void md_param_alloc_native(methoddesc *md)
+{
+ md_param_alloc_intern(md, 4, 1, 2);
}