mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
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:
parent
1c13c56a34
commit
b5ee0258bf
18 changed files with 619 additions and 271 deletions
19
Python/optimizer_cases.c.h
generated
19
Python/optimizer_cases.c.h
generated
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue