aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Lib/dis.py
diff options
context:
space:
mode:
authorSam Gross <colesbury@gmail.com>2025-01-23 04:26:25 -0500
committerGitHub <noreply@github.com>2025-01-23 09:26:25 +0000
commita10f99375e7912df863cf101a38e9703cfcd72f1 (patch)
tree7909c7896fe256427c1149d2416fb7912ad3ba48 /Lib/dis.py
parentd7d066c3ab6842117f9e0fb1c9dde4bce00fa1e3 (diff)
downloadcpython-a10f99375e7912df863cf101a38e9703cfcd72f1.tar.gz
cpython-a10f99375e7912df863cf101a38e9703cfcd72f1.zip
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 'Lib/dis.py')
-rw-r--r--Lib/dis.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/Lib/dis.py b/Lib/dis.py
index 5a34e228079..109c986bbe3 100644
--- a/Lib/dis.py
+++ b/Lib/dis.py
@@ -42,9 +42,7 @@ JUMP_BACKWARD = opmap['JUMP_BACKWARD']
FOR_ITER = opmap['FOR_ITER']
SEND = opmap['SEND']
LOAD_ATTR = opmap['LOAD_ATTR']
-LOAD_METHOD = opmap['LOAD_METHOD']
LOAD_SUPER_ATTR = opmap['LOAD_SUPER_ATTR']
-LOAD_SUPER_METHOD = opmap['LOAD_SUPER_METHOD']
CALL_INTRINSIC_1 = opmap['CALL_INTRINSIC_1']
CALL_INTRINSIC_2 = opmap['CALL_INTRINSIC_2']
LOAD_COMMON_CONSTANT = opmap['LOAD_COMMON_CONSTANT']
@@ -582,14 +580,16 @@ class ArgResolver:
argval, argrepr = _get_const_info(deop, arg, self.co_consts)
elif deop in hasname:
if deop == LOAD_GLOBAL:
- argval, argrepr = _get_name_info(arg, get_name)
- elif deop == LOAD_ATTR or deop == LOAD_METHOD:
- argval, argrepr = _get_name_info(arg, get_name)
- if deop == LOAD_METHOD and argrepr:
+ argval, argrepr = _get_name_info(arg//2, get_name)
+ if (arg & 1) and argrepr:
+ argrepr = f"{argrepr} + NULL"
+ elif deop == LOAD_ATTR:
+ argval, argrepr = _get_name_info(arg//2, get_name)
+ if (arg & 1) and argrepr:
argrepr = f"{argrepr} + NULL|self"
- elif deop == LOAD_SUPER_ATTR or deop == LOAD_SUPER_METHOD:
+ elif deop == LOAD_SUPER_ATTR:
argval, argrepr = _get_name_info(arg//4, get_name)
- if deop == LOAD_SUPER_METHOD and argrepr:
+ if (arg & 1) and argrepr:
argrepr = f"{argrepr} + NULL|self"
else:
argval, argrepr = _get_name_info(arg, get_name)