diff options
| author | Mark Shannon <mark@hotpy.org> | 2024-06-18 11:17:46 (GMT) |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-06-18 11:17:46 (GMT) |
| commit | 9cefcc0ee781a1bef9e0685c2271237005fb488b (patch) | |
| tree | 7c02067f4e021d90ec4fd850d9a06315b8fc39ab /Python/optimizer_cases.c.h | |
| parent | 73dc1c678eb720c2ced94d2f435a908bb6d18566 (diff) | |
| download | cpython-9cefcc0ee781a1bef9e0685c2271237005fb488b.zip cpython-9cefcc0ee781a1bef9e0685c2271237005fb488b.tar.gz cpython-9cefcc0ee781a1bef9e0685c2271237005fb488b.tar.bz2 | |
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
Diffstat (limited to 'Python/optimizer_cases.c.h')
| -rw-r--r-- | Python/optimizer_cases.c.h | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/Python/optimizer_cases.c.h b/Python/optimizer_cases.c.h index 53959a3..4650186 100644 --- a/Python/optimizer_cases.c.h +++ b/Python/optimizer_cases.c.h @@ -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; |
