GH-128914: Remove conditional stack effects from bytecodes.c and the code generators (GH-128918)

This commit is contained in:
Mark Shannon 2025-01-20 17:09:23 +00:00 committed by GitHub
parent 0a6412f9cc
commit ab61d3f430
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
44 changed files with 1460 additions and 1679 deletions

View file

@ -246,7 +246,7 @@ class Emitter:
if var.name == "null":
continue
close = "PyStackRef_CLOSE"
if "null" in var.name or var.condition and var.condition != "1":
if "null" in var.name:
close = "PyStackRef_XCLOSE"
if var.size:
if var.size == "1":
@ -255,9 +255,6 @@ class Emitter:
self.out.emit(f"for (int _i = {var.size}; --_i >= 0;) {{\n")
self.out.emit(f"{close}({var.name}[_i]);\n")
self.out.emit("}\n")
elif var.condition:
if var.condition != "0":
self.out.emit(f"{close}({var.name});\n")
else:
self.out.emit(f"{close}({var.name});\n")
for input in storage.inputs:
@ -668,8 +665,6 @@ def cflags(p: Properties) -> str:
flags.append("HAS_PURE_FLAG")
if p.no_save_ip:
flags.append("HAS_NO_SAVE_IP_FLAG")
if p.oparg_and_1:
flags.append("HAS_OPARG_AND_1_FLAG")
if flags:
return " | ".join(flags)
else: