mirror of
https://github.com/python/cpython.git
synced 2025-11-26 13:22:51 +00:00
GH-120507: Lower the BEFORE_WITH and BEFORE_ASYNC_WITH instructions. (#120640)
* Remove BEFORE_WITH and BEFORE_ASYNC_WITH instructions. * Add LOAD_SPECIAL instruction * Reimplement `with` and `async with` statements using LOAD_SPECIAL
This commit is contained in:
parent
73dc1c678e
commit
9cefcc0ee7
22 changed files with 663 additions and 651 deletions
16
Python/optimizer_cases.c.h
generated
16
Python/optimizer_cases.c.h
generated
|
|
@ -1368,9 +1368,19 @@
|
|||
break;
|
||||
}
|
||||
|
||||
/* _BEFORE_ASYNC_WITH is not a viable micro-op for tier 2 */
|
||||
|
||||
/* _BEFORE_WITH is not a viable micro-op for tier 2 */
|
||||
case _LOAD_SPECIAL: {
|
||||
_Py_UopsSymbol *owner;
|
||||
_Py_UopsSymbol *attr;
|
||||
_Py_UopsSymbol *self_or_null;
|
||||
owner = stack_pointer[-1];
|
||||
(void)owner;
|
||||
attr = sym_new_not_null(ctx);
|
||||
self_or_null = sym_new_unknown(ctx);
|
||||
stack_pointer[-1] = attr;
|
||||
stack_pointer[0] = self_or_null;
|
||||
stack_pointer += 1;
|
||||
break;
|
||||
}
|
||||
|
||||
case _WITH_EXCEPT_START: {
|
||||
_Py_UopsSymbol *res;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue