Lines Matching refs:self
154 def __repr__(self):
292 def _disassemble(self, lineno_width=3, mark_as_current=False, offset_width=4):
302 if self.starts_line is not None:
304 fields.append(lineno_fmt % self.starts_line)
313 if self.is_jump_target:
318 fields.append(repr(self.offset).rjust(offset_width))
320 fields.append(self.opname.ljust(_OPNAME_WIDTH))
322 if self.arg is not None:
323 fields.append(repr(self.arg).rjust(_OPARG_WIDTH))
325 if self.argrepr:
326 fields.append('(' + self.argrepr + ')')
698 def __init__(self, x, *, first_line=None, current_offset=None, show_caches=False, adaptive=False):
699 self.codeobj = co = _get_code_object(x)
701 self.first_line = co.co_firstlineno
702 self._line_offset = 0
704 self.first_line = first_line
705 self._line_offset = first_line - co.co_firstlineno
706 self._linestarts = dict(findlinestarts(co))
707 self._original_object = x
708 self.current_offset = current_offset
709 self.exception_entries = _parse_exception_table(co)
710 self.show_caches = show_caches
711 self.adaptive = adaptive
713 def __iter__(self):
714 co = self.codeobj
715 return _get_instructions_bytes(_get_code_array(co, self.adaptive),
718 self._linestarts,
719 line_offset=self._line_offset,
720 exception_entries=self.exception_entries,
722 show_caches=self.show_caches)
724 def __repr__(self):
725 return "{}({!r})".format(self.__class__.__name__,
726 self._original_object)
737 def info(self):
739 return _format_code_info(self.codeobj)
741 def dis(self):
743 co = self.codeobj
744 if self.current_offset is not None:
745 offset = self.current_offset
749 _disassemble_bytes(_get_code_array(co, self.adaptive),
752 linestarts=self._linestarts,
753 line_offset=self._line_offset,
756 exception_entries=self.exception_entries,
758 show_caches=self.show_caches)