cvsuser 03/11/18 23:31:00
Modified: imcc parser_util.c reg_alloc.c
Log:
Add some more trace, fix format a bit.
Revision Changes Path
1.49 +34 -2 parrot/imcc/parser_util.c
Index: parser_util.c
===================================================================
RCS file: /cvs/public/parrot/imcc/parser_util.c,v
retrieving revision 1.48
retrieving revision 1.49
diff -u -w -r1.48 -r1.49
--- parser_util.c 16 Nov 2003 04:31:40 -0000 1.48
+++ parser_util.c 19 Nov 2003 07:30:59 -0000 1.49
@@ -153,22 +153,43 @@
}
+/*
+ * Lookup the full opcode given the short name
+ * set I0, 5 -> set_i_ic
+ * set I0, I1 -> set_i_i
+ *
+ * Obviously the registers must be examined before returning
+ * the correct opcode.
+ *
+ * NOTE: All this nasty IMC_TRACE is for tracking down equally
+ * nasty bugs, so if you don't like the looks of it, stay
+ * out, but please don't remove it. :) -Mel
+ */
void
op_fullname(char * dest, const char * name, SymReg * args[],
int narg, int keyvec) {
int i;
-
+#if IMC_TRACE_HIGH
+ char * full = dest;
+ PIO_eprintf(NULL, "op %s", name);
+#endif
strcpy(dest, name);
dest += strlen(name);
for (i = 0; i < narg && args[i]; i++) {
*dest++ = '_';
if (args[i]->type == VTADDRESS) {
+#if IMC_TRACE_HIGH
+ PIO_eprintf(NULL, " (address)%s", args[i]->name);
+#endif
*dest++ = 'i';
*dest++ = 'c';
continue;
}
/* if one ever wants num keys, they go with 'S' */
if (keyvec & KEY_BIT(i)) {
+#if IMC_TRACE_HIGH
+ PIO_eprintf(NULL, " (key)%s", args[i]->name);
+#endif
*dest++ = 'k';
if (args[i]->set == 'S' || args[i]->set == 'N' ||
args[i]->set == 'K') {
@@ -179,10 +200,21 @@
continue;
}
*dest++ = tolower(args[i]->set);
- if (args[i]->type & (VTCONST|VT_CONSTP))
+ if (args[i]->type & (VTCONST|VT_CONSTP)) {
+#if IMC_TRACE_HIGH
+ PIO_eprintf(NULL, " (%cc)%s", tolower(args[i]->set), args[i]->name);
+#endif
*dest++ = 'c';
}
+#if IMC_TRACE_HIGH
+ else
+ PIO_eprintf(NULL, " (%c)%s", tolower(args[i]->set), args[i]->name);
+#endif
+ }
*dest = '\0';
+#if IMC_TRACE_HIGH
+ PIO_eprintf(NULL, " -> %s\n", full);
+#endif
}
int
1.5 +2 -2 parrot/imcc/reg_alloc.c
Index: reg_alloc.c
===================================================================
RCS file: /cvs/public/parrot/imcc/reg_alloc.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -w -r1.4 -r1.5
--- reg_alloc.c 16 Nov 2003 04:31:40 -0000 1.4
+++ reg_alloc.c 19 Nov 2003 07:30:59 -0000 1.5
@@ -994,7 +994,7 @@
sprintf(buf, "%d", unit->n_spilled);
regs[1] = mk_const(str_dup(buf), 'I');
regs[2] = new_sym;
- sprintf(buf, "%%s[%%s], %%s #STORE %s", old_sym->name);
+ sprintf(buf, "%%s[%%s], %%s #SPILL %s", old_sym->name);
tmp = INS(interpreter, unit, "set", buf, regs, 3, 2, 0);
tmp->bbindex = ins->bbindex;
tmp->flags |= ITSPILL;