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

Function _get_jump_target

Lib/dis.py:343–359  ·  view source on GitHub ↗

Gets the bytecode offset of the jump target if this is a jump instruction. Otherwise return None.

(op, arg, offset)

Source from the content-addressed store, hash-verified

341 return _inline_cache_entries.get(opname, 0)
342
343def _get_jump_target(op, arg, offset):
344 """Gets the bytecode offset of the jump target if this is a jump instruction.
345
346 Otherwise return None.
347 """
348 deop = _deoptop(op)
349 caches = _get_cache_size(_all_opname[deop])
350 if deop in hasjrel:
351 if _is_backward_jump(deop):
352 arg = -arg
353 target = offset + 2 + arg*2
354 target += 2 * caches
355 elif deop in hasjabs:
356 target = arg*2
357 else:
358 target = None
359 return target
360
361class Instruction(_Instruction):
362 """Details for a bytecode operation.

Callers 2

jump_targetMethod · 0.85
findlabelsFunction · 0.85

Calls 3

_deoptopFunction · 0.85
_get_cache_sizeFunction · 0.85
_is_backward_jumpFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…