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

Class Instruction

Tools/cases_generator/analyzer.py:266–299  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

264
265@dataclass
266class Instruction:
267 where: lexer.Token
268 name: str
269 parts: list[Part]
270 _properties: Properties | None
271 is_target: bool = False
272 family: Optional["Family"] = None
273 opcode: int = -1
274
275 @property
276 def properties(self) -> Properties:
277 if self._properties is None:
278 self._properties = self._compute_properties()
279 return self._properties
280
281 def _compute_properties(self) -> Properties:
282 return Properties.from_list([part.properties for part in self.parts])
283
284 def dump(self, indent: str) -> None:
285 print(indent, self.name, "=", ", ".join([part.name for part in self.parts]))
286 self.properties.dump(" " + indent)
287
288 @property
289 def size(self) -> int:
290 return 1 + sum(part.size for part in self.parts)
291
292 def is_super(self) -> bool:
293 if len(self.parts) != 1:
294 return False
295 uop = self.parts[0]
296 if isinstance(uop, Uop):
297 return uop.is_super()
298 else:
299 return False
300
301
302@dataclass

Callers 1

add_instructionFunction · 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…