[svn:parrot] r47614 - in branches/dynop_mapping: compilers/imcc src
plobsing at svn.parrot.org
plobsing at svn.parrot.org
Mon Jun 14 04:10:45 UTC 2010
Author: plobsing
Date: Mon Jun 14 04:10:44 2010
New Revision: 47614
URL: https://trac.parrot.org/parrot/changeset/47614
Log:
use '%d' in stead of non-existant '%I' in IMCC tracing
Modified:
branches/dynop_mapping/compilers/imcc/cfg.c
branches/dynop_mapping/compilers/imcc/instructions.c
branches/dynop_mapping/compilers/imcc/optimizer.c
branches/dynop_mapping/compilers/imcc/pbc.c
branches/dynop_mapping/compilers/imcc/pcc.c
branches/dynop_mapping/src/packfile.c
Modified: branches/dynop_mapping/compilers/imcc/cfg.c
==============================================================================
--- branches/dynop_mapping/compilers/imcc/cfg.c Mon Jun 14 00:28:55 2010 (r47613)
+++ branches/dynop_mapping/compilers/imcc/cfg.c Mon Jun 14 04:10:44 2010 (r47614)
@@ -463,7 +463,7 @@
if (r && (r->type & VTADDRESS) && r->first_ins)
bb_add_edge(interp, unit, from, unit->bb_list[r->first_ins->bbindex]);
else {
- IMCC_debug(interp, DEBUG_CFG, "register branch %I ", from->end);
+ IMCC_debug(interp, DEBUG_CFG, "register branch %d ", from->end);
for (ins = from->end; ins; ins = ins->prev) {
if ((ins->type & ITBRANCH)
&& STREQ(ins->opname, "set_addr")
Modified: branches/dynop_mapping/compilers/imcc/instructions.c
==============================================================================
--- branches/dynop_mapping/compilers/imcc/instructions.c Mon Jun 14 00:28:55 2010 (r47613)
+++ branches/dynop_mapping/compilers/imcc/instructions.c Mon Jun 14 04:10:44 2010 (r47614)
@@ -826,7 +826,7 @@
(emitters[emitter]).new_sub(interp, param, unit);
for (ins = unit->instructions; ins; ins = ins->next) {
- IMCC_debug(interp, DEBUG_IMC, "emit %I\n", ins);
+ IMCC_debug(interp, DEBUG_IMC, "emit %d\n", ins);
(emitters[emitter]).emit(interp, param, unit, ins);
}
Modified: branches/dynop_mapping/compilers/imcc/optimizer.c
==============================================================================
--- branches/dynop_mapping/compilers/imcc/optimizer.c Mon Jun 14 00:28:55 2010 (r47613)
+++ branches/dynop_mapping/compilers/imcc/optimizer.c Mon Jun 14 04:10:44 2010 (r47614)
@@ -461,12 +461,12 @@
ins->opnum == PARROT_OP_mul_n_nc_n) &&
(ins->symregs[0] == ins->symregs[1] ||
ins->symregs[0] == ins->symregs[2]))) {
- IMCC_debug(interp, DEBUG_OPT1, "opt1 %I => ", ins);
+ IMCC_debug(interp, DEBUG_OPT1, "opt1 %d => ", ins);
if (ins->symregs[0] == ins->symregs[1]) {
ins->symregs[1] = ins->symregs[2];
}
tmp = INS(interp, unit, ins->opname, "", ins->symregs, 2, 0, 0);
- IMCC_debug(interp, DEBUG_OPT1, "%I\n", tmp);
+ IMCC_debug(interp, DEBUG_OPT1, "%d\n", tmp);
subst_ins(unit, ins, tmp, 1);
ins = tmp;
changes = 1;
@@ -497,7 +497,7 @@
ins->opnum == PARROT_OP_div_n_nc ||
ins->opnum == PARROT_OP_fdiv_n_nc) &&
atof(ins->symregs[1]->name) == 1.0)) {
- IMCC_debug(interp, DEBUG_OPT1, "opt1 %I => ", ins);
+ IMCC_debug(interp, DEBUG_OPT1, "opt1 %d => ", ins);
ins = delete_ins(unit, ins);
if (ins)
ins = ins->prev ? ins->prev : unit->instructions;
@@ -519,7 +519,7 @@
|| ((ins->opnum == PARROT_OP_add_n_nc ||
ins->opnum == PARROT_OP_sub_n_nc) &&
atof(ins->symregs[1]->name) == 1.0)) {
- IMCC_debug(interp, DEBUG_OPT1, "opt1 %I => ", ins);
+ IMCC_debug(interp, DEBUG_OPT1, "opt1 %d => ", ins);
--ins->symregs[1]->use_count;
if (ins->opnum == PARROT_OP_add_i_ic ||
ins->opnum == PARROT_OP_add_n_nc)
@@ -527,7 +527,7 @@
else
tmp = INS(interp, unit, "dec", "", ins->symregs, 1, 0, 0);
subst_ins(unit, ins, tmp, 1);
- IMCC_debug(interp, DEBUG_OPT1, "%I\n", tmp);
+ IMCC_debug(interp, DEBUG_OPT1, "%d\n", tmp);
ins = tmp;
changes = 1;
continue;
@@ -570,7 +570,7 @@
atof(ins->symregs[2]->name) == 1.0)
|| (ins->opnum == PARROT_OP_mul_n_nc_n &&
atof(ins->symregs[1]->name) == 1.0)) {
- IMCC_debug(interp, DEBUG_OPT1, "opt1 %I => ", ins);
+ IMCC_debug(interp, DEBUG_OPT1, "opt1 %d => ", ins);
if (ins->symregs[1]->type == VTCONST) {
--ins->symregs[1]->use_count;
ins->symregs[1] = ins->symregs[2];
@@ -579,7 +579,7 @@
--ins->symregs[2]->use_count;
}
tmp = INS(interp, unit, "set", "", ins->symregs, 2, 0, 0);
- IMCC_debug(interp, DEBUG_OPT1, "%I\n", tmp);
+ IMCC_debug(interp, DEBUG_OPT1, "%d\n", tmp);
subst_ins(unit, ins, tmp, 1);
ins = tmp;
changes = 1;
@@ -600,14 +600,14 @@
|| ((ins->opnum == PARROT_OP_mul_n_nc_n ||
ins->opnum == PARROT_OP_mul_n_nc) &&
(f = atof(ins->symregs[1]->name), FLOAT_IS_ZERO(f)))) {
- IMCC_debug(interp, DEBUG_OPT1, "opt1 %I => ", ins);
+ IMCC_debug(interp, DEBUG_OPT1, "opt1 %d => ", ins);
r = mk_const(interp, "0", ins->symregs[0]->set);
--ins->symregs[1]->use_count;
if (ins->opsize == 4)
--ins->symregs[2]->use_count;
ins->symregs[1] = r;
tmp = INS(interp, unit, "set", "", ins->symregs, 2, 0, 0);
- IMCC_debug(interp, DEBUG_OPT1, "%I\n", tmp);
+ IMCC_debug(interp, DEBUG_OPT1, "%d\n", tmp);
subst_ins(unit, ins, tmp, 1);
ins = tmp;
changes = 1;
@@ -621,11 +621,11 @@
|| (ins->opnum == PARROT_OP_set_n_nc &&
(f = atof(ins->symregs[1]->name), FLOAT_IS_ZERO(f)) &&
ins->symregs[1]->name[0] != '-')) {
- IMCC_debug(interp, DEBUG_OPT1, "opt1 %I => ", ins);
+ IMCC_debug(interp, DEBUG_OPT1, "opt1 %d => ", ins);
--ins->symregs[1]->use_count;
tmp = INS(interp, unit, "null", "", ins->symregs, 1, 0, 0);
subst_ins(unit, ins, tmp, 1);
- IMCC_debug(interp, DEBUG_OPT1, "%I\n", tmp);
+ IMCC_debug(interp, DEBUG_OPT1, "%d\n", tmp);
ins = tmp;
changes = 1;
continue;
@@ -677,7 +677,7 @@
Instruction *ins2;
IMCC_debug(interp, DEBUG_OPT2,
- "propagating constant %I => \n", ins);
+ "propagating constant %d => \n", ins);
for (ins2 = ins->next; ins2; ins2 = ins2->next) {
int i;
if (ins2->bbindex != ins->bbindex)
@@ -694,7 +694,7 @@
SymReg *old;
IMCC_debug(interp, DEBUG_OPT2,
- "\tpropagating into %I register %i",
+ "\tpropagating into %d register %i",
ins2, i);
old = ins2->symregs[i];
ins2->symregs[i] = c;
@@ -708,7 +708,7 @@
subst_ins(unit, ins2, tmp, 1);
any = 1;
IMCC_debug(interp, DEBUG_OPT2,
- " reduced to %I\n", tmp);
+ " reduced to %d\n", tmp);
ins2 = prev->next;
}
}
@@ -726,7 +726,7 @@
ins2->opnum = op;
any = 1;
IMCC_debug(interp, DEBUG_OPT2,
- " -> %I\n", ins2);
+ " -> %d\n", ins2);
}
}
}
@@ -777,7 +777,7 @@
strcpy(b, r[1]->name);
r[1] = mk_const(interp, b, 'N');
tmp = INS(interp, unit, name, "", r, 2, 0, 0);
- IMCC_debug(interp, DEBUG_OPT1, "%I\n", tmp);
+ IMCC_debug(interp, DEBUG_OPT1, "%d\n", tmp);
}
}
return tmp;
@@ -1067,7 +1067,7 @@
tmp = INS(interp, unit, "set", "", r, 2, 0, 0);
}
if (tmp) {
- IMCC_debug(interp, DEBUG_OPT1, "%I\n", tmp);
+ IMCC_debug(interp, DEBUG_OPT1, "%d\n", tmp);
}
*ok = 1;
return tmp;
@@ -1116,7 +1116,7 @@
!STREQ(next->symregs[0]->name, get_branch_reg(ins)->name)) {
const int regno = get_branch_regno(ins);
IMCC_debug(interp, DEBUG_OPT1,
- "found branch to branch '%s' %I\n",
+ "found branch to branch '%s' %d\n",
r->first_ins->symregs[0]->name, next);
unit->ostat.branch_branch++;
if (regno < 0)
@@ -1209,7 +1209,7 @@
start->prev = ins;
IMCC_debug(interp, DEBUG_OPT1,
- "found branch to reorganize '%s' %I\n",
+ "found branch to reorganize '%s' %d\n",
r->first_ins->symregs[0]->name, ins);
/* unconditional jump can be eliminated */
@@ -1507,7 +1507,7 @@
for (ins = bb->start; ins && ins->bbindex == bbi;) {
IMCC_debug(interp, DEBUG_OPT1,
- "\tins deleted (dead block) %I\n", ins);
+ "\tins deleted (dead block) %d\n", ins);
ins = delete_ins(unit, ins);
unit->ostat.deleted_ins++;
changed++;
@@ -1525,7 +1525,7 @@
if ((last->type & IF_goto) && !(ins->type & ITLABEL) &&
STREQ(last->opname, "branch")) {
IMCC_debug(interp, DEBUG_OPT1,
- "unreachable ins deleted (after branch) %I\n", ins);
+ "unreachable ins deleted (after branch) %d\n", ins);
ins = delete_ins(unit, ins);
unit->ostat.deleted_ins++;
changed++;
@@ -1538,7 +1538,7 @@
if (ins && last && (last->type & IF_goto) && (ins->type & ITLABEL) &&
STREQ(last->opname, "branch") &&
STREQ(last->symregs[0]->name, ins->symregs[0]->name)) {
- IMCC_debug(interp, DEBUG_OPT1, "dead branch deleted %I\n", ins);
+ IMCC_debug(interp, DEBUG_OPT1, "dead branch deleted %d\n", ins);
ins = delete_ins(unit, last);
unit->ostat.deleted_ins++;
changed++;
@@ -1572,7 +1572,7 @@
if (ins->symregs) {
SymReg * const r = ins->symregs[0];
if (r && (r->use_count == 1 && r->lhs_use_count == 1)) {
- IMCC_debug(interp, DEBUG_OPT2, "used once '%I' deleted\n", ins);
+ IMCC_debug(interp, DEBUG_OPT2, "used once '%d' deleted\n", ins);
ins = delete_ins(unit, ins);
/* find previous instruction or first instruction of this CU
Modified: branches/dynop_mapping/compilers/imcc/pbc.c
==============================================================================
--- branches/dynop_mapping/compilers/imcc/pbc.c Mon Jun 14 00:28:55 2010 (r47613)
+++ branches/dynop_mapping/compilers/imcc/pbc.c Mon Jun 14 04:10:44 2010 (r47614)
@@ -670,7 +670,7 @@
(*src_lines)++;
if (ins->opnum < 0)
IMCC_fatal(interp, 1, "get_codesize: "
- "no opnum ins#%d %I\n",
+ "no opnum ins#%d %d\n",
ins->index, ins);
if (ins->opnum == PARROT_OP_set_p_pc) {
@@ -2435,7 +2435,7 @@
}
}
- IMCC_debug(interp, DEBUG_PBC, "\t%I\n", ins);
+ IMCC_debug(interp, DEBUG_PBC, "\t%d\n", ins);
IMCC_INFO(interp)->npc += ins->opsize;
}
Modified: branches/dynop_mapping/compilers/imcc/pcc.c
==============================================================================
--- branches/dynop_mapping/compilers/imcc/pcc.c Mon Jun 14 00:28:55 2010 (r47613)
+++ branches/dynop_mapping/compilers/imcc/pcc.c Mon Jun 14 04:10:44 2010 (r47614)
@@ -471,7 +471,7 @@
tmp = INS(interp, unit, "returncc", NULL, regs, 0, 0, 0);
}
- IMCC_debug(interp, DEBUG_IMC, "add sub ret - %I\n", tmp);
+ IMCC_debug(interp, DEBUG_IMC, "add sub ret - %d\n", tmp);
insert_ins(unit, unit->last_ins, tmp);
}
}
Modified: branches/dynop_mapping/src/packfile.c
==============================================================================
--- branches/dynop_mapping/src/packfile.c Mon Jun 14 00:28:55 2010 (r47613)
+++ branches/dynop_mapping/src/packfile.c Mon Jun 14 04:10:44 2010 (r47614)
@@ -2767,6 +2767,7 @@
const int old_op_count = byte_code->op_count;
byte_code->op_count += entry->n_ops = PF_fetch_opcode(self->pf, &cursor);
+ /* XXX could probably avoid reallocing by filling the func_table later */
if (!byte_code->op_func_table)
byte_code->op_func_table = mem_gc_allocate_n_typed(interp,
byte_code->op_count, op_func_t);
More information about the parrot-commits
mailing list