aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmilio G. Cota <cota@braap.org>2017-06-09 15:55:22 -0400
committerRichard Henderson <rth@twiddle.net>2017-06-19 11:10:59 -0700
commit2b48e10f888059a98043b4816769fa2a326a1d2c (patch)
tree3738b4cf1759d37cdd900da942628349a810f101
parent6e3b2bfd6af488a896f7936e99ef160f8f37e6f2 (diff)
downloadqemu-2b48e10f888059a98043b4816769fa2a326a1d2c.zip
qemu-2b48e10f888059a98043b4816769fa2a326a1d2c.tar.gz
qemu-2b48e10f888059a98043b4816769fa2a326a1d2c.tar.bz2
translate-all: consolidate tb init in tb_gen_code
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>
-rw-r--r--translate-all.c5
1 files 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