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 ab61d3f430.
This commit is contained in:
Sam Gross 2025-01-23 04:26:25 -05:00 committed by GitHub
parent d7d066c3ab
commit a10f99375e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
44 changed files with 1679 additions and 1460 deletions

View file

@ -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)