summaryrefslogtreecommitdiffstats
path: root/Tools/cases_generator
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2023-10-04 15:08:02 (GMT)
committerGitHub <noreply@github.com>2023-10-04 15:08:02 (GMT)
commit7c149a76b2bf4c66bb7c8650ffb71acce12f5ea2 (patch)
tree2dde159c7c323f1ce5e4535f3ca011992541d73d /Tools/cases_generator
parentd8c00d2a607242932359b995e4637c222fcb2284 (diff)
downloadcpython-7c149a76b2bf4c66bb7c8650ffb71acce12f5ea2.zip
cpython-7c149a76b2bf4c66bb7c8650ffb71acce12f5ea2.tar.gz
cpython-7c149a76b2bf4c66bb7c8650ffb71acce12f5ea2.tar.bz2
gh-104909: Split more LOAD_ATTR specializations (GH-110317)
* Split LOAD_ATTR_MODULE * Split LOAD_ATTR_WITH_HINT * Split _GUARD_TYPE_VERSION out of the latter * Split LOAD_ATTR_CLASS * Split LOAD_ATTR_NONDESCRIPTOR_WITH_VALUES * Fix indent of DEOPT_IF in macros * Split LOAD_ATTR_METHOD_LAZY_DICT * Split LOAD_ATTR_NONDESCRIPTOR_NO_DICT * Fix omission of _CHECK_ATTR_METHOD_LAZY_DICT
Diffstat (limited to 'Tools/cases_generator')
-rw-r--r--Tools/cases_generator/instructions.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/Tools/cases_generator/instructions.py b/Tools/cases_generator/instructions.py
index 5384bbe..bd7b7df 100644
--- a/Tools/cases_generator/instructions.py
+++ b/Tools/cases_generator/instructions.py
@@ -210,12 +210,14 @@ class Instruction:
out.write_raw(f"{space}if ({cond}) goto {label};\n")
elif m := re.match(r"(\s*)DEOPT_IF\((.+)\);\s*(?://.*)?$", line):
space, cond = m.groups()
+ space = extra + space
target = family.name if family else self.name
out.write_raw(f"{space}DEOPT_IF({cond}, {target});\n")
elif "DEOPT" in line:
filename = context.owner.filename
lineno = context.owner.tokens[context.begin].line
print(f"{filename}:{lineno}: ERROR: DEOPT_IF() must be all on one line")
+ out.write_raw(extra + line)
elif m := re.match(r"(\s*)DECREF_INPUTS\(\);\s*(?://.*)?$", line):
out.reset_lineno()
space = extra + m.group(1)