MCPcopy Index your code
hub / github.com/python/cpython / convert_labels_to_relocations

Method convert_labels_to_relocations

Tools/jit/_stencils.py:240–249  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

238 _got_entries: set[int] = dataclasses.field(default_factory=set, init=False)
239
240 def convert_labels_to_relocations(self) -> None:
241 for name, hole_plus in self.symbols.items():
242 if isinstance(name, str) and "_JIT_RELOCATION_" in name:
243 _, offset = hole_plus
244 reloc, target, _ = name.split("_JIT_RELOCATION_")
245 value, symbol = symbol_to_value(target)
246 hole = Hole(
247 int(offset), typing.cast(_schema.HoleKind, reloc), value, symbol, 0
248 )
249 self.code.holes.append(hole)
250
251 def process_relocations(self, known_symbols: dict[str, int]) -> None:
252 """Fix up all GOT and internal relocations for this stencil group."""

Callers 1

_build_stencilsMethod · 0.80

Calls 6

symbol_to_valueFunction · 0.85
HoleClass · 0.85
castMethod · 0.80
itemsMethod · 0.45
splitMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected