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

Class _Block

Tools/jit/_optimizers.py:132–152  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

130
131@dataclasses.dataclass(eq=False)
132class _Block:
133 label: str | None = None
134 # Non-instruction lines like labels, directives, and comments:
135 noninstructions: list[str] = dataclasses.field(default_factory=list)
136 # Instruction lines:
137 instructions: list[Instruction] = dataclasses.field(default_factory=list)
138 # If this block ends in a jump, where to?
139 target: typing.Self | None = None
140 # The next block in the linked list:
141 link: typing.Self | None = None
142 # Whether control flow can fall through to the linked block above:
143 fallthrough: bool = True
144 # Whether this block can eventually reach the next uop (_JIT_CONTINUE):
145 hot: bool = False
146
147 def resolve(self) -> typing.Self:
148 """Find the first non-empty block reachable from this one."""
149 block = self
150 while block.link and not block.instructions:
151 block = block.link
152 return block
153
154
155@dataclasses.dataclass

Callers 2

__post_init__Method · 0.85
_lookup_labelMethod · 0.85

Calls 1

fieldMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…