aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Python/executor_cases.c.h
diff options
context:
space:
mode:
authorTomas R. <tomas.roun8@gmail.com>2025-04-25 00:55:03 +0200
committerGitHub <noreply@github.com>2025-04-24 15:55:03 -0700
commit08e3389e8c433c16895127e8b745093f071b21b9 (patch)
treeb6d4616f165052023760cfaf08b001eff2bb73b5 /Python/executor_cases.c.h
parent15ff60aff0ca28b23c89cb1c0fc8f1f8997ed035 (diff)
downloadcpython-08e3389e8c433c16895127e8b745093f071b21b9.tar.gz
cpython-08e3389e8c433c16895127e8b745093f071b21b9.zip
GH-131798: Split up and optimize CALL_TUPLE_1 in the JIT (GH-132851)
Diffstat (limited to 'Python/executor_cases.c.h')
-rw-r--r--Python/executor_cases.c.h22
1 files changed, 13 insertions, 9 deletions
diff --git a/Python/executor_cases.c.h b/Python/executor_cases.c.h
index e5bba8ee959..978662b241a 100644
--- a/Python/executor_cases.c.h
+++ b/Python/executor_cases.c.h
@@ -5215,6 +5215,17 @@
break;
}
+ case _GUARD_CALLABLE_TUPLE_1: {
+ _PyStackRef callable;
+ callable = stack_pointer[-3];
+ PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable);
+ if (callable_o != (PyObject *)&PyTuple_Type) {
+ UOP_STAT_INC(uopcode, miss);
+ JUMP_TO_JUMP_TARGET();
+ }
+ break;
+ }
+
case _CALL_TUPLE_1: {
_PyStackRef arg;
_PyStackRef null;
@@ -5224,21 +5235,14 @@
arg = stack_pointer[-1];
null = stack_pointer[-2];
callable = stack_pointer[-3];
- PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable);
PyObject *arg_o = PyStackRef_AsPyObjectBorrow(arg);
assert(oparg == 1);
- if (!PyStackRef_IsNull(null)) {
- UOP_STAT_INC(uopcode, miss);
- JUMP_TO_JUMP_TARGET();
- }
- if (callable_o != (PyObject *)&PyTuple_Type) {
- UOP_STAT_INC(uopcode, miss);
- JUMP_TO_JUMP_TARGET();
- }
STAT_INC(CALL, hit);
_PyFrame_SetStackPointer(frame, stack_pointer);
PyObject *res_o = PySequence_Tuple(arg_o);
stack_pointer = _PyFrame_GetStackPointer(frame);
+ (void)callable;
+ (void)null;
stack_pointer += -3;
assert(WITHIN_STACK_BOUNDS());
_PyFrame_SetStackPointer(frame, stack_pointer);