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

Method offset_from_jump_arg

Lib/dis.py:563–573  ·  view source on GitHub ↗
(self, op, arg, offset)

Source from the content-addressed store, hash-verified

561 self.labels_map = labels_map or {}
562
563 def offset_from_jump_arg(self, op, arg, offset):
564 deop = _deoptop(op)
565 if deop in hasjabs:
566 return arg * 2
567 elif deop in hasjrel:
568 signed_arg = -arg if _is_backward_jump(deop) else arg
569 argval = offset + 2 + signed_arg*2
570 caches = _get_cache_size(_all_opname[deop])
571 argval += 2 * caches
572 return argval
573 return None
574
575 def get_label_for_offset(self, offset):
576 return self.labels_map.get(offset, None)

Callers 1

get_argval_argreprMethod · 0.95

Calls 3

_deoptopFunction · 0.85
_is_backward_jumpFunction · 0.85
_get_cache_sizeFunction · 0.85

Tested by

no test coverage detected