Start supporting Pypy 3.5 (5.7.1-beta)

This commit is contained in:
rocky
2017-07-08 17:47:32 -04:00
parent d332bde104
commit 2e164763eb
8 changed files with 52 additions and 22 deletions

View File

@@ -29,7 +29,7 @@ from fnmatch import fnmatch
TEST_VERSIONS=('2.3.7', '2.4.6', '2.5.6', '2.6.9', TEST_VERSIONS=('2.3.7', '2.4.6', '2.5.6', '2.6.9',
'pypy-2.4.0', 'pypy-2.6.1', 'pypy-2.4.0', 'pypy-2.6.1',
'pypy-5.0.1', 'pypy-5.3.1', 'pypy-5.0.1', 'pypy-5.3.1', 'pypy3.5-5.7.1-beta',
'2.7.10', '2.7.11', '2.7.12', '2.7.13', '2.7.10', '2.7.11', '2.7.12', '2.7.13',
'3.0.1', '3.1.5', '3.2.6', '3.0.1', '3.1.5', '3.2.6',
'3.3.5', '3.3.6', '3.3.5', '3.3.6',

View File

@@ -1,22 +1,18 @@
# Copyright (c) 2016 by Rocky Bernstein # Copyright (c) 2017 by Rocky Bernstein
""" """
Python PyPy 3.2 bytecode scanner/deparser Python PyPy 3.2 decompiler scanner.
This overlaps Python's 3.2's dis module, but it can be run from Does some additional massaging of xdis-disassembled instructions to
Python 3 and other versions of Python. Also, we save token make things easier for decompilation.
information for later use in deparsing.
""" """
import uncompyle6.scanners.scanner32 as scan import uncompyle6.scanners.scanner32 as scan
# bytecode verification, verify(), uses JUMP_OPs from here # bytecode verification, verify(), uses JUMP_OPs from here
from xdis.opcodes import opcode_32 as opc # is this rgith? from xdis.opcodes import opcode_32 as opc # is this right?
JUMP_OPs = map(lambda op: opc.opname[op], opc.hasjrel + opc.hasjabs) JUMP_OPs = map(lambda op: opc.opname[op], opc.hasjrel + opc.hasjabs)
# We base this off of 2.6 instead of the other way around # We base this off of 3.2
# because we cleaned things up this way.
# The history is that 2.7 support is the cleanest,
# then from that we got 2.6 and so on.
class ScannerPyPy32(scan.Scanner32): class ScannerPyPy32(scan.Scanner32):
def __init__(self, show_asm): def __init__(self, show_asm):
# There are no differences in initialization between # There are no differences in initialization between

View File

@@ -0,0 +1,22 @@
# Copyright (c) 2017 by Rocky Bernstein
"""
Python PyPy 3.2 decompiler scanner.
Does some additional massaging of xdis-disassembled instructions to
make things easier for decompilation.
"""
import uncompyle6.scanners.scanner35 as scan
# bytecode verification, verify(), uses JUMP_OPs from here
from xdis.opcodes import opcode_35 as opc # is this right?
JUMP_OPs = map(lambda op: opc.opname[op], opc.hasjrel + opc.hasjabs)
# We base this off of 3.5
class ScannerPyPy35(scan.Scanner35):
def __init__(self, show_asm):
# There are no differences in initialization between
# pypy 3.5 and 3.5
scan.Scanner35.__init__(self, show_asm, is_pypy=True)
self.version = 3.5
return

View File

@@ -1,6 +1,6 @@
# Copyright (c) 2016 by Rocky Bernstein # Copyright (c) 2016-2017 by Rocky Bernstein
""" """
Python 1.5 bytecode scanner/deparser Python 1.5 bytecode decompiler scanner.
This massages tokenized 1.5 bytecode to make it more amenable for This massages tokenized 1.5 bytecode to make it more amenable for
grammar parsing. grammar parsing.

View File

@@ -1,6 +1,9 @@
# Copyright (c) 2015-2016 by Rocky Bernstein # Copyright (c) 2015-2017 by Rocky Bernstein
""" """
Python 3.2 bytecode scanner/deparser Python 3.2 bytecode decompiler scanner.
Does some additional massaging of xdis-disassembled instructions to
make things easier for decompilation.
This sets up opcodes Python's 3.2 and calls a generalized This sets up opcodes Python's 3.2 and calls a generalized
scanner routine for Python 3. scanner routine for Python 3.

View File

@@ -1,6 +1,9 @@
# Copyright (c) 2015-2016 by Rocky Bernstein # Copyright (c) 2015-2017 by Rocky Bernstein
""" """
Python 3.4 bytecode scanner/deparser Python 3.4 bytecode decompiler scanner
Does some additional massaging of xdis-disassembled instructions to
make things easier for decompilation.
This sets up opcodes Python's 3.4 and calls a generalized This sets up opcodes Python's 3.4 and calls a generalized
scanner routine for Python 3. scanner routine for Python 3.

View File

@@ -1,6 +1,9 @@
# Copyright (c) 2016 by Rocky Bernstein # Copyright (c) 2017 by Rocky Bernstein
""" """
Python 3.5 bytecode scanner/deparser Python 3.5 bytecode decompiler scanner
Does some additional massaging of xdis-disassembled instructions to
make things easier for decompilation.
This sets up opcodes Python's 3.5 and calls a generalized This sets up opcodes Python's 3.5 and calls a generalized
scanner routine for Python 3. scanner routine for Python 3.
@@ -16,8 +19,8 @@ JUMP_OPs = map(lambda op: opc.opname[op], opc.hasjrel + opc.hasjabs)
class Scanner35(Scanner3): class Scanner35(Scanner3):
def __init__(self, show_asm=None): def __init__(self, show_asm=None, is_pypy=False):
Scanner3.__init__(self, 3.5, show_asm) Scanner3.__init__(self, 3.5, show_asm, is_pypy)
return return
pass pass

View File

@@ -1,6 +1,9 @@
# Copyright (c) 2016-2017 by Rocky Bernstein # Copyright (c) 2016-2017 by Rocky Bernstein
""" """
Python 3.6 bytecode scanner/deparser Python 3.6 bytecode decompiler scanner
Does some additional massaging of xdis-disassembled instructions to
make things easier for decompilation.
This sets up opcodes Python's 3.6 and calls a generalized This sets up opcodes Python's 3.6 and calls a generalized
scanner routine for Python 3. scanner routine for Python 3.