From 9cefcc0ee781a1bef9e0685c2271237005fb488b Mon Sep 17 00:00:00 2001 From: Mark Shannon Date: Tue, 18 Jun 2024 12:17:46 +0100 Subject: 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 --- Python/optimizer_bytecodes.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'Python/optimizer_bytecodes.c') diff --git a/Python/optimizer_bytecodes.c b/Python/optimizer_bytecodes.c index 121ca928fed..35463f25246 100644 --- a/Python/optimizer_bytecodes.c +++ b/Python/optimizer_bytecodes.c @@ -774,6 +774,12 @@ dummy_func(void) { } } + op(_LOAD_SPECIAL, (owner -- attr, self_or_null)) { + (void)owner; + attr = sym_new_not_null(ctx); + self_or_null = sym_new_unknown(ctx); + } + op(_JUMP_TO_TOP, (--)) { ctx->done = true; } @@ -782,7 +788,6 @@ dummy_func(void) { ctx->done = true; } - // END BYTECODES // } -- cgit v1.2.3