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

Class Instruction

Tools/jit/_optimizers.py:106–128  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

104
105@dataclasses.dataclass
106class Instruction:
107 kind: InstructionKind
108 name: str
109 text: str
110 target: str | None
111
112 def is_branch(self) -> bool:
113 return self.kind in (InstructionKind.LONG_BRANCH, InstructionKind.SHORT_BRANCH)
114
115 def update_target(self, target: str) -> "Instruction":
116 assert self.target is not None
117 return Instruction(
118 self.kind, self.name, self.text.replace(self.target, target), target
119 )
120
121 def update_name_and_target(self, name: str, target: str) -> "Instruction":
122 assert self.target is not None
123 return Instruction(
124 self.kind,
125 name,
126 self.text.replace(self.name, name).replace(self.target, target),
127 target,
128 )
129
130
131@dataclasses.dataclass(eq=False)

Callers 8

update_targetMethod · 0.70
_parse_instructionMethod · 0.70
_make_temp_labelMethod · 0.70
_fixup_constantsMethod · 0.70
_small_const_1Method · 0.70
_small_const_2Method · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…