diff options
author | Brandt Bucher <brandtbucher@microsoft.com> | 2025-05-22 11:15:03 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-05-22 11:15:03 -0400 |
commit | ec736e7daec33cb3383865895d7ab92d4ada8bc9 (patch) | |
tree | 18b8894a74a83c08eb1da2e8cd1b71eccd95025a /Python/executor_cases.c.h | |
parent | 09e72cf091d03479eddcb3c4526f5c6af56d31a0 (diff) | |
download | cpython-ec736e7daec33cb3383865895d7ab92d4ada8bc9.tar.gz cpython-ec736e7daec33cb3383865895d7ab92d4ada8bc9.zip |
GH-131798: Optimize cached class attributes and methods in the JIT (GH-134403)
Diffstat (limited to 'Python/executor_cases.c.h')
-rw-r--r-- | Python/executor_cases.c.h | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/Python/executor_cases.c.h b/Python/executor_cases.c.h index 1c8239f38ee..fcde31a3012 100644 --- a/Python/executor_cases.c.h +++ b/Python/executor_cases.c.h @@ -7105,6 +7105,36 @@ break; } + case _LOAD_CONST_UNDER_INLINE: { + _PyStackRef old; + _PyStackRef value; + _PyStackRef new; + old = stack_pointer[-1]; + PyObject *ptr = (PyObject *)CURRENT_OPERAND0(); + new = old; + value = PyStackRef_FromPyObjectNew(ptr); + stack_pointer[-1] = value; + stack_pointer[0] = new; + stack_pointer += 1; + assert(WITHIN_STACK_BOUNDS()); + break; + } + + case _LOAD_CONST_UNDER_INLINE_BORROW: { + _PyStackRef old; + _PyStackRef value; + _PyStackRef new; + old = stack_pointer[-1]; + PyObject *ptr = (PyObject *)CURRENT_OPERAND0(); + new = old; + value = PyStackRef_FromPyObjectBorrow(ptr); + stack_pointer[-1] = value; + stack_pointer[0] = new; + stack_pointer += 1; + assert(WITHIN_STACK_BOUNDS()); + break; + } + case _CHECK_FUNCTION: { uint32_t func_version = (uint32_t)CURRENT_OPERAND0(); assert(PyStackRef_FunctionCheck(frame->f_funcobj)); |