summaryrefslogtreecommitdiffstats
path: root/Python/bytecodes.c
diff options
context:
space:
mode:
authorTomas R. <tomas.roun8@gmail.com>2025-04-24 22:55:03 (GMT)
committerGitHub <noreply@github.com>2025-04-24 22:55:03 (GMT)
commit08e3389e8c433c16895127e8b745093f071b21b9 (patch)
treeb6d4616f165052023760cfaf08b001eff2bb73b5 /Python/bytecodes.c
parent15ff60aff0ca28b23c89cb1c0fc8f1f8997ed035 (diff)
downloadcpython-08e3389e8c433c16895127e8b745093f071b21b9.zip
cpython-08e3389e8c433c16895127e8b745093f071b21b9.tar.gz
cpython-08e3389e8c433c16895127e8b745093f071b21b9.tar.bz2
GH-131798: Split up and optimize CALL_TUPLE_1 in the JIT (GH-132851)
Diffstat (limited to 'Python/bytecodes.c')
-rw-r--r--Python/bytecodes.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/Python/bytecodes.c b/Python/bytecodes.c
index 2ad1b32..f5c6e73 100644
--- a/Python/bytecodes.c
+++ b/Python/bytecodes.c
@@ -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;