mirror of
https://github.com/python/cpython.git
synced 2025-07-08 03:45:36 +00:00
gh-120619: Strength reduce function guards, support 2-operand uop forms (GH-124846)
Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
This commit is contained in:
parent
f8276bf5f3
commit
6293d00e72
17 changed files with 379 additions and 270 deletions
|
@ -661,7 +661,7 @@ dummy_func(
|
|||
assert(next_instr->op.code == STORE_FAST);
|
||||
next_oparg = next_instr->op.arg;
|
||||
#else
|
||||
next_oparg = CURRENT_OPERAND();
|
||||
next_oparg = CURRENT_OPERAND0();
|
||||
#endif
|
||||
_PyStackRef *target_local = &GETLOCAL(next_oparg);
|
||||
DEOPT_IF(!PyStackRef_Is(*target_local, left));
|
||||
|
@ -3463,6 +3463,12 @@ dummy_func(
|
|||
EXIT_IF(func->func_version != func_version);
|
||||
}
|
||||
|
||||
tier2 op(_CHECK_FUNCTION_VERSION_INLINE, (func_version/2, callable_o/4 --)) {
|
||||
assert(PyFunction_Check(callable_o));
|
||||
PyFunctionObject *func = (PyFunctionObject *)callable_o;
|
||||
EXIT_IF(func->func_version != func_version);
|
||||
}
|
||||
|
||||
macro(CALL_PY_GENERAL) =
|
||||
unused/1 + // Skip over the counter
|
||||
_CHECK_PEP_523 +
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue