summaryrefslogtreecommitdiffstats
path: root/Python/bytecodes.c
diff options
context:
space:
mode:
authorTomas R. <tomas.roun8@gmail.com>2025-04-24 19:54:46 (GMT)
committerGitHub <noreply@github.com>2025-04-24 19:54:46 (GMT)
commit0a387b311e617a9a614c593551d3c04a37331e53 (patch)
tree825bd410f95ff8a77fb138188014fb5b2e0d8be3 /Python/bytecodes.c
parentc7a7aa9a57c25ef2666f7dbf62edab882747af6b (diff)
downloadcpython-0a387b311e617a9a614c593551d3c04a37331e53.zip
cpython-0a387b311e617a9a614c593551d3c04a37331e53.tar.gz
cpython-0a387b311e617a9a614c593551d3c04a37331e53.tar.bz2
GH-131798: Split up and optimize CALL_STR_1 in the JIT (GH-132849)
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 e988e06..2ad1b32 100644
--- a/Python/bytecodes.c
+++ b/Python/bytecodes.c
@@ -3995,17 +3995,21 @@ dummy_func(
_GUARD_CALLABLE_TYPE_1 +
_CALL_TYPE_1;
- op(_CALL_STR_1, (callable, null, arg -- res)) {
+ op(_GUARD_CALLABLE_STR_1, (callable, unused, unused -- callable, unused, unused)) {
PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable);
+ DEOPT_IF(callable_o != (PyObject *)&PyUnicode_Type);
+ }
+
+ op(_CALL_STR_1, (callable, null, arg -- res)) {
PyObject *arg_o = PyStackRef_AsPyObjectBorrow(arg);
assert(oparg == 1);
- DEOPT_IF(!PyStackRef_IsNull(null));
- DEOPT_IF(callable_o != (PyObject *)&PyUnicode_Type);
STAT_INC(CALL, hit);
PyObject *res_o = PyObject_Str(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);
@@ -4014,6 +4018,8 @@ dummy_func(
macro(CALL_STR_1) =
unused/1 +
unused/2 +
+ _GUARD_NOS_NULL +
+ _GUARD_CALLABLE_STR_1 +
_CALL_STR_1 +
_CHECK_PERIODIC;