Inline uc_tracecode when there is only exactly one hook

This commit is contained in:
2021-11-21 16:44:39 +01:00
parent 18d7f090ce
commit 87a391d549
31 changed files with 173 additions and 6 deletions

View File

@@ -5961,6 +5961,10 @@ static void sparc_tr_translate_insn(DisasContextBase *dcbase, CPUState *cs)
// Unicorn: trace this instruction on request
if (HOOK_EXISTS_BOUNDED(uc, UC_HOOK_CODE, dc->pc)) {
// Sync PC in advance
tcg_gen_movi_tl(tcg_ctx, tcg_ctx->cpu_pc, dc->pc);
gen_uc_tracecode(tcg_ctx, 4, UC_HOOK_CODE_IDX, uc, dc->pc);
// the callback might want to stop emulation immediately
check_exit_request(tcg_ctx);