opcode_25.py 972 B

12345678910111213141516171819202122232425262728293031323334353637
  1. # (C) Copyright 2017, 2020-2021, 2023 by Rocky Bernstein
  2. """
  3. CPython 2.5 bytecode opcodes
  4. This is a like Python 2.5's opcode.py with some additional classification
  5. of stack usage, and opererand formatting functions.
  6. """
  7. import xdis.opcodes.opcode_24 as opcode_24
  8. from xdis.opcodes.base import (
  9. def_op,
  10. finalize_opcodes,
  11. init_opdata,
  12. update_pj2,
  13. )
  14. from xdis.opcodes.opcode_2x import update_arg_fmt_base2x, opcode_extended_fmt_base2x
  15. version_tuple = (2, 5)
  16. python_implementation = "CPython"
  17. loc = locals()
  18. init_opdata(loc, opcode_24, version_tuple)
  19. # fmt: off
  20. # Bytecodes added in 2.5 from 2.4
  21. # OP NAME OPCODE POP PUSH
  22. #--------------------------------------------
  23. def_op(loc, 'WITH_CLEANUP', 81, 4, 3)
  24. # fmt: on
  25. opcode_arg_fmt = update_arg_fmt_base2x.copy()
  26. opcode_extended_fmt = opcode_extended_fmt12 = opcode_extended_fmt_base2x.copy()
  27. # FIXME remove (fix uncompyle6)
  28. update_pj2(globals(), loc)
  29. finalize_opcodes(loc)