Skip to content

Commit b00252e

Browse files
Trace through BINARY_OP_SUBSCR_GETITEM
1 parent ba64a5b commit b00252e

File tree

8 files changed

+463
-6
lines changed

8 files changed

+463
-6
lines changed

Include/internal/pycore_optimizer.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,7 @@ _PyJIT_translate_single_bytecode_to_trace(
367367
_Py_CODEUNIT *next_instr,
368368
PyCodeObject *code,
369369
PyFunctionObject *func,
370+
int old_stack_level,
370371
int opcode,
371372
int oparg,
372373
int jump_taken);

Python/bytecodes.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2985,6 +2985,7 @@ dummy_func(
29852985
int _jump_taken = false;
29862986
PyCodeObject *old_code = _PyFrame_GetCode(frame);
29872987
PyFunctionObject *old_func = (PyFunctionObject *)PyStackRef_AsPyObjectBorrow(frame->f_funcobj);
2988+
int _old_stack_level = 0;
29882989
TRACING_DISPATCH();
29892990
}
29902991
else {

Python/ceval.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -986,12 +986,12 @@ _PyObjectArray_Free(PyObject **array, PyObject **scratch)
986986

987987
#if _Py_TIER2
988988
// 1 for trace full, 0 for successful write.
989-
static int
990-
add_to_code_trace(PyThreadState *tstate, _PyInterpreterFrame *frame, PyCodeObject *old_code, PyFunctionObject *old_func, _Py_CODEUNIT *this_instr, _Py_CODEUNIT *next_instr, int opcode, int oparg, int jump_taken)
989+
static inline int
990+
add_to_code_trace(PyThreadState *tstate, _PyInterpreterFrame *frame, PyCodeObject *old_code, PyFunctionObject *old_func, int old_stack_level, _Py_CODEUNIT *this_instr, _Py_CODEUNIT *next_instr, int opcode, int oparg, int jump_taken)
991991
{
992992
assert(frame != NULL);
993993
assert(tstate->interp->jit_state.jit_tracer_code_curr_size < UOP_MAX_TRACE_LENGTH);
994-
return !_PyJIT_translate_single_bytecode_to_trace(tstate, frame, this_instr, next_instr, old_code, old_func, opcode, oparg, jump_taken);
994+
return !_PyJIT_translate_single_bytecode_to_trace(tstate, frame, this_instr, next_instr, old_code, old_func, old_stack_level, opcode, oparg, jump_taken);
995995
}
996996
#endif
997997

Python/ceval_macros.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@
164164
if (_is_sys_tracing) { \
165165
LEAVE_TRACING(); \
166166
} \
167-
else if ((IS_JIT_TRACING() && add_to_code_trace(tstate, frame, old_code, old_func, this_instr, next_instr, opcode, oparg, _jump_taken))) { \
167+
else if ((IS_JIT_TRACING() && add_to_code_trace(tstate, frame, old_code, old_func, _old_stack_level, this_instr, next_instr, opcode, oparg, _jump_taken))) { \
168168
BAIL_TRACING_NO_DISPATCH(); \
169169
} \
170170
} while (0);

Python/generated_cases.c.h

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)