|
From: | Richard Henderson |
Subject: | Re: [Qemu-devel] [PATCH v9 07/26] target: [tcg, i386] Refactor init_disas_context |
Date: | Mon, 26 Jun 2017 19:57:48 -0700 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.0 |
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.
r~
[Prev in Thread] | Current Thread | [Next in Thread] |