diff --git a/NEWS.md b/NEWS.md index 9eec51fc..564e19e4 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,4 +1,16 @@ -6.0.2 2021-11-05 +6.0.4 2022-05-19 HF+LB-1 +======================== + +* Detect 3.7.[7-13], 3.9.[8-13], 3.10.[1-4], PyPy 2.7.12, 3.[8-9]pypy +* Correct line-number detection on Python 1.0-1.4 +* Handle SET_LINENO in older pythons +* Warn about wrong names in after RESERVE_FAST in older Pythons +* Some PyPy x-3.9.7 tolerance +* Add Pypy 3.8 support +* Better PyPy 3.6 formatting +* Correct relative jump target calculation in 3.10 + +6.0.3 2021-11-05 ================= * xasm format fixes diff --git a/admin-tools/pyenv-newest-versions b/admin-tools/pyenv-newest-versions index 845fa6c0..53240a15 100644 --- a/admin-tools/pyenv-newest-versions +++ b/admin-tools/pyenv-newest-versions @@ -5,4 +5,4 @@ if [[ $0 == ${BASH_SOURCE[0]} ]] ; then echo "This script should be *sourced* rather than run directly through bash" exit 1 fi -export PYVERSIONS='3.6.15 pypy3.6-7.3.0 3.7.12 pypy3.7-7.3.9 pypy3.8-7.3.9 pypy3.9-7.3.8 pyston-2.3.2 3.7.13 3.8.13 3.9.12 3.10.4' +export PYVERSIONS='3.6.15 pypy3.6-7.3.1 3.7.13 pypy3.7-7.3.9 pypy3.8-7.3.9 pypy3.9-7.3.8 pyston-2.3.3 3.8.13 3.9.13 3.10.4' diff --git a/xdis/magics.py b/xdis/magics.py index 0499a071..f8afd224 100755 --- a/xdis/magics.py +++ b/xdis/magics.py @@ -430,7 +430,7 @@ def add_canonic_versions(versions, canonic): "3.9 3.9.0 3.9.0a1+ 3.9.0a2+ 3.9.0alpha1 3.9.0alpha2", "3.9.0alpha1" ) add_canonic_versions( - "3.9 3.9.0 3.9.1 3.9.2 3.9.3 3.9.4 3.9.5 3.9.6 3.9.7 3.9.8 3.9.9 3.9.10 3.9.11 3.9.12 " + "3.9 3.9.0 3.9.1 3.9.2 3.9.3 3.9.4 3.9.5 3.9.6 3.9.7 3.9.8 3.9.9 3.9.10 3.9.11 3.9.12 3.9.13 " "3.9.10pypy 3.9.11pypy 3.9.12pypy 3.9.0b5+", "3.9.0beta5" ) diff --git a/xdis/op_imports.py b/xdis/op_imports.py index c9bd3980..e7074187 100644 --- a/xdis/op_imports.py +++ b/xdis/op_imports.py @@ -54,6 +54,7 @@ from xdis.opcodes import opcode_36pypy as opcode_36pypy from xdis.opcodes import opcode_37pypy as opcode_37pypy from xdis.opcodes import opcode_38pypy as opcode_38pypy +from xdis.opcodes import opcode_39pypy as opcode_39pypy from xdis.version_info import IS_PYPY, version_tuple_to_str @@ -144,6 +145,7 @@ "3.8.0pypy": opcode_38pypy, "3.8.12pypy": opcode_38pypy, "3.8.13pypy": opcode_38pypy, + "3.9pypy": opcode_39pypy, } for k, v in canonic_python_version.items(): diff --git a/xdis/opcodes/opcode_39pypy.py b/xdis/opcodes/opcode_39pypy.py new file mode 100644 index 00000000..786f1406 --- /dev/null +++ b/xdis/opcodes/opcode_39pypy.py @@ -0,0 +1,84 @@ +# (C) Copyright 2022 by Rocky Bernstein +""" +PYPY 3.9 opcodes + +This is a like Python 3.8's opcode.py with some classification +of stack usage. +""" + +from xdis.opcodes.base import ( + format_CALL_FUNCTION_pos_name_encoded, + def_op, + extended_format_ATTR, + extended_format_RAISE_VARARGS_older, + extended_format_RETURN_VALUE, + finalize_opcodes, + format_RAISE_VARARGS_older, + format_extended_arg, + init_opdata, + jrel_op, + name_op, + nargs_op, + rm_op, + update_pj3, + varargs_op, +) + +from xdis.opcodes.opcode_37pypy import ( + extended_format_CALL_METHOD, + extended_format_CALL_METHOD_KW, + format_CALL_METHOD, + format_CALL_METHOD_KW, +) + +version = 3.9 +version_tuple = (3, 9) +python_implementation = "PyPy" + +from xdis.opcodes.opcode_33 import extended_format_MAKE_FUNCTION +import xdis.opcodes.opcode_39 as opcode_39 +from xdis.opcodes.opcode_37 import format_MAKE_FUNCTION_flags + +l = locals() +init_opdata(l, opcode_39, version_tuple, is_pypy=True) + + +# fmt: off +rm_op(l, "ROT_FOUR", 6) +rm_op(l, "LOAD_METHOD", 160) + +# PyPy only +# ---------- + +name_op(l, "LOOKUP_METHOD", 201, 1, 2) +l["hasvargs"].append(202) +nargs_op(l, "CALL_METHOD_KW", 204, -1, 1) + +# Used only in single-mode compilation list-comprehension generators +jrel_op(l, 'SETUP_EXCEPT', 121, 0, 6, conditional=True) # "" +varargs_op(l, "BUILD_LIST_FROM_ARG", 203) +def_op(l, "LOAD_REVDB_VAR", 205) + + +# fmt: on +opcode_arg_fmt = { + "CALL_FUNCTION": format_CALL_FUNCTION_pos_name_encoded, + "CALL_METHOD": format_CALL_METHOD, + "CALL_METHOD_KW": format_CALL_METHOD_KW, + "EXTENDED_ARG": format_extended_arg, + "MAKE_FUNCTION": format_MAKE_FUNCTION_flags, + "RAISE_VARARGS": format_RAISE_VARARGS_older, +} + +opcode_extended_fmt = { + "CALL_METHOD": extended_format_CALL_METHOD, + "CALL_METHOD_KW": extended_format_CALL_METHOD_KW, + "LOAD_ATTR": extended_format_ATTR, + "MAKE_FUNCTION": extended_format_MAKE_FUNCTION, + "RAISE_VARARGS": extended_format_RAISE_VARARGS_older, + "RETURN_VALUE": extended_format_RETURN_VALUE, + "STORE_ATTR": extended_format_ATTR, +} + +update_pj3(globals(), l) +finalize_opcodes(l) diff --git a/xdis/version.py b/xdis/version.py index 3d14f0e9..fec7efca 100644 --- a/xdis/version.py +++ b/xdis/version.py @@ -4,4 +4,4 @@ # well as importing into Python. That's why there is no # space around "=" below. # fmt: off -__version__="6.0.4.dev0" # noqa +__version__="6.0.4" # noqa