Skip to content

Commit a49df65

Browse files
committed
Reset changes
1 parent 0488f6d commit a49df65

3 files changed

Lines changed: 35 additions & 33 deletions

File tree

Tools/jit/_llvm.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ def _async_cache(f: _C[_P, _R]) -> _C[_P, _R]:
2424
lock = asyncio.Lock()
2525

2626
@functools.wraps(f)
27-
async def wrapper(*args: _P.args, **kwargs: _P.kwargs) -> _R: # pylint: disable = no-member
27+
async def wrapper(
28+
*args: _P.args, **kwargs: _P.kwargs # pylint: disable = no-member
29+
) -> _R:
2830
async with lock:
2931
if args not in cache:
3032
cache[args] = await f(*args, **kwargs)

Tools/jit/_stencils.py

Lines changed: 23 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -230,41 +230,35 @@ def remove_jump(self) -> None:
230230
"""Remove a zero-length continuation jump, if it exists."""
231231
hole = max(self.holes, key=lambda hole: hole.offset)
232232
match hole:
233-
case (
234-
Hole(
235-
offset=offset,
236-
kind="IMAGE_REL_AMD64_REL32",
237-
value=HoleValue.GOT,
238-
symbol="_JIT_CONTINUE",
239-
addend=-4,
240-
) as hole
241-
):
233+
case Hole(
234+
offset=offset,
235+
kind="IMAGE_REL_AMD64_REL32",
236+
value=HoleValue.GOT,
237+
symbol="_JIT_CONTINUE",
238+
addend=-4,
239+
) as hole:
242240
# jmp qword ptr [rip]
243241
jump = b"\x48\xff\x25\x00\x00\x00\x00"
244242
offset -= 3
245-
case (
246-
Hole(
247-
offset=offset,
248-
kind="IMAGE_REL_I386_REL32"
249-
| "R_X86_64_PLT32"
250-
| "X86_64_RELOC_BRANCH",
251-
value=HoleValue.CONTINUE,
252-
symbol=None,
253-
addend=addend,
254-
) as hole
255-
) if _signed(addend) == -4:
243+
case Hole(
244+
offset=offset,
245+
kind="IMAGE_REL_I386_REL32" | "R_X86_64_PLT32" | "X86_64_RELOC_BRANCH",
246+
value=HoleValue.CONTINUE,
247+
symbol=None,
248+
addend=addend,
249+
) as hole if (
250+
_signed(addend) == -4
251+
):
256252
# jmp 5
257253
jump = b"\xe9\x00\x00\x00\x00"
258254
offset -= 1
259-
case (
260-
Hole(
261-
offset=offset,
262-
kind="R_AARCH64_JUMP26",
263-
value=HoleValue.CONTINUE,
264-
symbol=None,
265-
addend=0,
266-
) as hole
267-
):
255+
case Hole(
256+
offset=offset,
257+
kind="R_AARCH64_JUMP26",
258+
value=HoleValue.CONTINUE,
259+
symbol=None,
260+
addend=0,
261+
) as hole:
268262
# b #4
269263
jump = b"\x00\x00\x00\x14"
270264
case _:

Tools/jit/_targets.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,9 @@ def build(
233233
jit_stencils_new.unlink(missing_ok=True)
234234

235235

236-
class _COFF(_Target[_schema.COFFSection, _schema.COFFRelocation]): # pylint: disable = too-few-public-methods
236+
class _COFF(
237+
_Target[_schema.COFFSection, _schema.COFFRelocation]
238+
): # pylint: disable = too-few-public-methods
237239
def _handle_section(
238240
self, section: _schema.COFFSection, group: _stencils.StencilGroup
239241
) -> None:
@@ -319,7 +321,9 @@ def _handle_relocation(
319321
return _stencils.Hole(offset, kind, value, symbol, addend)
320322

321323

322-
class _ELF(_Target[_schema.ELFSection, _schema.ELFRelocation]): # pylint: disable = too-few-public-methods
324+
class _ELF(
325+
_Target[_schema.ELFSection, _schema.ELFRelocation]
326+
): # pylint: disable = too-few-public-methods
323327
def _handle_section(
324328
self, section: _schema.ELFSection, group: _stencils.StencilGroup
325329
) -> None:
@@ -407,7 +411,9 @@ def _handle_relocation(
407411
return _stencils.Hole(offset, kind, value, symbol, addend)
408412

409413

410-
class _MachO(_Target[_schema.MachOSection, _schema.MachORelocation]): # pylint: disable = too-few-public-methods
414+
class _MachO(
415+
_Target[_schema.MachOSection, _schema.MachORelocation]
416+
): # pylint: disable = too-few-public-methods
411417
def _handle_section(
412418
self, section: _schema.MachOSection, group: _stencils.StencilGroup
413419
) -> None:

0 commit comments

Comments
 (0)