]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-128195: Add `_REPLACE_WITH_TRUE` to the tier2 optimizer (GH-128203)
authorYan Yanchii <yyanchiy@gmail.com>
Mon, 23 Dec 2024 21:17:47 +0000 (22:17 +0100)
committerGitHub <noreply@github.com>
Mon, 23 Dec 2024 21:17:47 +0000 (05:17 +0800)
Add `_REPLACE_WITH_TRUE` to the tier2 optimizer

Python/optimizer_bytecodes.c
Python/optimizer_cases.c.h

index e60c0d38425bfe5536fff10ba7f4b97d1c36b0a0..a14d119b7a1dece0d352cd382edb36c84c9a1830 100644 (file)
@@ -899,6 +899,10 @@ dummy_func(void) {
         (void)version;
     }
 
+    op(_REPLACE_WITH_TRUE, (value -- res)) {
+        res = sym_new_const(ctx, Py_True);
+    }
+
 // END BYTECODES //
 
 }
index b46079ec8a19921d29a0d82f8a124865e2bd6f44..0fcf5e18ed580854e84fea1ea0baca0b82aab84c 100644 (file)
 
         case _REPLACE_WITH_TRUE: {
             _Py_UopsSymbol *res;
-            res = sym_new_not_null(ctx);
+            res = sym_new_const(ctx, Py_True);
             stack_pointer[-1] = res;
             break;
         }