mirror of
https://github.com/python/cpython.git
synced 2025-09-09 18:32:22 +00:00
GH-103963: Make dis display names of args for intrinsics opcodes (#104029)
This commit is contained in:
parent
65a49c6553
commit
872cbc6132
6 changed files with 110 additions and 17 deletions
|
@ -11,6 +11,8 @@ from opcode import (
|
|||
_cache_format,
|
||||
_inline_cache_entries,
|
||||
_nb_ops,
|
||||
_intrinsic_1_descs,
|
||||
_intrinsic_2_descs,
|
||||
_specializations,
|
||||
_specialized_instructions,
|
||||
)
|
||||
|
@ -42,6 +44,8 @@ FOR_ITER = opmap['FOR_ITER']
|
|||
SEND = opmap['SEND']
|
||||
LOAD_ATTR = opmap['LOAD_ATTR']
|
||||
LOAD_SUPER_ATTR = opmap['LOAD_SUPER_ATTR']
|
||||
CALL_INTRINSIC_1 = opmap['CALL_INTRINSIC_1']
|
||||
CALL_INTRINSIC_2 = opmap['CALL_INTRINSIC_2']
|
||||
|
||||
CACHE = opmap["CACHE"]
|
||||
|
||||
|
@ -506,6 +510,10 @@ def _get_instructions_bytes(code, varname_from_oparg=None,
|
|||
if arg & (1<<i))
|
||||
elif deop == BINARY_OP:
|
||||
_, argrepr = _nb_ops[arg]
|
||||
elif deop == CALL_INTRINSIC_1:
|
||||
argrepr = _intrinsic_1_descs[arg]
|
||||
elif deop == CALL_INTRINSIC_2:
|
||||
argrepr = _intrinsic_2_descs[arg]
|
||||
yield Instruction(_all_opname[op], op,
|
||||
arg, argval, argrepr,
|
||||
offset, starts_line, is_jump_target, positions)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue