Skip to content

Commit 2d1522d

Browse files
committed
Fix build
1 parent 09789e6 commit 2d1522d

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

Tools/jit/_targets.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@
3131

3232
ASYNCIO_RUNNER = asyncio.Runner()
3333

34+
# TODO: Read this from Tools/cases_generator/analyzer.py instead of hardcoding.
35+
_MAX_CACHED_REGISTER = 3
36+
3437
_S = typing.TypeVar("_S", _schema.COFFSection, _schema.ELFSection, _schema.MachOSection)
3538
_R = typing.TypeVar(
3639
"_R", _schema.COFFRelocation, _schema.ELFRelocation, _schema.MachORelocation
@@ -209,6 +212,9 @@ async def _build_stencils(self) -> dict[str, _stencils.StencilGroup]:
209212
tasks.append(group.create_task(coro, name="shim"))
210213
template = TOOLS_JIT_TEMPLATE_C.read_text()
211214
for case, opname in cases_and_opnames:
215+
guard = re.match(r"#if MAX_CACHED_REGISTER >= (\d+)\n", case)
216+
if guard and int(guard.group(1)) > _MAX_CACHED_REGISTER:
217+
continue
212218
# Write out a copy of the template with *only* this case
213219
# inserted. This is about twice as fast as #include'ing all
214220
# of executor_cases.c.h each time we compile (since the C

0 commit comments

Comments
 (0)