Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 17dab2e

Browse filesBrowse files
authored
GH-113464: Clean up JIT stencil generation (GH-115800)
1 parent 465df88 commit 17dab2e
Copy full SHA for 17dab2e

File tree

Expand file treeCollapse file tree

1 file changed

+5
-6
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+5
-6
lines changed

‎Tools/jit/_targets.py

Copy file name to clipboardExpand all lines: Tools/jit/_targets.py
+5-6Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,7 @@ class _Target(typing.Generic[_S, _R]):
4545
def _compute_digest(self, out: pathlib.Path) -> str:
4646
hasher = hashlib.sha256()
4747
hasher.update(self.triple.encode())
48-
hasher.update(self.alignment.to_bytes())
49-
hasher.update(self.prefix.encode())
48+
hasher.update(self.debug.to_bytes())
5049
# These dependencies are also reflected in _JITSources in regen.targets:
5150
hasher.update(PYTHON_EXECUTOR_CASES_C_H.read_bytes())
5251
hasher.update((out / "pyconfig.h").read_bytes())
@@ -119,6 +118,7 @@ async def _compile(
119118
"-O3",
120119
"-c",
121120
"-fno-asynchronous-unwind-tables",
121+
"-fno-builtin",
122122
# SET_FUNCTION_ATTRIBUTE on 32-bit Windows debug builds:
123123
"-fno-jump-tables",
124124
# Position-independent code adds indirection to every load and jump:
@@ -166,7 +166,7 @@ def build(self, out: pathlib.Path, *, comment: str = "") -> None:
166166
with jit_stencils.open("w") as file:
167167
file.write(digest)
168168
if comment:
169-
file.write(f"// {comment}\n")
169+
file.write(f"// {comment}\n\n")
170170
file.write("")
171171
for line in _writer.dump(stencil_groups):
172172
file.write(f"{line}\n")
@@ -310,6 +310,8 @@ def _handle_section(
310310
flags = {flag["Name"] for flag in section["Attributes"]["Flags"]}
311311
name = section["Name"]["Value"]
312312
name = name.removeprefix(self.prefix)
313+
if "Debug" in flags:
314+
return
313315
if "SomeInstructions" in flags:
314316
value = _stencils.HoleValue.CODE
315317
stencil = group.code
@@ -371,9 +373,6 @@ def _handle_relocation(
371373
addend = 0
372374
case _:
373375
raise NotImplementedError(relocation)
374-
# Turn Clang's weird __bzero calls into normal bzero calls:
375-
if symbol == "__bzero":
376-
symbol = "bzero"
377376
return _stencils.Hole(offset, kind, value, symbol, addend)
378377

379378

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.