GH-123040: Specialize shadowed LOAD_ATTR. (GH-123219)

This commit is contained in:
Mark Shannon 2024-08-23 10:22:35 +01:00 committed by GitHub
parent 90b6d0e0f8
commit 5d3201fe3f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 334 additions and 201 deletions

View file

@ -1936,6 +1936,7 @@ dummy_func(
LOAD_ATTR_WITH_HINT,
LOAD_ATTR_SLOT,
LOAD_ATTR_CLASS,
LOAD_ATTR_CLASS_WITH_METACLASS_CHECK,
LOAD_ATTR_PROPERTY,
LOAD_ATTR_GETATTRIBUTE_OVERRIDDEN,
LOAD_ATTR_METHOD_WITH_VALUES,
@ -2119,7 +2120,6 @@ dummy_func(
EXIT_IF(!PyType_Check(owner_o));
assert(type_version != 0);
EXIT_IF(((PyTypeObject *)owner_o)->tp_version_tag != type_version);
}
split op(_LOAD_ATTR_CLASS, (descr/4, owner -- attr, null if (oparg & 1))) {
@ -2136,6 +2136,12 @@ dummy_func(
unused/2 +
_LOAD_ATTR_CLASS;
macro(LOAD_ATTR_CLASS_WITH_METACLASS_CHECK) =
unused/1 +
_CHECK_ATTR_CLASS +
_GUARD_TYPE_VERSION +
_LOAD_ATTR_CLASS;
op(_LOAD_ATTR_PROPERTY_FRAME, (fget/4, owner -- new_frame: _PyInterpreterFrame *)) {
assert((oparg & 1) == 0);
assert(Py_IS_TYPE(fget, &PyFunction_Type));