summaryrefslogtreecommitdiffstats
path: root/Objects/frameobject.c
diff options
context:
space:
mode:
authorSam Gross <colesbury@gmail.com>2025-01-23 09:26:25 (GMT)
committerGitHub <noreply@github.com>2025-01-23 09:26:25 (GMT)
commita10f99375e7912df863cf101a38e9703cfcd72f1 (patch)
tree7909c7896fe256427c1149d2416fb7912ad3ba48 /Objects/frameobject.c
parentd7d066c3ab6842117f9e0fb1c9dde4bce00fa1e3 (diff)
downloadcpython-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 'Objects/frameobject.c')
-rw-r--r--Objects/frameobject.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/Objects/frameobject.c b/Objects/frameobject.c
index 44b3a2a..15ec4b7 100644
--- a/Objects/frameobject.c
+++ b/Objects/frameobject.c
@@ -1261,18 +1261,27 @@ mark_stacks(PyCodeObject *code_obj, int len)
stacks[next_i] = next_stack;
break;
case LOAD_GLOBAL:
+ {
+ int j = oparg;
next_stack = push_value(next_stack, Object);
+ if (j & 1) {
+ next_stack = push_value(next_stack, Null);
+ }
stacks[next_i] = next_stack;
break;
+ }
case LOAD_ATTR:
+ {
assert(top_of_stack(next_stack) == Object);
+ int j = oparg;
+ if (j & 1) {
+ next_stack = pop_value(next_stack);
+ next_stack = push_value(next_stack, Object);
+ next_stack = push_value(next_stack, Null);
+ }
stacks[next_i] = next_stack;
break;
- case LOAD_METHOD:
- assert(top_of_stack(next_stack) == Object);
- next_stack = push_value(next_stack, Null);
- stacks[next_i] = next_stack;
- break;
+ }
case SWAP:
{
int n = oparg;