mirror of
https://github.com/python/cpython.git
synced 2025-07-08 03:45:36 +00:00
GH-131798: Optimize cached class attributes and methods in the JIT (GH-134403)
This commit is contained in:
parent
09e72cf091
commit
ec736e7dae
12 changed files with 365 additions and 130 deletions
30
Python/executor_cases.c.h
generated
30
Python/executor_cases.c.h
generated
|
@ -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));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue