summaryrefslogtreecommitdiff
path: root/cpu-exec.c
diff options
context:
space:
mode:
authorAndreas Färber <afaerber@suse.de>2013-08-26 06:03:38 +0200
committerAndreas Färber <afaerber@suse.de>2014-03-13 19:20:46 +0100
commit8cd70437f385fc53f34481d506cf4a18ebe75976 (patch)
tree3eb662386197cdda01b3576974d9515d4b707ef3 /cpu-exec.c
parent28ecfd7a62fafe8f4f0b35a157005f4d13913043 (diff)
downloadqemu-8cd70437f385fc53f34481d506cf4a18ebe75976.tar.gz
qemu-8cd70437f385fc53f34481d506cf4a18ebe75976.tar.bz2
qemu-8cd70437f385fc53f34481d506cf4a18ebe75976.zip
cpu: Move tb_jmp_cache field from CPU_COMMON to CPUState
Clear it on reset. Signed-off-by: Andreas Färber <afaerber@suse.de>
Diffstat (limited to 'cpu-exec.c')
-rw-r--r--cpu-exec.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/cpu-exec.c b/cpu-exec.c
index 9d98f210a4..dd8da531d0 100644
--- a/cpu-exec.c
+++ b/cpu-exec.c
@@ -118,6 +118,7 @@ static TranslationBlock *tb_find_slow(CPUArchState *env,
target_ulong cs_base,
uint64_t flags)
{
+ CPUState *cpu = ENV_GET_CPU(env);
TranslationBlock *tb, **ptb1;
unsigned int h;
tb_page_addr_t phys_pc, phys_page1;
@@ -165,12 +166,13 @@ static TranslationBlock *tb_find_slow(CPUArchState *env,
tcg_ctx.tb_ctx.tb_phys_hash[h] = tb;
}
/* we add the TB in the virtual pc hash table */
- env->tb_jmp_cache[tb_jmp_cache_hash_func(pc)] = tb;
+ cpu->tb_jmp_cache[tb_jmp_cache_hash_func(pc)] = tb;
return tb;
}
static inline TranslationBlock *tb_find_fast(CPUArchState *env)
{
+ CPUState *cpu = ENV_GET_CPU(env);
TranslationBlock *tb;
target_ulong cs_base, pc;
int flags;
@@ -179,7 +181,7 @@ static inline TranslationBlock *tb_find_fast(CPUArchState *env)
always be the same before a given translated block
is executed. */
cpu_get_tb_cpu_state(env, &pc, &cs_base, &flags);
- tb = env->tb_jmp_cache[tb_jmp_cache_hash_func(pc)];
+ tb = cpu->tb_jmp_cache[tb_jmp_cache_hash_func(pc)];
if (unlikely(!tb || tb->pc != pc || tb->cs_base != cs_base ||
tb->flags != flags)) {
tb = tb_find_slow(env, pc, cs_base, flags);