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:
Mark Shannon 2024-06-18 12:17:46 +01:00 committed by GitHub
parent 73dc1c678e
commit 9cefcc0ee7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
22 changed files with 663 additions and 651 deletions

View file

@ -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;