mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
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:
parent
d7d066c3ab
commit
a10f99375e
44 changed files with 1679 additions and 1460 deletions
|
@ -247,7 +247,7 @@ class Emitter:
|
|||
if var.name == "null":
|
||||
continue
|
||||
close = "PyStackRef_CLOSE"
|
||||
if "null" in var.name:
|
||||
if "null" in var.name or var.condition and var.condition != "1":
|
||||
close = "PyStackRef_XCLOSE"
|
||||
if var.size:
|
||||
if var.size == "1":
|
||||
|
@ -256,6 +256,9 @@ 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:
|
||||
|
@ -683,6 +686,8 @@ 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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue