diff options
author | Savannah Ostrowski <savannahostrowski@gmail.com> | 2025-03-21 18:23:12 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-03-21 18:23:12 (GMT) |
commit | b92ee14b80cc8898f799aa8120ec99dd0c882339 (patch) | |
tree | a32440d8906db0dc9393983205d43b3cfb4eef41 /Python/bytecodes.c | |
parent | 0de5e0c5442abddbe17481ef450e4abc992058f5 (diff) | |
download | cpython-b92ee14b80cc8898f799aa8120ec99dd0c882339.zip cpython-b92ee14b80cc8898f799aa8120ec99dd0c882339.tar.gz cpython-b92ee14b80cc8898f799aa8120ec99dd0c882339.tar.bz2 |
GH-130415: Optimize constant comparison in JIT builds (GH-131489)
Diffstat (limited to 'Python/bytecodes.c')
-rw-r--r-- | Python/bytecodes.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Python/bytecodes.c b/Python/bytecodes.c index cdd4d5b..fe1465b 100644 --- a/Python/bytecodes.c +++ b/Python/bytecodes.c @@ -5133,6 +5133,12 @@ dummy_func( value = PyStackRef_FromPyObjectImmortal(ptr); } + tier2 pure op(_POP_TWO_LOAD_CONST_INLINE_BORROW, (ptr/4, pop1, pop2 -- value)) { + PyStackRef_CLOSE(pop2); + PyStackRef_CLOSE(pop1); + value = PyStackRef_FromPyObjectImmortal(ptr); + } + tier2 op(_CHECK_FUNCTION, (func_version/2 -- )) { assert(PyStackRef_FunctionCheck(frame->f_funcobj)); PyFunctionObject *func = (PyFunctionObject *)PyStackRef_AsPyObjectBorrow(frame->f_funcobj); |