aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Python/optimizer_bytecodes.c
diff options
context:
space:
mode:
authorMark Shannon <mark@hotpy.org>2024-06-18 12:17:46 +0100
committerGitHub <noreply@github.com>2024-06-18 12:17:46 +0100
commit9cefcc0ee781a1bef9e0685c2271237005fb488b (patch)
tree7c02067f4e021d90ec4fd850d9a06315b8fc39ab /Python/optimizer_bytecodes.c
parent73dc1c678eb720c2ced94d2f435a908bb6d18566 (diff)
downloadcpython-9cefcc0ee781a1bef9e0685c2271237005fb488b.tar.gz
cpython-9cefcc0ee781a1bef9e0685c2271237005fb488b.zip
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_bytecodes.c')
-rw-r--r--Python/optimizer_bytecodes.c7
1 files changed, 6 insertions, 1 deletions
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 //
}