提交 cc9c1ed1 编写于 作者: P Peter Maydell

target-arm: A64: Avoid duplicate exit_tb(0) in non-linked goto_tb

If gen_goto_tb() decides not to link the two TBs, then the
fallback path generates unnecessary code:
 * if singlestep is enabled then we generate unreachable code
   after the gen_exception_internal(EXCP_DEBUG)
 * if singlestep is disabled then we will generate exit_tb(0)
   twice, once in gen_goto_tb() and once coming out of the
   main loop with is_jmp set to DISAS_JUMP

Correct these deficiencies by only emitting exit_tb() in the
non-singlestep case, in which case we can use DISAS_TB_JUMP
to suppress the main-loop exit_tb().
Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
Reviewed-by: NEdgar E. Iglesias <edgar.iglesias@xilinx.com>
上级 3a298203
...@@ -234,9 +234,10 @@ static inline void gen_goto_tb(DisasContext *s, int n, uint64_t dest) ...@@ -234,9 +234,10 @@ static inline void gen_goto_tb(DisasContext *s, int n, uint64_t dest)
gen_a64_set_pc_im(dest); gen_a64_set_pc_im(dest);
if (s->singlestep_enabled) { if (s->singlestep_enabled) {
gen_exception_internal(EXCP_DEBUG); gen_exception_internal(EXCP_DEBUG);
} else {
tcg_gen_exit_tb(0);
s->is_jmp = DISAS_TB_JUMP;
} }
tcg_gen_exit_tb(0);
s->is_jmp = DISAS_JUMP;
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册