MCPcopy Index your code
hub / github.com/RustPython/RustPython / print_instruction

Method print_instruction

Lib/dis.py:463–479  ·  view source on GitHub ↗
(self, instr, mark_as_current=False)

Source from the content-addressed store, hash-verified

461 self.show_positions = show_positions
462
463 def print_instruction(self, instr, mark_as_current=False):
464 self.print_instruction_line(instr, mark_as_current)
465 if self.show_caches and instr.cache_info:
466 offset = instr.offset
467 for name, size, data in instr.cache_info:
468 for i in range(size):
469 offset += 2
470 # Only show the fancy argrepr for a CACHE instruction when it's
471 # the first entry for a particular cache value:
472 if i == 0:
473 argrepr = f"{name}: {int.from_bytes(data, sys.byteorder)}"
474 else:
475 argrepr = ""
476 self.print_instruction_line(
477 Instruction("CACHE", CACHE, 0, None, argrepr, offset, offset,
478 False, None, None, instr.positions),
479 False)
480
481 def print_instruction_line(self, instr, mark_as_current):
482 """Format instruction details for inclusion in disassembly output."""

Callers 2

__str__Method · 0.95
print_instructionsFunction · 0.80

Calls 3

InstructionClass · 0.70
from_bytesMethod · 0.45

Tested by

no test coverage detected