diff options
author | Sam Gross <colesbury@gmail.com> | 2025-01-23 09:26:25 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-01-23 09:26:25 (GMT) |
commit | a10f99375e7912df863cf101a38e9703cfcd72f1 (patch) | |
tree | 7909c7896fe256427c1149d2416fb7912ad3ba48 /Python/optimizer_bytecodes.c | |
parent | d7d066c3ab6842117f9e0fb1c9dde4bce00fa1e3 (diff) | |
download | cpython-a10f99375e7912df863cf101a38e9703cfcd72f1.zip cpython-a10f99375e7912df863cf101a38e9703cfcd72f1.tar.gz cpython-a10f99375e7912df863cf101a38e9703cfcd72f1.tar.bz2 |
Revert "GH-128914: Remove conditional stack effects from `bytecodes.c` and the code generators (GH-128918)" (GH-129202)
The commit introduced a ~2.5-3% regression in the free threading build.
This reverts commit ab61d3f4303d14a413bc9ae6557c730ffdf7579e.
Diffstat (limited to 'Python/optimizer_bytecodes.c')
-rw-r--r-- | Python/optimizer_bytecodes.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/Python/optimizer_bytecodes.c b/Python/optimizer_bytecodes.c index af834b6..881a607 100644 --- a/Python/optimizer_bytecodes.c +++ b/Python/optimizer_bytecodes.c @@ -528,8 +528,9 @@ dummy_func(void) { top_out = top_in; } - op(_LOAD_ATTR_INSTANCE_VALUE, (offset/1, owner -- attr)) { + op(_LOAD_ATTR_INSTANCE_VALUE, (offset/1, owner -- attr, null if (oparg & 1))) { attr = sym_new_not_null(ctx); + null = sym_new_null(ctx); (void)offset; (void)owner; } @@ -552,19 +553,15 @@ dummy_func(void) { } } - op(_LOAD_ATTR, (owner -- attr)) { - (void)owner; - attr = sym_new_not_null(ctx); - } - - op(_LOAD_METHOD, (owner -- attr, self_or_null)) { + op(_LOAD_ATTR, (owner -- attr, self_or_null if (oparg & 1))) { (void)owner; attr = sym_new_not_null(ctx); self_or_null = sym_new_unknown(ctx); } - op(_LOAD_ATTR_MODULE_FROM_KEYS, (index/1, owner, mod_keys -- attr)) { + op(_LOAD_ATTR_MODULE_FROM_KEYS, (index/1, owner, mod_keys -- attr, null if (oparg & 1))) { (void)index; + null = sym_new_null(ctx); attr = NULL; if (this_instr[-1].opcode == _NOP) { // Preceding _CHECK_ATTR_MODULE_PUSH_KEYS was removed: mod is const and dict is watched. @@ -592,38 +589,41 @@ dummy_func(void) { (void)owner; } - op(_LOAD_ATTR_WITH_HINT, (hint/1, owner, dict -- attr)) { + op(_LOAD_ATTR_WITH_HINT, (hint/1, owner, dict -- attr, null if (oparg & 1))) { attr = sym_new_not_null(ctx); + null = sym_new_null(ctx); (void)hint; (void)owner; (void)dict; } - op(_LOAD_ATTR_SLOT, (index/1, owner -- attr)) { + op(_LOAD_ATTR_SLOT, (index/1, owner -- attr, null if (oparg & 1))) { attr = sym_new_not_null(ctx); + null = sym_new_null(ctx); (void)index; (void)owner; } - op(_LOAD_ATTR_CLASS, (descr/4, owner -- attr)) { + op(_LOAD_ATTR_CLASS, (descr/4, owner -- attr, null if (oparg & 1))) { attr = sym_new_not_null(ctx); + null = sym_new_null(ctx); (void)descr; (void)owner; } - op(_LOAD_METHOD_WITH_VALUES, (descr/4, owner -- attr, self)) { + op(_LOAD_ATTR_METHOD_WITH_VALUES, (descr/4, owner -- attr, self if (1))) { (void)descr; attr = sym_new_not_null(ctx); self = owner; } - op(_LOAD_METHOD_NO_DICT, (descr/4, owner -- attr, self)) { + op(_LOAD_ATTR_METHOD_NO_DICT, (descr/4, owner -- attr, self if (1))) { (void)descr; attr = sym_new_not_null(ctx); self = owner; } - op(_LOAD_METHOD_LAZY_DICT, (descr/4, owner -- attr, self)) { + op(_LOAD_ATTR_METHOD_LAZY_DICT, (descr/4, owner -- attr, self if (1))) { (void)descr; attr = sym_new_not_null(ctx); self = owner; @@ -819,7 +819,7 @@ dummy_func(void) { Py_UNREACHABLE(); } - op(_PUSH_FRAME, (new_frame: _Py_UOpsAbstractFrame * -- )) { + op(_PUSH_FRAME, (new_frame: _Py_UOpsAbstractFrame * -- unused if (0))) { SYNC_SP(); ctx->frame->stack_pointer = stack_pointer; ctx->frame = new_frame; |