mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-10 02:54:58 -06:00
tcg: Change generator-side labels to a pointer
This is less about improved type checking than enabling a subsequent change to the representation of labels. Acked-by: Claudio Fontana <claudio.fontana@huawei.com> Tested-by: Claudio Fontana <claudio.fontana@huawei.com> Cc: Andrzej Zaborowski <balrogg@gmail.com> Cc: Peter Maydell <peter.maydell@linaro.org> Cc: Aurelien Jarno <aurelien@aurel32.net> Cc: Blue Swirl <blauwirbel@gmail.com> Cc: Stefan Weil <sw@weilnetz.de> Reviewed-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de> Signed-off-by: Richard Henderson <rth@twiddle.net>
This commit is contained in:
parent
42a268c241
commit
bec1631100
10 changed files with 108 additions and 125 deletions
|
@ -208,12 +208,10 @@ static __attribute__((unused)) inline void tcg_patch64(tcg_insn_unit *p,
|
|||
/* label relocation processing */
|
||||
|
||||
static void tcg_out_reloc(TCGContext *s, tcg_insn_unit *code_ptr, int type,
|
||||
int label_index, intptr_t addend)
|
||||
TCGLabel *l, intptr_t addend)
|
||||
{
|
||||
TCGLabel *l;
|
||||
TCGRelocation *r;
|
||||
|
||||
l = &s->labels[label_index];
|
||||
if (l->has_value) {
|
||||
/* FIXME: This may break relocations on RISC targets that
|
||||
modify instruction fields in place. The caller may not have
|
||||
|
@ -230,9 +228,8 @@ static void tcg_out_reloc(TCGContext *s, tcg_insn_unit *code_ptr, int type,
|
|||
}
|
||||
}
|
||||
|
||||
static void tcg_out_label(TCGContext *s, int label_index, tcg_insn_unit *ptr)
|
||||
static void tcg_out_label(TCGContext *s, TCGLabel *l, tcg_insn_unit *ptr)
|
||||
{
|
||||
TCGLabel *l = &s->labels[label_index];
|
||||
intptr_t value = (intptr_t)ptr;
|
||||
TCGRelocation *r;
|
||||
|
||||
|
@ -2333,7 +2330,7 @@ static inline int tcg_gen_code_common(TCGContext *s,
|
|||
break;
|
||||
case INDEX_op_set_label:
|
||||
tcg_reg_alloc_bb_end(s, s->reserved_regs);
|
||||
tcg_out_label(s, args[0], s->code_ptr);
|
||||
tcg_out_label(s, arg_label(args[0]), s->code_ptr);
|
||||
break;
|
||||
case INDEX_op_call:
|
||||
tcg_reg_alloc_call(s, op->callo, op->calli, args,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue