All of lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Henderson <rth@twiddle.net>
To: qemu-devel@nongnu.org
Cc: peter.maydell@linaro.org, "Emilio G. Cota" <cota@braap.org>
Subject: [Qemu-devel] [PULL 03/10] translate-all: consolidate tb init in tb_gen_code
Date: Tue, 13 Jun 2017 22:23:04 -0700	[thread overview]
Message-ID: <20170614052311.13785-4-rth@twiddle.net> (raw)
In-Reply-To: <20170614052311.13785-1-rth@twiddle.net>

From: "Emilio G. Cota" <cota@braap.org>

We are partially initializing tb in tb_alloc. Instead, fully
initialize it in tb_gen_code, which is tb_alloc's only caller.

This saves an unnecessary write to tb->cflags.

Signed-off-by: Emilio G. Cota <cota@braap.org>
Message-Id: <1497038122-26364-1-git-send-email-cota@braap.org>
Signed-off-by: Richard Henderson <rth@twiddle.net>
---
 translate-all.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/translate-all.c b/translate-all.c
index bb094ad..46c5592 100644
--- a/translate-all.c
+++ b/translate-all.c
@@ -843,9 +843,6 @@ static TranslationBlock *tb_alloc(target_ulong pc)
         ctx->tbs = g_renew(TranslationBlock *, ctx->tbs, ctx->tbs_size);
     }
     ctx->tbs[ctx->nb_tbs++] = tb;
-    tb->pc = pc;
-    tb->cflags = 0;
-    tb->invalid = false;
     return tb;
 }
 
@@ -1289,9 +1286,11 @@ TranslationBlock *tb_gen_code(CPUState *cpu,
 
     gen_code_buf = tcg_ctx.code_gen_ptr;
     tb->tc_ptr = gen_code_buf;
+    tb->pc = pc;
     tb->cs_base = cs_base;
     tb->flags = flags;
     tb->cflags = cflags;
+    tb->invalid = false;
 
 #ifdef CONFIG_PROFILER
     tcg_ctx.tb_count1++; /* includes aborted translations because of
-- 
2.9.4

  parent reply	other threads:[~2017-06-14  5:23 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-14  5:23 [Qemu-devel] [PULL 00/10] TCG queued patches Richard Henderson
2017-06-14  5:23 ` [Qemu-devel] [PULL 01/10] util: add cacheinfo Richard Henderson
2017-06-14  5:23 ` [Qemu-devel] [PULL 02/10] tcg: allocate TB structs before the corresponding translated code Richard Henderson
2017-06-14  5:23 ` Richard Henderson [this message]
2017-06-14  5:23 ` [Qemu-devel] [PULL 04/10] tcg/aarch64: Use ADR in tcg_out_movi Richard Henderson
2017-06-14  5:23 ` [Qemu-devel] [PULL 05/10] tcg/arm: Use indirect branch for goto_tb Richard Henderson
2017-06-14  5:23 ` [Qemu-devel] [PULL 06/10] tcg/arm: Remove limit on code buffer size Richard Henderson
2017-06-14  5:23 ` [Qemu-devel] [PULL 07/10] tcg/arm: Try pc-relative addresses for movi Richard Henderson
2017-06-14  5:23 ` [Qemu-devel] [PULL 08/10] tcg/arm: Use ldr (literal) for goto_tb Richard Henderson
2017-06-14  5:23 ` [Qemu-devel] [PULL 09/10] Revert "target/aarch64: optimize indirect branches" Richard Henderson
2017-06-14 14:27   ` Philippe Mathieu-Daudé
2017-06-14  5:23 ` [Qemu-devel] [PULL 10/10] tcg: Remove tb_htable_lookup from helper_lookup_tb_ptr Richard Henderson
2017-06-14  5:42 ` [Qemu-devel] [PULL 00/10] TCG queued patches no-reply
2017-06-14  5:43 ` no-reply
2017-06-14 15:23 ` Richard Henderson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170614052311.13785-4-rth@twiddle.net \
    --to=rth@twiddle.net \
    --cc=cota@braap.org \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.