Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5e229ed

Browse files
committed
Consider target when caching the JIT stencils
1 parent c518c09 commit 5e229ed

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

Tools/jit/build.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -275,10 +275,10 @@ def _process_relocations(self, stencil: Stencil, group: StencilGroup) -> None:
275275
stencil.holes.append(hole)
276276

277277
def _handle_section(self, section: _S, group: StencilGroup) -> None:
278-
raise NotImplementedError()
278+
raise NotImplementedError(type(self))
279279

280280
def _handle_relocation(self, base: int, relocation: _R, raw: bytes) -> Hole:
281-
raise NotImplementedError()
281+
raise NotImplementedError(type(self))
282282

283283
async def _compile(
284284
self, opname: str, c: pathlib.Path, tempdir: pathlib.Path
@@ -306,10 +306,10 @@ async def _compile(
306306
# Don't make calls to weird stack-smashing canaries:
307307
"-fno-stack-protector",
308308
# We have three options for code model:
309-
# - "small": the default, assumes that code and data reside in the lowest
310-
# 2GB of memory (128MB on aarch64)
311-
# - "medium": assumes that code resides in the lowest 2GB of memory, and
312-
# makes no assumptions about data (not available on aarch64)
309+
# - "small": the default, assumes that code and data reside in the
310+
# lowest 2GB of memory (128MB on aarch64)
311+
# - "medium": assumes that code resides in the lowest 2GB of memory,
312+
# and makes no assumptions about data (not available on aarch64)
313313
# - "large": makes no assumptions about either code or data
314314
"-mcmodel=large",
315315
]
@@ -332,6 +332,7 @@ async def build_stencils(self) -> dict[str, StencilGroup]:
332332
def build(self, out: pathlib.Path) -> None:
333333
jit_stencils = out / "jit_stencils.h"
334334
hasher = hashlib.sha256()
335+
hasher.update(self.sha256())
335336
hasher.update(PYTHON_EXECUTOR_CASES_C_H.read_bytes())
336337
hasher.update((out / "pyconfig.h").read_bytes())
337338
for dirpath, _, filenames in sorted(os.walk(TOOLS_JIT)):

0 commit comments

Comments
 (0)