GH-93911: Specialize LOAD_ATTR for custom __getattribute__ (GH-93988)

This commit is contained in:
Ken Jin 2022-08-17 19:37:07 +08:00 committed by GitHub
parent 36517101dd
commit 7276ca25f5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 219 additions and 86 deletions

View file

@ -787,6 +787,9 @@ pycore_init_builtins(PyThreadState *tstate)
PyObject *list_append = _PyType_Lookup(&PyList_Type, &_Py_ID(append));
assert(list_append);
interp->callable_cache.list_append = list_append;
PyObject *object__getattribute__ = _PyType_Lookup(&PyBaseObject_Type, &_Py_ID(__getattribute__));
assert(object__getattribute__);
interp->callable_cache.object__getattribute__ = object__getattribute__;
if (_PyBuiltins_AddExceptions(bimod) < 0) {
return _PyStatus_ERR("failed to add exceptions to builtins");