pypy33.py 735 B

123456789101112131415161718192021222324
  1. # Copyright (c) 2019-2021 by Rocky Bernstein
  2. """
  3. Python PyPy 3.3 decompiler scanner.
  4. Does some additional massaging of xdis-disassembled instructions to
  5. make things easier for decompilation.
  6. """
  7. import uncompyle6.scanners.scanner33 as scan
  8. # bytecode verification, verify(), uses JUMP_OPs from here
  9. from xdis.opcodes import opcode_33pypy as opc
  10. JUMP_OPs = map(lambda op: opc.opname[op], opc.hasjrel + opc.hasjabs)
  11. # We base this off of 3.3
  12. class ScannerPyPy33(scan.Scanner33):
  13. def __init__(self, show_asm):
  14. # There are no differences in initialization between
  15. # pypy 3.3 and 3.3
  16. scan.Scanner33.__init__(self, show_asm, is_pypy=True)
  17. self.version = (3, 3)
  18. self.opc = opc
  19. return