mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 16:53:55 -06:00
tcg: Use tcg_malloc to allocate TCGLabel
Pre-allocating 512 of them per TB is a waste. Reviewed-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de> Signed-off-by: Richard Henderson <rth@twiddle.net>
This commit is contained in:
parent
bec1631100
commit
51e3972c41
2 changed files with 23 additions and 24 deletions
31
tcg/tcg.c
31
tcg/tcg.c
|
@ -246,15 +246,11 @@ static void tcg_out_label(TCGContext *s, TCGLabel *l, tcg_insn_unit *ptr)
|
|||
TCGLabel *gen_new_label(void)
|
||||
{
|
||||
TCGContext *s = &tcg_ctx;
|
||||
int idx;
|
||||
TCGLabel *l;
|
||||
TCGLabel *l = tcg_malloc(sizeof(TCGLabel));
|
||||
|
||||
if (s->nb_labels >= TCG_MAX_LABELS)
|
||||
tcg_abort();
|
||||
idx = s->nb_labels++;
|
||||
l = &s->labels[idx];
|
||||
l->has_value = 0;
|
||||
l->u.first_reloc = NULL;
|
||||
*l = (TCGLabel){
|
||||
.id = s->nb_labels++
|
||||
};
|
||||
|
||||
return l;
|
||||
}
|
||||
|
@ -1086,11 +1082,20 @@ void tcg_dump_ops(TCGContext *s)
|
|||
i = 0;
|
||||
break;
|
||||
}
|
||||
for (; i < nb_cargs; i++) {
|
||||
if (k != 0) {
|
||||
qemu_log(",");
|
||||
}
|
||||
qemu_log("$0x%" TCG_PRIlx, args[k++]);
|
||||
switch (c) {
|
||||
case INDEX_op_set_label:
|
||||
case INDEX_op_br:
|
||||
case INDEX_op_brcond_i32:
|
||||
case INDEX_op_brcond_i64:
|
||||
case INDEX_op_brcond2_i32:
|
||||
qemu_log("%s$L%d", k ? "," : "", arg_label(args[k])->id);
|
||||
i++, k++;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
for (; i < nb_cargs; i++, k++) {
|
||||
qemu_log("%s$0x%" TCG_PRIlx, k ? "," : "", args[k]);
|
||||
}
|
||||
}
|
||||
qemu_log("\n");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue