diff options
author | Mark Shannon <mark@hotpy.org> | 2025-01-20 15:49:15 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-01-20 15:49:15 (GMT) |
commit | f0f7b978be84c432139da1b107825aa2dc536854 (patch) | |
tree | 182db424e88dda2de2236ccb6de7e319ca18e2cc /Python/optimizer_analysis.c | |
parent | e1fa2fcc7c1bf5291a7f71300b7828b49be9ab72 (diff) | |
download | cpython-f0f7b978be84c432139da1b107825aa2dc536854.zip cpython-f0f7b978be84c432139da1b107825aa2dc536854.tar.gz cpython-f0f7b978be84c432139da1b107825aa2dc536854.tar.bz2 |
GH-128939: Refactor JIT optimize structs (GH-128940)
Diffstat (limited to 'Python/optimizer_analysis.c')
-rw-r--r-- | Python/optimizer_analysis.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/Python/optimizer_analysis.c b/Python/optimizer_analysis.c index 0ef15c6..b9ac30e 100644 --- a/Python/optimizer_analysis.c +++ b/Python/optimizer_analysis.c @@ -368,13 +368,17 @@ remove_globals(_PyInterpreterFrame *frame, _PyUOpInstruction *buffer, #define sym_truthiness _Py_uop_sym_truthiness #define frame_new _Py_uop_frame_new #define frame_pop _Py_uop_frame_pop +#define sym_new_tuple _Py_uop_sym_new_tuple +#define sym_tuple_getitem _Py_uop_sym_tuple_getitem +#define sym_tuple_length _Py_uop_sym_tuple_length +#define sym_is_immortal _Py_uop_sym_is_immortal static int optimize_to_bool( _PyUOpInstruction *this_instr, - _Py_UOpsContext *ctx, - _Py_UopsSymbol *value, - _Py_UopsSymbol **result_ptr) + JitOptContext *ctx, + JitOptSymbol *value, + JitOptSymbol **result_ptr) { if (sym_matches_type(value, &PyBool_Type)) { REPLACE_OP(this_instr, _NOP, 0, 0); @@ -460,8 +464,8 @@ optimize_uops( ) { - _Py_UOpsContext context; - _Py_UOpsContext *ctx = &context; + JitOptContext context; + JitOptContext *ctx = &context; uint32_t opcode = UINT16_MAX; int curr_space = 0; int max_space = 0; @@ -486,7 +490,7 @@ optimize_uops( int oparg = this_instr->oparg; opcode = this_instr->opcode; - _Py_UopsSymbol **stack_pointer = ctx->frame->stack_pointer; + JitOptSymbol **stack_pointer = ctx->frame->stack_pointer; #ifdef Py_DEBUG if (get_lltrace() >= 3) { |