VirtualBox

Ignore:
Timestamp:
Oct 16, 2008 11:59:21 AM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
38026
Message:

more recompiler work

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/recompiler_new/translate-all.c

    r13230 r13337  
    4141#include "tcg.h"
    4242
    43 #ifndef VBOX
    4443/* code generation context */
    4544TCGContext tcg_ctx;
    46 #else
    47 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 #endif
    5545
    5646uint16_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;
     47TCGArg gen_opparam_buf[OPPARAM_BUF_SIZE];
    6048
    6149target_ulong gen_opc_pc[OPC_BUF_SIZE];
     50uint16_t gen_opc_icount[OPC_BUF_SIZE];
    6251uint8_t gen_opc_instr_start[OPC_BUF_SIZE];
    6352#if defined(TARGET_I386)
     
    8675}
    8776
    88 #ifndef VBOX
    8977void cpu_gen_init()
    9078{
     
    9381                  CPU_TEMP_BUF_NLONGS * sizeof(long));
    9482}
    95 #else
    96 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 #endif
    10483
    10584/* return non zero if the very first instruction is invalid so that
     
    11089*/
    11190int 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{
    11793    TCGContext *s = &tcg_ctx;
    118 #endif
    11994    uint8_t *gen_code_buf;
    12095    int gen_code_size;
     
    133108    tcg_func_start(s);
    134109
    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);
    140111#else /* !VBOX */
    141112    tcg_func_start(s);
    142113
    143     if (gen_intermediate_code(env, tb) < 0)
    144         return -1;
     114    gen_intermediate_code(env, tb);
    145115#endif /* !VBOX */
    146116
     
    196166                      void *puc)
    197167{
    198 #ifndef VBOX
    199168    TCGContext *s = &tcg_ctx;
    200 #else
    201     TCGContext *s = getCompilerCtx(env);
    202 #endif
    203169    int j;
    204170    unsigned long tc_ptr;
     
    213179
    214180#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);
    218182#else
    219183    gen_intermediate_code_pc(env, tb);
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette