Changeset 13337 in vbox for trunk/src/recompiler_new/translate-all.c
- Timestamp:
- Oct 16, 2008 11:59:21 AM (16 years ago)
- svn:sync-xref-src-repo-rev:
- 38026
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/recompiler_new/translate-all.c
r13230 r13337 41 41 #include "tcg.h" 42 42 43 #ifndef VBOX44 43 /* code generation context */ 45 44 TCGContext tcg_ctx; 46 #else47 TCGContext g_tcg_ctx;48 static TCGContext* getCompilerCtx(CPUState *env)49 {50 /** @todo nike: should be field in CPU env */51 //return env->tcg_context;52 return &g_tcg_ctx;53 }54 #endif55 45 56 46 uint16_t gen_opc_buf[OPC_BUF_SIZE]; 57 uint32_t gen_opparam_buf[OPPARAM_BUF_SIZE]; 58 long gen_labels[OPC_BUF_SIZE]; 59 int nb_gen_labels; 47 TCGArg gen_opparam_buf[OPPARAM_BUF_SIZE]; 60 48 61 49 target_ulong gen_opc_pc[OPC_BUF_SIZE]; 50 uint16_t gen_opc_icount[OPC_BUF_SIZE]; 62 51 uint8_t gen_opc_instr_start[OPC_BUF_SIZE]; 63 52 #if defined(TARGET_I386) … … 86 75 } 87 76 88 #ifndef VBOX89 77 void cpu_gen_init() 90 78 { … … 93 81 CPU_TEMP_BUF_NLONGS * sizeof(long)); 94 82 } 95 #else96 void cpu_gen_init(CPUState *env)97 {98 TCGContext* tcg_ctx = getCompilerCtx(env);99 tcg_context_init(tcg_ctx);100 tcg_set_frame(tcg_ctx, TCG_AREG0, offsetof(CPUState, temp_buf),101 CPU_TEMP_BUF_NLONGS * sizeof(long));102 }103 #endif104 83 105 84 /* return non zero if the very first instruction is invalid so that … … 110 89 */ 111 90 int cpu_gen_code(CPUState *env, TranslationBlock *tb, 112 int max_code_size, int *gen_code_size_ptr) 113 { 114 #ifdef VBOX 115 TCGContext *s = getCompilerCtx(env); 116 #else 91 int *gen_code_size_ptr) 92 { 117 93 TCGContext *s = &tcg_ctx; 118 #endif119 94 uint8_t *gen_code_buf; 120 95 int gen_code_size; … … 133 108 tcg_func_start(s); 134 109 135 if (gen_intermediate_code(env, tb) < 0) 136 { 137 RAWEx_ProfileStop(env, STATS_QEMU_COMPILATION); 138 return -1; 139 } 110 gen_intermediate_code(env, tb); 140 111 #else /* !VBOX */ 141 112 tcg_func_start(s); 142 113 143 if (gen_intermediate_code(env, tb) < 0) 144 return -1; 114 gen_intermediate_code(env, tb); 145 115 #endif /* !VBOX */ 146 116 … … 196 166 void *puc) 197 167 { 198 #ifndef VBOX199 168 TCGContext *s = &tcg_ctx; 200 #else201 TCGContext *s = getCompilerCtx(env);202 #endif203 169 int j; 204 170 unsigned long tc_ptr; … … 213 179 214 180 #ifdef VBOX 215 /** @todo: what's right here? */ 216 if (gen_intermediate_code_pc(env, tb) < 0) 217 return -1; 181 gen_intermediate_code_pc(env, tb); 218 182 #else 219 183 gen_intermediate_code_pc(env, tb);
Note:
See TracChangeset
for help on using the changeset viewer.