[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v9 07/26] target: [tcg, i386] Refactor init_disa
From: |
Lluís Vilanova |
Subject: |
Re: [Qemu-devel] [PATCH v9 07/26] target: [tcg, i386] Refactor init_disas_context |
Date: |
Tue, 27 Jun 2017 09:07:21 +0300 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) |
Richard Henderson writes:
> On 06/25/2017 02:12 AM, Lluís Vilanova wrote:
>> + DisasContext *dc = container_of(db, DisasContext, base);
>> CPUX86State *env = cpu->env_ptr;
>> - DisasContext dc1, *dc = &dc1;
>> - DisasContextBase *db = &dc1.base;
>> - uint32_t flags;
>> - target_ulong cs_base;
>> - int num_insns;
>> - int max_insns;
>> -
>> - /* generate intermediate code */
>> - db->pc_first = tb->pc;
>> - cs_base = tb->cs_base;
>> - flags = tb->flags;
>> + uint32_t flags = db->tb->flags;
>> + target_ulong cs_base = db->tb->cs_base;
> As a nit, it would be better for the compiler if you keep only one of the two
> pointers {dc,db} live. That is, once you've used container_of, always use
> dc-> base instead of db.
That's what the previous version did, but Emilio proposed to use both to keep
diffs more readable.
Still, if using both dc/db will confuse the compiler's alias analysis, I can
revert it back to dc->base.
Thanks,
Lluis
- Re: [Qemu-devel] [PATCH v9 04/26] target: [tcg] Add generic translation framework, (continued)
- [Qemu-devel] [PATCH v9 05/26] target: [tcg] Redefine DISAS_* onto the generic translation framework (DJ_*), Lluís Vilanova, 2017/06/25
- [Qemu-devel] [PATCH v9 06/26] target: [tcg, i386] Port to DisasContextBase, Lluís Vilanova, 2017/06/25
- [Qemu-devel] [PATCH v9 07/26] target: [tcg, i386] Refactor init_disas_context, Lluís Vilanova, 2017/06/25
- [Qemu-devel] [PATCH v9 08/26] target: [tcg, i386] Refactor init_globals, Lluís Vilanova, 2017/06/25
- [Qemu-devel] [PATCH v9 09/26] target: [tcg, i386] Refactor insn_start, Lluís Vilanova, 2017/06/25
- [Qemu-devel] [PATCH v9 10/26] target: [tcg, i386] Refactor breakpoint_check, Lluís Vilanova, 2017/06/25
- [Qemu-devel] [PATCH v9 11/26] target: [tcg, i386] Refactor disas_insn, Lluís Vilanova, 2017/06/25
- [Qemu-devel] [PATCH v9 12/26] target: [tcg,i386] Refactor tb_stop, Lluís Vilanova, 2017/06/25
- [Qemu-devel] [PATCH v9 13/26] target: [tcg, i386] Refactor disas_flags, Lluís Vilanova, 2017/06/25
- [Qemu-devel] [PATCH v9 14/26] target: [tcg, i386] Replace DISAS_* with DJ_*, Lluís Vilanova, 2017/06/25
- [Qemu-devel] [PATCH v9 16/26] target: [tcg, arm] Replace DISAS_* with DJ_*, Lluís Vilanova, 2017/06/25
- [Qemu-devel] [PATCH v9 17/26] target: [tcg, arm] Port to DisasContextBase, Lluís Vilanova, 2017/06/25