- if (runverbose) {
- s4 p, t, s1, d, a;
- s4 longargs = 0;
- s4 fltargs = 0;
- s4 dblargs = 0;
-
-/* M_MFLR(REG_ITMP3); */
- /* XXX must be a multiple of 16 */
- M_LDA(REG_SP, REG_SP, -(24 + (INT_ARG_CNT + FLT_ARG_CNT + 1) * 8));
-
-/* M_IST(REG_ITMP3, REG_SP, 24 + (INT_ARG_CNT + FLT_ARG_CNT) * 8); */
-
- M_CLR(REG_ITMP1);
-
- /* save all arguments into the reserved stack space */
- for (p = 0; p < m->paramcount && p < TRACE_ARGS_NUM; p++) {
- t = m->paramtypes[p];
-
- if (IS_INT_LNG_TYPE(t)) {
- /* overlapping u8's are on the stack */
- if ((p + longargs + dblargs) < (INT_ARG_CNT - IS_2_WORD_TYPE(t))) {
- s1 = rd->argintregs[p + longargs + dblargs];
-
- if (!IS_2_WORD_TYPE(t)) {
- M_IST(REG_ITMP1, REG_SP, 24 + p * 8);
- M_IST(s1, REG_SP, 24 + p * 8 + 4);
-
- } else {
- M_IST(s1, REG_SP, 24 + p * 8);
- M_IST(rd->secondregs[s1], REG_SP, 24 + p * 8 + 4);
- longargs++;
- }
-
- } else {
- /* we do not have a data segment here */
- /* a = dseg_adds4(cd, 0xdeadbeef);
- M_ILD(REG_ITMP1, REG_PV, a); */
- M_LDA(REG_ITMP1, REG_ZERO, -1);
- M_IST(REG_ITMP1, REG_SP, 24 + p * 8);
- M_IST(REG_ITMP1, REG_SP, 24 + p * 8 + 4);
- }
-
- } else {
- if ((fltargs + dblargs) < FLT_ARG_CNT) {
- s1 = rd->argfltregs[fltargs + dblargs];
-
- if (!IS_2_WORD_TYPE(t)) {
- M_IST(REG_ITMP1, REG_SP, 24 + p * 8);
- M_FST(s1, REG_SP, 24 + p * 8 + 4);
- fltargs++;
-
- } else {
- M_DST(s1, REG_SP, 24 + p * 8);
- dblargs++;
- }
-
- } else {
- /* this should not happen */
- }
- }
- }
-
- /* TODO: save remaining integer and flaot argument registers */
-
- /* load first 4 arguments into integer argument registers */
- for (p = 0; p < 8; p++) {
- d = rd->argintregs[p];
- M_ILD(d, REG_SP, 24 + p * 4);
- }
-
- M_ALD(REG_ITMP1, REG_PV, -6 * 4);
- M_AST(REG_ITMP1, REG_SP, 11 * 8); /* 24 (linkage area) + 32 (4 * s8 parameter area regs) + 32 (4 * s8 parameter area stack) = 88 */
- M_ALD(REG_ITMP2, REG_PV, -5 * 4);
- M_MTCTR(REG_ITMP2);
- M_JSR;
-
- longargs = 0;
- fltargs = 0;
- dblargs = 0;
-
- /* restore arguments into the reserved stack space */
- for (p = 0; p < m->paramcount && p < TRACE_ARGS_NUM; p++) {
- t = m->paramtypes[p];
-
- if (IS_INT_LNG_TYPE(t)) {
- if ((p + longargs + dblargs) < INT_ARG_CNT) {
- s1 = rd->argintregs[p + longargs + dblargs];
-
- if (!IS_2_WORD_TYPE(t)) {
- M_ILD(s1, REG_SP, 24 + p * 8 + 4);
-
- } else {
- M_ILD(s1, REG_SP, 24 + p * 8);
- M_ILD(rd->secondregs[s1], REG_SP, 24 + p * 8 + 4);
- longargs++;
- }
- }
-
- } else {
- if ((fltargs + dblargs) < FLT_ARG_CNT) {
- s1 = rd->argfltregs[fltargs + dblargs];
-
- if (!IS_2_WORD_TYPE(t)) {
- M_FLD(s1, REG_SP, 24 + p * 8 + 4);
- fltargs++;
-
- } else {
- M_DLD(s1, REG_SP, 24 + p * 8);
- dblargs++;
- }
- }
- }
- }
-
-/* M_ILD(REG_ITMP3, REG_SP, 24 + (INT_ARG_CNT + FLT_ARG_CNT) * 8); */
-
- M_LDA(REG_SP, REG_SP, 24 + (INT_ARG_CNT + FLT_ARG_CNT + 1) * 8);
-/* M_MTLR(REG_ITMP3); */
- }
-
- /* save argument registers on stack -- if we have to */
- if ((m->flags & ACC_STATIC && m->paramcount > (INT_ARG_CNT - 2)) ||
- m->paramcount > (INT_ARG_CNT - 1)) {
- s4 i;
- s4 paramshiftcnt = (m->flags & ACC_STATIC) ? 2 : 1;
- s4 stackparamcnt = (m->paramcount > INT_ARG_CNT) ? m->paramcount - INT_ARG_CNT : 0;
-
- stackframesize = stackparamcnt + paramshiftcnt;
-
- M_LDA(REG_SP, REG_SP, -stackframesize * 8);
-
- panic("nativestub");
- }
-
- if (m->flags & ACC_STATIC) {
- M_MOV(rd->argintregs[5], rd->argintregs[7]);
- M_MOV(rd->argintregs[4], rd->argintregs[6]);
- M_MOV(rd->argintregs[3], rd->argintregs[5]);
- M_MOV(rd->argintregs[2], rd->argintregs[4]);
- M_MOV(rd->argintregs[1], rd->argintregs[3]);
- M_MOV(rd->argintregs[0], rd->argintregs[2]);
-
- /* put class into second argument register */
- M_ALD(rd->argintregs[1], REG_PV, -8 * 4);
-
- } else {
- M_MOV(rd->argintregs[6], rd->argintregs[7]);
- M_MOV(rd->argintregs[5], rd->argintregs[6]);
- M_MOV(rd->argintregs[4], rd->argintregs[5]);
- M_MOV(rd->argintregs[3], rd->argintregs[4]);
- M_MOV(rd->argintregs[2], rd->argintregs[3]);
- M_MOV(rd->argintregs[1], rd->argintregs[2]);
- M_MOV(rd->argintregs[0], rd->argintregs[1]);
- }
-
- /* put env into first argument register */
- M_ALD(rd->argintregs[0], REG_PV, -4 * 4);