[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 03/12] translate-all: consolidate tb init in tb_gen_c
From: |
Richard Henderson |
Subject: |
[Qemu-devel] [PULL 03/12] translate-all: consolidate tb init in tb_gen_code |
Date: |
Mon, 19 Jun 2017 11:18:30 -0700 |
From: "Emilio G. Cota" <address@hidden>
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 <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Richard Henderson <address@hidden>
---
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
- [Qemu-devel] [PULL 00/12] TCG queued patches, Richard Henderson, 2017/06/19
- [Qemu-devel] [PULL 01/12] util: add cacheinfo, Richard Henderson, 2017/06/19
- [Qemu-devel] [PULL 03/12] translate-all: consolidate tb init in tb_gen_code,
Richard Henderson <=
- [Qemu-devel] [PULL 04/12] tcg/aarch64: Use ADR in tcg_out_movi, Richard Henderson, 2017/06/19
- [Qemu-devel] [PULL 05/12] tcg/arm: Use indirect branch for goto_tb, Richard Henderson, 2017/06/19
- [Qemu-devel] [PULL 06/12] tcg/arm: Remove limit on code buffer size, Richard Henderson, 2017/06/19
- [Qemu-devel] [PULL 02/12] tcg: allocate TB structs before the corresponding translated code, Richard Henderson, 2017/06/19
- [Qemu-devel] [PULL 09/12] tcg: Increase hit rate of lookup_tb_ptr, Richard Henderson, 2017/06/19
- [Qemu-devel] [PULL 07/12] tcg/arm: Try pc-relative addresses for movi, Richard Henderson, 2017/06/19
- [Qemu-devel] [PULL 08/12] tcg/arm: Use ldr (literal) for goto_tb, Richard Henderson, 2017/06/19
- [Qemu-devel] [PULL 10/12] target/alpha: Use tcg_gen_lookup_and_goto_ptr, Richard Henderson, 2017/06/19
- [Qemu-devel] [PULL 11/12] target/s390x: Exit after changing PSW mask, Richard Henderson, 2017/06/19
- [Qemu-devel] [PULL 12/12] target/arm: Exit after clearing aarch64 interrupt mask, Richard Henderson, 2017/06/19