GH-131798: Optimize cached class attributes and methods in the JIT (GH-134403)

This commit is contained in:
Brandt Bucher 2025-05-22 11:15:03 -04:00 committed by GitHub
parent 09e72cf091
commit ec736e7dae
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 365 additions and 130 deletions

View file

@ -5307,6 +5307,18 @@ dummy_func(
value = PyStackRef_FromPyObjectBorrow(ptr);
}
tier2 op(_LOAD_CONST_UNDER_INLINE, (ptr/4, old -- value, new)) {
new = old;
DEAD(old);
value = PyStackRef_FromPyObjectNew(ptr);
}
tier2 op(_LOAD_CONST_UNDER_INLINE_BORROW, (ptr/4, old -- value, new)) {
new = old;
DEAD(old);
value = PyStackRef_FromPyObjectBorrow(ptr);
}
tier2 op(_CHECK_FUNCTION, (func_version/2 -- )) {
assert(PyStackRef_FunctionCheck(frame->f_funcobj));
PyFunctionObject *func = (PyFunctionObject *)PyStackRef_AsPyObjectBorrow(frame->f_funcobj);