mirror of
https://github.com/python/cpython.git
synced 2025-08-28 20:56:54 +00:00
GH-131798: Split up and optimize CALL_TUPLE_1 in the JIT (GH-132851)
This commit is contained in:
parent
15ff60aff0
commit
08e3389e8c
10 changed files with 277 additions and 161 deletions
|
@ -4023,17 +4023,21 @@ dummy_func(
|
|||
_CALL_STR_1 +
|
||||
_CHECK_PERIODIC;
|
||||
|
||||
op(_CALL_TUPLE_1, (callable, null, arg -- res)) {
|
||||
op(_GUARD_CALLABLE_TUPLE_1, (callable, unused, unused -- callable, unused, unused)) {
|
||||
PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable);
|
||||
DEOPT_IF(callable_o != (PyObject *)&PyTuple_Type);
|
||||
}
|
||||
|
||||
op(_CALL_TUPLE_1, (callable, null, arg -- res)) {
|
||||
PyObject *arg_o = PyStackRef_AsPyObjectBorrow(arg);
|
||||
|
||||
assert(oparg == 1);
|
||||
DEOPT_IF(!PyStackRef_IsNull(null));
|
||||
DEOPT_IF(callable_o != (PyObject *)&PyTuple_Type);
|
||||
STAT_INC(CALL, hit);
|
||||
PyObject *res_o = PySequence_Tuple(arg_o);
|
||||
DEAD(null);
|
||||
DEAD(callable);
|
||||
(void)callable; // Silence compiler warnings about unused variables
|
||||
(void)null;
|
||||
PyStackRef_CLOSE(arg);
|
||||
ERROR_IF(res_o == NULL, error);
|
||||
res = PyStackRef_FromPyObjectSteal(res_o);
|
||||
|
@ -4042,6 +4046,8 @@ dummy_func(
|
|||
macro(CALL_TUPLE_1) =
|
||||
unused/1 +
|
||||
unused/2 +
|
||||
_GUARD_NOS_NULL +
|
||||
_GUARD_CALLABLE_TUPLE_1 +
|
||||
_CALL_TUPLE_1 +
|
||||
_CHECK_PERIODIC;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue