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

Method _mark_hot_blocks

Tools/jit/_optimizers.py:350–357  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

348 end.link, continuation.link = continuation, end.link
349
350 def _mark_hot_blocks(self) -> None:
351 # Start with the last block, and perform a DFS to find all blocks that
352 # can eventually reach it:
353 todo = list(self._blocks())[-1:]
354 while todo:
355 block = todo.pop()
356 block.hot = True
357 todo.extend(pre for pre in self._predecessors(block) if not pre.hot)
358
359 def _invert_hot_branches(self) -> None:
360 for branch in self._blocks():

Callers 1

runMethod · 0.95

Calls 5

_blocksMethod · 0.95
_predecessorsMethod · 0.95
listClass · 0.85
popMethod · 0.45
extendMethod · 0.45

Tested by

no test coverage detected