gh-115999: Specialize LOAD_ATTR for instance and class receivers in free-threaded builds (#128164)

Finish specialization for LOAD_ATTR in the free-threaded build by adding support for class and instance receivers.
This commit is contained in:
mpage 2025-01-14 11:56:11 -08:00 committed by GitHub
parent 1c13c56a34
commit b5ee0258bf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
18 changed files with 619 additions and 271 deletions

View file

@ -1250,22 +1250,33 @@
}
case _CHECK_ATTR_WITH_HINT: {
_Py_UopsSymbol *owner;
_Py_UopsSymbol *dict;
owner = stack_pointer[-1];
dict = sym_new_not_null(ctx);
(void)owner;
stack_pointer[0] = dict;
stack_pointer += 1;
assert(WITHIN_STACK_BOUNDS());
break;
}
case _LOAD_ATTR_WITH_HINT: {
_Py_UopsSymbol *dict;
_Py_UopsSymbol *owner;
_Py_UopsSymbol *attr;
_Py_UopsSymbol *null = NULL;
owner = stack_pointer[-1];
dict = stack_pointer[-1];
owner = stack_pointer[-2];
uint16_t hint = (uint16_t)this_instr->operand0;
attr = sym_new_not_null(ctx);
null = sym_new_null(ctx);
(void)hint;
(void)owner;
stack_pointer[-1] = attr;
if (oparg & 1) stack_pointer[0] = null;
stack_pointer += (oparg & 1);
(void)dict;
stack_pointer[-2] = attr;
if (oparg & 1) stack_pointer[-1] = null;
stack_pointer += -1 + (oparg & 1);
assert(WITHIN_STACK_BOUNDS());
break;
}