mirror of
https://github.com/python/cpython.git
synced 2025-12-31 04:23:37 +00:00
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
This commit is contained in:
parent
d8c00d2a60
commit
7c149a76b2
6 changed files with 598 additions and 219 deletions
|
|
@ -210,12 +210,14 @@ def write_body(
|
|||
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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue