On 06/14/2017 07:02 AM, Alex Bennée wrote:
Just a little precursor re-factoring before I was going to add a trace
point:

   - single return point, defaulting to tcg_ctx.code_gen_epilogue

Why? Any if you're going to do that, why not init ret = epilogue and avoid the null test at the end?

   - move cs_base, pc and flags inside the jump cache hit scope

Funny story. While looking at this again, I notice that there's no reason to avoid, and every reason not to avoid, calling tb_htable_lookup when tb_jmp_cache is empty. So I'm now doing

    tb = atomic_rcu_read(...);
    cpu_get_tb_cpu_state(env, &pc, &cs_base, &flags);

    if (!(tb && tb->pc == addr && ...)) {
        tb = tb_htable_lookup(...);
        ...

   - calculate the tb_jmp_cache hash once

I did look once and the compiler is doing the CSE.  But it does look cleaner.


r~

Reply via email to