aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Python/optimizer_bytecodes.c
diff options
context:
space:
mode:
authorDiego Russo <diego.russo@arm.com>2025-05-19 15:48:55 -0400
committerGitHub <noreply@github.com>2025-05-19 15:48:55 -0400
commit42d03f393313d8a228a45dad1d0897ea99f5ec89 (patch)
treef736d4fbdff627bc2497d58a9f2103a93f467398 /Python/optimizer_bytecodes.c
parent92f85ff3a07335e32a0e00a55b7b6aaf3657019b (diff)
downloadcpython-42d03f393313d8a228a45dad1d0897ea99f5ec89.tar.gz
cpython-42d03f393313d8a228a45dad1d0897ea99f5ec89.zip
GH-131798: Split CALL_LIST_APPEND into several uops (GH-134240)
Diffstat (limited to 'Python/optimizer_bytecodes.c')
-rw-r--r--Python/optimizer_bytecodes.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/Python/optimizer_bytecodes.c b/Python/optimizer_bytecodes.c
index ad25c68e62a..708b436f6e4 100644
--- a/Python/optimizer_bytecodes.c
+++ b/Python/optimizer_bytecodes.c
@@ -1087,6 +1087,13 @@ dummy_func(void) {
sym_set_null(null);
}
+ op(_GUARD_NOS_NOT_NULL, (nos, unused -- nos, unused)) {
+ if (sym_is_not_null(nos)) {
+ REPLACE_OP(this_instr, _NOP, 0, 0);
+ }
+ sym_set_non_null(nos);
+ }
+
op(_GUARD_THIRD_NULL, (null, unused, unused -- null, unused, unused)) {
if (sym_is_null(null)) {
REPLACE_OP(this_instr, _NOP, 0, 0);
@@ -1135,6 +1142,14 @@ dummy_func(void) {
sym_set_const(callable, isinstance);
}
+ op(_GUARD_CALLABLE_LIST_APPEND, (callable, unused, unused -- callable, unused, unused)) {
+ PyObject *list_append = _PyInterpreterState_GET()->callable_cache.list_append;
+ if (sym_get_const(ctx, callable) == list_append) {
+ REPLACE_OP(this_instr, _NOP, 0, 0);
+ }
+ sym_set_const(callable, list_append);
+ }
+
// END BYTECODES //
}