mirror of
https://github.com/python/cpython.git
synced 2025-08-25 19:24:42 +00:00
GH-113710: Improve _SET_IP
and _CHECK_VALIDITY
(GH-115248)
This commit is contained in:
parent
de07941729
commit
681778c56a
7 changed files with 79 additions and 35 deletions
13
Python/executor_cases.c.h
generated
13
Python/executor_cases.c.h
generated
|
@ -3360,10 +3360,9 @@
|
|||
}
|
||||
|
||||
case _SET_IP: {
|
||||
oparg = CURRENT_OPARG();
|
||||
PyObject *instr_ptr = (PyObject *)CURRENT_OPERAND();
|
||||
TIER_TWO_ONLY
|
||||
// TODO: Put the code pointer in `operand` to avoid indirection via `frame`
|
||||
frame->instr_ptr = _PyCode_CODE(_PyFrame_GetCode(frame)) + oparg;
|
||||
frame->instr_ptr = (_Py_CODEUNIT *)instr_ptr;
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -3459,4 +3458,12 @@
|
|||
break;
|
||||
}
|
||||
|
||||
case _CHECK_VALIDITY_AND_SET_IP: {
|
||||
PyObject *instr_ptr = (PyObject *)CURRENT_OPERAND();
|
||||
TIER_TWO_ONLY
|
||||
if (!current_executor->vm_data.valid) goto deoptimize;
|
||||
frame->instr_ptr = (_Py_CODEUNIT *)instr_ptr;
|
||||
break;
|
||||
}
|
||||
|
||||
#undef TIER_TWO
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue