summaryrefslogtreecommitdiffstats
path: root/Python/bytecodes.c
diff options
context:
space:
mode:
authorTomas R. <tomas.roun8@gmail.com>2025-04-22 16:30:38 (GMT)
committerGitHub <noreply@github.com>2025-04-22 16:30:38 (GMT)
commita6a3dbb7db0516a72c5ef149223d904f4e6a31ae (patch)
tree99b48ba60bf96d77b062d01966341f4a30c15be9 /Python/bytecodes.c
parent87b1ea016b1454b1e83b9113fa9435849b7743aa (diff)
downloadcpython-a6a3dbb7db0516a72c5ef149223d904f4e6a31ae.zip
cpython-a6a3dbb7db0516a72c5ef149223d904f4e6a31ae.tar.gz
cpython-a6a3dbb7db0516a72c5ef149223d904f4e6a31ae.tar.bz2
GH-131798: JIT: Split CALL_TYPE_1 into several uops (GH-132419)
Diffstat (limited to 'Python/bytecodes.c')
-rw-r--r--Python/bytecodes.c21
1 files changed, 18 insertions, 3 deletions
diff --git a/Python/bytecodes.c b/Python/bytecodes.c
index ad82e0b..e988e06 100644
--- a/Python/bytecodes.c
+++ b/Python/bytecodes.c
@@ -3966,20 +3966,35 @@ dummy_func(
_SAVE_RETURN_OFFSET +
_PUSH_FRAME;
- inst(CALL_TYPE_1, (unused/1, unused/2, callable, null, arg -- res)) {
+ op(_GUARD_NOS_NULL, (null, unused -- null, unused)) {
+ DEOPT_IF(!PyStackRef_IsNull(null));
+ }
+
+ op(_GUARD_CALLABLE_TYPE_1, (callable, unused, unused -- callable, unused, unused)) {
PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable);
+ DEOPT_IF(callable_o != (PyObject *)&PyType_Type);
+ }
+
+ op(_CALL_TYPE_1, (callable, null, arg -- res)) {
PyObject *arg_o = PyStackRef_AsPyObjectBorrow(arg);
assert(oparg == 1);
- DEOPT_IF(!PyStackRef_IsNull(null));
DEAD(null);
- DEOPT_IF(callable_o != (PyObject *)&PyType_Type);
DEAD(callable);
+ (void)callable; // Silence compiler warnings about unused variables
+ (void)null;
STAT_INC(CALL, hit);
res = PyStackRef_FromPyObjectNew(Py_TYPE(arg_o));
PyStackRef_CLOSE(arg);
}
+ macro(CALL_TYPE_1) =
+ unused/1 +
+ unused/2 +
+ _GUARD_NOS_NULL +
+ _GUARD_CALLABLE_TYPE_1 +
+ _CALL_TYPE_1;
+
op(_CALL_STR_1, (callable, null, arg -- res)) {
PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable);
PyObject *arg_o = PyStackRef_AsPyObjectBorrow(arg);