Ejemplo n.º 1
0
version = 3.5

import xdis.opcodes.opcode_35 as opcode_35

l = locals()
init_opdata(l, opcode_35, version, is_pypy=True)

## FIXME: DRY common PYPY opcode additions

# PyPy only
# ----------
def_op(l, 'FORMAT_VALUE',   155)
def_op(l, 'BUILD_STRING',   157)
name_op(l, 'LOOKUP_METHOD',  201,  1, 2)
nargs_op(l, 'CALL_METHOD', 202, -1, 1)
l['hasvargs'].append(202)

# Used only in single-mode compilation list-comprehension generators
varargs_op(l, 'BUILD_LIST_FROM_ARG', 203)

# Used only in assert statements
jrel_op(l, 'JUMP_IF_NOT_DEBUG',      204, conditional=True)

# There are no opcodes to remove or change.
# If there were, they'd be listed below.

# FIXME remove (fix uncompyle6)
update_pj3(globals(), l)

finalize_opcodes(l)
Ejemplo n.º 2
0
python_implementation = "CPython"

l = locals()

init_opdata(l, opcode_33, version)

# These are removed since Python 3.3
rm_op(l, "STORE_LOCALS", 69)

# These are new since Python 3.3
free_op(l, "LOAD_CLASSDEREF", 148)

update_pj3(globals(), l)

opcode_arg_fmt = {
    "CALL_FUNCTION": format_CALL_FUNCTION_pos_name_encoded,
    "CALL_FUNCTION_KW": format_CALL_FUNCTION_pos_name_encoded,
    "CALL_FUNCTION_VAR_KW": format_CALL_FUNCTION_pos_name_encoded,
    "MAKE_FUNCTION": opcode_33.format_MAKE_FUNCTION_default_pos_arg,
    "EXTENDED_ARG": format_extended_arg,
    "RAISE_VARARGS": format_RAISE_VARARGS_older
}

opcode_extended_fmt = {
    "CALL_FUNCTION": extended_format_CALL_FUNCTION,
    "MAKE_FUNCTION": opcode_33.extended_format_MAKE_FUNCTION,
    "RAISE_VARARGS": extended_format_RAISE_VARARGS_older,
}

finalize_opcodes(l)