mirror of
https://github.com/python/cpython.git
synced 2026-01-06 15:32:22 +00:00
GH-128939: Refactor JIT optimize structs (GH-128940)
This commit is contained in:
parent
e1fa2fcc7c
commit
f0f7b978be
9 changed files with 816 additions and 527 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue