opcode_34.py 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. # (C) Copyright 2017, 2020-2021, 2023, 2025 by Rocky Bernstein
  2. # This program is free software; you can redistribute it and/or
  3. # modify it under the terms of the GNU General Public License
  4. # as published by the Free Software Foundation; either version 2
  5. # of the License, or (at your option) any later version.
  6. #
  7. # This program is distributed in the hope that it will be useful,
  8. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. # GNU General Public License for more details.
  11. #
  12. # You should have received a copy of the GNU General Public License
  13. # along with this program; if not, write to the Free Software
  14. # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  15. """
  16. CPython 3.4 bytecode opcodes
  17. This is a like Python 3.4's opcode.py with some classification
  18. of stack usage.
  19. """
  20. import xdis.opcodes.opcode_33 as opcode_33
  21. from xdis.opcodes.base import finalize_opcodes, free_op, init_opdata, rm_op, update_pj3
  22. from xdis.opcodes.opcode_33 import opcode_arg_fmt33, opcode_extended_fmt33
  23. version_tuple = (3, 4)
  24. python_implementation = "CPython"
  25. loc = locals()
  26. init_opdata(loc, opcode_33, version_tuple)
  27. # fmt: off
  28. # These are removed since Python 3.3
  29. rm_op(loc, "STORE_LOCALS", 69)
  30. # These are new since Python 3.3
  31. free_op(loc, "LOAD_CLASSDEREF", 148)
  32. # fmt: on
  33. opcode_arg_fmt = opcode_arg_fmt34 = opcode_arg_fmt33.copy()
  34. opcode_extended_fmt = opcode_extended_fmt34 = opcode_extended_fmt33
  35. update_pj3(globals(), loc)
  36. finalize_opcodes(loc)