]> Git Repo - qemu.git/commitdiff
gen-icount: fold exitreq_label into TCGContext
authorEmilio G. Cota <[email protected]>
Tue, 4 Jul 2017 17:54:21 +0000 (13:54 -0400)
committerRichard Henderson <[email protected]>
Tue, 24 Oct 2017 20:53:42 +0000 (13:53 -0700)
Groundwork for supporting multiple TCG contexts.

Reviewed-by: Richard Henderson <[email protected]>
Reviewed-by: Alex BennĂ©e <[email protected]>
Signed-off-by: Emilio G. Cota <[email protected]>
Signed-off-by: Richard Henderson <[email protected]>
include/exec/gen-icount.h
tcg/tcg.h

index c58b0b2585078bcef81007478b7234e5a8c2e22a..fe8017646246cf84e2e5c82a092e856e21d65448 100644 (file)
@@ -6,13 +6,12 @@
 /* Helpers for instruction counting code generation.  */
 
 static int icount_start_insn_idx;
-static TCGLabel *exitreq_label;
 
 static inline void gen_tb_start(TranslationBlock *tb)
 {
     TCGv_i32 count, imm;
 
-    exitreq_label = gen_new_label();
+    tcg_ctx->exitreq_label = gen_new_label();
     if (tb_cflags(tb) & CF_USE_ICOUNT) {
         count = tcg_temp_local_new_i32();
     } else {
@@ -34,7 +33,7 @@ static inline void gen_tb_start(TranslationBlock *tb)
         tcg_temp_free_i32(imm);
     }
 
-    tcg_gen_brcondi_i32(TCG_COND_LT, count, 0, exitreq_label);
+    tcg_gen_brcondi_i32(TCG_COND_LT, count, 0, tcg_ctx->exitreq_label);
 
     if (tb_cflags(tb) & CF_USE_ICOUNT) {
         tcg_gen_st16_i32(count, tcg_ctx->tcg_env,
@@ -52,7 +51,7 @@ static inline void gen_tb_end(TranslationBlock *tb, int num_insns)
         tcg_set_insn_param(icount_start_insn_idx, 1, num_insns);
     }
 
-    gen_set_label(exitreq_label);
+    gen_set_label(tcg_ctx->exitreq_label);
     tcg_gen_exit_tb((uintptr_t)tb + TB_EXIT_REQUESTED);
 
     /* Terminate the linked list.  */
index 17fd14655746b87a7d592c9f62fae9aa6f7e2245..cca85b4d8552ec74d73a89e8ab9dc9a257eecdbb 100644 (file)
--- a/tcg/tcg.h
+++ b/tcg/tcg.h
@@ -675,6 +675,8 @@ struct TCGContext {
     struct TCGLabelPoolData *pool_labels;
 #endif
 
+    TCGLabel *exitreq_label;
+
     TCGTempSet free_temps[TCG_TYPE_COUNT * 2];
     TCGTemp temps[TCG_MAX_TEMPS]; /* globals first, temps after */
 
This page took 0.028493 seconds and 4 git commands to generate.