0
0
mirror of https://github.com/python/cpython.git synced 2024-11-24 17:47:13 +01:00

gh-105481: generate op IDs from bytecode.c instead of hard coding them in opcode.py (#107971)

This commit is contained in:
Irit Katriel 2023-08-16 23:25:18 +01:00 committed by GitHub
parent e88eb3775e
commit 665a4391e1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
21 changed files with 1593 additions and 1521 deletions

View File

@ -14,8 +14,6 @@ extern "C" {
extern const uint8_t _PyOpcode_Caches[256];
extern const uint8_t _PyOpcode_Deopt[256];
#ifdef NEED_OPCODE_TABLES
const uint8_t _PyOpcode_Caches[256] = {
@ -34,546 +32,8 @@ const uint8_t _PyOpcode_Caches[256] = {
[JUMP_BACKWARD] = 1,
[TO_BOOL] = 3,
};
const uint8_t _PyOpcode_Deopt[256] = {
[BEFORE_ASYNC_WITH] = BEFORE_ASYNC_WITH,
[BEFORE_WITH] = BEFORE_WITH,
[BINARY_OP] = BINARY_OP,
[BINARY_OP_ADD_FLOAT] = BINARY_OP,
[BINARY_OP_ADD_INT] = BINARY_OP,
[BINARY_OP_ADD_UNICODE] = BINARY_OP,
[BINARY_OP_INPLACE_ADD_UNICODE] = BINARY_OP,
[BINARY_OP_MULTIPLY_FLOAT] = BINARY_OP,
[BINARY_OP_MULTIPLY_INT] = BINARY_OP,
[BINARY_OP_SUBTRACT_FLOAT] = BINARY_OP,
[BINARY_OP_SUBTRACT_INT] = BINARY_OP,
[BINARY_SLICE] = BINARY_SLICE,
[BINARY_SUBSCR] = BINARY_SUBSCR,
[BINARY_SUBSCR_DICT] = BINARY_SUBSCR,
[BINARY_SUBSCR_GETITEM] = BINARY_SUBSCR,
[BINARY_SUBSCR_LIST_INT] = BINARY_SUBSCR,
[BINARY_SUBSCR_STR_INT] = BINARY_SUBSCR,
[BINARY_SUBSCR_TUPLE_INT] = BINARY_SUBSCR,
[BUILD_CONST_KEY_MAP] = BUILD_CONST_KEY_MAP,
[BUILD_LIST] = BUILD_LIST,
[BUILD_MAP] = BUILD_MAP,
[BUILD_SET] = BUILD_SET,
[BUILD_SLICE] = BUILD_SLICE,
[BUILD_STRING] = BUILD_STRING,
[BUILD_TUPLE] = BUILD_TUPLE,
[CACHE] = CACHE,
[CALL] = CALL,
[CALL_BOUND_METHOD_EXACT_ARGS] = CALL,
[CALL_BUILTIN_CLASS] = CALL,
[CALL_BUILTIN_FAST_WITH_KEYWORDS] = CALL,
[CALL_FUNCTION_EX] = CALL_FUNCTION_EX,
[CALL_INTRINSIC_1] = CALL_INTRINSIC_1,
[CALL_INTRINSIC_2] = CALL_INTRINSIC_2,
[CALL_METHOD_DESCRIPTOR_FAST_WITH_KEYWORDS] = CALL,
[CALL_NO_KW_ALLOC_AND_ENTER_INIT] = CALL,
[CALL_NO_KW_BUILTIN_FAST] = CALL,
[CALL_NO_KW_BUILTIN_O] = CALL,
[CALL_NO_KW_ISINSTANCE] = CALL,
[CALL_NO_KW_LEN] = CALL,
[CALL_NO_KW_LIST_APPEND] = CALL,
[CALL_NO_KW_METHOD_DESCRIPTOR_FAST] = CALL,
[CALL_NO_KW_METHOD_DESCRIPTOR_NOARGS] = CALL,
[CALL_NO_KW_METHOD_DESCRIPTOR_O] = CALL,
[CALL_NO_KW_STR_1] = CALL,
[CALL_NO_KW_TUPLE_1] = CALL,
[CALL_NO_KW_TYPE_1] = CALL,
[CALL_PY_EXACT_ARGS] = CALL,
[CALL_PY_WITH_DEFAULTS] = CALL,
[CHECK_EG_MATCH] = CHECK_EG_MATCH,
[CHECK_EXC_MATCH] = CHECK_EXC_MATCH,
[CLEANUP_THROW] = CLEANUP_THROW,
[COMPARE_OP] = COMPARE_OP,
[COMPARE_OP_FLOAT] = COMPARE_OP,
[COMPARE_OP_INT] = COMPARE_OP,
[COMPARE_OP_STR] = COMPARE_OP,
[CONTAINS_OP] = CONTAINS_OP,
[CONVERT_VALUE] = CONVERT_VALUE,
[COPY] = COPY,
[COPY_FREE_VARS] = COPY_FREE_VARS,
[DELETE_ATTR] = DELETE_ATTR,
[DELETE_DEREF] = DELETE_DEREF,
[DELETE_FAST] = DELETE_FAST,
[DELETE_GLOBAL] = DELETE_GLOBAL,
[DELETE_NAME] = DELETE_NAME,
[DELETE_SUBSCR] = DELETE_SUBSCR,
[DICT_MERGE] = DICT_MERGE,
[DICT_UPDATE] = DICT_UPDATE,
[END_ASYNC_FOR] = END_ASYNC_FOR,
[END_FOR] = END_FOR,
[END_SEND] = END_SEND,
[ENTER_EXECUTOR] = ENTER_EXECUTOR,
[EXIT_INIT_CHECK] = EXIT_INIT_CHECK,
[EXTENDED_ARG] = EXTENDED_ARG,
[FORMAT_SIMPLE] = FORMAT_SIMPLE,
[FORMAT_WITH_SPEC] = FORMAT_WITH_SPEC,
[FOR_ITER] = FOR_ITER,
[FOR_ITER_GEN] = FOR_ITER,
[FOR_ITER_LIST] = FOR_ITER,
[FOR_ITER_RANGE] = FOR_ITER,
[FOR_ITER_TUPLE] = FOR_ITER,
[GET_AITER] = GET_AITER,
[GET_ANEXT] = GET_ANEXT,
[GET_AWAITABLE] = GET_AWAITABLE,
[GET_ITER] = GET_ITER,
[GET_LEN] = GET_LEN,
[GET_YIELD_FROM_ITER] = GET_YIELD_FROM_ITER,
[IMPORT_FROM] = IMPORT_FROM,
[IMPORT_NAME] = IMPORT_NAME,
[INSTRUMENTED_CALL] = INSTRUMENTED_CALL,
[INSTRUMENTED_CALL_FUNCTION_EX] = INSTRUMENTED_CALL_FUNCTION_EX,
[INSTRUMENTED_END_FOR] = INSTRUMENTED_END_FOR,
[INSTRUMENTED_END_SEND] = INSTRUMENTED_END_SEND,
[INSTRUMENTED_FOR_ITER] = INSTRUMENTED_FOR_ITER,
[INSTRUMENTED_INSTRUCTION] = INSTRUMENTED_INSTRUCTION,
[INSTRUMENTED_JUMP_BACKWARD] = INSTRUMENTED_JUMP_BACKWARD,
[INSTRUMENTED_JUMP_FORWARD] = INSTRUMENTED_JUMP_FORWARD,
[INSTRUMENTED_LINE] = INSTRUMENTED_LINE,
[INSTRUMENTED_LOAD_SUPER_ATTR] = INSTRUMENTED_LOAD_SUPER_ATTR,
[INSTRUMENTED_POP_JUMP_IF_FALSE] = INSTRUMENTED_POP_JUMP_IF_FALSE,
[INSTRUMENTED_POP_JUMP_IF_NONE] = INSTRUMENTED_POP_JUMP_IF_NONE,
[INSTRUMENTED_POP_JUMP_IF_NOT_NONE] = INSTRUMENTED_POP_JUMP_IF_NOT_NONE,
[INSTRUMENTED_POP_JUMP_IF_TRUE] = INSTRUMENTED_POP_JUMP_IF_TRUE,
[INSTRUMENTED_RESUME] = INSTRUMENTED_RESUME,
[INSTRUMENTED_RETURN_CONST] = INSTRUMENTED_RETURN_CONST,
[INSTRUMENTED_RETURN_VALUE] = INSTRUMENTED_RETURN_VALUE,
[INSTRUMENTED_YIELD_VALUE] = INSTRUMENTED_YIELD_VALUE,
[INTERPRETER_EXIT] = INTERPRETER_EXIT,
[IS_OP] = IS_OP,
[JUMP_BACKWARD] = JUMP_BACKWARD,
[JUMP_BACKWARD_NO_INTERRUPT] = JUMP_BACKWARD_NO_INTERRUPT,
[JUMP_FORWARD] = JUMP_FORWARD,
[KW_NAMES] = KW_NAMES,
[LIST_APPEND] = LIST_APPEND,
[LIST_EXTEND] = LIST_EXTEND,
[LOAD_ASSERTION_ERROR] = LOAD_ASSERTION_ERROR,
[LOAD_ATTR] = LOAD_ATTR,
[LOAD_ATTR_CLASS] = LOAD_ATTR,
[LOAD_ATTR_GETATTRIBUTE_OVERRIDDEN] = LOAD_ATTR,
[LOAD_ATTR_INSTANCE_VALUE] = LOAD_ATTR,
[LOAD_ATTR_METHOD_LAZY_DICT] = LOAD_ATTR,
[LOAD_ATTR_METHOD_NO_DICT] = LOAD_ATTR,
[LOAD_ATTR_METHOD_WITH_VALUES] = LOAD_ATTR,
[LOAD_ATTR_MODULE] = LOAD_ATTR,
[LOAD_ATTR_NONDESCRIPTOR_NO_DICT] = LOAD_ATTR,
[LOAD_ATTR_NONDESCRIPTOR_WITH_VALUES] = LOAD_ATTR,
[LOAD_ATTR_PROPERTY] = LOAD_ATTR,
[LOAD_ATTR_SLOT] = LOAD_ATTR,
[LOAD_ATTR_WITH_HINT] = LOAD_ATTR,
[LOAD_BUILD_CLASS] = LOAD_BUILD_CLASS,
[LOAD_CONST] = LOAD_CONST,
[LOAD_DEREF] = LOAD_DEREF,
[LOAD_FAST] = LOAD_FAST,
[LOAD_FAST_AND_CLEAR] = LOAD_FAST_AND_CLEAR,
[LOAD_FAST_CHECK] = LOAD_FAST_CHECK,
[LOAD_FAST_LOAD_FAST] = LOAD_FAST_LOAD_FAST,
[LOAD_FROM_DICT_OR_DEREF] = LOAD_FROM_DICT_OR_DEREF,
[LOAD_FROM_DICT_OR_GLOBALS] = LOAD_FROM_DICT_OR_GLOBALS,
[LOAD_GLOBAL] = LOAD_GLOBAL,
[LOAD_GLOBAL_BUILTIN] = LOAD_GLOBAL,
[LOAD_GLOBAL_MODULE] = LOAD_GLOBAL,
[LOAD_LOCALS] = LOAD_LOCALS,
[LOAD_NAME] = LOAD_NAME,
[LOAD_SUPER_ATTR] = LOAD_SUPER_ATTR,
[LOAD_SUPER_ATTR_ATTR] = LOAD_SUPER_ATTR,
[LOAD_SUPER_ATTR_METHOD] = LOAD_SUPER_ATTR,
[MAKE_CELL] = MAKE_CELL,
[MAKE_FUNCTION] = MAKE_FUNCTION,
[MAP_ADD] = MAP_ADD,
[MATCH_CLASS] = MATCH_CLASS,
[MATCH_KEYS] = MATCH_KEYS,
[MATCH_MAPPING] = MATCH_MAPPING,
[MATCH_SEQUENCE] = MATCH_SEQUENCE,
[NOP] = NOP,
[POP_EXCEPT] = POP_EXCEPT,
[POP_JUMP_IF_FALSE] = POP_JUMP_IF_FALSE,
[POP_JUMP_IF_NONE] = POP_JUMP_IF_NONE,
[POP_JUMP_IF_NOT_NONE] = POP_JUMP_IF_NOT_NONE,
[POP_JUMP_IF_TRUE] = POP_JUMP_IF_TRUE,
[POP_TOP] = POP_TOP,
[PUSH_EXC_INFO] = PUSH_EXC_INFO,
[PUSH_NULL] = PUSH_NULL,
[RAISE_VARARGS] = RAISE_VARARGS,
[RERAISE] = RERAISE,
[RESERVED] = RESERVED,
[RESUME] = RESUME,
[RETURN_CONST] = RETURN_CONST,
[RETURN_GENERATOR] = RETURN_GENERATOR,
[RETURN_VALUE] = RETURN_VALUE,
[SEND] = SEND,
[SEND_GEN] = SEND,
[SETUP_ANNOTATIONS] = SETUP_ANNOTATIONS,
[SET_ADD] = SET_ADD,
[SET_FUNCTION_ATTRIBUTE] = SET_FUNCTION_ATTRIBUTE,
[SET_UPDATE] = SET_UPDATE,
[STORE_ATTR] = STORE_ATTR,
[STORE_ATTR_INSTANCE_VALUE] = STORE_ATTR,
[STORE_ATTR_SLOT] = STORE_ATTR,
[STORE_ATTR_WITH_HINT] = STORE_ATTR,
[STORE_DEREF] = STORE_DEREF,
[STORE_FAST] = STORE_FAST,
[STORE_FAST_LOAD_FAST] = STORE_FAST_LOAD_FAST,
[STORE_FAST_STORE_FAST] = STORE_FAST_STORE_FAST,
[STORE_GLOBAL] = STORE_GLOBAL,
[STORE_NAME] = STORE_NAME,
[STORE_SLICE] = STORE_SLICE,
[STORE_SUBSCR] = STORE_SUBSCR,
[STORE_SUBSCR_DICT] = STORE_SUBSCR,
[STORE_SUBSCR_LIST_INT] = STORE_SUBSCR,
[SWAP] = SWAP,
[TO_BOOL] = TO_BOOL,
[TO_BOOL_ALWAYS_TRUE] = TO_BOOL,
[TO_BOOL_BOOL] = TO_BOOL,
[TO_BOOL_INT] = TO_BOOL,
[TO_BOOL_LIST] = TO_BOOL,
[TO_BOOL_NONE] = TO_BOOL,
[TO_BOOL_STR] = TO_BOOL,
[UNARY_INVERT] = UNARY_INVERT,
[UNARY_NEGATIVE] = UNARY_NEGATIVE,
[UNARY_NOT] = UNARY_NOT,
[UNPACK_EX] = UNPACK_EX,
[UNPACK_SEQUENCE] = UNPACK_SEQUENCE,
[UNPACK_SEQUENCE_LIST] = UNPACK_SEQUENCE,
[UNPACK_SEQUENCE_TUPLE] = UNPACK_SEQUENCE,
[UNPACK_SEQUENCE_TWO_TUPLE] = UNPACK_SEQUENCE,
[WITH_EXCEPT_START] = WITH_EXCEPT_START,
[YIELD_VALUE] = YIELD_VALUE,
};
#endif // NEED_OPCODE_TABLES
extern const char *const _PyOpcode_OpName[268];
#ifdef NEED_OPCODE_TABLES
const char *const _PyOpcode_OpName[268] = {
[CACHE] = "CACHE",
[POP_TOP] = "POP_TOP",
[PUSH_NULL] = "PUSH_NULL",
[INTERPRETER_EXIT] = "INTERPRETER_EXIT",
[END_FOR] = "END_FOR",
[END_SEND] = "END_SEND",
[TO_BOOL] = "TO_BOOL",
[TO_BOOL_ALWAYS_TRUE] = "TO_BOOL_ALWAYS_TRUE",
[TO_BOOL_BOOL] = "TO_BOOL_BOOL",
[NOP] = "NOP",
[TO_BOOL_INT] = "TO_BOOL_INT",
[UNARY_NEGATIVE] = "UNARY_NEGATIVE",
[UNARY_NOT] = "UNARY_NOT",
[TO_BOOL_LIST] = "TO_BOOL_LIST",
[TO_BOOL_NONE] = "TO_BOOL_NONE",
[UNARY_INVERT] = "UNARY_INVERT",
[EXIT_INIT_CHECK] = "EXIT_INIT_CHECK",
[RESERVED] = "RESERVED",
[TO_BOOL_STR] = "TO_BOOL_STR",
[BINARY_OP_MULTIPLY_INT] = "BINARY_OP_MULTIPLY_INT",
[BINARY_OP_ADD_INT] = "BINARY_OP_ADD_INT",
[BINARY_OP_SUBTRACT_INT] = "BINARY_OP_SUBTRACT_INT",
[BINARY_OP_MULTIPLY_FLOAT] = "BINARY_OP_MULTIPLY_FLOAT",
[BINARY_OP_ADD_FLOAT] = "BINARY_OP_ADD_FLOAT",
[MAKE_FUNCTION] = "MAKE_FUNCTION",
[BINARY_SUBSCR] = "BINARY_SUBSCR",
[BINARY_SLICE] = "BINARY_SLICE",
[STORE_SLICE] = "STORE_SLICE",
[BINARY_OP_SUBTRACT_FLOAT] = "BINARY_OP_SUBTRACT_FLOAT",
[BINARY_OP_ADD_UNICODE] = "BINARY_OP_ADD_UNICODE",
[GET_LEN] = "GET_LEN",
[MATCH_MAPPING] = "MATCH_MAPPING",
[MATCH_SEQUENCE] = "MATCH_SEQUENCE",
[MATCH_KEYS] = "MATCH_KEYS",
[BINARY_OP_INPLACE_ADD_UNICODE] = "BINARY_OP_INPLACE_ADD_UNICODE",
[PUSH_EXC_INFO] = "PUSH_EXC_INFO",
[CHECK_EXC_MATCH] = "CHECK_EXC_MATCH",
[CHECK_EG_MATCH] = "CHECK_EG_MATCH",
[BINARY_SUBSCR_DICT] = "BINARY_SUBSCR_DICT",
[BINARY_SUBSCR_GETITEM] = "BINARY_SUBSCR_GETITEM",
[FORMAT_SIMPLE] = "FORMAT_SIMPLE",
[FORMAT_WITH_SPEC] = "FORMAT_WITH_SPEC",
[BINARY_SUBSCR_LIST_INT] = "BINARY_SUBSCR_LIST_INT",
[BINARY_SUBSCR_STR_INT] = "BINARY_SUBSCR_STR_INT",
[BINARY_SUBSCR_TUPLE_INT] = "BINARY_SUBSCR_TUPLE_INT",
[STORE_SUBSCR_DICT] = "STORE_SUBSCR_DICT",
[STORE_SUBSCR_LIST_INT] = "STORE_SUBSCR_LIST_INT",
[SEND_GEN] = "SEND_GEN",
[UNPACK_SEQUENCE_TWO_TUPLE] = "UNPACK_SEQUENCE_TWO_TUPLE",
[WITH_EXCEPT_START] = "WITH_EXCEPT_START",
[GET_AITER] = "GET_AITER",
[GET_ANEXT] = "GET_ANEXT",
[BEFORE_ASYNC_WITH] = "BEFORE_ASYNC_WITH",
[BEFORE_WITH] = "BEFORE_WITH",
[END_ASYNC_FOR] = "END_ASYNC_FOR",
[CLEANUP_THROW] = "CLEANUP_THROW",
[UNPACK_SEQUENCE_TUPLE] = "UNPACK_SEQUENCE_TUPLE",
[UNPACK_SEQUENCE_LIST] = "UNPACK_SEQUENCE_LIST",
[STORE_ATTR_INSTANCE_VALUE] = "STORE_ATTR_INSTANCE_VALUE",
[STORE_ATTR_SLOT] = "STORE_ATTR_SLOT",
[STORE_SUBSCR] = "STORE_SUBSCR",
[DELETE_SUBSCR] = "DELETE_SUBSCR",
[STORE_ATTR_WITH_HINT] = "STORE_ATTR_WITH_HINT",
[LOAD_GLOBAL_MODULE] = "LOAD_GLOBAL_MODULE",
[LOAD_GLOBAL_BUILTIN] = "LOAD_GLOBAL_BUILTIN",
[LOAD_SUPER_ATTR_ATTR] = "LOAD_SUPER_ATTR_ATTR",
[LOAD_SUPER_ATTR_METHOD] = "LOAD_SUPER_ATTR_METHOD",
[LOAD_ATTR_INSTANCE_VALUE] = "LOAD_ATTR_INSTANCE_VALUE",
[GET_ITER] = "GET_ITER",
[GET_YIELD_FROM_ITER] = "GET_YIELD_FROM_ITER",
[LOAD_ATTR_MODULE] = "LOAD_ATTR_MODULE",
[LOAD_BUILD_CLASS] = "LOAD_BUILD_CLASS",
[LOAD_ATTR_WITH_HINT] = "LOAD_ATTR_WITH_HINT",
[LOAD_ATTR_SLOT] = "LOAD_ATTR_SLOT",
[LOAD_ASSERTION_ERROR] = "LOAD_ASSERTION_ERROR",
[RETURN_GENERATOR] = "RETURN_GENERATOR",
[LOAD_ATTR_CLASS] = "LOAD_ATTR_CLASS",
[LOAD_ATTR_PROPERTY] = "LOAD_ATTR_PROPERTY",
[LOAD_ATTR_GETATTRIBUTE_OVERRIDDEN] = "LOAD_ATTR_GETATTRIBUTE_OVERRIDDEN",
[LOAD_ATTR_METHOD_WITH_VALUES] = "LOAD_ATTR_METHOD_WITH_VALUES",
[LOAD_ATTR_METHOD_NO_DICT] = "LOAD_ATTR_METHOD_NO_DICT",
[LOAD_ATTR_METHOD_LAZY_DICT] = "LOAD_ATTR_METHOD_LAZY_DICT",
[LOAD_ATTR_NONDESCRIPTOR_WITH_VALUES] = "LOAD_ATTR_NONDESCRIPTOR_WITH_VALUES",
[RETURN_VALUE] = "RETURN_VALUE",
[LOAD_ATTR_NONDESCRIPTOR_NO_DICT] = "LOAD_ATTR_NONDESCRIPTOR_NO_DICT",
[SETUP_ANNOTATIONS] = "SETUP_ANNOTATIONS",
[COMPARE_OP_FLOAT] = "COMPARE_OP_FLOAT",
[LOAD_LOCALS] = "LOAD_LOCALS",
[COMPARE_OP_INT] = "COMPARE_OP_INT",
[POP_EXCEPT] = "POP_EXCEPT",
[STORE_NAME] = "STORE_NAME",
[DELETE_NAME] = "DELETE_NAME",
[UNPACK_SEQUENCE] = "UNPACK_SEQUENCE",
[FOR_ITER] = "FOR_ITER",
[UNPACK_EX] = "UNPACK_EX",
[STORE_ATTR] = "STORE_ATTR",
[DELETE_ATTR] = "DELETE_ATTR",
[STORE_GLOBAL] = "STORE_GLOBAL",
[DELETE_GLOBAL] = "DELETE_GLOBAL",
[SWAP] = "SWAP",
[LOAD_CONST] = "LOAD_CONST",
[LOAD_NAME] = "LOAD_NAME",
[BUILD_TUPLE] = "BUILD_TUPLE",
[BUILD_LIST] = "BUILD_LIST",
[BUILD_SET] = "BUILD_SET",
[BUILD_MAP] = "BUILD_MAP",
[LOAD_ATTR] = "LOAD_ATTR",
[COMPARE_OP] = "COMPARE_OP",
[IMPORT_NAME] = "IMPORT_NAME",
[IMPORT_FROM] = "IMPORT_FROM",
[JUMP_FORWARD] = "JUMP_FORWARD",
[COMPARE_OP_STR] = "COMPARE_OP_STR",
[FOR_ITER_LIST] = "FOR_ITER_LIST",
[FOR_ITER_TUPLE] = "FOR_ITER_TUPLE",
[POP_JUMP_IF_FALSE] = "POP_JUMP_IF_FALSE",
[POP_JUMP_IF_TRUE] = "POP_JUMP_IF_TRUE",
[LOAD_GLOBAL] = "LOAD_GLOBAL",
[IS_OP] = "IS_OP",
[CONTAINS_OP] = "CONTAINS_OP",
[RERAISE] = "RERAISE",
[COPY] = "COPY",
[RETURN_CONST] = "RETURN_CONST",
[BINARY_OP] = "BINARY_OP",
[SEND] = "SEND",
[LOAD_FAST] = "LOAD_FAST",
[STORE_FAST] = "STORE_FAST",
[DELETE_FAST] = "DELETE_FAST",
[LOAD_FAST_CHECK] = "LOAD_FAST_CHECK",
[POP_JUMP_IF_NOT_NONE] = "POP_JUMP_IF_NOT_NONE",
[POP_JUMP_IF_NONE] = "POP_JUMP_IF_NONE",
[RAISE_VARARGS] = "RAISE_VARARGS",
[GET_AWAITABLE] = "GET_AWAITABLE",
[FOR_ITER_RANGE] = "FOR_ITER_RANGE",
[BUILD_SLICE] = "BUILD_SLICE",
[JUMP_BACKWARD_NO_INTERRUPT] = "JUMP_BACKWARD_NO_INTERRUPT",
[MAKE_CELL] = "MAKE_CELL",
[FOR_ITER_GEN] = "FOR_ITER_GEN",
[LOAD_DEREF] = "LOAD_DEREF",
[STORE_DEREF] = "STORE_DEREF",
[DELETE_DEREF] = "DELETE_DEREF",
[JUMP_BACKWARD] = "JUMP_BACKWARD",
[LOAD_SUPER_ATTR] = "LOAD_SUPER_ATTR",
[CALL_FUNCTION_EX] = "CALL_FUNCTION_EX",
[LOAD_FAST_AND_CLEAR] = "LOAD_FAST_AND_CLEAR",
[EXTENDED_ARG] = "EXTENDED_ARG",
[LIST_APPEND] = "LIST_APPEND",
[SET_ADD] = "SET_ADD",
[MAP_ADD] = "MAP_ADD",
[CALL_BOUND_METHOD_EXACT_ARGS] = "CALL_BOUND_METHOD_EXACT_ARGS",
[COPY_FREE_VARS] = "COPY_FREE_VARS",
[YIELD_VALUE] = "YIELD_VALUE",
[RESUME] = "RESUME",
[MATCH_CLASS] = "MATCH_CLASS",
[CALL_PY_EXACT_ARGS] = "CALL_PY_EXACT_ARGS",
[CALL_PY_WITH_DEFAULTS] = "CALL_PY_WITH_DEFAULTS",
[CALL_NO_KW_TYPE_1] = "CALL_NO_KW_TYPE_1",
[BUILD_CONST_KEY_MAP] = "BUILD_CONST_KEY_MAP",
[BUILD_STRING] = "BUILD_STRING",
[CONVERT_VALUE] = "CONVERT_VALUE",
[CALL_NO_KW_STR_1] = "CALL_NO_KW_STR_1",
[CALL_NO_KW_TUPLE_1] = "CALL_NO_KW_TUPLE_1",
[CALL_BUILTIN_CLASS] = "CALL_BUILTIN_CLASS",
[LIST_EXTEND] = "LIST_EXTEND",
[SET_UPDATE] = "SET_UPDATE",
[DICT_MERGE] = "DICT_MERGE",
[DICT_UPDATE] = "DICT_UPDATE",
[CALL_NO_KW_BUILTIN_O] = "CALL_NO_KW_BUILTIN_O",
[CALL_NO_KW_BUILTIN_FAST] = "CALL_NO_KW_BUILTIN_FAST",
[LOAD_FAST_LOAD_FAST] = "LOAD_FAST_LOAD_FAST",
[STORE_FAST_LOAD_FAST] = "STORE_FAST_LOAD_FAST",
[STORE_FAST_STORE_FAST] = "STORE_FAST_STORE_FAST",
[CALL] = "CALL",
[KW_NAMES] = "KW_NAMES",
[CALL_INTRINSIC_1] = "CALL_INTRINSIC_1",
[CALL_INTRINSIC_2] = "CALL_INTRINSIC_2",
[LOAD_FROM_DICT_OR_GLOBALS] = "LOAD_FROM_DICT_OR_GLOBALS",
[LOAD_FROM_DICT_OR_DEREF] = "LOAD_FROM_DICT_OR_DEREF",
[SET_FUNCTION_ATTRIBUTE] = "SET_FUNCTION_ATTRIBUTE",
[CALL_BUILTIN_FAST_WITH_KEYWORDS] = "CALL_BUILTIN_FAST_WITH_KEYWORDS",
[CALL_NO_KW_LEN] = "CALL_NO_KW_LEN",
[CALL_NO_KW_ISINSTANCE] = "CALL_NO_KW_ISINSTANCE",
[CALL_NO_KW_LIST_APPEND] = "CALL_NO_KW_LIST_APPEND",
[CALL_NO_KW_METHOD_DESCRIPTOR_O] = "CALL_NO_KW_METHOD_DESCRIPTOR_O",
[CALL_METHOD_DESCRIPTOR_FAST_WITH_KEYWORDS] = "CALL_METHOD_DESCRIPTOR_FAST_WITH_KEYWORDS",
[CALL_NO_KW_METHOD_DESCRIPTOR_NOARGS] = "CALL_NO_KW_METHOD_DESCRIPTOR_NOARGS",
[CALL_NO_KW_METHOD_DESCRIPTOR_FAST] = "CALL_NO_KW_METHOD_DESCRIPTOR_FAST",
[CALL_NO_KW_ALLOC_AND_ENTER_INIT] = "CALL_NO_KW_ALLOC_AND_ENTER_INIT",
[187] = "<187>",
[188] = "<188>",
[189] = "<189>",
[190] = "<190>",
[191] = "<191>",
[192] = "<192>",
[193] = "<193>",
[194] = "<194>",
[195] = "<195>",
[196] = "<196>",
[197] = "<197>",
[198] = "<198>",
[199] = "<199>",
[200] = "<200>",
[201] = "<201>",
[202] = "<202>",
[203] = "<203>",
[204] = "<204>",
[205] = "<205>",
[206] = "<206>",
[207] = "<207>",
[208] = "<208>",
[209] = "<209>",
[210] = "<210>",
[211] = "<211>",
[212] = "<212>",
[213] = "<213>",
[214] = "<214>",
[215] = "<215>",
[216] = "<216>",
[217] = "<217>",
[218] = "<218>",
[219] = "<219>",
[220] = "<220>",
[221] = "<221>",
[222] = "<222>",
[223] = "<223>",
[224] = "<224>",
[225] = "<225>",
[226] = "<226>",
[227] = "<227>",
[228] = "<228>",
[229] = "<229>",
[ENTER_EXECUTOR] = "ENTER_EXECUTOR",
[231] = "<231>",
[232] = "<232>",
[233] = "<233>",
[234] = "<234>",
[235] = "<235>",
[236] = "<236>",
[INSTRUMENTED_LOAD_SUPER_ATTR] = "INSTRUMENTED_LOAD_SUPER_ATTR",
[INSTRUMENTED_POP_JUMP_IF_NONE] = "INSTRUMENTED_POP_JUMP_IF_NONE",
[INSTRUMENTED_POP_JUMP_IF_NOT_NONE] = "INSTRUMENTED_POP_JUMP_IF_NOT_NONE",
[INSTRUMENTED_RESUME] = "INSTRUMENTED_RESUME",
[INSTRUMENTED_CALL] = "INSTRUMENTED_CALL",
[INSTRUMENTED_RETURN_VALUE] = "INSTRUMENTED_RETURN_VALUE",
[INSTRUMENTED_YIELD_VALUE] = "INSTRUMENTED_YIELD_VALUE",
[INSTRUMENTED_CALL_FUNCTION_EX] = "INSTRUMENTED_CALL_FUNCTION_EX",
[INSTRUMENTED_JUMP_FORWARD] = "INSTRUMENTED_JUMP_FORWARD",
[INSTRUMENTED_JUMP_BACKWARD] = "INSTRUMENTED_JUMP_BACKWARD",
[INSTRUMENTED_RETURN_CONST] = "INSTRUMENTED_RETURN_CONST",
[INSTRUMENTED_FOR_ITER] = "INSTRUMENTED_FOR_ITER",
[INSTRUMENTED_POP_JUMP_IF_FALSE] = "INSTRUMENTED_POP_JUMP_IF_FALSE",
[INSTRUMENTED_POP_JUMP_IF_TRUE] = "INSTRUMENTED_POP_JUMP_IF_TRUE",
[INSTRUMENTED_END_FOR] = "INSTRUMENTED_END_FOR",
[INSTRUMENTED_END_SEND] = "INSTRUMENTED_END_SEND",
[INSTRUMENTED_INSTRUCTION] = "INSTRUMENTED_INSTRUCTION",
[INSTRUMENTED_LINE] = "INSTRUMENTED_LINE",
[255] = "<255>",
[SETUP_FINALLY] = "SETUP_FINALLY",
[SETUP_CLEANUP] = "SETUP_CLEANUP",
[SETUP_WITH] = "SETUP_WITH",
[POP_BLOCK] = "POP_BLOCK",
[JUMP] = "JUMP",
[JUMP_NO_INTERRUPT] = "JUMP_NO_INTERRUPT",
[LOAD_METHOD] = "LOAD_METHOD",
[LOAD_SUPER_METHOD] = "LOAD_SUPER_METHOD",
[LOAD_ZERO_SUPER_METHOD] = "LOAD_ZERO_SUPER_METHOD",
[LOAD_ZERO_SUPER_ATTR] = "LOAD_ZERO_SUPER_ATTR",
[STORE_FAST_MAYBE_NULL] = "STORE_FAST_MAYBE_NULL",
[LOAD_CLOSURE] = "LOAD_CLOSURE",
};
#endif // NEED_OPCODE_TABLES
#define EXTRA_CASES \
case 187: \
case 188: \
case 189: \
case 190: \
case 191: \
case 192: \
case 193: \
case 194: \
case 195: \
case 196: \
case 197: \
case 198: \
case 199: \
case 200: \
case 201: \
case 202: \
case 203: \
case 204: \
case 205: \
case 206: \
case 207: \
case 208: \
case 209: \
case 210: \
case 211: \
case 212: \
case 213: \
case 214: \
case 215: \
case 216: \
case 217: \
case 218: \
case 219: \
case 220: \
case 221: \
case 222: \
case 223: \
case 224: \
case 225: \
case 226: \
case 227: \
case 228: \
case 229: \
case 231: \
case 232: \
case 233: \
case 234: \
case 235: \
case 236: \
case 255: \
;
#ifdef __cplusplus
}
#endif

View File

@ -1537,3 +1537,493 @@ const char * const _PyOpcode_uop_name[OPCODE_UOP_NAME_SIZE] = {
[INSERT] = "INSERT",
};
#endif // NEED_OPCODE_METADATA
extern const char *const _PyOpcode_OpName[268];
#ifdef NEED_OPCODE_METADATA
const char *const _PyOpcode_OpName[268] = {
[CACHE] = "CACHE",
[RESERVED] = "RESERVED",
[RESUME] = "RESUME",
[BEFORE_ASYNC_WITH] = "BEFORE_ASYNC_WITH",
[BEFORE_WITH] = "BEFORE_WITH",
[BINARY_OP_ADD_FLOAT] = "BINARY_OP_ADD_FLOAT",
[BINARY_OP_ADD_INT] = "BINARY_OP_ADD_INT",
[BINARY_OP_ADD_UNICODE] = "BINARY_OP_ADD_UNICODE",
[BINARY_OP_INPLACE_ADD_UNICODE] = "BINARY_OP_INPLACE_ADD_UNICODE",
[BINARY_OP_MULTIPLY_FLOAT] = "BINARY_OP_MULTIPLY_FLOAT",
[BINARY_OP_MULTIPLY_INT] = "BINARY_OP_MULTIPLY_INT",
[BINARY_OP_SUBTRACT_FLOAT] = "BINARY_OP_SUBTRACT_FLOAT",
[BINARY_OP_SUBTRACT_INT] = "BINARY_OP_SUBTRACT_INT",
[BINARY_SLICE] = "BINARY_SLICE",
[BINARY_SUBSCR] = "BINARY_SUBSCR",
[BINARY_SUBSCR_DICT] = "BINARY_SUBSCR_DICT",
[BINARY_SUBSCR_GETITEM] = "BINARY_SUBSCR_GETITEM",
[BINARY_SUBSCR_LIST_INT] = "BINARY_SUBSCR_LIST_INT",
[BINARY_SUBSCR_STR_INT] = "BINARY_SUBSCR_STR_INT",
[BINARY_SUBSCR_TUPLE_INT] = "BINARY_SUBSCR_TUPLE_INT",
[CHECK_EG_MATCH] = "CHECK_EG_MATCH",
[CHECK_EXC_MATCH] = "CHECK_EXC_MATCH",
[CLEANUP_THROW] = "CLEANUP_THROW",
[DELETE_SUBSCR] = "DELETE_SUBSCR",
[END_ASYNC_FOR] = "END_ASYNC_FOR",
[END_FOR] = "END_FOR",
[END_SEND] = "END_SEND",
[EXIT_INIT_CHECK] = "EXIT_INIT_CHECK",
[FORMAT_SIMPLE] = "FORMAT_SIMPLE",
[FORMAT_WITH_SPEC] = "FORMAT_WITH_SPEC",
[GET_AITER] = "GET_AITER",
[GET_ANEXT] = "GET_ANEXT",
[GET_ITER] = "GET_ITER",
[GET_LEN] = "GET_LEN",
[GET_YIELD_FROM_ITER] = "GET_YIELD_FROM_ITER",
[INTERPRETER_EXIT] = "INTERPRETER_EXIT",
[LOAD_ASSERTION_ERROR] = "LOAD_ASSERTION_ERROR",
[LOAD_BUILD_CLASS] = "LOAD_BUILD_CLASS",
[LOAD_LOCALS] = "LOAD_LOCALS",
[MAKE_FUNCTION] = "MAKE_FUNCTION",
[MATCH_KEYS] = "MATCH_KEYS",
[MATCH_MAPPING] = "MATCH_MAPPING",
[MATCH_SEQUENCE] = "MATCH_SEQUENCE",
[NOP] = "NOP",
[POP_EXCEPT] = "POP_EXCEPT",
[POP_TOP] = "POP_TOP",
[PUSH_EXC_INFO] = "PUSH_EXC_INFO",
[PUSH_NULL] = "PUSH_NULL",
[RETURN_GENERATOR] = "RETURN_GENERATOR",
[RETURN_VALUE] = "RETURN_VALUE",
[SETUP_ANNOTATIONS] = "SETUP_ANNOTATIONS",
[STORE_ATTR_INSTANCE_VALUE] = "STORE_ATTR_INSTANCE_VALUE",
[STORE_ATTR_SLOT] = "STORE_ATTR_SLOT",
[STORE_SLICE] = "STORE_SLICE",
[STORE_SUBSCR] = "STORE_SUBSCR",
[STORE_SUBSCR_DICT] = "STORE_SUBSCR_DICT",
[STORE_SUBSCR_LIST_INT] = "STORE_SUBSCR_LIST_INT",
[TO_BOOL] = "TO_BOOL",
[TO_BOOL_ALWAYS_TRUE] = "TO_BOOL_ALWAYS_TRUE",
[TO_BOOL_BOOL] = "TO_BOOL_BOOL",
[TO_BOOL_INT] = "TO_BOOL_INT",
[TO_BOOL_LIST] = "TO_BOOL_LIST",
[TO_BOOL_NONE] = "TO_BOOL_NONE",
[TO_BOOL_STR] = "TO_BOOL_STR",
[UNARY_INVERT] = "UNARY_INVERT",
[UNARY_NEGATIVE] = "UNARY_NEGATIVE",
[UNARY_NOT] = "UNARY_NOT",
[WITH_EXCEPT_START] = "WITH_EXCEPT_START",
[BINARY_OP] = "BINARY_OP",
[BUILD_CONST_KEY_MAP] = "BUILD_CONST_KEY_MAP",
[BUILD_LIST] = "BUILD_LIST",
[BUILD_MAP] = "BUILD_MAP",
[BUILD_SET] = "BUILD_SET",
[BUILD_SLICE] = "BUILD_SLICE",
[BUILD_STRING] = "BUILD_STRING",
[BUILD_TUPLE] = "BUILD_TUPLE",
[CALL] = "CALL",
[CALL_BOUND_METHOD_EXACT_ARGS] = "CALL_BOUND_METHOD_EXACT_ARGS",
[CALL_BUILTIN_CLASS] = "CALL_BUILTIN_CLASS",
[CALL_BUILTIN_FAST_WITH_KEYWORDS] = "CALL_BUILTIN_FAST_WITH_KEYWORDS",
[CALL_FUNCTION_EX] = "CALL_FUNCTION_EX",
[CALL_INTRINSIC_1] = "CALL_INTRINSIC_1",
[CALL_INTRINSIC_2] = "CALL_INTRINSIC_2",
[CALL_METHOD_DESCRIPTOR_FAST_WITH_KEYWORDS] = "CALL_METHOD_DESCRIPTOR_FAST_WITH_KEYWORDS",
[CALL_NO_KW_ALLOC_AND_ENTER_INIT] = "CALL_NO_KW_ALLOC_AND_ENTER_INIT",
[CALL_NO_KW_BUILTIN_FAST] = "CALL_NO_KW_BUILTIN_FAST",
[CALL_NO_KW_BUILTIN_O] = "CALL_NO_KW_BUILTIN_O",
[CALL_NO_KW_ISINSTANCE] = "CALL_NO_KW_ISINSTANCE",
[CALL_NO_KW_LEN] = "CALL_NO_KW_LEN",
[CALL_NO_KW_LIST_APPEND] = "CALL_NO_KW_LIST_APPEND",
[CALL_NO_KW_METHOD_DESCRIPTOR_FAST] = "CALL_NO_KW_METHOD_DESCRIPTOR_FAST",
[CALL_NO_KW_METHOD_DESCRIPTOR_NOARGS] = "CALL_NO_KW_METHOD_DESCRIPTOR_NOARGS",
[CALL_NO_KW_METHOD_DESCRIPTOR_O] = "CALL_NO_KW_METHOD_DESCRIPTOR_O",
[CALL_NO_KW_STR_1] = "CALL_NO_KW_STR_1",
[CALL_NO_KW_TUPLE_1] = "CALL_NO_KW_TUPLE_1",
[CALL_NO_KW_TYPE_1] = "CALL_NO_KW_TYPE_1",
[CALL_PY_EXACT_ARGS] = "CALL_PY_EXACT_ARGS",
[CALL_PY_WITH_DEFAULTS] = "CALL_PY_WITH_DEFAULTS",
[COMPARE_OP] = "COMPARE_OP",
[COMPARE_OP_FLOAT] = "COMPARE_OP_FLOAT",
[COMPARE_OP_INT] = "COMPARE_OP_INT",
[COMPARE_OP_STR] = "COMPARE_OP_STR",
[CONTAINS_OP] = "CONTAINS_OP",
[CONVERT_VALUE] = "CONVERT_VALUE",
[COPY] = "COPY",
[COPY_FREE_VARS] = "COPY_FREE_VARS",
[DELETE_ATTR] = "DELETE_ATTR",
[DELETE_DEREF] = "DELETE_DEREF",
[DELETE_FAST] = "DELETE_FAST",
[DELETE_GLOBAL] = "DELETE_GLOBAL",
[DELETE_NAME] = "DELETE_NAME",
[DICT_MERGE] = "DICT_MERGE",
[DICT_UPDATE] = "DICT_UPDATE",
[ENTER_EXECUTOR] = "ENTER_EXECUTOR",
[EXTENDED_ARG] = "EXTENDED_ARG",
[FOR_ITER] = "FOR_ITER",
[FOR_ITER_GEN] = "FOR_ITER_GEN",
[FOR_ITER_LIST] = "FOR_ITER_LIST",
[FOR_ITER_RANGE] = "FOR_ITER_RANGE",
[FOR_ITER_TUPLE] = "FOR_ITER_TUPLE",
[GET_AWAITABLE] = "GET_AWAITABLE",
[IMPORT_FROM] = "IMPORT_FROM",
[IMPORT_NAME] = "IMPORT_NAME",
[IS_OP] = "IS_OP",
[JUMP_BACKWARD] = "JUMP_BACKWARD",
[JUMP_BACKWARD_NO_INTERRUPT] = "JUMP_BACKWARD_NO_INTERRUPT",
[JUMP_FORWARD] = "JUMP_FORWARD",
[KW_NAMES] = "KW_NAMES",
[LIST_APPEND] = "LIST_APPEND",
[LIST_EXTEND] = "LIST_EXTEND",
[LOAD_ATTR] = "LOAD_ATTR",
[LOAD_ATTR_CLASS] = "LOAD_ATTR_CLASS",
[LOAD_ATTR_GETATTRIBUTE_OVERRIDDEN] = "LOAD_ATTR_GETATTRIBUTE_OVERRIDDEN",
[LOAD_ATTR_INSTANCE_VALUE] = "LOAD_ATTR_INSTANCE_VALUE",
[LOAD_ATTR_METHOD_LAZY_DICT] = "LOAD_ATTR_METHOD_LAZY_DICT",
[LOAD_ATTR_METHOD_NO_DICT] = "LOAD_ATTR_METHOD_NO_DICT",
[LOAD_ATTR_METHOD_WITH_VALUES] = "LOAD_ATTR_METHOD_WITH_VALUES",
[LOAD_ATTR_MODULE] = "LOAD_ATTR_MODULE",
[LOAD_ATTR_NONDESCRIPTOR_NO_DICT] = "LOAD_ATTR_NONDESCRIPTOR_NO_DICT",
[LOAD_ATTR_NONDESCRIPTOR_WITH_VALUES] = "LOAD_ATTR_NONDESCRIPTOR_WITH_VALUES",
[LOAD_ATTR_PROPERTY] = "LOAD_ATTR_PROPERTY",
[LOAD_ATTR_SLOT] = "LOAD_ATTR_SLOT",
[LOAD_ATTR_WITH_HINT] = "LOAD_ATTR_WITH_HINT",
[LOAD_CONST] = "LOAD_CONST",
[LOAD_DEREF] = "LOAD_DEREF",
[LOAD_FAST] = "LOAD_FAST",
[LOAD_FAST_AND_CLEAR] = "LOAD_FAST_AND_CLEAR",
[LOAD_FAST_CHECK] = "LOAD_FAST_CHECK",
[LOAD_FAST_LOAD_FAST] = "LOAD_FAST_LOAD_FAST",
[LOAD_FROM_DICT_OR_DEREF] = "LOAD_FROM_DICT_OR_DEREF",
[LOAD_FROM_DICT_OR_GLOBALS] = "LOAD_FROM_DICT_OR_GLOBALS",
[LOAD_GLOBAL] = "LOAD_GLOBAL",
[LOAD_GLOBAL_BUILTIN] = "LOAD_GLOBAL_BUILTIN",
[LOAD_GLOBAL_MODULE] = "LOAD_GLOBAL_MODULE",
[LOAD_NAME] = "LOAD_NAME",
[LOAD_SUPER_ATTR] = "LOAD_SUPER_ATTR",
[LOAD_SUPER_ATTR_ATTR] = "LOAD_SUPER_ATTR_ATTR",
[LOAD_SUPER_ATTR_METHOD] = "LOAD_SUPER_ATTR_METHOD",
[MAKE_CELL] = "MAKE_CELL",
[MAP_ADD] = "MAP_ADD",
[MATCH_CLASS] = "MATCH_CLASS",
[POP_JUMP_IF_FALSE] = "POP_JUMP_IF_FALSE",
[POP_JUMP_IF_NONE] = "POP_JUMP_IF_NONE",
[POP_JUMP_IF_NOT_NONE] = "POP_JUMP_IF_NOT_NONE",
[POP_JUMP_IF_TRUE] = "POP_JUMP_IF_TRUE",
[RAISE_VARARGS] = "RAISE_VARARGS",
[RERAISE] = "RERAISE",
[RETURN_CONST] = "RETURN_CONST",
[SEND] = "SEND",
[SEND_GEN] = "SEND_GEN",
[SET_ADD] = "SET_ADD",
[SET_FUNCTION_ATTRIBUTE] = "SET_FUNCTION_ATTRIBUTE",
[SET_UPDATE] = "SET_UPDATE",
[STORE_ATTR] = "STORE_ATTR",
[STORE_ATTR_WITH_HINT] = "STORE_ATTR_WITH_HINT",
[STORE_DEREF] = "STORE_DEREF",
[STORE_FAST] = "STORE_FAST",
[STORE_FAST_LOAD_FAST] = "STORE_FAST_LOAD_FAST",
[STORE_FAST_STORE_FAST] = "STORE_FAST_STORE_FAST",
[STORE_GLOBAL] = "STORE_GLOBAL",
[STORE_NAME] = "STORE_NAME",
[SWAP] = "SWAP",
[UNPACK_EX] = "UNPACK_EX",
[UNPACK_SEQUENCE] = "UNPACK_SEQUENCE",
[UNPACK_SEQUENCE_LIST] = "UNPACK_SEQUENCE_LIST",
[UNPACK_SEQUENCE_TUPLE] = "UNPACK_SEQUENCE_TUPLE",
[UNPACK_SEQUENCE_TWO_TUPLE] = "UNPACK_SEQUENCE_TWO_TUPLE",
[YIELD_VALUE] = "YIELD_VALUE",
[INSTRUMENTED_RESUME] = "INSTRUMENTED_RESUME",
[INSTRUMENTED_END_FOR] = "INSTRUMENTED_END_FOR",
[INSTRUMENTED_END_SEND] = "INSTRUMENTED_END_SEND",
[INSTRUMENTED_RETURN_VALUE] = "INSTRUMENTED_RETURN_VALUE",
[INSTRUMENTED_RETURN_CONST] = "INSTRUMENTED_RETURN_CONST",
[INSTRUMENTED_YIELD_VALUE] = "INSTRUMENTED_YIELD_VALUE",
[INSTRUMENTED_LOAD_SUPER_ATTR] = "INSTRUMENTED_LOAD_SUPER_ATTR",
[INSTRUMENTED_FOR_ITER] = "INSTRUMENTED_FOR_ITER",
[INSTRUMENTED_CALL] = "INSTRUMENTED_CALL",
[INSTRUMENTED_CALL_FUNCTION_EX] = "INSTRUMENTED_CALL_FUNCTION_EX",
[INSTRUMENTED_INSTRUCTION] = "INSTRUMENTED_INSTRUCTION",
[INSTRUMENTED_JUMP_FORWARD] = "INSTRUMENTED_JUMP_FORWARD",
[INSTRUMENTED_JUMP_BACKWARD] = "INSTRUMENTED_JUMP_BACKWARD",
[INSTRUMENTED_POP_JUMP_IF_TRUE] = "INSTRUMENTED_POP_JUMP_IF_TRUE",
[INSTRUMENTED_POP_JUMP_IF_FALSE] = "INSTRUMENTED_POP_JUMP_IF_FALSE",
[INSTRUMENTED_POP_JUMP_IF_NONE] = "INSTRUMENTED_POP_JUMP_IF_NONE",
[INSTRUMENTED_POP_JUMP_IF_NOT_NONE] = "INSTRUMENTED_POP_JUMP_IF_NOT_NONE",
[INSTRUMENTED_LINE] = "INSTRUMENTED_LINE",
[JUMP] = "JUMP",
[JUMP_NO_INTERRUPT] = "JUMP_NO_INTERRUPT",
[LOAD_CLOSURE] = "LOAD_CLOSURE",
[LOAD_METHOD] = "LOAD_METHOD",
[LOAD_SUPER_METHOD] = "LOAD_SUPER_METHOD",
[LOAD_ZERO_SUPER_ATTR] = "LOAD_ZERO_SUPER_ATTR",
[LOAD_ZERO_SUPER_METHOD] = "LOAD_ZERO_SUPER_METHOD",
[POP_BLOCK] = "POP_BLOCK",
[SETUP_CLEANUP] = "SETUP_CLEANUP",
[SETUP_FINALLY] = "SETUP_FINALLY",
[SETUP_WITH] = "SETUP_WITH",
[STORE_FAST_MAYBE_NULL] = "STORE_FAST_MAYBE_NULL",
};
#endif // NEED_OPCODE_METADATA
extern const uint8_t _PyOpcode_Deopt[256];
#ifdef NEED_OPCODE_METADATA
const uint8_t _PyOpcode_Deopt[256] = {
[BEFORE_ASYNC_WITH] = BEFORE_ASYNC_WITH,
[BEFORE_WITH] = BEFORE_WITH,
[BINARY_OP] = BINARY_OP,
[BINARY_OP_ADD_FLOAT] = BINARY_OP,
[BINARY_OP_ADD_INT] = BINARY_OP,
[BINARY_OP_ADD_UNICODE] = BINARY_OP,
[BINARY_OP_INPLACE_ADD_UNICODE] = BINARY_OP,
[BINARY_OP_MULTIPLY_FLOAT] = BINARY_OP,
[BINARY_OP_MULTIPLY_INT] = BINARY_OP,
[BINARY_OP_SUBTRACT_FLOAT] = BINARY_OP,
[BINARY_OP_SUBTRACT_INT] = BINARY_OP,
[BINARY_SLICE] = BINARY_SLICE,
[BINARY_SUBSCR] = BINARY_SUBSCR,
[BINARY_SUBSCR_DICT] = BINARY_SUBSCR,
[BINARY_SUBSCR_GETITEM] = BINARY_SUBSCR,
[BINARY_SUBSCR_LIST_INT] = BINARY_SUBSCR,
[BINARY_SUBSCR_STR_INT] = BINARY_SUBSCR,
[BINARY_SUBSCR_TUPLE_INT] = BINARY_SUBSCR,
[BUILD_CONST_KEY_MAP] = BUILD_CONST_KEY_MAP,
[BUILD_LIST] = BUILD_LIST,
[BUILD_MAP] = BUILD_MAP,
[BUILD_SET] = BUILD_SET,
[BUILD_SLICE] = BUILD_SLICE,
[BUILD_STRING] = BUILD_STRING,
[BUILD_TUPLE] = BUILD_TUPLE,
[CACHE] = CACHE,
[CALL] = CALL,
[CALL_BOUND_METHOD_EXACT_ARGS] = CALL,
[CALL_BUILTIN_CLASS] = CALL,
[CALL_BUILTIN_FAST_WITH_KEYWORDS] = CALL,
[CALL_FUNCTION_EX] = CALL_FUNCTION_EX,
[CALL_INTRINSIC_1] = CALL_INTRINSIC_1,
[CALL_INTRINSIC_2] = CALL_INTRINSIC_2,
[CALL_METHOD_DESCRIPTOR_FAST_WITH_KEYWORDS] = CALL,
[CALL_NO_KW_ALLOC_AND_ENTER_INIT] = CALL,
[CALL_NO_KW_BUILTIN_FAST] = CALL,
[CALL_NO_KW_BUILTIN_O] = CALL,
[CALL_NO_KW_ISINSTANCE] = CALL,
[CALL_NO_KW_LEN] = CALL,
[CALL_NO_KW_LIST_APPEND] = CALL,
[CALL_NO_KW_METHOD_DESCRIPTOR_FAST] = CALL,
[CALL_NO_KW_METHOD_DESCRIPTOR_NOARGS] = CALL,
[CALL_NO_KW_METHOD_DESCRIPTOR_O] = CALL,
[CALL_NO_KW_STR_1] = CALL,
[CALL_NO_KW_TUPLE_1] = CALL,
[CALL_NO_KW_TYPE_1] = CALL,
[CALL_PY_EXACT_ARGS] = CALL,
[CALL_PY_WITH_DEFAULTS] = CALL,
[CHECK_EG_MATCH] = CHECK_EG_MATCH,
[CHECK_EXC_MATCH] = CHECK_EXC_MATCH,
[CLEANUP_THROW] = CLEANUP_THROW,
[COMPARE_OP] = COMPARE_OP,
[COMPARE_OP_FLOAT] = COMPARE_OP,
[COMPARE_OP_INT] = COMPARE_OP,
[COMPARE_OP_STR] = COMPARE_OP,
[CONTAINS_OP] = CONTAINS_OP,
[CONVERT_VALUE] = CONVERT_VALUE,
[COPY] = COPY,
[COPY_FREE_VARS] = COPY_FREE_VARS,
[DELETE_ATTR] = DELETE_ATTR,
[DELETE_DEREF] = DELETE_DEREF,
[DELETE_FAST] = DELETE_FAST,
[DELETE_GLOBAL] = DELETE_GLOBAL,
[DELETE_NAME] = DELETE_NAME,
[DELETE_SUBSCR] = DELETE_SUBSCR,
[DICT_MERGE] = DICT_MERGE,
[DICT_UPDATE] = DICT_UPDATE,
[END_ASYNC_FOR] = END_ASYNC_FOR,
[END_FOR] = END_FOR,
[END_SEND] = END_SEND,
[ENTER_EXECUTOR] = ENTER_EXECUTOR,
[EXIT_INIT_CHECK] = EXIT_INIT_CHECK,
[EXTENDED_ARG] = EXTENDED_ARG,
[FORMAT_SIMPLE] = FORMAT_SIMPLE,
[FORMAT_WITH_SPEC] = FORMAT_WITH_SPEC,
[FOR_ITER] = FOR_ITER,
[FOR_ITER_GEN] = FOR_ITER,
[FOR_ITER_LIST] = FOR_ITER,
[FOR_ITER_RANGE] = FOR_ITER,
[FOR_ITER_TUPLE] = FOR_ITER,
[GET_AITER] = GET_AITER,
[GET_ANEXT] = GET_ANEXT,
[GET_AWAITABLE] = GET_AWAITABLE,
[GET_ITER] = GET_ITER,
[GET_LEN] = GET_LEN,
[GET_YIELD_FROM_ITER] = GET_YIELD_FROM_ITER,
[IMPORT_FROM] = IMPORT_FROM,
[IMPORT_NAME] = IMPORT_NAME,
[INSTRUMENTED_CALL] = INSTRUMENTED_CALL,
[INSTRUMENTED_CALL_FUNCTION_EX] = INSTRUMENTED_CALL_FUNCTION_EX,
[INSTRUMENTED_END_FOR] = INSTRUMENTED_END_FOR,
[INSTRUMENTED_END_SEND] = INSTRUMENTED_END_SEND,
[INSTRUMENTED_FOR_ITER] = INSTRUMENTED_FOR_ITER,
[INSTRUMENTED_INSTRUCTION] = INSTRUMENTED_INSTRUCTION,
[INSTRUMENTED_JUMP_BACKWARD] = INSTRUMENTED_JUMP_BACKWARD,
[INSTRUMENTED_JUMP_FORWARD] = INSTRUMENTED_JUMP_FORWARD,
[INSTRUMENTED_LINE] = INSTRUMENTED_LINE,
[INSTRUMENTED_LOAD_SUPER_ATTR] = INSTRUMENTED_LOAD_SUPER_ATTR,
[INSTRUMENTED_POP_JUMP_IF_FALSE] = INSTRUMENTED_POP_JUMP_IF_FALSE,
[INSTRUMENTED_POP_JUMP_IF_NONE] = INSTRUMENTED_POP_JUMP_IF_NONE,
[INSTRUMENTED_POP_JUMP_IF_NOT_NONE] = INSTRUMENTED_POP_JUMP_IF_NOT_NONE,
[INSTRUMENTED_POP_JUMP_IF_TRUE] = INSTRUMENTED_POP_JUMP_IF_TRUE,
[INSTRUMENTED_RESUME] = INSTRUMENTED_RESUME,
[INSTRUMENTED_RETURN_CONST] = INSTRUMENTED_RETURN_CONST,
[INSTRUMENTED_RETURN_VALUE] = INSTRUMENTED_RETURN_VALUE,
[INSTRUMENTED_YIELD_VALUE] = INSTRUMENTED_YIELD_VALUE,
[INTERPRETER_EXIT] = INTERPRETER_EXIT,
[IS_OP] = IS_OP,
[JUMP_BACKWARD] = JUMP_BACKWARD,
[JUMP_BACKWARD_NO_INTERRUPT] = JUMP_BACKWARD_NO_INTERRUPT,
[JUMP_FORWARD] = JUMP_FORWARD,
[KW_NAMES] = KW_NAMES,
[LIST_APPEND] = LIST_APPEND,
[LIST_EXTEND] = LIST_EXTEND,
[LOAD_ASSERTION_ERROR] = LOAD_ASSERTION_ERROR,
[LOAD_ATTR] = LOAD_ATTR,
[LOAD_ATTR_CLASS] = LOAD_ATTR,
[LOAD_ATTR_GETATTRIBUTE_OVERRIDDEN] = LOAD_ATTR,
[LOAD_ATTR_INSTANCE_VALUE] = LOAD_ATTR,
[LOAD_ATTR_METHOD_LAZY_DICT] = LOAD_ATTR,
[LOAD_ATTR_METHOD_NO_DICT] = LOAD_ATTR,
[LOAD_ATTR_METHOD_WITH_VALUES] = LOAD_ATTR,
[LOAD_ATTR_MODULE] = LOAD_ATTR,
[LOAD_ATTR_NONDESCRIPTOR_NO_DICT] = LOAD_ATTR,
[LOAD_ATTR_NONDESCRIPTOR_WITH_VALUES] = LOAD_ATTR,
[LOAD_ATTR_PROPERTY] = LOAD_ATTR,
[LOAD_ATTR_SLOT] = LOAD_ATTR,
[LOAD_ATTR_WITH_HINT] = LOAD_ATTR,
[LOAD_BUILD_CLASS] = LOAD_BUILD_CLASS,
[LOAD_CONST] = LOAD_CONST,
[LOAD_DEREF] = LOAD_DEREF,
[LOAD_FAST] = LOAD_FAST,
[LOAD_FAST_AND_CLEAR] = LOAD_FAST_AND_CLEAR,
[LOAD_FAST_CHECK] = LOAD_FAST_CHECK,
[LOAD_FAST_LOAD_FAST] = LOAD_FAST_LOAD_FAST,
[LOAD_FROM_DICT_OR_DEREF] = LOAD_FROM_DICT_OR_DEREF,
[LOAD_FROM_DICT_OR_GLOBALS] = LOAD_FROM_DICT_OR_GLOBALS,
[LOAD_GLOBAL] = LOAD_GLOBAL,
[LOAD_GLOBAL_BUILTIN] = LOAD_GLOBAL,
[LOAD_GLOBAL_MODULE] = LOAD_GLOBAL,
[LOAD_LOCALS] = LOAD_LOCALS,
[LOAD_NAME] = LOAD_NAME,
[LOAD_SUPER_ATTR] = LOAD_SUPER_ATTR,
[LOAD_SUPER_ATTR_ATTR] = LOAD_SUPER_ATTR,
[LOAD_SUPER_ATTR_METHOD] = LOAD_SUPER_ATTR,
[MAKE_CELL] = MAKE_CELL,
[MAKE_FUNCTION] = MAKE_FUNCTION,
[MAP_ADD] = MAP_ADD,
[MATCH_CLASS] = MATCH_CLASS,
[MATCH_KEYS] = MATCH_KEYS,
[MATCH_MAPPING] = MATCH_MAPPING,
[MATCH_SEQUENCE] = MATCH_SEQUENCE,
[NOP] = NOP,
[POP_EXCEPT] = POP_EXCEPT,
[POP_JUMP_IF_FALSE] = POP_JUMP_IF_FALSE,
[POP_JUMP_IF_NONE] = POP_JUMP_IF_NONE,
[POP_JUMP_IF_NOT_NONE] = POP_JUMP_IF_NOT_NONE,
[POP_JUMP_IF_TRUE] = POP_JUMP_IF_TRUE,
[POP_TOP] = POP_TOP,
[PUSH_EXC_INFO] = PUSH_EXC_INFO,
[PUSH_NULL] = PUSH_NULL,
[RAISE_VARARGS] = RAISE_VARARGS,
[RERAISE] = RERAISE,
[RESERVED] = RESERVED,
[RESUME] = RESUME,
[RETURN_CONST] = RETURN_CONST,
[RETURN_GENERATOR] = RETURN_GENERATOR,
[RETURN_VALUE] = RETURN_VALUE,
[SEND] = SEND,
[SEND_GEN] = SEND,
[SETUP_ANNOTATIONS] = SETUP_ANNOTATIONS,
[SET_ADD] = SET_ADD,
[SET_FUNCTION_ATTRIBUTE] = SET_FUNCTION_ATTRIBUTE,
[SET_UPDATE] = SET_UPDATE,
[STORE_ATTR] = STORE_ATTR,
[STORE_ATTR_INSTANCE_VALUE] = STORE_ATTR,
[STORE_ATTR_SLOT] = STORE_ATTR,
[STORE_ATTR_WITH_HINT] = STORE_ATTR,
[STORE_DEREF] = STORE_DEREF,
[STORE_FAST] = STORE_FAST,
[STORE_FAST_LOAD_FAST] = STORE_FAST_LOAD_FAST,
[STORE_FAST_STORE_FAST] = STORE_FAST_STORE_FAST,
[STORE_GLOBAL] = STORE_GLOBAL,
[STORE_NAME] = STORE_NAME,
[STORE_SLICE] = STORE_SLICE,
[STORE_SUBSCR] = STORE_SUBSCR,
[STORE_SUBSCR_DICT] = STORE_SUBSCR,
[STORE_SUBSCR_LIST_INT] = STORE_SUBSCR,
[SWAP] = SWAP,
[TO_BOOL] = TO_BOOL,
[TO_BOOL_ALWAYS_TRUE] = TO_BOOL,
[TO_BOOL_BOOL] = TO_BOOL,
[TO_BOOL_INT] = TO_BOOL,
[TO_BOOL_LIST] = TO_BOOL,
[TO_BOOL_NONE] = TO_BOOL,
[TO_BOOL_STR] = TO_BOOL,
[UNARY_INVERT] = UNARY_INVERT,
[UNARY_NEGATIVE] = UNARY_NEGATIVE,
[UNARY_NOT] = UNARY_NOT,
[UNPACK_EX] = UNPACK_EX,
[UNPACK_SEQUENCE] = UNPACK_SEQUENCE,
[UNPACK_SEQUENCE_LIST] = UNPACK_SEQUENCE,
[UNPACK_SEQUENCE_TUPLE] = UNPACK_SEQUENCE,
[UNPACK_SEQUENCE_TWO_TUPLE] = UNPACK_SEQUENCE,
[WITH_EXCEPT_START] = WITH_EXCEPT_START,
[YIELD_VALUE] = YIELD_VALUE,
};
#endif // NEED_OPCODE_METADATA
#define EXTRA_CASES \
case 188: \
case 189: \
case 190: \
case 191: \
case 192: \
case 193: \
case 194: \
case 195: \
case 196: \
case 197: \
case 198: \
case 199: \
case 200: \
case 201: \
case 202: \
case 203: \
case 204: \
case 205: \
case 206: \
case 207: \
case 208: \
case 209: \
case 210: \
case 211: \
case 212: \
case 213: \
case 214: \
case 215: \
case 216: \
case 217: \
case 218: \
case 219: \
case 220: \
case 221: \
case 222: \
case 223: \
case 224: \
case 225: \
case 226: \
case 227: \
case 228: \
case 229: \
case 230: \
case 231: \
case 232: \
case 233: \
case 234: \
case 235: \
case 236: \
case 255: \
;

436
Include/opcode_ids.h generated
View File

@ -1,4 +1,7 @@
// Auto-generated by Tools/build/generate_opcode_h.py from Lib/opcode.py
// This file is generated by Tools/cases_generator/generate_cases.py
// from:
// Python/bytecodes.c
// Do not edit!
#ifndef Py_OPCODE_IDS_H
#define Py_OPCODE_IDS_H
@ -6,228 +9,227 @@
extern "C" {
#endif
/* Instruction opcodes for compiled code */
#define CACHE 0
#define POP_TOP 1
#define PUSH_NULL 2
#define INTERPRETER_EXIT 3
#define END_FOR 4
#define END_SEND 5
#define TO_BOOL 6
#define NOP 9
#define UNARY_NEGATIVE 11
#define UNARY_NOT 12
#define UNARY_INVERT 15
#define EXIT_INIT_CHECK 16
#define BEFORE_ASYNC_WITH 1
#define BEFORE_WITH 2
#define BINARY_OP_ADD_FLOAT 3
#define BINARY_OP_ADD_INT 4
#define BINARY_OP_ADD_UNICODE 5
#define BINARY_OP_INPLACE_ADD_UNICODE 6
#define BINARY_OP_MULTIPLY_FLOAT 7
#define BINARY_OP_MULTIPLY_INT 8
#define BINARY_OP_SUBTRACT_FLOAT 9
#define BINARY_OP_SUBTRACT_INT 10
#define BINARY_SLICE 11
#define BINARY_SUBSCR 12
#define BINARY_SUBSCR_DICT 13
#define BINARY_SUBSCR_GETITEM 14
#define BINARY_SUBSCR_LIST_INT 15
#define BINARY_SUBSCR_STR_INT 16
#define RESERVED 17
#define MAKE_FUNCTION 24
#define BINARY_SUBSCR 25
#define BINARY_SLICE 26
#define STORE_SLICE 27
#define GET_LEN 30
#define MATCH_MAPPING 31
#define MATCH_SEQUENCE 32
#define MATCH_KEYS 33
#define PUSH_EXC_INFO 35
#define CHECK_EXC_MATCH 36
#define CHECK_EG_MATCH 37
#define FORMAT_SIMPLE 40
#define FORMAT_WITH_SPEC 41
#define WITH_EXCEPT_START 49
#define GET_AITER 50
#define GET_ANEXT 51
#define BEFORE_ASYNC_WITH 52
#define BEFORE_WITH 53
#define END_ASYNC_FOR 54
#define CLEANUP_THROW 55
#define STORE_SUBSCR 60
#define DELETE_SUBSCR 61
#define GET_ITER 68
#define GET_YIELD_FROM_ITER 69
#define LOAD_BUILD_CLASS 71
#define LOAD_ASSERTION_ERROR 74
#define RETURN_GENERATOR 75
#define RETURN_VALUE 83
#define SETUP_ANNOTATIONS 85
#define LOAD_LOCALS 87
#define POP_EXCEPT 89
#define STORE_NAME 90
#define DELETE_NAME 91
#define UNPACK_SEQUENCE 92
#define FOR_ITER 93
#define UNPACK_EX 94
#define STORE_ATTR 95
#define DELETE_ATTR 96
#define STORE_GLOBAL 97
#define DELETE_GLOBAL 98
#define SWAP 99
#define LOAD_CONST 100
#define LOAD_NAME 101
#define BUILD_TUPLE 102
#define BUILD_LIST 103
#define BUILD_SET 104
#define BUILD_MAP 105
#define LOAD_ATTR 106
#define COMPARE_OP 107
#define IMPORT_NAME 108
#define IMPORT_FROM 109
#define JUMP_FORWARD 110
#define POP_JUMP_IF_FALSE 114
#define POP_JUMP_IF_TRUE 115
#define LOAD_GLOBAL 116
#define IS_OP 117
#define CONTAINS_OP 118
#define RERAISE 119
#define COPY 120
#define RETURN_CONST 121
#define BINARY_OP 122
#define SEND 123
#define LOAD_FAST 124
#define STORE_FAST 125
#define DELETE_FAST 126
#define LOAD_FAST_CHECK 127
#define POP_JUMP_IF_NOT_NONE 128
#define POP_JUMP_IF_NONE 129
#define RAISE_VARARGS 130
#define GET_AWAITABLE 131
#define BUILD_SLICE 133
#define JUMP_BACKWARD_NO_INTERRUPT 134
#define MAKE_CELL 135
#define LOAD_DEREF 137
#define STORE_DEREF 138
#define DELETE_DEREF 139
#define JUMP_BACKWARD 140
#define LOAD_SUPER_ATTR 141
#define CALL_FUNCTION_EX 142
#define LOAD_FAST_AND_CLEAR 143
#define EXTENDED_ARG 144
#define LIST_APPEND 145
#define SET_ADD 146
#define MAP_ADD 147
#define COPY_FREE_VARS 149
#define YIELD_VALUE 150
#define RESUME 151
#define MATCH_CLASS 152
#define BUILD_CONST_KEY_MAP 156
#define BUILD_STRING 157
#define CONVERT_VALUE 158
#define LIST_EXTEND 162
#define SET_UPDATE 163
#define DICT_MERGE 164
#define DICT_UPDATE 165
#define LOAD_FAST_LOAD_FAST 168
#define STORE_FAST_LOAD_FAST 169
#define STORE_FAST_STORE_FAST 170
#define CALL 171
#define KW_NAMES 172
#define CALL_INTRINSIC_1 173
#define CALL_INTRINSIC_2 174
#define LOAD_FROM_DICT_OR_GLOBALS 175
#define LOAD_FROM_DICT_OR_DEREF 176
#define SET_FUNCTION_ATTRIBUTE 177
#define ENTER_EXECUTOR 230
#define BINARY_SUBSCR_TUPLE_INT 18
#define CHECK_EG_MATCH 19
#define CHECK_EXC_MATCH 20
#define CLEANUP_THROW 21
#define DELETE_SUBSCR 22
#define END_ASYNC_FOR 23
#define END_FOR 24
#define END_SEND 25
#define EXIT_INIT_CHECK 26
#define FORMAT_SIMPLE 27
#define FORMAT_WITH_SPEC 28
#define GET_AITER 29
#define GET_ANEXT 30
#define GET_ITER 31
#define GET_LEN 32
#define GET_YIELD_FROM_ITER 33
#define INTERPRETER_EXIT 34
#define LOAD_ASSERTION_ERROR 35
#define LOAD_BUILD_CLASS 36
#define LOAD_LOCALS 37
#define MAKE_FUNCTION 38
#define MATCH_KEYS 39
#define MATCH_MAPPING 40
#define MATCH_SEQUENCE 41
#define NOP 42
#define POP_EXCEPT 43
#define POP_TOP 44
#define PUSH_EXC_INFO 45
#define PUSH_NULL 46
#define RETURN_GENERATOR 47
#define RETURN_VALUE 48
#define SETUP_ANNOTATIONS 49
#define STORE_ATTR_INSTANCE_VALUE 50
#define STORE_ATTR_SLOT 51
#define STORE_SLICE 52
#define STORE_SUBSCR 53
#define STORE_SUBSCR_DICT 54
#define STORE_SUBSCR_LIST_INT 55
#define TO_BOOL 56
#define TO_BOOL_ALWAYS_TRUE 57
#define TO_BOOL_BOOL 58
#define TO_BOOL_INT 59
#define TO_BOOL_LIST 60
#define TO_BOOL_NONE 61
#define TO_BOOL_STR 62
#define UNARY_INVERT 63
#define UNARY_NEGATIVE 64
#define UNARY_NOT 65
#define WITH_EXCEPT_START 66
#define HAVE_ARGUMENT 67
#define BINARY_OP 67
#define BUILD_CONST_KEY_MAP 68
#define BUILD_LIST 69
#define BUILD_MAP 70
#define BUILD_SET 71
#define BUILD_SLICE 72
#define BUILD_STRING 73
#define BUILD_TUPLE 74
#define CALL 75
#define CALL_BOUND_METHOD_EXACT_ARGS 76
#define CALL_BUILTIN_CLASS 77
#define CALL_BUILTIN_FAST_WITH_KEYWORDS 78
#define CALL_FUNCTION_EX 79
#define CALL_INTRINSIC_1 80
#define CALL_INTRINSIC_2 81
#define CALL_METHOD_DESCRIPTOR_FAST_WITH_KEYWORDS 82
#define CALL_NO_KW_ALLOC_AND_ENTER_INIT 83
#define CALL_NO_KW_BUILTIN_FAST 84
#define CALL_NO_KW_BUILTIN_O 85
#define CALL_NO_KW_ISINSTANCE 86
#define CALL_NO_KW_LEN 87
#define CALL_NO_KW_LIST_APPEND 88
#define CALL_NO_KW_METHOD_DESCRIPTOR_FAST 89
#define CALL_NO_KW_METHOD_DESCRIPTOR_NOARGS 90
#define CALL_NO_KW_METHOD_DESCRIPTOR_O 91
#define CALL_NO_KW_STR_1 92
#define CALL_NO_KW_TUPLE_1 93
#define CALL_NO_KW_TYPE_1 94
#define CALL_PY_EXACT_ARGS 95
#define CALL_PY_WITH_DEFAULTS 96
#define COMPARE_OP 97
#define COMPARE_OP_FLOAT 98
#define COMPARE_OP_INT 99
#define COMPARE_OP_STR 100
#define CONTAINS_OP 101
#define CONVERT_VALUE 102
#define COPY 103
#define COPY_FREE_VARS 104
#define DELETE_ATTR 105
#define DELETE_DEREF 106
#define DELETE_FAST 107
#define DELETE_GLOBAL 108
#define DELETE_NAME 109
#define DICT_MERGE 110
#define DICT_UPDATE 111
#define ENTER_EXECUTOR 112
#define EXTENDED_ARG 113
#define FOR_ITER 114
#define FOR_ITER_GEN 115
#define FOR_ITER_LIST 116
#define FOR_ITER_RANGE 117
#define FOR_ITER_TUPLE 118
#define GET_AWAITABLE 119
#define IMPORT_FROM 120
#define IMPORT_NAME 121
#define IS_OP 122
#define JUMP_BACKWARD 123
#define JUMP_BACKWARD_NO_INTERRUPT 124
#define JUMP_FORWARD 125
#define KW_NAMES 126
#define LIST_APPEND 127
#define LIST_EXTEND 128
#define LOAD_ATTR 129
#define LOAD_ATTR_CLASS 130
#define LOAD_ATTR_GETATTRIBUTE_OVERRIDDEN 131
#define LOAD_ATTR_INSTANCE_VALUE 132
#define LOAD_ATTR_METHOD_LAZY_DICT 133
#define LOAD_ATTR_METHOD_NO_DICT 134
#define LOAD_ATTR_METHOD_WITH_VALUES 135
#define LOAD_ATTR_MODULE 136
#define LOAD_ATTR_NONDESCRIPTOR_NO_DICT 137
#define LOAD_ATTR_NONDESCRIPTOR_WITH_VALUES 138
#define LOAD_ATTR_PROPERTY 139
#define LOAD_ATTR_SLOT 140
#define LOAD_ATTR_WITH_HINT 141
#define LOAD_CONST 142
#define LOAD_DEREF 143
#define LOAD_FAST 144
#define LOAD_FAST_AND_CLEAR 145
#define LOAD_FAST_CHECK 146
#define LOAD_FAST_LOAD_FAST 147
#define LOAD_FROM_DICT_OR_DEREF 148
#define LOAD_FROM_DICT_OR_GLOBALS 149
#define LOAD_GLOBAL 150
#define LOAD_GLOBAL_BUILTIN 151
#define LOAD_GLOBAL_MODULE 152
#define LOAD_NAME 153
#define LOAD_SUPER_ATTR 154
#define LOAD_SUPER_ATTR_ATTR 155
#define LOAD_SUPER_ATTR_METHOD 156
#define MAKE_CELL 157
#define MAP_ADD 158
#define MATCH_CLASS 159
#define POP_JUMP_IF_FALSE 160
#define POP_JUMP_IF_NONE 161
#define POP_JUMP_IF_NOT_NONE 162
#define POP_JUMP_IF_TRUE 163
#define RAISE_VARARGS 164
#define RERAISE 165
#define RESUME 166
#define RETURN_CONST 167
#define SEND 168
#define SEND_GEN 169
#define SET_ADD 170
#define SET_FUNCTION_ATTRIBUTE 171
#define SET_UPDATE 172
#define STORE_ATTR 173
#define STORE_ATTR_WITH_HINT 174
#define STORE_DEREF 175
#define STORE_FAST 176
#define STORE_FAST_LOAD_FAST 177
#define STORE_FAST_STORE_FAST 178
#define STORE_GLOBAL 179
#define STORE_NAME 180
#define SWAP 181
#define UNPACK_EX 182
#define UNPACK_SEQUENCE 183
#define UNPACK_SEQUENCE_LIST 184
#define UNPACK_SEQUENCE_TUPLE 185
#define UNPACK_SEQUENCE_TWO_TUPLE 186
#define YIELD_VALUE 187
#define MIN_INSTRUMENTED_OPCODE 237
#define INSTRUMENTED_LOAD_SUPER_ATTR 237
#define INSTRUMENTED_POP_JUMP_IF_NONE 238
#define INSTRUMENTED_POP_JUMP_IF_NOT_NONE 239
#define INSTRUMENTED_RESUME 240
#define INSTRUMENTED_CALL 241
#define INSTRUMENTED_RETURN_VALUE 242
#define INSTRUMENTED_YIELD_VALUE 243
#define INSTRUMENTED_CALL_FUNCTION_EX 244
#define INSTRUMENTED_JUMP_FORWARD 245
#define INSTRUMENTED_JUMP_BACKWARD 246
#define INSTRUMENTED_RETURN_CONST 247
#define INSTRUMENTED_FOR_ITER 248
#define INSTRUMENTED_POP_JUMP_IF_FALSE 249
#define INSTRUMENTED_RESUME 237
#define INSTRUMENTED_END_FOR 238
#define INSTRUMENTED_END_SEND 239
#define INSTRUMENTED_RETURN_VALUE 240
#define INSTRUMENTED_RETURN_CONST 241
#define INSTRUMENTED_YIELD_VALUE 242
#define INSTRUMENTED_LOAD_SUPER_ATTR 243
#define INSTRUMENTED_FOR_ITER 244
#define INSTRUMENTED_CALL 245
#define INSTRUMENTED_CALL_FUNCTION_EX 246
#define INSTRUMENTED_INSTRUCTION 247
#define INSTRUMENTED_JUMP_FORWARD 248
#define INSTRUMENTED_JUMP_BACKWARD 249
#define INSTRUMENTED_POP_JUMP_IF_TRUE 250
#define INSTRUMENTED_END_FOR 251
#define INSTRUMENTED_END_SEND 252
#define INSTRUMENTED_INSTRUCTION 253
#define INSTRUMENTED_POP_JUMP_IF_FALSE 251
#define INSTRUMENTED_POP_JUMP_IF_NONE 252
#define INSTRUMENTED_POP_JUMP_IF_NOT_NONE 253
#define INSTRUMENTED_LINE 254
#define SETUP_FINALLY 256
#define SETUP_CLEANUP 257
#define SETUP_WITH 258
#define POP_BLOCK 259
#define JUMP 260
#define JUMP_NO_INTERRUPT 261
#define LOAD_METHOD 262
#define LOAD_SUPER_METHOD 263
#define LOAD_ZERO_SUPER_METHOD 264
#define LOAD_ZERO_SUPER_ATTR 265
#define STORE_FAST_MAYBE_NULL 266
#define LOAD_CLOSURE 267
#define TO_BOOL_ALWAYS_TRUE 7
#define TO_BOOL_BOOL 8
#define TO_BOOL_INT 10
#define TO_BOOL_LIST 13
#define TO_BOOL_NONE 14
#define TO_BOOL_STR 18
#define BINARY_OP_MULTIPLY_INT 19
#define BINARY_OP_ADD_INT 20
#define BINARY_OP_SUBTRACT_INT 21
#define BINARY_OP_MULTIPLY_FLOAT 22
#define BINARY_OP_ADD_FLOAT 23
#define BINARY_OP_SUBTRACT_FLOAT 28
#define BINARY_OP_ADD_UNICODE 29
#define BINARY_OP_INPLACE_ADD_UNICODE 34
#define BINARY_SUBSCR_DICT 38
#define BINARY_SUBSCR_GETITEM 39
#define BINARY_SUBSCR_LIST_INT 42
#define BINARY_SUBSCR_STR_INT 43
#define BINARY_SUBSCR_TUPLE_INT 44
#define STORE_SUBSCR_DICT 45
#define STORE_SUBSCR_LIST_INT 46
#define SEND_GEN 47
#define UNPACK_SEQUENCE_TWO_TUPLE 48
#define UNPACK_SEQUENCE_TUPLE 56
#define UNPACK_SEQUENCE_LIST 57
#define STORE_ATTR_INSTANCE_VALUE 58
#define STORE_ATTR_SLOT 59
#define STORE_ATTR_WITH_HINT 62
#define LOAD_GLOBAL_MODULE 63
#define LOAD_GLOBAL_BUILTIN 64
#define LOAD_SUPER_ATTR_ATTR 65
#define LOAD_SUPER_ATTR_METHOD 66
#define LOAD_ATTR_INSTANCE_VALUE 67
#define LOAD_ATTR_MODULE 70
#define LOAD_ATTR_WITH_HINT 72
#define LOAD_ATTR_SLOT 73
#define LOAD_ATTR_CLASS 76
#define LOAD_ATTR_PROPERTY 77
#define LOAD_ATTR_GETATTRIBUTE_OVERRIDDEN 78
#define LOAD_ATTR_METHOD_WITH_VALUES 79
#define LOAD_ATTR_METHOD_NO_DICT 80
#define LOAD_ATTR_METHOD_LAZY_DICT 81
#define LOAD_ATTR_NONDESCRIPTOR_WITH_VALUES 82
#define LOAD_ATTR_NONDESCRIPTOR_NO_DICT 84
#define COMPARE_OP_FLOAT 86
#define COMPARE_OP_INT 88
#define COMPARE_OP_STR 111
#define FOR_ITER_LIST 112
#define FOR_ITER_TUPLE 113
#define FOR_ITER_RANGE 132
#define FOR_ITER_GEN 136
#define CALL_BOUND_METHOD_EXACT_ARGS 148
#define CALL_PY_EXACT_ARGS 153
#define CALL_PY_WITH_DEFAULTS 154
#define CALL_NO_KW_TYPE_1 155
#define CALL_NO_KW_STR_1 159
#define CALL_NO_KW_TUPLE_1 160
#define CALL_BUILTIN_CLASS 161
#define CALL_NO_KW_BUILTIN_O 166
#define CALL_NO_KW_BUILTIN_FAST 167
#define CALL_BUILTIN_FAST_WITH_KEYWORDS 178
#define CALL_NO_KW_LEN 179
#define CALL_NO_KW_ISINSTANCE 180
#define CALL_NO_KW_LIST_APPEND 181
#define CALL_NO_KW_METHOD_DESCRIPTOR_O 182
#define CALL_METHOD_DESCRIPTOR_FAST_WITH_KEYWORDS 183
#define CALL_NO_KW_METHOD_DESCRIPTOR_NOARGS 184
#define CALL_NO_KW_METHOD_DESCRIPTOR_FAST 185
#define CALL_NO_KW_ALLOC_AND_ENTER_INIT 186
#define JUMP 256
#define JUMP_NO_INTERRUPT 257
#define LOAD_CLOSURE 258
#define LOAD_METHOD 259
#define LOAD_SUPER_METHOD 260
#define LOAD_ZERO_SUPER_ATTR 261
#define LOAD_ZERO_SUPER_METHOD 262
#define POP_BLOCK 263
#define SETUP_CLEANUP 264
#define SETUP_FINALLY 265
#define SETUP_WITH 266
#define STORE_FAST_MAYBE_NULL 267
#ifdef __cplusplus
}

226
Lib/_opcode_metadata.py generated
View File

@ -103,4 +103,228 @@ _specializations = {
# An irregular case:
_specializations["BINARY_OP"].append("BINARY_OP_INPLACE_ADD_UNICODE")
_specialized_instructions = [opcode for family in _specializations.values() for opcode in family]
_specialized_opmap = {
'BINARY_OP_ADD_FLOAT': 3,
'BINARY_OP_ADD_INT': 4,
'BINARY_OP_ADD_UNICODE': 5,
'BINARY_OP_INPLACE_ADD_UNICODE': 6,
'BINARY_OP_MULTIPLY_FLOAT': 7,
'BINARY_OP_MULTIPLY_INT': 8,
'BINARY_OP_SUBTRACT_FLOAT': 9,
'BINARY_OP_SUBTRACT_INT': 10,
'BINARY_SUBSCR_DICT': 13,
'BINARY_SUBSCR_GETITEM': 14,
'BINARY_SUBSCR_LIST_INT': 15,
'BINARY_SUBSCR_STR_INT': 16,
'BINARY_SUBSCR_TUPLE_INT': 18,
'STORE_ATTR_INSTANCE_VALUE': 50,
'STORE_ATTR_SLOT': 51,
'STORE_SUBSCR_DICT': 54,
'STORE_SUBSCR_LIST_INT': 55,
'TO_BOOL_ALWAYS_TRUE': 57,
'TO_BOOL_BOOL': 58,
'TO_BOOL_INT': 59,
'TO_BOOL_LIST': 60,
'TO_BOOL_NONE': 61,
'TO_BOOL_STR': 62,
'CALL_BOUND_METHOD_EXACT_ARGS': 76,
'CALL_BUILTIN_CLASS': 77,
'CALL_BUILTIN_FAST_WITH_KEYWORDS': 78,
'CALL_METHOD_DESCRIPTOR_FAST_WITH_KEYWORDS': 82,
'CALL_NO_KW_ALLOC_AND_ENTER_INIT': 83,
'CALL_NO_KW_BUILTIN_FAST': 84,
'CALL_NO_KW_BUILTIN_O': 85,
'CALL_NO_KW_ISINSTANCE': 86,
'CALL_NO_KW_LEN': 87,
'CALL_NO_KW_LIST_APPEND': 88,
'CALL_NO_KW_METHOD_DESCRIPTOR_FAST': 89,
'CALL_NO_KW_METHOD_DESCRIPTOR_NOARGS': 90,
'CALL_NO_KW_METHOD_DESCRIPTOR_O': 91,
'CALL_NO_KW_STR_1': 92,
'CALL_NO_KW_TUPLE_1': 93,
'CALL_NO_KW_TYPE_1': 94,
'CALL_PY_EXACT_ARGS': 95,
'CALL_PY_WITH_DEFAULTS': 96,
'COMPARE_OP_FLOAT': 98,
'COMPARE_OP_INT': 99,
'COMPARE_OP_STR': 100,
'FOR_ITER_GEN': 115,
'FOR_ITER_LIST': 116,
'FOR_ITER_RANGE': 117,
'FOR_ITER_TUPLE': 118,
'LOAD_ATTR_CLASS': 130,
'LOAD_ATTR_GETATTRIBUTE_OVERRIDDEN': 131,
'LOAD_ATTR_INSTANCE_VALUE': 132,
'LOAD_ATTR_METHOD_LAZY_DICT': 133,
'LOAD_ATTR_METHOD_NO_DICT': 134,
'LOAD_ATTR_METHOD_WITH_VALUES': 135,
'LOAD_ATTR_MODULE': 136,
'LOAD_ATTR_NONDESCRIPTOR_NO_DICT': 137,
'LOAD_ATTR_NONDESCRIPTOR_WITH_VALUES': 138,
'LOAD_ATTR_PROPERTY': 139,
'LOAD_ATTR_SLOT': 140,
'LOAD_ATTR_WITH_HINT': 141,
'LOAD_GLOBAL_BUILTIN': 151,
'LOAD_GLOBAL_MODULE': 152,
'LOAD_SUPER_ATTR_ATTR': 155,
'LOAD_SUPER_ATTR_METHOD': 156,
'SEND_GEN': 169,
'STORE_ATTR_WITH_HINT': 174,
'UNPACK_SEQUENCE_LIST': 184,
'UNPACK_SEQUENCE_TUPLE': 185,
'UNPACK_SEQUENCE_TWO_TUPLE': 186,
}
opmap = {
'CACHE': 0,
'BEFORE_ASYNC_WITH': 1,
'BEFORE_WITH': 2,
'BINARY_SLICE': 11,
'BINARY_SUBSCR': 12,
'RESERVED': 17,
'CHECK_EG_MATCH': 19,
'CHECK_EXC_MATCH': 20,
'CLEANUP_THROW': 21,
'DELETE_SUBSCR': 22,
'END_ASYNC_FOR': 23,
'END_FOR': 24,
'END_SEND': 25,
'EXIT_INIT_CHECK': 26,
'FORMAT_SIMPLE': 27,
'FORMAT_WITH_SPEC': 28,
'GET_AITER': 29,
'GET_ANEXT': 30,
'GET_ITER': 31,
'GET_LEN': 32,
'GET_YIELD_FROM_ITER': 33,
'INTERPRETER_EXIT': 34,
'LOAD_ASSERTION_ERROR': 35,
'LOAD_BUILD_CLASS': 36,
'LOAD_LOCALS': 37,
'MAKE_FUNCTION': 38,
'MATCH_KEYS': 39,
'MATCH_MAPPING': 40,
'MATCH_SEQUENCE': 41,
'NOP': 42,
'POP_EXCEPT': 43,
'POP_TOP': 44,
'PUSH_EXC_INFO': 45,
'PUSH_NULL': 46,
'RETURN_GENERATOR': 47,
'RETURN_VALUE': 48,
'SETUP_ANNOTATIONS': 49,
'STORE_SLICE': 52,
'STORE_SUBSCR': 53,
'TO_BOOL': 56,
'UNARY_INVERT': 63,
'UNARY_NEGATIVE': 64,
'UNARY_NOT': 65,
'WITH_EXCEPT_START': 66,
'BINARY_OP': 67,
'BUILD_CONST_KEY_MAP': 68,
'BUILD_LIST': 69,
'BUILD_MAP': 70,
'BUILD_SET': 71,
'BUILD_SLICE': 72,
'BUILD_STRING': 73,
'BUILD_TUPLE': 74,
'CALL': 75,
'CALL_FUNCTION_EX': 79,
'CALL_INTRINSIC_1': 80,
'CALL_INTRINSIC_2': 81,
'COMPARE_OP': 97,
'CONTAINS_OP': 101,
'CONVERT_VALUE': 102,
'COPY': 103,
'COPY_FREE_VARS': 104,
'DELETE_ATTR': 105,
'DELETE_DEREF': 106,
'DELETE_FAST': 107,
'DELETE_GLOBAL': 108,
'DELETE_NAME': 109,
'DICT_MERGE': 110,
'DICT_UPDATE': 111,
'ENTER_EXECUTOR': 112,
'EXTENDED_ARG': 113,
'FOR_ITER': 114,
'GET_AWAITABLE': 119,
'IMPORT_FROM': 120,
'IMPORT_NAME': 121,
'IS_OP': 122,
'JUMP_BACKWARD': 123,
'JUMP_BACKWARD_NO_INTERRUPT': 124,
'JUMP_FORWARD': 125,
'KW_NAMES': 126,
'LIST_APPEND': 127,
'LIST_EXTEND': 128,
'LOAD_ATTR': 129,
'LOAD_CONST': 142,
'LOAD_DEREF': 143,
'LOAD_FAST': 144,
'LOAD_FAST_AND_CLEAR': 145,
'LOAD_FAST_CHECK': 146,
'LOAD_FAST_LOAD_FAST': 147,
'LOAD_FROM_DICT_OR_DEREF': 148,
'LOAD_FROM_DICT_OR_GLOBALS': 149,
'LOAD_GLOBAL': 150,
'LOAD_NAME': 153,
'LOAD_SUPER_ATTR': 154,
'MAKE_CELL': 157,
'MAP_ADD': 158,
'MATCH_CLASS': 159,
'POP_JUMP_IF_FALSE': 160,
'POP_JUMP_IF_NONE': 161,
'POP_JUMP_IF_NOT_NONE': 162,
'POP_JUMP_IF_TRUE': 163,
'RAISE_VARARGS': 164,
'RERAISE': 165,
'RESUME': 166,
'RETURN_CONST': 167,
'SEND': 168,
'SET_ADD': 170,
'SET_FUNCTION_ATTRIBUTE': 171,
'SET_UPDATE': 172,
'STORE_ATTR': 173,
'STORE_DEREF': 175,
'STORE_FAST': 176,
'STORE_FAST_LOAD_FAST': 177,
'STORE_FAST_STORE_FAST': 178,
'STORE_GLOBAL': 179,
'STORE_NAME': 180,
'SWAP': 181,
'UNPACK_EX': 182,
'UNPACK_SEQUENCE': 183,
'YIELD_VALUE': 187,
'INSTRUMENTED_RESUME': 237,
'INSTRUMENTED_END_FOR': 238,
'INSTRUMENTED_END_SEND': 239,
'INSTRUMENTED_RETURN_VALUE': 240,
'INSTRUMENTED_RETURN_CONST': 241,
'INSTRUMENTED_YIELD_VALUE': 242,
'INSTRUMENTED_LOAD_SUPER_ATTR': 243,
'INSTRUMENTED_FOR_ITER': 244,
'INSTRUMENTED_CALL': 245,
'INSTRUMENTED_CALL_FUNCTION_EX': 246,
'INSTRUMENTED_INSTRUCTION': 247,
'INSTRUMENTED_JUMP_FORWARD': 248,
'INSTRUMENTED_JUMP_BACKWARD': 249,
'INSTRUMENTED_POP_JUMP_IF_TRUE': 250,
'INSTRUMENTED_POP_JUMP_IF_FALSE': 251,
'INSTRUMENTED_POP_JUMP_IF_NONE': 252,
'INSTRUMENTED_POP_JUMP_IF_NOT_NONE': 253,
'INSTRUMENTED_LINE': 254,
'JUMP': 256,
'JUMP_NO_INTERRUPT': 257,
'LOAD_CLOSURE': 258,
'LOAD_METHOD': 259,
'LOAD_SUPER_METHOD': 260,
'LOAD_ZERO_SUPER_ATTR': 261,
'LOAD_ZERO_SUPER_METHOD': 262,
'POP_BLOCK': 263,
'SETUP_CLEANUP': 264,
'SETUP_FINALLY': 265,
'SETUP_WITH': 266,
'STORE_FAST_MAYBE_NULL': 267,
}
MIN_INSTRUMENTED_OPCODE = 237
HAVE_ARGUMENT = 67

View File

@ -14,7 +14,7 @@ from opcode import (
_intrinsic_1_descs,
_intrinsic_2_descs,
_specializations,
_specialized_instructions,
_specialized_opmap,
)
__all__ = ["code_info", "dis", "disassemble", "distb", "disco",
@ -49,11 +49,11 @@ CACHE = opmap["CACHE"]
_all_opname = list(opname)
_all_opmap = dict(opmap)
_empty_slot = [slot for slot, name in enumerate(_all_opname) if name.startswith("<")]
for spec_op, specialized in zip(_empty_slot, _specialized_instructions):
for name, op in _specialized_opmap.items():
# fill opname and opmap
_all_opname[spec_op] = specialized
_all_opmap[specialized] = spec_op
assert op < len(_all_opname)
_all_opname[op] = name
_all_opmap[name] = op
deoptmap = {
specialized: base for base, family in _specializations.items() for specialized in family

View File

@ -454,6 +454,7 @@ _code_type = type(_write_atomic.__code__)
# Python 3.13a1 3556 (Convert LOAD_CLOSURE to a pseudo-op)
# Python 3.13a1 3557 (Make the conversion to boolean in jumps explicit)
# Python 3.13a1 3558 (Reorder the stack items for CALL)
# Python 3.13a1 3559 (Generate opcode IDs from bytecodes.c)
# Python 3.14 will start with 3600
@ -470,7 +471,7 @@ _code_type = type(_write_atomic.__code__)
# Whenever MAGIC_NUMBER is changed, the ranges in the magic_values array
# in PC/launcher.c must also be updated.
MAGIC_NUMBER = (3558).to_bytes(2, 'little') + b'\r\n'
MAGIC_NUMBER = (3559).to_bytes(2, 'little') + b'\r\n'
_RAW_MAGIC_NUMBER = int.from_bytes(MAGIC_NUMBER, 'little') # For import.c

View File

@ -6,8 +6,7 @@ operate on bytecodes (e.g. peephole optimizers).
# Note that __all__ is further extended below
__all__ = ["cmp_op", "opname", "opmap", "stack_effect", "hascompare",
"HAVE_ARGUMENT", "EXTENDED_ARG"]
__all__ = ["cmp_op", "stack_effect", "hascompare"]
import _opcode
from _opcode import stack_effect
@ -15,215 +14,18 @@ from _opcode import stack_effect
import sys
# The build uses older versions of Python which do not have _opcode_metadata
if sys.version_info[:2] >= (3, 13):
from _opcode_metadata import _specializations, _specialized_instructions
from _opcode_metadata import _specializations, _specialized_opmap
from _opcode_metadata import opmap, HAVE_ARGUMENT, MIN_INSTRUMENTED_OPCODE
EXTENDED_ARG = opmap['EXTENDED_ARG']
opname = ['<%r>' % (op,) for op in range(max(opmap.values()) + 1)]
for op, i in opmap.items():
opname[i] = op
__all__.extend(["opname", "opmap", "HAVE_ARGUMENT", "EXTENDED_ARG"])
cmp_op = ('<', '<=', '==', '!=', '>', '>=')
opmap = {}
def def_op(name, op):
opmap[name] = op
# Instruction opcodes for compiled code
# Blank lines correspond to available opcodes
def_op('CACHE', 0)
def_op('POP_TOP', 1)
def_op('PUSH_NULL', 2)
def_op('INTERPRETER_EXIT', 3)
def_op('END_FOR', 4)
def_op('END_SEND', 5)
def_op('TO_BOOL', 6)
def_op('NOP', 9)
def_op('UNARY_NEGATIVE', 11)
def_op('UNARY_NOT', 12)
def_op('UNARY_INVERT', 15)
def_op('EXIT_INIT_CHECK', 16)
# We reserve 17 as it is the initial value for the specializing counter
# This helps us catch cases where we attempt to execute a cache.
def_op('RESERVED', 17)
def_op('MAKE_FUNCTION', 24)
def_op('BINARY_SUBSCR', 25)
def_op('BINARY_SLICE', 26)
def_op('STORE_SLICE', 27)
def_op('GET_LEN', 30)
def_op('MATCH_MAPPING', 31)
def_op('MATCH_SEQUENCE', 32)
def_op('MATCH_KEYS', 33)
def_op('PUSH_EXC_INFO', 35)
def_op('CHECK_EXC_MATCH', 36)
def_op('CHECK_EG_MATCH', 37)
def_op('FORMAT_SIMPLE', 40)
def_op('FORMAT_WITH_SPEC', 41)
def_op('WITH_EXCEPT_START', 49)
def_op('GET_AITER', 50)
def_op('GET_ANEXT', 51)
def_op('BEFORE_ASYNC_WITH', 52)
def_op('BEFORE_WITH', 53)
def_op('END_ASYNC_FOR', 54)
def_op('CLEANUP_THROW', 55)
def_op('STORE_SUBSCR', 60)
def_op('DELETE_SUBSCR', 61)
def_op('GET_ITER', 68)
def_op('GET_YIELD_FROM_ITER', 69)
def_op('LOAD_BUILD_CLASS', 71)
def_op('LOAD_ASSERTION_ERROR', 74)
def_op('RETURN_GENERATOR', 75)
def_op('RETURN_VALUE', 83)
def_op('SETUP_ANNOTATIONS', 85)
def_op('LOAD_LOCALS', 87)
def_op('POP_EXCEPT', 89)
HAVE_ARGUMENT = 90 # real opcodes from here have an argument:
def_op('STORE_NAME', 90) # Index in name list
def_op('DELETE_NAME', 91) # ""
def_op('UNPACK_SEQUENCE', 92) # Number of tuple items
def_op('FOR_ITER', 93)
def_op('UNPACK_EX', 94)
def_op('STORE_ATTR', 95) # Index in name list
def_op('DELETE_ATTR', 96) # ""
def_op('STORE_GLOBAL', 97) # ""
def_op('DELETE_GLOBAL', 98) # ""
def_op('SWAP', 99)
def_op('LOAD_CONST', 100) # Index in const list
def_op('LOAD_NAME', 101) # Index in name list
def_op('BUILD_TUPLE', 102) # Number of tuple items
def_op('BUILD_LIST', 103) # Number of list items
def_op('BUILD_SET', 104) # Number of set items
def_op('BUILD_MAP', 105) # Number of dict entries
def_op('LOAD_ATTR', 106) # Index in name list
def_op('COMPARE_OP', 107) # Comparison operator
def_op('IMPORT_NAME', 108) # Index in name list
def_op('IMPORT_FROM', 109) # Index in name list
def_op('JUMP_FORWARD', 110) # Number of words to skip
def_op('POP_JUMP_IF_FALSE', 114)
def_op('POP_JUMP_IF_TRUE', 115)
def_op('LOAD_GLOBAL', 116) # Index in name list
def_op('IS_OP', 117)
def_op('CONTAINS_OP', 118)
def_op('RERAISE', 119)
def_op('COPY', 120)
def_op('RETURN_CONST', 121)
def_op('BINARY_OP', 122)
def_op('SEND', 123) # Number of words to skip
def_op('LOAD_FAST', 124) # Local variable number, no null check
def_op('STORE_FAST', 125) # Local variable number
def_op('DELETE_FAST', 126) # Local variable number
def_op('LOAD_FAST_CHECK', 127) # Local variable number
def_op('POP_JUMP_IF_NOT_NONE', 128)
def_op('POP_JUMP_IF_NONE', 129)
def_op('RAISE_VARARGS', 130) # Number of raise arguments (1, 2, or 3)
def_op('GET_AWAITABLE', 131)
def_op('BUILD_SLICE', 133) # Number of items
def_op('JUMP_BACKWARD_NO_INTERRUPT', 134) # Number of words to skip (backwards)
def_op('MAKE_CELL', 135)
def_op('LOAD_DEREF', 137)
def_op('STORE_DEREF', 138)
def_op('DELETE_DEREF', 139)
def_op('JUMP_BACKWARD', 140) # Number of words to skip (backwards)
def_op('LOAD_SUPER_ATTR', 141)
def_op('CALL_FUNCTION_EX', 142) # Flags
def_op('LOAD_FAST_AND_CLEAR', 143) # Local variable number
def_op('EXTENDED_ARG', 144)
EXTENDED_ARG = opmap['EXTENDED_ARG']
def_op('LIST_APPEND', 145)
def_op('SET_ADD', 146)
def_op('MAP_ADD', 147)
def_op('COPY_FREE_VARS', 149)
def_op('YIELD_VALUE', 150)
def_op('RESUME', 151) # This must be kept in sync with deepfreeze.py
def_op('MATCH_CLASS', 152)
def_op('BUILD_CONST_KEY_MAP', 156)
def_op('BUILD_STRING', 157)
def_op('CONVERT_VALUE', 158)
def_op('LIST_EXTEND', 162)
def_op('SET_UPDATE', 163)
def_op('DICT_MERGE', 164)
def_op('DICT_UPDATE', 165)
def_op('LOAD_FAST_LOAD_FAST', 168)
def_op('STORE_FAST_LOAD_FAST', 169)
def_op('STORE_FAST_STORE_FAST', 170)
def_op('CALL', 171)
def_op('KW_NAMES', 172)
def_op('CALL_INTRINSIC_1', 173)
def_op('CALL_INTRINSIC_2', 174)
def_op('LOAD_FROM_DICT_OR_GLOBALS', 175)
def_op('LOAD_FROM_DICT_OR_DEREF', 176)
def_op('SET_FUNCTION_ATTRIBUTE', 177) # Attribute
# Optimizer hook
def_op('ENTER_EXECUTOR', 230)
# Instrumented instructions
MIN_INSTRUMENTED_OPCODE = 237
def_op('INSTRUMENTED_LOAD_SUPER_ATTR', 237)
def_op('INSTRUMENTED_POP_JUMP_IF_NONE', 238)
def_op('INSTRUMENTED_POP_JUMP_IF_NOT_NONE', 239)
def_op('INSTRUMENTED_RESUME', 240)
def_op('INSTRUMENTED_CALL', 241)
def_op('INSTRUMENTED_RETURN_VALUE', 242)
def_op('INSTRUMENTED_YIELD_VALUE', 243)
def_op('INSTRUMENTED_CALL_FUNCTION_EX', 244)
def_op('INSTRUMENTED_JUMP_FORWARD', 245)
def_op('INSTRUMENTED_JUMP_BACKWARD', 246)
def_op('INSTRUMENTED_RETURN_CONST', 247)
def_op('INSTRUMENTED_FOR_ITER', 248)
def_op('INSTRUMENTED_POP_JUMP_IF_FALSE', 249)
def_op('INSTRUMENTED_POP_JUMP_IF_TRUE', 250)
def_op('INSTRUMENTED_END_FOR', 251)
def_op('INSTRUMENTED_END_SEND', 252)
def_op('INSTRUMENTED_INSTRUCTION', 253)
def_op('INSTRUMENTED_LINE', 254)
# 255 is reserved
# Pseudo ops are above 255:
def_op('SETUP_FINALLY', 256)
def_op('SETUP_CLEANUP', 257)
def_op('SETUP_WITH', 258)
def_op('POP_BLOCK', 259)
def_op('JUMP', 260)
def_op('JUMP_NO_INTERRUPT', 261)
def_op('LOAD_METHOD', 262)
def_op('LOAD_SUPER_METHOD', 263)
def_op('LOAD_ZERO_SUPER_METHOD', 264)
def_op('LOAD_ZERO_SUPER_ATTR', 265)
def_op('STORE_FAST_MAYBE_NULL', 266)
def_op('LOAD_CLOSURE', 267)
del def_op
opname = ['<%r>' % (op,) for op in range(max(opmap.values()) + 1)]
for op, i in opmap.items():
opname[i] = op
# The build uses older versions of Python which do not have _opcode.has_* functions
if sys.version_info[:2] >= (3, 13):
# These lists are documented as part of the dis module's API
@ -243,7 +45,7 @@ if sys.version_info[:2] >= (3, 13):
_intrinsic_1_descs = _opcode.get_intrinsic1_descs()
_intrinsic_2_descs = _opcode.get_intrinsic2_descs()
hascompare = [opmap["COMPARE_OP"]]
hascompare = [opmap["COMPARE_OP"]]
_nb_ops = [
("NB_ADD", "+"),

View File

@ -196,11 +196,11 @@ dis_bug42562 = """\
# Extended arg followed by NOP
code_bug_45757 = bytes([
0x90, 0x01, # EXTENDED_ARG 0x01
0x09, 0xFF, # NOP 0xFF
0x90, 0x01, # EXTENDED_ARG 0x01
0x64, 0x29, # LOAD_CONST 0x29
0x53, 0x00, # RETURN_VALUE 0x00
opcode.opmap['EXTENDED_ARG'], 0x01, # EXTENDED_ARG 0x01
opcode.opmap['NOP'], 0xFF, # NOP 0xFF
opcode.opmap['EXTENDED_ARG'], 0x01, # EXTENDED_ARG 0x01
opcode.opmap['LOAD_CONST'], 0x29, # LOAD_CONST 0x29
opcode.opmap['RETURN_VALUE'], 0x00, # RETURN_VALUE 0x00
])
dis_bug_45757 = """\
@ -931,7 +931,7 @@ class DisTests(DisTestBase):
with_offsets)
def test_opmap(self):
self.assertEqual(dis.opmap["NOP"], 9)
self.assertEqual(dis.opmap["CACHE"], 0)
self.assertIn(dis.opmap["LOAD_CONST"], dis.hasconst)
self.assertIn(dis.opmap["STORE_NAME"], dis.hasname)
@ -940,7 +940,6 @@ class DisTests(DisTestBase):
def test_boundaries(self):
self.assertEqual(dis.opmap["EXTENDED_ARG"], dis.EXTENDED_ARG)
self.assertEqual(dis.opmap["STORE_NAME"], dis.HAVE_ARGUMENT)
def test_widths(self):
long_opcodes = set(['JUMP_BACKWARD_NO_INTERRUPT',
@ -1617,197 +1616,197 @@ def _prepare_test_cases():
Instruction = dis.Instruction
expected_opinfo_outer = [
Instruction(opname='MAKE_CELL', opcode=135, arg=0, argval='a', argrepr='a', offset=0, start_offset=0, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='MAKE_CELL', opcode=135, arg=1, argval='b', argrepr='b', offset=2, start_offset=2, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='RESUME', opcode=151, arg=0, argval=0, argrepr='', offset=4, start_offset=4, starts_line=1, is_jump_target=False, positions=None),
Instruction(opname='LOAD_CONST', opcode=100, arg=5, argval=(3, 4), argrepr='(3, 4)', offset=6, start_offset=6, starts_line=2, is_jump_target=False, positions=None),
Instruction(opname='LOAD_FAST', opcode=124, arg=0, argval='a', argrepr='a', offset=8, start_offset=8, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='LOAD_FAST', opcode=124, arg=1, argval='b', argrepr='b', offset=10, start_offset=10, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='BUILD_TUPLE', opcode=102, arg=2, argval=2, argrepr='', offset=12, start_offset=12, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='LOAD_CONST', opcode=100, arg=1, argval=code_object_f, argrepr=repr(code_object_f), offset=14, start_offset=14, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='MAKE_FUNCTION', opcode=24, arg=None, argval=None, argrepr='', offset=16, start_offset=16, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='SET_FUNCTION_ATTRIBUTE', opcode=177, arg=8, argval=8, argrepr='closure', offset=18, start_offset=18, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='SET_FUNCTION_ATTRIBUTE', opcode=177, arg=1, argval=1, argrepr='defaults', offset=20, start_offset=20, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='STORE_FAST', opcode=125, arg=2, argval='f', argrepr='f', offset=22, start_offset=22, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='LOAD_GLOBAL', opcode=116, arg=1, argval='print', argrepr='print + NULL', offset=24, start_offset=24, starts_line=7, is_jump_target=False, positions=None),
Instruction(opname='LOAD_DEREF', opcode=137, arg=0, argval='a', argrepr='a', offset=34, start_offset=34, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='LOAD_DEREF', opcode=137, arg=1, argval='b', argrepr='b', offset=36, start_offset=36, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='LOAD_CONST', opcode=100, arg=2, argval='', argrepr="''", offset=38, start_offset=38, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='LOAD_CONST', opcode=100, arg=3, argval=1, argrepr='1', offset=40, start_offset=40, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='BUILD_LIST', opcode=103, arg=0, argval=0, argrepr='', offset=42, start_offset=42, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='BUILD_MAP', opcode=105, arg=0, argval=0, argrepr='', offset=44, start_offset=44, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='LOAD_CONST', opcode=100, arg=4, argval='Hello world!', argrepr="'Hello world!'", offset=46, start_offset=46, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='CALL', opcode=171, arg=7, argval=7, argrepr='', offset=48, start_offset=48, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=56, start_offset=56, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='LOAD_FAST', opcode=124, arg=2, argval='f', argrepr='f', offset=58, start_offset=58, starts_line=8, is_jump_target=False, positions=None),
Instruction(opname='RETURN_VALUE', opcode=83, arg=None, argval=None, argrepr='', offset=60, start_offset=60, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='MAKE_CELL', opcode=157, arg=0, argval='a', argrepr='a', offset=0, start_offset=0, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='MAKE_CELL', opcode=157, arg=1, argval='b', argrepr='b', offset=2, start_offset=2, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='RESUME', opcode=166, arg=0, argval=0, argrepr='', offset=4, start_offset=4, starts_line=1, is_jump_target=False, positions=None),
Instruction(opname='LOAD_CONST', opcode=142, arg=5, argval=(3, 4), argrepr='(3, 4)', offset=6, start_offset=6, starts_line=2, is_jump_target=False, positions=None),
Instruction(opname='LOAD_FAST', opcode=144, arg=0, argval='a', argrepr='a', offset=8, start_offset=8, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='LOAD_FAST', opcode=144, arg=1, argval='b', argrepr='b', offset=10, start_offset=10, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='BUILD_TUPLE', opcode=74, arg=2, argval=2, argrepr='', offset=12, start_offset=12, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='LOAD_CONST', opcode=142, arg=1, argval=code_object_f, argrepr=repr(code_object_f), offset=14, start_offset=14, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='MAKE_FUNCTION', opcode=38, arg=None, argval=None, argrepr='', offset=16, start_offset=16, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='SET_FUNCTION_ATTRIBUTE', opcode=171, arg=8, argval=8, argrepr='closure', offset=18, start_offset=18, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='SET_FUNCTION_ATTRIBUTE', opcode=171, arg=1, argval=1, argrepr='defaults', offset=20, start_offset=20, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='STORE_FAST', opcode=176, arg=2, argval='f', argrepr='f', offset=22, start_offset=22, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='LOAD_GLOBAL', opcode=150, arg=1, argval='print', argrepr='print + NULL', offset=24, start_offset=24, starts_line=7, is_jump_target=False, positions=None),
Instruction(opname='LOAD_DEREF', opcode=143, arg=0, argval='a', argrepr='a', offset=34, start_offset=34, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='LOAD_DEREF', opcode=143, arg=1, argval='b', argrepr='b', offset=36, start_offset=36, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='LOAD_CONST', opcode=142, arg=2, argval='', argrepr="''", offset=38, start_offset=38, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='LOAD_CONST', opcode=142, arg=3, argval=1, argrepr='1', offset=40, start_offset=40, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='BUILD_LIST', opcode=69, arg=0, argval=0, argrepr='', offset=42, start_offset=42, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='BUILD_MAP', opcode=70, arg=0, argval=0, argrepr='', offset=44, start_offset=44, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='LOAD_CONST', opcode=142, arg=4, argval='Hello world!', argrepr="'Hello world!'", offset=46, start_offset=46, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='CALL', opcode=75, arg=7, argval=7, argrepr='', offset=48, start_offset=48, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='POP_TOP', opcode=44, arg=None, argval=None, argrepr='', offset=56, start_offset=56, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='LOAD_FAST', opcode=144, arg=2, argval='f', argrepr='f', offset=58, start_offset=58, starts_line=8, is_jump_target=False, positions=None),
Instruction(opname='RETURN_VALUE', opcode=48, arg=None, argval=None, argrepr='', offset=60, start_offset=60, starts_line=None, is_jump_target=False, positions=None),
]
expected_opinfo_f = [
Instruction(opname='COPY_FREE_VARS', opcode=149, arg=2, argval=2, argrepr='', offset=0, start_offset=0, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='MAKE_CELL', opcode=135, arg=0, argval='c', argrepr='c', offset=2, start_offset=2, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='MAKE_CELL', opcode=135, arg=1, argval='d', argrepr='d', offset=4, start_offset=4, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='RESUME', opcode=151, arg=0, argval=0, argrepr='', offset=6, start_offset=6, starts_line=2, is_jump_target=False, positions=None),
Instruction(opname='LOAD_CONST', opcode=100, arg=2, argval=(5, 6), argrepr='(5, 6)', offset=8, start_offset=8, starts_line=3, is_jump_target=False, positions=None),
Instruction(opname='LOAD_FAST', opcode=124, arg=3, argval='a', argrepr='a', offset=10, start_offset=10, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='LOAD_FAST', opcode=124, arg=4, argval='b', argrepr='b', offset=12, start_offset=12, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='LOAD_FAST', opcode=124, arg=0, argval='c', argrepr='c', offset=14, start_offset=14, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='LOAD_FAST', opcode=124, arg=1, argval='d', argrepr='d', offset=16, start_offset=16, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='BUILD_TUPLE', opcode=102, arg=4, argval=4, argrepr='', offset=18, start_offset=18, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='LOAD_CONST', opcode=100, arg=1, argval=code_object_inner, argrepr=repr(code_object_inner), offset=20, start_offset=20, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='MAKE_FUNCTION', opcode=24, arg=None, argval=None, argrepr='', offset=22, start_offset=22, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='SET_FUNCTION_ATTRIBUTE', opcode=177, arg=8, argval=8, argrepr='closure', offset=24, start_offset=24, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='SET_FUNCTION_ATTRIBUTE', opcode=177, arg=1, argval=1, argrepr='defaults', offset=26, start_offset=26, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='STORE_FAST', opcode=125, arg=2, argval='inner', argrepr='inner', offset=28, start_offset=28, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='LOAD_GLOBAL', opcode=116, arg=1, argval='print', argrepr='print + NULL', offset=30, start_offset=30, starts_line=5, is_jump_target=False, positions=None),
Instruction(opname='LOAD_DEREF', opcode=137, arg=3, argval='a', argrepr='a', offset=40, start_offset=40, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='LOAD_DEREF', opcode=137, arg=4, argval='b', argrepr='b', offset=42, start_offset=42, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='LOAD_DEREF', opcode=137, arg=0, argval='c', argrepr='c', offset=44, start_offset=44, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='LOAD_DEREF', opcode=137, arg=1, argval='d', argrepr='d', offset=46, start_offset=46, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='CALL', opcode=171, arg=4, argval=4, argrepr='', offset=48, start_offset=48, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=56, start_offset=56, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='LOAD_FAST', opcode=124, arg=2, argval='inner', argrepr='inner', offset=58, start_offset=58, starts_line=6, is_jump_target=False, positions=None),
Instruction(opname='RETURN_VALUE', opcode=83, arg=None, argval=None, argrepr='', offset=60, start_offset=60, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='COPY_FREE_VARS', opcode=104, arg=2, argval=2, argrepr='', offset=0, start_offset=0, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='MAKE_CELL', opcode=157, arg=0, argval='c', argrepr='c', offset=2, start_offset=2, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='MAKE_CELL', opcode=157, arg=1, argval='d', argrepr='d', offset=4, start_offset=4, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='RESUME', opcode=166, arg=0, argval=0, argrepr='', offset=6, start_offset=6, starts_line=2, is_jump_target=False, positions=None),
Instruction(opname='LOAD_CONST', opcode=142, arg=2, argval=(5, 6), argrepr='(5, 6)', offset=8, start_offset=8, starts_line=3, is_jump_target=False, positions=None),
Instruction(opname='LOAD_FAST', opcode=144, arg=3, argval='a', argrepr='a', offset=10, start_offset=10, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='LOAD_FAST', opcode=144, arg=4, argval='b', argrepr='b', offset=12, start_offset=12, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='LOAD_FAST', opcode=144, arg=0, argval='c', argrepr='c', offset=14, start_offset=14, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='LOAD_FAST', opcode=144, arg=1, argval='d', argrepr='d', offset=16, start_offset=16, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='BUILD_TUPLE', opcode=74, arg=4, argval=4, argrepr='', offset=18, start_offset=18, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='LOAD_CONST', opcode=142, arg=1, argval=code_object_inner, argrepr=repr(code_object_inner), offset=20, start_offset=20, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='MAKE_FUNCTION', opcode=38, arg=None, argval=None, argrepr='', offset=22, start_offset=22, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='SET_FUNCTION_ATTRIBUTE', opcode=171, arg=8, argval=8, argrepr='closure', offset=24, start_offset=24, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='SET_FUNCTION_ATTRIBUTE', opcode=171, arg=1, argval=1, argrepr='defaults', offset=26, start_offset=26, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='STORE_FAST', opcode=176, arg=2, argval='inner', argrepr='inner', offset=28, start_offset=28, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='LOAD_GLOBAL', opcode=150, arg=1, argval='print', argrepr='print + NULL', offset=30, start_offset=30, starts_line=5, is_jump_target=False, positions=None),
Instruction(opname='LOAD_DEREF', opcode=143, arg=3, argval='a', argrepr='a', offset=40, start_offset=40, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='LOAD_DEREF', opcode=143, arg=4, argval='b', argrepr='b', offset=42, start_offset=42, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='LOAD_DEREF', opcode=143, arg=0, argval='c', argrepr='c', offset=44, start_offset=44, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='LOAD_DEREF', opcode=143, arg=1, argval='d', argrepr='d', offset=46, start_offset=46, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='CALL', opcode=75, arg=4, argval=4, argrepr='', offset=48, start_offset=48, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='POP_TOP', opcode=44, arg=None, argval=None, argrepr='', offset=56, start_offset=56, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='LOAD_FAST', opcode=144, arg=2, argval='inner', argrepr='inner', offset=58, start_offset=58, starts_line=6, is_jump_target=False, positions=None),
Instruction(opname='RETURN_VALUE', opcode=48, arg=None, argval=None, argrepr='', offset=60, start_offset=60, starts_line=None, is_jump_target=False, positions=None),
]
expected_opinfo_inner = [
Instruction(opname='COPY_FREE_VARS', opcode=149, arg=4, argval=4, argrepr='', offset=0, start_offset=0, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='RESUME', opcode=151, arg=0, argval=0, argrepr='', offset=2, start_offset=2, starts_line=3, is_jump_target=False, positions=None),
Instruction(opname='LOAD_GLOBAL', opcode=116, arg=1, argval='print', argrepr='print + NULL', offset=4, start_offset=4, starts_line=4, is_jump_target=False, positions=None),
Instruction(opname='LOAD_DEREF', opcode=137, arg=2, argval='a', argrepr='a', offset=14, start_offset=14, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='LOAD_DEREF', opcode=137, arg=3, argval='b', argrepr='b', offset=16, start_offset=16, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='LOAD_DEREF', opcode=137, arg=4, argval='c', argrepr='c', offset=18, start_offset=18, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='LOAD_DEREF', opcode=137, arg=5, argval='d', argrepr='d', offset=20, start_offset=20, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='LOAD_FAST_LOAD_FAST', opcode=168, arg=1, argval=('e', 'f'), argrepr='e, f', offset=22, start_offset=22, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='CALL', opcode=171, arg=6, argval=6, argrepr='', offset=24, start_offset=24, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=32, start_offset=32, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='RETURN_CONST', opcode=121, arg=0, argval=None, argrepr='None', offset=34, start_offset=34, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='COPY_FREE_VARS', opcode=104, arg=4, argval=4, argrepr='', offset=0, start_offset=0, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='RESUME', opcode=166, arg=0, argval=0, argrepr='', offset=2, start_offset=2, starts_line=3, is_jump_target=False, positions=None),
Instruction(opname='LOAD_GLOBAL', opcode=150, arg=1, argval='print', argrepr='print + NULL', offset=4, start_offset=4, starts_line=4, is_jump_target=False, positions=None),
Instruction(opname='LOAD_DEREF', opcode=143, arg=2, argval='a', argrepr='a', offset=14, start_offset=14, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='LOAD_DEREF', opcode=143, arg=3, argval='b', argrepr='b', offset=16, start_offset=16, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='LOAD_DEREF', opcode=143, arg=4, argval='c', argrepr='c', offset=18, start_offset=18, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='LOAD_DEREF', opcode=143, arg=5, argval='d', argrepr='d', offset=20, start_offset=20, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='LOAD_FAST_LOAD_FAST', opcode=147, arg=1, argval=('e', 'f'), argrepr='e, f', offset=22, start_offset=22, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='CALL', opcode=75, arg=6, argval=6, argrepr='', offset=24, start_offset=24, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='POP_TOP', opcode=44, arg=None, argval=None, argrepr='', offset=32, start_offset=32, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='RETURN_CONST', opcode=167, arg=0, argval=None, argrepr='None', offset=34, start_offset=34, starts_line=None, is_jump_target=False, positions=None),
]
expected_opinfo_jumpy = [
Instruction(opname='RESUME', opcode=151, arg=0, argval=0, argrepr='', offset=0, start_offset=0, starts_line=1, is_jump_target=False, positions=None),
Instruction(opname='LOAD_GLOBAL', opcode=116, arg=1, argval='range', argrepr='range + NULL', offset=2, start_offset=2, starts_line=3, is_jump_target=False, positions=None),
Instruction(opname='LOAD_CONST', opcode=100, arg=1, argval=10, argrepr='10', offset=12, start_offset=12, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='CALL', opcode=171, arg=1, argval=1, argrepr='', offset=14, start_offset=14, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='GET_ITER', opcode=68, arg=None, argval=None, argrepr='', offset=22, start_offset=22, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='FOR_ITER', opcode=93, arg=28, argval=84, argrepr='to 84', offset=24, start_offset=24, starts_line=None, is_jump_target=True, positions=None),
Instruction(opname='STORE_FAST', opcode=125, arg=0, argval='i', argrepr='i', offset=28, start_offset=28, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='LOAD_GLOBAL', opcode=116, arg=3, argval='print', argrepr='print + NULL', offset=30, start_offset=30, starts_line=4, is_jump_target=False, positions=None),
Instruction(opname='LOAD_FAST', opcode=124, arg=0, argval='i', argrepr='i', offset=40, start_offset=40, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='CALL', opcode=171, arg=1, argval=1, argrepr='', offset=42, start_offset=42, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=50, start_offset=50, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='LOAD_FAST', opcode=124, arg=0, argval='i', argrepr='i', offset=52, start_offset=52, starts_line=5, is_jump_target=False, positions=None),
Instruction(opname='LOAD_CONST', opcode=100, arg=2, argval=4, argrepr='4', offset=54, start_offset=54, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='COMPARE_OP', opcode=107, arg=18, argval='<', argrepr='bool(<)', offset=56, start_offset=56, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='POP_JUMP_IF_FALSE', opcode=114, arg=2, argval=66, argrepr='to 66', offset=60, start_offset=60, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='JUMP_BACKWARD', opcode=140, arg=21, argval=24, argrepr='to 24', offset=62, start_offset=62, starts_line=6, is_jump_target=False, positions=None),
Instruction(opname='LOAD_FAST', opcode=124, arg=0, argval='i', argrepr='i', offset=66, start_offset=66, starts_line=7, is_jump_target=True, positions=None),
Instruction(opname='LOAD_CONST', opcode=100, arg=3, argval=6, argrepr='6', offset=68, start_offset=68, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='COMPARE_OP', opcode=107, arg=148, argval='>', argrepr='bool(>)', offset=70, start_offset=70, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='POP_JUMP_IF_TRUE', opcode=115, arg=2, argval=80, argrepr='to 80', offset=74, start_offset=74, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='JUMP_BACKWARD', opcode=140, arg=28, argval=24, argrepr='to 24', offset=76, start_offset=76, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=80, start_offset=80, starts_line=8, is_jump_target=True, positions=None),
Instruction(opname='JUMP_FORWARD', opcode=110, arg=12, argval=108, argrepr='to 108', offset=82, start_offset=82, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='END_FOR', opcode=4, arg=None, argval=None, argrepr='', offset=84, start_offset=84, starts_line=3, is_jump_target=True, positions=None),
Instruction(opname='LOAD_GLOBAL', opcode=116, arg=3, argval='print', argrepr='print + NULL', offset=86, start_offset=86, starts_line=10, is_jump_target=False, positions=None),
Instruction(opname='LOAD_CONST', opcode=100, arg=4, argval='I can haz else clause?', argrepr="'I can haz else clause?'", offset=96, start_offset=96, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='CALL', opcode=171, arg=1, argval=1, argrepr='', offset=98, start_offset=98, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=106, start_offset=106, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='LOAD_FAST_CHECK', opcode=127, arg=0, argval='i', argrepr='i', offset=108, start_offset=108, starts_line=11, is_jump_target=True, positions=None),
Instruction(opname='TO_BOOL', opcode=6, arg=None, argval=None, argrepr='', offset=110, start_offset=110, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='POP_JUMP_IF_FALSE', opcode=114, arg=37, argval=194, argrepr='to 194', offset=118, start_offset=118, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='LOAD_GLOBAL', opcode=116, arg=3, argval='print', argrepr='print + NULL', offset=120, start_offset=120, starts_line=12, is_jump_target=True, positions=None),
Instruction(opname='LOAD_FAST', opcode=124, arg=0, argval='i', argrepr='i', offset=130, start_offset=130, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='CALL', opcode=171, arg=1, argval=1, argrepr='', offset=132, start_offset=132, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=140, start_offset=140, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='LOAD_FAST', opcode=124, arg=0, argval='i', argrepr='i', offset=142, start_offset=142, starts_line=13, is_jump_target=False, positions=None),
Instruction(opname='LOAD_CONST', opcode=100, arg=5, argval=1, argrepr='1', offset=144, start_offset=144, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='BINARY_OP', opcode=122, arg=23, argval=23, argrepr='-=', offset=146, start_offset=146, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='STORE_FAST', opcode=125, arg=0, argval='i', argrepr='i', offset=150, start_offset=150, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='LOAD_FAST', opcode=124, arg=0, argval='i', argrepr='i', offset=152, start_offset=152, starts_line=14, is_jump_target=False, positions=None),
Instruction(opname='LOAD_CONST', opcode=100, arg=3, argval=6, argrepr='6', offset=154, start_offset=154, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='COMPARE_OP', opcode=107, arg=148, argval='>', argrepr='bool(>)', offset=156, start_offset=156, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='POP_JUMP_IF_FALSE', opcode=114, arg=2, argval=166, argrepr='to 166', offset=160, start_offset=160, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='JUMP_BACKWARD', opcode=140, arg=29, argval=108, argrepr='to 108', offset=162, start_offset=162, starts_line=15, is_jump_target=False, positions=None),
Instruction(opname='LOAD_FAST', opcode=124, arg=0, argval='i', argrepr='i', offset=166, start_offset=166, starts_line=16, is_jump_target=True, positions=None),
Instruction(opname='LOAD_CONST', opcode=100, arg=2, argval=4, argrepr='4', offset=168, start_offset=168, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='COMPARE_OP', opcode=107, arg=18, argval='<', argrepr='bool(<)', offset=170, start_offset=170, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='POP_JUMP_IF_FALSE', opcode=114, arg=1, argval=178, argrepr='to 178', offset=174, start_offset=174, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='JUMP_FORWARD', opcode=110, arg=19, argval=216, argrepr='to 216', offset=176, start_offset=176, starts_line=17, is_jump_target=False, positions=None),
Instruction(opname='LOAD_FAST', opcode=124, arg=0, argval='i', argrepr='i', offset=178, start_offset=178, starts_line=11, is_jump_target=True, positions=None),
Instruction(opname='TO_BOOL', opcode=6, arg=None, argval=None, argrepr='', offset=180, start_offset=180, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='POP_JUMP_IF_FALSE', opcode=114, arg=2, argval=194, argrepr='to 194', offset=188, start_offset=188, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='JUMP_BACKWARD', opcode=140, arg=37, argval=120, argrepr='to 120', offset=190, start_offset=190, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='LOAD_GLOBAL', opcode=116, arg=3, argval='print', argrepr='print + NULL', offset=194, start_offset=194, starts_line=19, is_jump_target=True, positions=None),
Instruction(opname='LOAD_CONST', opcode=100, arg=6, argval='Who let lolcatz into this test suite?', argrepr="'Who let lolcatz into this test suite?'", offset=204, start_offset=204, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='CALL', opcode=171, arg=1, argval=1, argrepr='', offset=206, start_offset=206, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=214, start_offset=214, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='NOP', opcode=9, arg=None, argval=None, argrepr='', offset=216, start_offset=216, starts_line=20, is_jump_target=True, positions=None),
Instruction(opname='LOAD_CONST', opcode=100, arg=5, argval=1, argrepr='1', offset=218, start_offset=218, starts_line=21, is_jump_target=False, positions=None),
Instruction(opname='LOAD_CONST', opcode=100, arg=7, argval=0, argrepr='0', offset=220, start_offset=220, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='BINARY_OP', opcode=122, arg=11, argval=11, argrepr='/', offset=222, start_offset=222, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=226, start_offset=226, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='LOAD_FAST', opcode=124, arg=0, argval='i', argrepr='i', offset=228, start_offset=228, starts_line=25, is_jump_target=False, positions=None),
Instruction(opname='BEFORE_WITH', opcode=53, arg=None, argval=None, argrepr='', offset=230, start_offset=230, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='STORE_FAST', opcode=125, arg=1, argval='dodgy', argrepr='dodgy', offset=232, start_offset=232, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='LOAD_GLOBAL', opcode=116, arg=3, argval='print', argrepr='print + NULL', offset=234, start_offset=234, starts_line=26, is_jump_target=False, positions=None),
Instruction(opname='LOAD_CONST', opcode=100, arg=8, argval='Never reach this', argrepr="'Never reach this'", offset=244, start_offset=244, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='CALL', opcode=171, arg=1, argval=1, argrepr='', offset=246, start_offset=246, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=254, start_offset=254, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='LOAD_CONST', opcode=100, arg=0, argval=None, argrepr='None', offset=256, start_offset=256, starts_line=25, is_jump_target=False, positions=None),
Instruction(opname='LOAD_CONST', opcode=100, arg=0, argval=None, argrepr='None', offset=258, start_offset=258, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='LOAD_CONST', opcode=100, arg=0, argval=None, argrepr='None', offset=260, start_offset=260, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='CALL', opcode=171, arg=2, argval=2, argrepr='', offset=262, start_offset=262, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=270, start_offset=270, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='LOAD_GLOBAL', opcode=116, arg=3, argval='print', argrepr='print + NULL', offset=272, start_offset=272, starts_line=28, is_jump_target=True, positions=None),
Instruction(opname='LOAD_CONST', opcode=100, arg=10, argval="OK, now we're done", argrepr='"OK, now we\'re done"', offset=282, start_offset=282, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='CALL', opcode=171, arg=1, argval=1, argrepr='', offset=284, start_offset=284, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=292, start_offset=292, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='RETURN_CONST', opcode=121, arg=0, argval=None, argrepr='None', offset=294, start_offset=294, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='PUSH_EXC_INFO', opcode=35, arg=None, argval=None, argrepr='', offset=296, start_offset=296, starts_line=25, is_jump_target=False, positions=None),
Instruction(opname='WITH_EXCEPT_START', opcode=49, arg=None, argval=None, argrepr='', offset=298, start_offset=298, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='TO_BOOL', opcode=6, arg=None, argval=None, argrepr='', offset=300, start_offset=300, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='POP_JUMP_IF_TRUE', opcode=115, arg=1, argval=312, argrepr='to 312', offset=308, start_offset=308, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='RERAISE', opcode=119, arg=2, argval=2, argrepr='', offset=310, start_offset=310, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=312, start_offset=312, starts_line=None, is_jump_target=True, positions=None),
Instruction(opname='POP_EXCEPT', opcode=89, arg=None, argval=None, argrepr='', offset=314, start_offset=314, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=316, start_offset=316, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=318, start_offset=318, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='JUMP_BACKWARD', opcode=140, arg=26, argval=272, argrepr='to 272', offset=320, start_offset=320, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='COPY', opcode=120, arg=3, argval=3, argrepr='', offset=324, start_offset=324, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='POP_EXCEPT', opcode=89, arg=None, argval=None, argrepr='', offset=326, start_offset=326, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='RERAISE', opcode=119, arg=1, argval=1, argrepr='', offset=328, start_offset=328, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='PUSH_EXC_INFO', opcode=35, arg=None, argval=None, argrepr='', offset=330, start_offset=330, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='LOAD_GLOBAL', opcode=116, arg=4, argval='ZeroDivisionError', argrepr='ZeroDivisionError', offset=332, start_offset=332, starts_line=22, is_jump_target=False, positions=None),
Instruction(opname='CHECK_EXC_MATCH', opcode=36, arg=None, argval=None, argrepr='', offset=342, start_offset=342, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='POP_JUMP_IF_FALSE', opcode=114, arg=15, argval=376, argrepr='to 376', offset=344, start_offset=344, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=346, start_offset=346, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='LOAD_GLOBAL', opcode=116, arg=3, argval='print', argrepr='print + NULL', offset=348, start_offset=348, starts_line=23, is_jump_target=False, positions=None),
Instruction(opname='LOAD_CONST', opcode=100, arg=9, argval='Here we go, here we go, here we go...', argrepr="'Here we go, here we go, here we go...'", offset=358, start_offset=358, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='CALL', opcode=171, arg=1, argval=1, argrepr='', offset=360, start_offset=360, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=368, start_offset=368, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='POP_EXCEPT', opcode=89, arg=None, argval=None, argrepr='', offset=370, start_offset=370, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='JUMP_BACKWARD', opcode=140, arg=52, argval=272, argrepr='to 272', offset=372, start_offset=372, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='RERAISE', opcode=119, arg=0, argval=0, argrepr='', offset=376, start_offset=376, starts_line=22, is_jump_target=True, positions=None),
Instruction(opname='COPY', opcode=120, arg=3, argval=3, argrepr='', offset=378, start_offset=378, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='POP_EXCEPT', opcode=89, arg=None, argval=None, argrepr='', offset=380, start_offset=380, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='RERAISE', opcode=119, arg=1, argval=1, argrepr='', offset=382, start_offset=382, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='PUSH_EXC_INFO', opcode=35, arg=None, argval=None, argrepr='', offset=384, start_offset=384, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='LOAD_GLOBAL', opcode=116, arg=3, argval='print', argrepr='print + NULL', offset=386, start_offset=386, starts_line=28, is_jump_target=False, positions=None),
Instruction(opname='LOAD_CONST', opcode=100, arg=10, argval="OK, now we're done", argrepr='"OK, now we\'re done"', offset=396, start_offset=396, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='CALL', opcode=171, arg=1, argval=1, argrepr='', offset=398, start_offset=398, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=406, start_offset=406, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='RERAISE', opcode=119, arg=0, argval=0, argrepr='', offset=408, start_offset=408, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='COPY', opcode=120, arg=3, argval=3, argrepr='', offset=410, start_offset=410, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='POP_EXCEPT', opcode=89, arg=None, argval=None, argrepr='', offset=412, start_offset=412, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='RERAISE', opcode=119, arg=1, argval=1, argrepr='', offset=414, start_offset=414, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='RESUME', opcode=166, arg=0, argval=0, argrepr='', offset=0, start_offset=0, starts_line=1, is_jump_target=False, positions=None),
Instruction(opname='LOAD_GLOBAL', opcode=150, arg=1, argval='range', argrepr='range + NULL', offset=2, start_offset=2, starts_line=3, is_jump_target=False, positions=None),
Instruction(opname='LOAD_CONST', opcode=142, arg=1, argval=10, argrepr='10', offset=12, start_offset=12, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='CALL', opcode=75, arg=1, argval=1, argrepr='', offset=14, start_offset=14, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='GET_ITER', opcode=31, arg=None, argval=None, argrepr='', offset=22, start_offset=22, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='FOR_ITER', opcode=114, arg=28, argval=84, argrepr='to 84', offset=24, start_offset=24, starts_line=None, is_jump_target=True, positions=None),
Instruction(opname='STORE_FAST', opcode=176, arg=0, argval='i', argrepr='i', offset=28, start_offset=28, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='LOAD_GLOBAL', opcode=150, arg=3, argval='print', argrepr='print + NULL', offset=30, start_offset=30, starts_line=4, is_jump_target=False, positions=None),
Instruction(opname='LOAD_FAST', opcode=144, arg=0, argval='i', argrepr='i', offset=40, start_offset=40, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='CALL', opcode=75, arg=1, argval=1, argrepr='', offset=42, start_offset=42, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='POP_TOP', opcode=44, arg=None, argval=None, argrepr='', offset=50, start_offset=50, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='LOAD_FAST', opcode=144, arg=0, argval='i', argrepr='i', offset=52, start_offset=52, starts_line=5, is_jump_target=False, positions=None),
Instruction(opname='LOAD_CONST', opcode=142, arg=2, argval=4, argrepr='4', offset=54, start_offset=54, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='COMPARE_OP', opcode=97, arg=18, argval='<', argrepr='bool(<)', offset=56, start_offset=56, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='POP_JUMP_IF_FALSE', opcode=160, arg=2, argval=66, argrepr='to 66', offset=60, start_offset=60, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='JUMP_BACKWARD', opcode=123, arg=21, argval=24, argrepr='to 24', offset=62, start_offset=62, starts_line=6, is_jump_target=False, positions=None),
Instruction(opname='LOAD_FAST', opcode=144, arg=0, argval='i', argrepr='i', offset=66, start_offset=66, starts_line=7, is_jump_target=True, positions=None),
Instruction(opname='LOAD_CONST', opcode=142, arg=3, argval=6, argrepr='6', offset=68, start_offset=68, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='COMPARE_OP', opcode=97, arg=148, argval='>', argrepr='bool(>)', offset=70, start_offset=70, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='POP_JUMP_IF_TRUE', opcode=163, arg=2, argval=80, argrepr='to 80', offset=74, start_offset=74, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='JUMP_BACKWARD', opcode=123, arg=28, argval=24, argrepr='to 24', offset=76, start_offset=76, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='POP_TOP', opcode=44, arg=None, argval=None, argrepr='', offset=80, start_offset=80, starts_line=8, is_jump_target=True, positions=None),
Instruction(opname='JUMP_FORWARD', opcode=125, arg=12, argval=108, argrepr='to 108', offset=82, start_offset=82, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='END_FOR', opcode=24, arg=None, argval=None, argrepr='', offset=84, start_offset=84, starts_line=3, is_jump_target=True, positions=None),
Instruction(opname='LOAD_GLOBAL', opcode=150, arg=3, argval='print', argrepr='print + NULL', offset=86, start_offset=86, starts_line=10, is_jump_target=False, positions=None),
Instruction(opname='LOAD_CONST', opcode=142, arg=4, argval='I can haz else clause?', argrepr="'I can haz else clause?'", offset=96, start_offset=96, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='CALL', opcode=75, arg=1, argval=1, argrepr='', offset=98, start_offset=98, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='POP_TOP', opcode=44, arg=None, argval=None, argrepr='', offset=106, start_offset=106, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='LOAD_FAST_CHECK', opcode=146, arg=0, argval='i', argrepr='i', offset=108, start_offset=108, starts_line=11, is_jump_target=True, positions=None),
Instruction(opname='TO_BOOL', opcode=56, arg=None, argval=None, argrepr='', offset=110, start_offset=110, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='POP_JUMP_IF_FALSE', opcode=160, arg=37, argval=194, argrepr='to 194', offset=118, start_offset=118, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='LOAD_GLOBAL', opcode=150, arg=3, argval='print', argrepr='print + NULL', offset=120, start_offset=120, starts_line=12, is_jump_target=True, positions=None),
Instruction(opname='LOAD_FAST', opcode=144, arg=0, argval='i', argrepr='i', offset=130, start_offset=130, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='CALL', opcode=75, arg=1, argval=1, argrepr='', offset=132, start_offset=132, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='POP_TOP', opcode=44, arg=None, argval=None, argrepr='', offset=140, start_offset=140, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='LOAD_FAST', opcode=144, arg=0, argval='i', argrepr='i', offset=142, start_offset=142, starts_line=13, is_jump_target=False, positions=None),
Instruction(opname='LOAD_CONST', opcode=142, arg=5, argval=1, argrepr='1', offset=144, start_offset=144, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='BINARY_OP', opcode=67, arg=23, argval=23, argrepr='-=', offset=146, start_offset=146, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='STORE_FAST', opcode=176, arg=0, argval='i', argrepr='i', offset=150, start_offset=150, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='LOAD_FAST', opcode=144, arg=0, argval='i', argrepr='i', offset=152, start_offset=152, starts_line=14, is_jump_target=False, positions=None),
Instruction(opname='LOAD_CONST', opcode=142, arg=3, argval=6, argrepr='6', offset=154, start_offset=154, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='COMPARE_OP', opcode=97, arg=148, argval='>', argrepr='bool(>)', offset=156, start_offset=156, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='POP_JUMP_IF_FALSE', opcode=160, arg=2, argval=166, argrepr='to 166', offset=160, start_offset=160, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='JUMP_BACKWARD', opcode=123, arg=29, argval=108, argrepr='to 108', offset=162, start_offset=162, starts_line=15, is_jump_target=False, positions=None),
Instruction(opname='LOAD_FAST', opcode=144, arg=0, argval='i', argrepr='i', offset=166, start_offset=166, starts_line=16, is_jump_target=True, positions=None),
Instruction(opname='LOAD_CONST', opcode=142, arg=2, argval=4, argrepr='4', offset=168, start_offset=168, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='COMPARE_OP', opcode=97, arg=18, argval='<', argrepr='bool(<)', offset=170, start_offset=170, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='POP_JUMP_IF_FALSE', opcode=160, arg=1, argval=178, argrepr='to 178', offset=174, start_offset=174, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='JUMP_FORWARD', opcode=125, arg=19, argval=216, argrepr='to 216', offset=176, start_offset=176, starts_line=17, is_jump_target=False, positions=None),
Instruction(opname='LOAD_FAST', opcode=144, arg=0, argval='i', argrepr='i', offset=178, start_offset=178, starts_line=11, is_jump_target=True, positions=None),
Instruction(opname='TO_BOOL', opcode=56, arg=None, argval=None, argrepr='', offset=180, start_offset=180, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='POP_JUMP_IF_FALSE', opcode=160, arg=2, argval=194, argrepr='to 194', offset=188, start_offset=188, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='JUMP_BACKWARD', opcode=123, arg=37, argval=120, argrepr='to 120', offset=190, start_offset=190, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='LOAD_GLOBAL', opcode=150, arg=3, argval='print', argrepr='print + NULL', offset=194, start_offset=194, starts_line=19, is_jump_target=True, positions=None),
Instruction(opname='LOAD_CONST', opcode=142, arg=6, argval='Who let lolcatz into this test suite?', argrepr="'Who let lolcatz into this test suite?'", offset=204, start_offset=204, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='CALL', opcode=75, arg=1, argval=1, argrepr='', offset=206, start_offset=206, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='POP_TOP', opcode=44, arg=None, argval=None, argrepr='', offset=214, start_offset=214, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='NOP', opcode=42, arg=None, argval=None, argrepr='', offset=216, start_offset=216, starts_line=20, is_jump_target=True, positions=None),
Instruction(opname='LOAD_CONST', opcode=142, arg=5, argval=1, argrepr='1', offset=218, start_offset=218, starts_line=21, is_jump_target=False, positions=None),
Instruction(opname='LOAD_CONST', opcode=142, arg=7, argval=0, argrepr='0', offset=220, start_offset=220, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='BINARY_OP', opcode=67, arg=11, argval=11, argrepr='/', offset=222, start_offset=222, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='POP_TOP', opcode=44, arg=None, argval=None, argrepr='', offset=226, start_offset=226, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='LOAD_FAST', opcode=144, arg=0, argval='i', argrepr='i', offset=228, start_offset=228, starts_line=25, is_jump_target=False, positions=None),
Instruction(opname='BEFORE_WITH', opcode=2, arg=None, argval=None, argrepr='', offset=230, start_offset=230, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='STORE_FAST', opcode=176, arg=1, argval='dodgy', argrepr='dodgy', offset=232, start_offset=232, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='LOAD_GLOBAL', opcode=150, arg=3, argval='print', argrepr='print + NULL', offset=234, start_offset=234, starts_line=26, is_jump_target=False, positions=None),
Instruction(opname='LOAD_CONST', opcode=142, arg=8, argval='Never reach this', argrepr="'Never reach this'", offset=244, start_offset=244, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='CALL', opcode=75, arg=1, argval=1, argrepr='', offset=246, start_offset=246, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='POP_TOP', opcode=44, arg=None, argval=None, argrepr='', offset=254, start_offset=254, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='LOAD_CONST', opcode=142, arg=0, argval=None, argrepr='None', offset=256, start_offset=256, starts_line=25, is_jump_target=False, positions=None),
Instruction(opname='LOAD_CONST', opcode=142, arg=0, argval=None, argrepr='None', offset=258, start_offset=258, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='LOAD_CONST', opcode=142, arg=0, argval=None, argrepr='None', offset=260, start_offset=260, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='CALL', opcode=75, arg=2, argval=2, argrepr='', offset=262, start_offset=262, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='POP_TOP', opcode=44, arg=None, argval=None, argrepr='', offset=270, start_offset=270, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='LOAD_GLOBAL', opcode=150, arg=3, argval='print', argrepr='print + NULL', offset=272, start_offset=272, starts_line=28, is_jump_target=True, positions=None),
Instruction(opname='LOAD_CONST', opcode=142, arg=10, argval="OK, now we're done", argrepr='"OK, now we\'re done"', offset=282, start_offset=282, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='CALL', opcode=75, arg=1, argval=1, argrepr='', offset=284, start_offset=284, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='POP_TOP', opcode=44, arg=None, argval=None, argrepr='', offset=292, start_offset=292, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='RETURN_CONST', opcode=167, arg=0, argval=None, argrepr='None', offset=294, start_offset=294, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='PUSH_EXC_INFO', opcode=45, arg=None, argval=None, argrepr='', offset=296, start_offset=296, starts_line=25, is_jump_target=False, positions=None),
Instruction(opname='WITH_EXCEPT_START', opcode=66, arg=None, argval=None, argrepr='', offset=298, start_offset=298, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='TO_BOOL', opcode=56, arg=None, argval=None, argrepr='', offset=300, start_offset=300, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='POP_JUMP_IF_TRUE', opcode=163, arg=1, argval=312, argrepr='to 312', offset=308, start_offset=308, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='RERAISE', opcode=165, arg=2, argval=2, argrepr='', offset=310, start_offset=310, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='POP_TOP', opcode=44, arg=None, argval=None, argrepr='', offset=312, start_offset=312, starts_line=None, is_jump_target=True, positions=None),
Instruction(opname='POP_EXCEPT', opcode=43, arg=None, argval=None, argrepr='', offset=314, start_offset=314, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='POP_TOP', opcode=44, arg=None, argval=None, argrepr='', offset=316, start_offset=316, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='POP_TOP', opcode=44, arg=None, argval=None, argrepr='', offset=318, start_offset=318, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='JUMP_BACKWARD', opcode=123, arg=26, argval=272, argrepr='to 272', offset=320, start_offset=320, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='COPY', opcode=103, arg=3, argval=3, argrepr='', offset=324, start_offset=324, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='POP_EXCEPT', opcode=43, arg=None, argval=None, argrepr='', offset=326, start_offset=326, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='RERAISE', opcode=165, arg=1, argval=1, argrepr='', offset=328, start_offset=328, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='PUSH_EXC_INFO', opcode=45, arg=None, argval=None, argrepr='', offset=330, start_offset=330, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='LOAD_GLOBAL', opcode=150, arg=4, argval='ZeroDivisionError', argrepr='ZeroDivisionError', offset=332, start_offset=332, starts_line=22, is_jump_target=False, positions=None),
Instruction(opname='CHECK_EXC_MATCH', opcode=20, arg=None, argval=None, argrepr='', offset=342, start_offset=342, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='POP_JUMP_IF_FALSE', opcode=160, arg=15, argval=376, argrepr='to 376', offset=344, start_offset=344, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='POP_TOP', opcode=44, arg=None, argval=None, argrepr='', offset=346, start_offset=346, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='LOAD_GLOBAL', opcode=150, arg=3, argval='print', argrepr='print + NULL', offset=348, start_offset=348, starts_line=23, is_jump_target=False, positions=None),
Instruction(opname='LOAD_CONST', opcode=142, arg=9, argval='Here we go, here we go, here we go...', argrepr="'Here we go, here we go, here we go...'", offset=358, start_offset=358, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='CALL', opcode=75, arg=1, argval=1, argrepr='', offset=360, start_offset=360, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='POP_TOP', opcode=44, arg=None, argval=None, argrepr='', offset=368, start_offset=368, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='POP_EXCEPT', opcode=43, arg=None, argval=None, argrepr='', offset=370, start_offset=370, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='JUMP_BACKWARD', opcode=123, arg=52, argval=272, argrepr='to 272', offset=372, start_offset=372, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='RERAISE', opcode=165, arg=0, argval=0, argrepr='', offset=376, start_offset=376, starts_line=22, is_jump_target=True, positions=None),
Instruction(opname='COPY', opcode=103, arg=3, argval=3, argrepr='', offset=378, start_offset=378, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='POP_EXCEPT', opcode=43, arg=None, argval=None, argrepr='', offset=380, start_offset=380, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='RERAISE', opcode=165, arg=1, argval=1, argrepr='', offset=382, start_offset=382, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='PUSH_EXC_INFO', opcode=45, arg=None, argval=None, argrepr='', offset=384, start_offset=384, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='LOAD_GLOBAL', opcode=150, arg=3, argval='print', argrepr='print + NULL', offset=386, start_offset=386, starts_line=28, is_jump_target=False, positions=None),
Instruction(opname='LOAD_CONST', opcode=142, arg=10, argval="OK, now we're done", argrepr='"OK, now we\'re done"', offset=396, start_offset=396, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='CALL', opcode=75, arg=1, argval=1, argrepr='', offset=398, start_offset=398, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='POP_TOP', opcode=44, arg=None, argval=None, argrepr='', offset=406, start_offset=406, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='RERAISE', opcode=165, arg=0, argval=0, argrepr='', offset=408, start_offset=408, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='COPY', opcode=103, arg=3, argval=3, argrepr='', offset=410, start_offset=410, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='POP_EXCEPT', opcode=43, arg=None, argval=None, argrepr='', offset=412, start_offset=412, starts_line=None, is_jump_target=False, positions=None),
Instruction(opname='RERAISE', opcode=165, arg=1, argval=1, argrepr='', offset=414, start_offset=414, starts_line=None, is_jump_target=False, positions=None),
]
# One last piece of inspect fodder to check the default line number handling
def simple(): pass
expected_opinfo_simple = [
Instruction(opname='RESUME', opcode=151, arg=0, argval=0, argrepr='', offset=0, start_offset=0, starts_line=simple.__code__.co_firstlineno, is_jump_target=False, positions=None),
Instruction(opname='RETURN_CONST', opcode=121, arg=0, argval=None, argrepr='None', offset=2, start_offset=2, starts_line=None, is_jump_target=False),
Instruction(opname='RESUME', opcode=166, arg=0, argval=0, argrepr='', offset=0, start_offset=0, starts_line=simple.__code__.co_firstlineno, is_jump_target=False, positions=None),
Instruction(opname='RETURN_CONST', opcode=167, arg=0, argval=None, argrepr='None', offset=2, start_offset=2, starts_line=None, is_jump_target=False),
]
@ -1943,7 +1942,7 @@ class InstructionTests(InstructionTestCase):
self.assertEqual(code, baseopcode)
# Specialized instructions
for name in opcode._specialized_instructions:
for name in opcode._specialized_opmap:
instruction = Instruction(opname=name, opcode=dis._all_opmap[name], arg=None, argval=None, argrepr='',
offset=0, start_offset=0, starts_line=1, is_jump_target=False, positions=None)
baseopname = instruction.baseopname

View File

@ -361,7 +361,7 @@ class EmbeddingTests(EmbeddingTestsMixin, unittest.TestCase):
for instruction in dis.get_instructions(f, adaptive=True):
opname = instruction.opname
if (
opname in opcode._specialized_instructions
opname in opcode._specialized_opmap
# Exclude superinstructions:
and "__" not in opname
):

View File

@ -1431,14 +1431,9 @@ regen-opcode:
# using Tools/build/generate_opcode_h.py
$(PYTHON_FOR_REGEN) $(srcdir)/Tools/build/generate_opcode_h.py \
$(srcdir)/Lib/opcode.py \
$(srcdir)/Lib/_opcode_metadata.py \
$(srcdir)/Include/opcode_ids.h.new \
$(srcdir)/Include/opcode.h.new \
$(srcdir)/Python/opcode_targets.h.new \
$(srcdir)/Include/internal/pycore_opcode.h.new
$(UPDATE_FILE) $(srcdir)/Include/opcode_ids.h $(srcdir)/Include/opcode_ids.h.new
$(UPDATE_FILE) $(srcdir)/Include/opcode.h $(srcdir)/Include/opcode.h.new
$(UPDATE_FILE) $(srcdir)/Python/opcode_targets.h $(srcdir)/Python/opcode_targets.h.new
$(UPDATE_FILE) $(srcdir)/Include/internal/pycore_opcode.h $(srcdir)/Include/internal/pycore_opcode.h.new
.PHONY: regen-token
@ -1550,12 +1545,16 @@ regen-cases:
$(srcdir)/Tools/cases_generator/generate_cases.py \
$(CASESFLAG) \
-o $(srcdir)/Python/generated_cases.c.h.new \
-n $(srcdir)/Include/opcode_ids.h.new \
-t $(srcdir)/Python/opcode_targets.h.new \
-m $(srcdir)/Include/internal/pycore_opcode_metadata.h.new \
-e $(srcdir)/Python/executor_cases.c.h.new \
-p $(srcdir)/Lib/_opcode_metadata.py.new \
-a $(srcdir)/Python/abstract_interp_cases.c.h.new \
$(srcdir)/Python/bytecodes.c
$(UPDATE_FILE) $(srcdir)/Python/generated_cases.c.h $(srcdir)/Python/generated_cases.c.h.new
$(UPDATE_FILE) $(srcdir)/Include/opcode_ids.h $(srcdir)/Include/opcode_ids.h.new
$(UPDATE_FILE) $(srcdir)/Python/opcode_targets.h $(srcdir)/Python/opcode_targets.h.new
$(UPDATE_FILE) $(srcdir)/Include/internal/pycore_opcode_metadata.h $(srcdir)/Include/internal/pycore_opcode_metadata.h.new
$(UPDATE_FILE) $(srcdir)/Python/executor_cases.c.h $(srcdir)/Python/executor_cases.c.h.new
$(UPDATE_FILE) $(srcdir)/Python/abstract_interp_cases.c.h $(srcdir)/Python/abstract_interp_cases.c.h.new

View File

@ -0,0 +1,2 @@
Opcode IDs are generated from bytecodes.c instead of being hard coded in
opcode.py.

View File

@ -6,7 +6,8 @@
#include "pycore_code.h" // _PyCodeConstructor
#include "pycore_frame.h" // FRAME_SPECIALS_SIZE
#include "pycore_interp.h" // PyInterpreterState.co_extra_freefuncs
#include "pycore_opcode.h" // _PyOpcode_Deopt
#include "pycore_opcode.h" // _PyOpcode_Caches
#include "pycore_opcode_metadata.h" // _PyOpcode_Deopt
#include "pycore_pystate.h" // _PyInterpreterState_GET()
#include "pycore_setobject.h" // _PySet_NextEntry()
#include "pycore_tuple.h" // _PyTuple_ITEMS()

View File

@ -7,6 +7,8 @@
#include "pycore_moduleobject.h" // _PyModule_GetDict()
#include "pycore_object.h" // _PyObject_GC_UNTRACK()
#include "pycore_opcode.h" // _PyOpcode_Caches
#include "pycore_opcode_metadata.h" // _PyOpcode_Deopt
#include "frameobject.h" // PyFrameObject
#include "pycore_frame.h"

View File

@ -14,7 +14,7 @@
<Argument>-C</Argument>
</_ASTOutputs>
<_OpcodeSources Include="$(PySourcePath)Tools\build\generate_opcode_h.py;$(PySourcePath)Lib\opcode.py" />
<_OpcodeOutputs Include="$(PySourcePath)Include\opcode.h;$(PySourcePath)Include\internal\pycore_opcode.h;$(PySourcePath)Python\opcode_targets.h" />
<_OpcodeOutputs Include="$(PySourcePath)Include\opcode.h;$(PySourcePath)Include\internal\pycore_opcode.h" />
<_TokenSources Include="$(PySourcePath)Grammar\Tokens" />
<_TokenOutputs Include="$(PySourcePath)Doc\library\token-list.inc">
<Format>rst</Format>
@ -59,7 +59,7 @@
Inputs="@(_OpcodeSources)" Outputs="@(_OpcodeOutputs)"
DependsOnTargets="FindPythonForBuild">
<Message Text="Regenerate @(_OpcodeOutputs->'%(Filename)%(Extension)',' ')" Importance="high" />
<Exec Command="$(PythonForBuild) Tools\build\generate_opcode_h.py Lib\opcode.py Lib\_opcode_metadata.py Include\opcode_ids.h Include\opcode.h Python/opcode_targets.h Include\internal\pycore_opcode.h Include\internal\pycore_intrinsics.h"
<Exec Command="$(PythonForBuild) Tools\build\generate_opcode_h.py Lib\opcode.py Include\opcode.h Include\internal\pycore_opcode.h Include\internal\pycore_intrinsics.h"
WorkingDirectory="$(PySourcePath)" />
</Target>

View File

@ -1,17 +1,17 @@
// Auto-generated by Programs/freeze_test_frozenmain.py
unsigned char M_test_frozenmain[] = {
227,0,0,0,0,0,0,0,0,0,0,0,0,8,0,0,
0,0,0,0,0,243,164,0,0,0,151,0,100,0,100,1,
108,0,90,0,100,0,100,1,108,1,90,1,101,2,2,0,
100,2,171,1,0,0,0,0,0,0,1,0,101,2,2,0,
100,3,101,0,106,6,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,171,2,0,0,0,0,0,0,
1,0,101,1,106,8,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,2,0,171,0,0,0,0,0,
0,0,100,4,25,0,0,0,90,5,100,5,68,0,93,20,
0,0,90,6,101,2,2,0,100,6,101,6,40,0,100,7,
101,5,101,6,25,0,0,0,40,0,157,4,171,1,0,0,
0,0,0,0,1,0,140,22,0,0,4,0,121,1,41,8,
0,0,0,0,0,243,164,0,0,0,166,0,142,0,142,1,
121,0,180,0,142,0,142,1,121,1,180,1,153,2,46,0,
142,2,75,1,0,0,0,0,0,0,44,0,153,2,46,0,
142,3,153,0,129,6,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,75,2,0,0,0,0,0,0,
44,0,153,1,129,8,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,46,0,75,0,0,0,0,0,
0,0,142,4,12,0,0,0,180,5,142,5,31,0,114,20,
0,0,180,6,153,2,46,0,142,6,153,6,27,0,142,7,
153,5,153,6,12,0,0,0,27,0,73,4,75,1,0,0,
0,0,0,0,44,0,123,22,0,0,24,0,167,1,41,8,
233,0,0,0,0,78,122,18,70,114,111,122,101,110,32,72,
101,108,108,111,32,87,111,114,108,100,122,8,115,121,115,46,
97,114,103,118,218,6,99,111,110,102,105,103,41,5,218,12,

View File

@ -17,7 +17,6 @@
#include "pycore_long.h" // _PyLong_GetZero()
#include "pycore_moduleobject.h" // PyModuleObject
#include "pycore_object.h" // _PyObject_GC_TRACK()
#include "pycore_opcode.h" // EXTRA_CASES
#include "pycore_opcode_metadata.h" // uop names
#include "pycore_opcode_utils.h" // MAKE_FUNCTION_*
#include "pycore_pyerrors.h" // _PyErr_GetRaisedException()

451
Python/opcode_targets.h generated
View File

@ -1,258 +1,257 @@
static void *opcode_targets[256] = {
&&TARGET_CACHE,
&&TARGET_POP_TOP,
&&TARGET_PUSH_NULL,
&&TARGET_INTERPRETER_EXIT,
&&TARGET_BEFORE_ASYNC_WITH,
&&TARGET_BEFORE_WITH,
&&TARGET_BINARY_OP_ADD_FLOAT,
&&TARGET_BINARY_OP_ADD_INT,
&&TARGET_BINARY_OP_ADD_UNICODE,
&&TARGET_BINARY_OP_INPLACE_ADD_UNICODE,
&&TARGET_BINARY_OP_MULTIPLY_FLOAT,
&&TARGET_BINARY_OP_MULTIPLY_INT,
&&TARGET_BINARY_OP_SUBTRACT_FLOAT,
&&TARGET_BINARY_OP_SUBTRACT_INT,
&&TARGET_BINARY_SLICE,
&&TARGET_BINARY_SUBSCR,
&&TARGET_BINARY_SUBSCR_DICT,
&&TARGET_BINARY_SUBSCR_GETITEM,
&&TARGET_BINARY_SUBSCR_LIST_INT,
&&TARGET_BINARY_SUBSCR_STR_INT,
&&TARGET_RESERVED,
&&TARGET_BINARY_SUBSCR_TUPLE_INT,
&&TARGET_CHECK_EG_MATCH,
&&TARGET_CHECK_EXC_MATCH,
&&TARGET_CLEANUP_THROW,
&&TARGET_DELETE_SUBSCR,
&&TARGET_END_ASYNC_FOR,
&&TARGET_END_FOR,
&&TARGET_END_SEND,
&&TARGET_EXIT_INIT_CHECK,
&&TARGET_FORMAT_SIMPLE,
&&TARGET_FORMAT_WITH_SPEC,
&&TARGET_GET_AITER,
&&TARGET_GET_ANEXT,
&&TARGET_GET_ITER,
&&TARGET_GET_LEN,
&&TARGET_GET_YIELD_FROM_ITER,
&&TARGET_INTERPRETER_EXIT,
&&TARGET_LOAD_ASSERTION_ERROR,
&&TARGET_LOAD_BUILD_CLASS,
&&TARGET_LOAD_LOCALS,
&&TARGET_MAKE_FUNCTION,
&&TARGET_MATCH_KEYS,
&&TARGET_MATCH_MAPPING,
&&TARGET_MATCH_SEQUENCE,
&&TARGET_NOP,
&&TARGET_POP_EXCEPT,
&&TARGET_POP_TOP,
&&TARGET_PUSH_EXC_INFO,
&&TARGET_PUSH_NULL,
&&TARGET_RETURN_GENERATOR,
&&TARGET_RETURN_VALUE,
&&TARGET_SETUP_ANNOTATIONS,
&&TARGET_STORE_ATTR_INSTANCE_VALUE,
&&TARGET_STORE_ATTR_SLOT,
&&TARGET_STORE_SLICE,
&&TARGET_STORE_SUBSCR,
&&TARGET_STORE_SUBSCR_DICT,
&&TARGET_STORE_SUBSCR_LIST_INT,
&&TARGET_TO_BOOL,
&&TARGET_TO_BOOL_ALWAYS_TRUE,
&&TARGET_TO_BOOL_BOOL,
&&TARGET_NOP,
&&TARGET_TO_BOOL_INT,
&&TARGET_UNARY_NEGATIVE,
&&TARGET_UNARY_NOT,
&&TARGET_TO_BOOL_LIST,
&&TARGET_TO_BOOL_NONE,
&&TARGET_UNARY_INVERT,
&&TARGET_EXIT_INIT_CHECK,
&&TARGET_RESERVED,
&&TARGET_TO_BOOL_STR,
&&TARGET_BINARY_OP_MULTIPLY_INT,
&&TARGET_BINARY_OP_ADD_INT,
&&TARGET_BINARY_OP_SUBTRACT_INT,
&&TARGET_BINARY_OP_MULTIPLY_FLOAT,
&&TARGET_BINARY_OP_ADD_FLOAT,
&&TARGET_MAKE_FUNCTION,
&&TARGET_BINARY_SUBSCR,
&&TARGET_BINARY_SLICE,
&&TARGET_STORE_SLICE,
&&TARGET_BINARY_OP_SUBTRACT_FLOAT,
&&TARGET_BINARY_OP_ADD_UNICODE,
&&TARGET_GET_LEN,
&&TARGET_MATCH_MAPPING,
&&TARGET_MATCH_SEQUENCE,
&&TARGET_MATCH_KEYS,
&&TARGET_BINARY_OP_INPLACE_ADD_UNICODE,
&&TARGET_PUSH_EXC_INFO,
&&TARGET_CHECK_EXC_MATCH,
&&TARGET_CHECK_EG_MATCH,
&&TARGET_BINARY_SUBSCR_DICT,
&&TARGET_BINARY_SUBSCR_GETITEM,
&&TARGET_FORMAT_SIMPLE,
&&TARGET_FORMAT_WITH_SPEC,
&&TARGET_BINARY_SUBSCR_LIST_INT,
&&TARGET_BINARY_SUBSCR_STR_INT,
&&TARGET_BINARY_SUBSCR_TUPLE_INT,
&&TARGET_STORE_SUBSCR_DICT,
&&TARGET_STORE_SUBSCR_LIST_INT,
&&TARGET_SEND_GEN,
&&TARGET_UNPACK_SEQUENCE_TWO_TUPLE,
&&TARGET_UNARY_INVERT,
&&TARGET_UNARY_NEGATIVE,
&&TARGET_UNARY_NOT,
&&TARGET_WITH_EXCEPT_START,
&&TARGET_GET_AITER,
&&TARGET_GET_ANEXT,
&&TARGET_BEFORE_ASYNC_WITH,
&&TARGET_BEFORE_WITH,
&&TARGET_END_ASYNC_FOR,
&&TARGET_CLEANUP_THROW,
&&TARGET_UNPACK_SEQUENCE_TUPLE,
&&TARGET_UNPACK_SEQUENCE_LIST,
&&TARGET_STORE_ATTR_INSTANCE_VALUE,
&&TARGET_STORE_ATTR_SLOT,
&&TARGET_STORE_SUBSCR,
&&TARGET_DELETE_SUBSCR,
&&TARGET_STORE_ATTR_WITH_HINT,
&&TARGET_LOAD_GLOBAL_MODULE,
&&TARGET_LOAD_GLOBAL_BUILTIN,
&&TARGET_LOAD_SUPER_ATTR_ATTR,
&&TARGET_LOAD_SUPER_ATTR_METHOD,
&&TARGET_LOAD_ATTR_INSTANCE_VALUE,
&&TARGET_GET_ITER,
&&TARGET_GET_YIELD_FROM_ITER,
&&TARGET_LOAD_ATTR_MODULE,
&&TARGET_LOAD_BUILD_CLASS,
&&TARGET_LOAD_ATTR_WITH_HINT,
&&TARGET_LOAD_ATTR_SLOT,
&&TARGET_LOAD_ASSERTION_ERROR,
&&TARGET_RETURN_GENERATOR,
&&TARGET_LOAD_ATTR_CLASS,
&&TARGET_LOAD_ATTR_PROPERTY,
&&TARGET_LOAD_ATTR_GETATTRIBUTE_OVERRIDDEN,
&&TARGET_LOAD_ATTR_METHOD_WITH_VALUES,
&&TARGET_LOAD_ATTR_METHOD_NO_DICT,
&&TARGET_LOAD_ATTR_METHOD_LAZY_DICT,
&&TARGET_LOAD_ATTR_NONDESCRIPTOR_WITH_VALUES,
&&TARGET_RETURN_VALUE,
&&TARGET_LOAD_ATTR_NONDESCRIPTOR_NO_DICT,
&&TARGET_SETUP_ANNOTATIONS,
&&TARGET_COMPARE_OP_FLOAT,
&&TARGET_LOAD_LOCALS,
&&TARGET_COMPARE_OP_INT,
&&TARGET_POP_EXCEPT,
&&TARGET_STORE_NAME,
&&TARGET_DELETE_NAME,
&&TARGET_UNPACK_SEQUENCE,
&&TARGET_FOR_ITER,
&&TARGET_UNPACK_EX,
&&TARGET_STORE_ATTR,
&&TARGET_DELETE_ATTR,
&&TARGET_STORE_GLOBAL,
&&TARGET_DELETE_GLOBAL,
&&TARGET_SWAP,
&&TARGET_LOAD_CONST,
&&TARGET_LOAD_NAME,
&&TARGET_BUILD_TUPLE,
&&TARGET_BUILD_LIST,
&&TARGET_BUILD_SET,
&&TARGET_BUILD_MAP,
&&TARGET_LOAD_ATTR,
&&TARGET_COMPARE_OP,
&&TARGET_IMPORT_NAME,
&&TARGET_IMPORT_FROM,
&&TARGET_JUMP_FORWARD,
&&TARGET_COMPARE_OP_STR,
&&TARGET_FOR_ITER_LIST,
&&TARGET_FOR_ITER_TUPLE,
&&TARGET_POP_JUMP_IF_FALSE,
&&TARGET_POP_JUMP_IF_TRUE,
&&TARGET_LOAD_GLOBAL,
&&TARGET_IS_OP,
&&TARGET_CONTAINS_OP,
&&TARGET_RERAISE,
&&TARGET_COPY,
&&TARGET_RETURN_CONST,
&&TARGET_BINARY_OP,
&&TARGET_SEND,
&&TARGET_LOAD_FAST,
&&TARGET_STORE_FAST,
&&TARGET_DELETE_FAST,
&&TARGET_LOAD_FAST_CHECK,
&&TARGET_POP_JUMP_IF_NOT_NONE,
&&TARGET_POP_JUMP_IF_NONE,
&&TARGET_RAISE_VARARGS,
&&TARGET_GET_AWAITABLE,
&&TARGET_FOR_ITER_RANGE,
&&TARGET_BUILD_SLICE,
&&TARGET_JUMP_BACKWARD_NO_INTERRUPT,
&&TARGET_MAKE_CELL,
&&TARGET_FOR_ITER_GEN,
&&TARGET_LOAD_DEREF,
&&TARGET_STORE_DEREF,
&&TARGET_DELETE_DEREF,
&&TARGET_JUMP_BACKWARD,
&&TARGET_LOAD_SUPER_ATTR,
&&TARGET_CALL_FUNCTION_EX,
&&TARGET_LOAD_FAST_AND_CLEAR,
&&TARGET_EXTENDED_ARG,
&&TARGET_LIST_APPEND,
&&TARGET_SET_ADD,
&&TARGET_MAP_ADD,
&&TARGET_CALL_BOUND_METHOD_EXACT_ARGS,
&&TARGET_COPY_FREE_VARS,
&&TARGET_YIELD_VALUE,
&&TARGET_RESUME,
&&TARGET_MATCH_CLASS,
&&TARGET_CALL_PY_EXACT_ARGS,
&&TARGET_CALL_PY_WITH_DEFAULTS,
&&TARGET_CALL_NO_KW_TYPE_1,
&&TARGET_BUILD_CONST_KEY_MAP,
&&TARGET_BUILD_LIST,
&&TARGET_BUILD_MAP,
&&TARGET_BUILD_SET,
&&TARGET_BUILD_SLICE,
&&TARGET_BUILD_STRING,
&&TARGET_CONVERT_VALUE,
&&TARGET_CALL_NO_KW_STR_1,
&&TARGET_CALL_NO_KW_TUPLE_1,
&&TARGET_CALL_BUILTIN_CLASS,
&&TARGET_LIST_EXTEND,
&&TARGET_SET_UPDATE,
&&TARGET_DICT_MERGE,
&&TARGET_DICT_UPDATE,
&&TARGET_CALL_NO_KW_BUILTIN_O,
&&TARGET_CALL_NO_KW_BUILTIN_FAST,
&&TARGET_LOAD_FAST_LOAD_FAST,
&&TARGET_STORE_FAST_LOAD_FAST,
&&TARGET_STORE_FAST_STORE_FAST,
&&TARGET_BUILD_TUPLE,
&&TARGET_CALL,
&&TARGET_KW_NAMES,
&&TARGET_CALL_BOUND_METHOD_EXACT_ARGS,
&&TARGET_CALL_BUILTIN_CLASS,
&&TARGET_CALL_BUILTIN_FAST_WITH_KEYWORDS,
&&TARGET_CALL_FUNCTION_EX,
&&TARGET_CALL_INTRINSIC_1,
&&TARGET_CALL_INTRINSIC_2,
&&TARGET_LOAD_FROM_DICT_OR_GLOBALS,
&&TARGET_LOAD_FROM_DICT_OR_DEREF,
&&TARGET_SET_FUNCTION_ATTRIBUTE,
&&TARGET_CALL_BUILTIN_FAST_WITH_KEYWORDS,
&&TARGET_CALL_NO_KW_LEN,
&&TARGET_CALL_NO_KW_ISINSTANCE,
&&TARGET_CALL_NO_KW_LIST_APPEND,
&&TARGET_CALL_NO_KW_METHOD_DESCRIPTOR_O,
&&TARGET_CALL_METHOD_DESCRIPTOR_FAST_WITH_KEYWORDS,
&&TARGET_CALL_NO_KW_METHOD_DESCRIPTOR_NOARGS,
&&TARGET_CALL_NO_KW_METHOD_DESCRIPTOR_FAST,
&&TARGET_CALL_NO_KW_ALLOC_AND_ENTER_INIT,
&&_unknown_opcode,
&&_unknown_opcode,
&&_unknown_opcode,
&&_unknown_opcode,
&&_unknown_opcode,
&&_unknown_opcode,
&&_unknown_opcode,
&&_unknown_opcode,
&&_unknown_opcode,
&&_unknown_opcode,
&&_unknown_opcode,
&&_unknown_opcode,
&&_unknown_opcode,
&&_unknown_opcode,
&&_unknown_opcode,
&&_unknown_opcode,
&&_unknown_opcode,
&&_unknown_opcode,
&&_unknown_opcode,
&&_unknown_opcode,
&&_unknown_opcode,
&&_unknown_opcode,
&&_unknown_opcode,
&&_unknown_opcode,
&&_unknown_opcode,
&&_unknown_opcode,
&&_unknown_opcode,
&&_unknown_opcode,
&&_unknown_opcode,
&&_unknown_opcode,
&&_unknown_opcode,
&&_unknown_opcode,
&&_unknown_opcode,
&&_unknown_opcode,
&&_unknown_opcode,
&&_unknown_opcode,
&&_unknown_opcode,
&&_unknown_opcode,
&&_unknown_opcode,
&&_unknown_opcode,
&&_unknown_opcode,
&&_unknown_opcode,
&&_unknown_opcode,
&&TARGET_CALL_NO_KW_BUILTIN_FAST,
&&TARGET_CALL_NO_KW_BUILTIN_O,
&&TARGET_CALL_NO_KW_ISINSTANCE,
&&TARGET_CALL_NO_KW_LEN,
&&TARGET_CALL_NO_KW_LIST_APPEND,
&&TARGET_CALL_NO_KW_METHOD_DESCRIPTOR_FAST,
&&TARGET_CALL_NO_KW_METHOD_DESCRIPTOR_NOARGS,
&&TARGET_CALL_NO_KW_METHOD_DESCRIPTOR_O,
&&TARGET_CALL_NO_KW_STR_1,
&&TARGET_CALL_NO_KW_TUPLE_1,
&&TARGET_CALL_NO_KW_TYPE_1,
&&TARGET_CALL_PY_EXACT_ARGS,
&&TARGET_CALL_PY_WITH_DEFAULTS,
&&TARGET_COMPARE_OP,
&&TARGET_COMPARE_OP_FLOAT,
&&TARGET_COMPARE_OP_INT,
&&TARGET_COMPARE_OP_STR,
&&TARGET_CONTAINS_OP,
&&TARGET_CONVERT_VALUE,
&&TARGET_COPY,
&&TARGET_COPY_FREE_VARS,
&&TARGET_DELETE_ATTR,
&&TARGET_DELETE_DEREF,
&&TARGET_DELETE_FAST,
&&TARGET_DELETE_GLOBAL,
&&TARGET_DELETE_NAME,
&&TARGET_DICT_MERGE,
&&TARGET_DICT_UPDATE,
&&TARGET_ENTER_EXECUTOR,
&&TARGET_EXTENDED_ARG,
&&TARGET_FOR_ITER,
&&TARGET_FOR_ITER_GEN,
&&TARGET_FOR_ITER_LIST,
&&TARGET_FOR_ITER_RANGE,
&&TARGET_FOR_ITER_TUPLE,
&&TARGET_GET_AWAITABLE,
&&TARGET_IMPORT_FROM,
&&TARGET_IMPORT_NAME,
&&TARGET_IS_OP,
&&TARGET_JUMP_BACKWARD,
&&TARGET_JUMP_BACKWARD_NO_INTERRUPT,
&&TARGET_JUMP_FORWARD,
&&TARGET_KW_NAMES,
&&TARGET_LIST_APPEND,
&&TARGET_LIST_EXTEND,
&&TARGET_LOAD_ATTR,
&&TARGET_LOAD_ATTR_CLASS,
&&TARGET_LOAD_ATTR_GETATTRIBUTE_OVERRIDDEN,
&&TARGET_LOAD_ATTR_INSTANCE_VALUE,
&&TARGET_LOAD_ATTR_METHOD_LAZY_DICT,
&&TARGET_LOAD_ATTR_METHOD_NO_DICT,
&&TARGET_LOAD_ATTR_METHOD_WITH_VALUES,
&&TARGET_LOAD_ATTR_MODULE,
&&TARGET_LOAD_ATTR_NONDESCRIPTOR_NO_DICT,
&&TARGET_LOAD_ATTR_NONDESCRIPTOR_WITH_VALUES,
&&TARGET_LOAD_ATTR_PROPERTY,
&&TARGET_LOAD_ATTR_SLOT,
&&TARGET_LOAD_ATTR_WITH_HINT,
&&TARGET_LOAD_CONST,
&&TARGET_LOAD_DEREF,
&&TARGET_LOAD_FAST,
&&TARGET_LOAD_FAST_AND_CLEAR,
&&TARGET_LOAD_FAST_CHECK,
&&TARGET_LOAD_FAST_LOAD_FAST,
&&TARGET_LOAD_FROM_DICT_OR_DEREF,
&&TARGET_LOAD_FROM_DICT_OR_GLOBALS,
&&TARGET_LOAD_GLOBAL,
&&TARGET_LOAD_GLOBAL_BUILTIN,
&&TARGET_LOAD_GLOBAL_MODULE,
&&TARGET_LOAD_NAME,
&&TARGET_LOAD_SUPER_ATTR,
&&TARGET_LOAD_SUPER_ATTR_ATTR,
&&TARGET_LOAD_SUPER_ATTR_METHOD,
&&TARGET_MAKE_CELL,
&&TARGET_MAP_ADD,
&&TARGET_MATCH_CLASS,
&&TARGET_POP_JUMP_IF_FALSE,
&&TARGET_POP_JUMP_IF_NONE,
&&TARGET_POP_JUMP_IF_NOT_NONE,
&&TARGET_POP_JUMP_IF_TRUE,
&&TARGET_RAISE_VARARGS,
&&TARGET_RERAISE,
&&TARGET_RESUME,
&&TARGET_RETURN_CONST,
&&TARGET_SEND,
&&TARGET_SEND_GEN,
&&TARGET_SET_ADD,
&&TARGET_SET_FUNCTION_ATTRIBUTE,
&&TARGET_SET_UPDATE,
&&TARGET_STORE_ATTR,
&&TARGET_STORE_ATTR_WITH_HINT,
&&TARGET_STORE_DEREF,
&&TARGET_STORE_FAST,
&&TARGET_STORE_FAST_LOAD_FAST,
&&TARGET_STORE_FAST_STORE_FAST,
&&TARGET_STORE_GLOBAL,
&&TARGET_STORE_NAME,
&&TARGET_SWAP,
&&TARGET_UNPACK_EX,
&&TARGET_UNPACK_SEQUENCE,
&&TARGET_UNPACK_SEQUENCE_LIST,
&&TARGET_UNPACK_SEQUENCE_TUPLE,
&&TARGET_UNPACK_SEQUENCE_TWO_TUPLE,
&&TARGET_YIELD_VALUE,
&&_unknown_opcode,
&&_unknown_opcode,
&&_unknown_opcode,
&&_unknown_opcode,
&&_unknown_opcode,
&&_unknown_opcode,
&&_unknown_opcode,
&&_unknown_opcode,
&&_unknown_opcode,
&&_unknown_opcode,
&&_unknown_opcode,
&&_unknown_opcode,
&&_unknown_opcode,
&&_unknown_opcode,
&&_unknown_opcode,
&&_unknown_opcode,
&&_unknown_opcode,
&&_unknown_opcode,
&&_unknown_opcode,
&&_unknown_opcode,
&&_unknown_opcode,
&&_unknown_opcode,
&&_unknown_opcode,
&&_unknown_opcode,
&&_unknown_opcode,
&&_unknown_opcode,
&&_unknown_opcode,
&&_unknown_opcode,
&&_unknown_opcode,
&&_unknown_opcode,
&&_unknown_opcode,
&&_unknown_opcode,
&&_unknown_opcode,
&&_unknown_opcode,
&&_unknown_opcode,
&&_unknown_opcode,
&&_unknown_opcode,
&&_unknown_opcode,
&&_unknown_opcode,
&&_unknown_opcode,
&&_unknown_opcode,
&&_unknown_opcode,
&&_unknown_opcode,
&&_unknown_opcode,
&&_unknown_opcode,
&&_unknown_opcode,
&&_unknown_opcode,
&&_unknown_opcode,
&&_unknown_opcode,
&&TARGET_INSTRUMENTED_LOAD_SUPER_ATTR,
&&TARGET_INSTRUMENTED_POP_JUMP_IF_NONE,
&&TARGET_INSTRUMENTED_POP_JUMP_IF_NOT_NONE,
&&TARGET_INSTRUMENTED_RESUME,
&&TARGET_INSTRUMENTED_CALL,
&&TARGET_INSTRUMENTED_RETURN_VALUE,
&&TARGET_INSTRUMENTED_YIELD_VALUE,
&&TARGET_INSTRUMENTED_CALL_FUNCTION_EX,
&&TARGET_INSTRUMENTED_JUMP_FORWARD,
&&TARGET_INSTRUMENTED_JUMP_BACKWARD,
&&TARGET_INSTRUMENTED_RETURN_CONST,
&&TARGET_INSTRUMENTED_FOR_ITER,
&&TARGET_INSTRUMENTED_POP_JUMP_IF_FALSE,
&&TARGET_INSTRUMENTED_POP_JUMP_IF_TRUE,
&&TARGET_INSTRUMENTED_END_FOR,
&&TARGET_INSTRUMENTED_END_SEND,
&&TARGET_INSTRUMENTED_RETURN_VALUE,
&&TARGET_INSTRUMENTED_RETURN_CONST,
&&TARGET_INSTRUMENTED_YIELD_VALUE,
&&TARGET_INSTRUMENTED_LOAD_SUPER_ATTR,
&&TARGET_INSTRUMENTED_FOR_ITER,
&&TARGET_INSTRUMENTED_CALL,
&&TARGET_INSTRUMENTED_CALL_FUNCTION_EX,
&&TARGET_INSTRUMENTED_INSTRUCTION,
&&TARGET_INSTRUMENTED_JUMP_FORWARD,
&&TARGET_INSTRUMENTED_JUMP_BACKWARD,
&&TARGET_INSTRUMENTED_POP_JUMP_IF_TRUE,
&&TARGET_INSTRUMENTED_POP_JUMP_IF_FALSE,
&&TARGET_INSTRUMENTED_POP_JUMP_IF_NONE,
&&TARGET_INSTRUMENTED_POP_JUMP_IF_NOT_NONE,
&&TARGET_INSTRUMENTED_LINE,
&&_unknown_opcode
};
&&_unknown_opcode};

View File

@ -22,7 +22,7 @@ ROOT = os.path.dirname(os.path.dirname(os.path.dirname(__file__)))
verbose = False
# This must be kept in sync with opcode.py
RESUME = 151
RESUME = 166
def isprintable(b: bytes) -> bool:
return all(0x20 <= c < 0x7f for c in b)
@ -297,10 +297,12 @@ class Printer:
self.write(f".co_linetable = {co_linetable},")
self.write(f"._co_cached = NULL,")
self.write(f".co_code_adaptive = {co_code_adaptive},")
for i, op in enumerate(code.co_code[::2]):
first_traceable = 0
for op in code.co_code[::2]:
if op == RESUME:
self.write(f"._co_firsttraceable = {i},")
break
first_traceable += 1
self.write(f"._co_firsttraceable = {first_traceable},")
name_as_code = f"(PyCodeObject *)&{name}"
self.finis.append(f"_PyStaticCode_Fini({name_as_code});")
self.inits.append(f"_PyStaticCode_Init({name_as_code})")

View File

@ -27,27 +27,6 @@ opcode_h_footer = """
#endif /* !Py_OPCODE_H */
"""
opcode_ids_h_header = f"""
// Auto-generated by {SCRIPT_NAME} from {PYTHON_OPCODE}
#ifndef Py_OPCODE_IDS_H
#define Py_OPCODE_IDS_H
#ifdef __cplusplus
extern "C" {{
#endif
/* Instruction opcodes for compiled code */
""".lstrip()
opcode_ids_h_footer = """
#ifdef __cplusplus
}
#endif
#endif /* !Py_OPCODE_IDS_H */
"""
internal_header = f"""
// Auto-generated by {SCRIPT_NAME} from {PYTHON_OPCODE}
@ -83,52 +62,10 @@ def get_python_module_dict(filename):
return mod
def main(opcode_py,
_opcode_metadata_py='Lib/_opcode_metadata.py',
opcode_ids_h='Include/opcode_ids.h',
opcode_h='Include/opcode.h',
opcode_targets_h='Python/opcode_targets.h',
internal_opcode_h='Include/internal/pycore_opcode.h'):
_opcode_metadata = get_python_module_dict(_opcode_metadata_py)
opcode = get_python_module_dict(opcode_py)
opmap = opcode['opmap']
opname = opcode['opname']
MIN_INSTRUMENTED_OPCODE = opcode["MIN_INSTRUMENTED_OPCODE"]
NUM_OPCODES = len(opname)
used = [ False ] * len(opname)
next_op = 1
for name, op in opmap.items():
used[op] = True
specialized_opmap = {}
opname_including_specialized = opname.copy()
for name in _opcode_metadata['_specialized_instructions']:
while used[next_op]:
next_op += 1
specialized_opmap[name] = next_op
opname_including_specialized[next_op] = name
used[next_op] = True
with open(opcode_ids_h, 'w') as fobj:
fobj.write(opcode_ids_h_header)
for name in opname:
if name in opmap:
op = opmap[name]
if op == MIN_INSTRUMENTED_OPCODE:
fobj.write(DEFINE.format("MIN_INSTRUMENTED_OPCODE", MIN_INSTRUMENTED_OPCODE))
fobj.write(DEFINE.format(name, op))
for name, op in specialized_opmap.items():
fobj.write(DEFINE.format(name, op))
fobj.write(opcode_ids_h_footer)
with open(opcode_h, 'w') as fobj:
fobj.write(opcode_h_header)
@ -143,7 +80,6 @@ def main(opcode_py,
iobj.write(internal_header)
iobj.write("\nextern const uint8_t _PyOpcode_Caches[256];\n")
iobj.write("\nextern const uint8_t _PyOpcode_Deopt[256];\n")
iobj.write("\n#ifdef NEED_OPCODE_TABLES\n")
iobj.write("\nconst uint8_t _PyOpcode_Caches[256] = {\n")
@ -151,52 +87,12 @@ def main(opcode_py,
iobj.write(f" [{name}] = {entries},\n")
iobj.write("};\n")
deoptcodes = {}
for basic, op in opmap.items():
if op < 256:
deoptcodes[basic] = basic
for basic, family in _opcode_metadata["_specializations"].items():
for specialized in family:
deoptcodes[specialized] = basic
iobj.write("\nconst uint8_t _PyOpcode_Deopt[256] = {\n")
for opt, deopt in sorted(deoptcodes.items()):
iobj.write(f" [{opt}] = {deopt},\n")
iobj.write("};\n")
iobj.write("#endif // NEED_OPCODE_TABLES\n")
iobj.write("\n")
iobj.write(f"\nextern const char *const _PyOpcode_OpName[{NUM_OPCODES}];\n")
iobj.write("\n#ifdef NEED_OPCODE_TABLES\n")
iobj.write(f"const char *const _PyOpcode_OpName[{NUM_OPCODES}] = {{\n")
for op, name in enumerate(opname_including_specialized):
if name[0] != "<":
op = name
iobj.write(f''' [{op}] = "{name}",\n''')
iobj.write("};\n")
iobj.write("#endif // NEED_OPCODE_TABLES\n")
iobj.write("\n")
iobj.write("#define EXTRA_CASES \\\n")
for i, flag in enumerate(used):
if not flag:
iobj.write(f" case {i}: \\\n")
iobj.write(" ;\n")
iobj.write(internal_footer)
with open(opcode_targets_h, "w") as f:
targets = ["_unknown_opcode"] * 256
for op, name in enumerate(opname_including_specialized):
if op < 256 and not name.startswith("<"):
targets[op] = f"TARGET_{name}"
f.write("static void *opcode_targets[256] = {\n")
f.write(",\n".join([f" &&{s}" for s in targets]))
f.write("\n};\n")
print(f"{opcode_h} regenerated from {opcode_py}")
if __name__ == '__main__':
main(sys.argv[1], sys.argv[2], sys.argv[3], sys.argv[4],
sys.argv[5], sys.argv[6])
main(sys.argv[1], sys.argv[2], sys.argv[3])

View File

@ -5,6 +5,7 @@ Writes the cases to generated_cases.c.h, which is #included in ceval.c.
import argparse
import contextlib
import itertools
import os
import posixpath
import sys
@ -36,6 +37,12 @@ THIS = os.path.relpath(__file__, ROOT).replace(os.path.sep, posixpath.sep)
DEFAULT_INPUT = os.path.relpath(os.path.join(ROOT, "Python/bytecodes.c"))
DEFAULT_OUTPUT = os.path.relpath(os.path.join(ROOT, "Python/generated_cases.c.h"))
DEFAULT_OPCODE_IDS_H_OUTPUT = os.path.relpath(
os.path.join(ROOT, "Include/opcode_ids.h")
)
DEFAULT_OPCODE_TARGETS_H_OUTPUT = os.path.relpath(
os.path.join(ROOT, "Python/opcode_targets.h")
)
DEFAULT_METADATA_OUTPUT = os.path.relpath(
os.path.join(ROOT, "Include/internal/pycore_opcode_metadata.h")
)
@ -86,6 +93,20 @@ arg_parser = argparse.ArgumentParser(
arg_parser.add_argument(
"-o", "--output", type=str, help="Generated code", default=DEFAULT_OUTPUT
)
arg_parser.add_argument(
"-n",
"--opcode_ids_h",
type=str,
help="Header file with opcode number definitions",
default=DEFAULT_OPCODE_IDS_H_OUTPUT,
)
arg_parser.add_argument(
"-t",
"--opcode_targets_h",
type=str,
help="File with opcode targets for computed gotos",
default=DEFAULT_OPCODE_TARGETS_H_OUTPUT,
)
arg_parser.add_argument(
"-m",
"--metadata",
@ -225,6 +246,129 @@ class Generator(Analyzer):
self.out.write_raw(self.from_source_files())
self.out.write_raw(f"{self.out.comment} Do not edit!\n")
def assign_opcode_ids(self):
"""Assign IDs to opcodes"""
ops: list[(bool, str)] = [] # (has_arg, name) for each opcode
instrumented_ops: list[str] = []
for instr in itertools.chain(
[instr for instr in self.instrs.values() if instr.kind != "op"],
self.macro_instrs.values()):
name = instr.name
if name.startswith('INSTRUMENTED_'):
instrumented_ops.append(name)
else:
ops.append((instr.instr_flags.HAS_ARG_FLAG, name))
# Special case: this instruction is implemented in ceval.c
# rather than bytecodes.c, so we need to add it explicitly
# here (at least until we add something to bytecodes.c to
# declare external instructions).
instrumented_ops.append('INSTRUMENTED_LINE')
# assert lists are unique
assert len(set(ops)) == len(ops)
assert len(set(instrumented_ops)) == len(instrumented_ops)
opname: list[str or None] = [None] * 512
opmap: dict = {}
markers: dict = {}
def map_op(op, name):
assert op < len(opname)
assert opname[op] is None
assert name not in opmap
opname[op] = name
opmap[name] = op
# 0 is reserved for cache entries. This helps debugging.
map_op(0, 'CACHE')
# 17 is reserved as it is the initial value for the specializing counter.
# This helps catch cases where we attempt to execute a cache.
map_op(17, 'RESERVED')
# 166 is RESUME - it is hard coded as such in Tools/build/deepfreeze.py
map_op(166, 'RESUME')
next_opcode = 1
for has_arg, name in sorted(ops):
if name in opmap:
continue # an anchored name, like CACHE
while opname[next_opcode] is not None:
next_opcode += 1
assert next_opcode < 255
map_op(next_opcode, name)
if has_arg and 'HAVE_ARGUMENT' not in markers:
markers['HAVE_ARGUMENT'] = next_opcode
# Instrumented opcodes are at the end of the valid range
min_instrumented = 254 - (len(instrumented_ops) - 1)
assert next_opcode <= min_instrumented
markers['MIN_INSTRUMENTED_OPCODE'] = min_instrumented
for i, op in enumerate(instrumented_ops):
map_op(min_instrumented + i, op)
# Pseudo opcodes are after the valid range
for i, op in enumerate(sorted(self.pseudos)):
map_op(256 + i, op)
assert 255 not in opmap # 255 is reserved
self.opmap = opmap
self.markers = markers
def write_opcode_ids(self, opcode_ids_h_filename, opcode_targets_filename):
"""Write header file that defined the opcode IDs"""
with open(opcode_ids_h_filename, "w") as f:
# Create formatter
self.out = Formatter(f, 0)
self.write_provenance_header()
self.out.emit("")
self.out.emit("#ifndef Py_OPCODE_IDS_H")
self.out.emit("#define Py_OPCODE_IDS_H")
self.out.emit("#ifdef __cplusplus")
self.out.emit("extern \"C\" {")
self.out.emit("#endif")
self.out.emit("")
self.out.emit("/* Instruction opcodes for compiled code */")
def define(name, opcode):
self.out.emit(f"#define {name:<38} {opcode:>3}")
all_pairs = []
# the second item in the tuple sorts the markers before the ops
all_pairs.extend((i, 1, name) for (name, i) in self.markers.items())
all_pairs.extend((i, 2, name) for (name, i) in self.opmap.items())
for i, _, name in sorted(all_pairs):
assert name is not None
define(name, i)
self.out.emit("")
self.out.emit("#ifdef __cplusplus")
self.out.emit("}")
self.out.emit("#endif")
self.out.emit("#endif /* !Py_OPCODE_IDS_H */")
with open(opcode_targets_filename, "w") as f:
# Create formatter
self.out = Formatter(f, 0)
with self.out.block("static void *opcode_targets[256] =", ";"):
targets = ["_unknown_opcode"] * 256
for name, op in self.opmap.items():
if op < 256:
targets[op] = f"TARGET_{name}"
f.write(",\n".join([f" &&{s}" for s in targets]))
def write_metadata(self, metadata_filename: str, pymetadata_filename: str) -> None:
"""Write instruction metadata to output file."""
@ -378,12 +522,46 @@ class Generator(Analyzer):
):
self.write_uop_items(lambda name, counter: f'[{name}] = "{name}",')
with self.metadata_item(
f"const char *const _PyOpcode_OpName[{1 + max(self.opmap.values())}]", "=", ";"
):
for name in self.opmap:
self.out.emit(f'[{name}] = "{name}",')
deoptcodes = {}
for name, op in self.opmap.items():
if op < 256:
deoptcodes[name] = name
for name, family in self.families.items():
for m in family.members:
deoptcodes[m] = name
# special case:
deoptcodes['BINARY_OP_INPLACE_ADD_UNICODE'] = 'BINARY_OP'
with self.metadata_item(
f"const uint8_t _PyOpcode_Deopt[256]", "=", ";"
):
for opt, deopt in sorted(deoptcodes.items()):
self.out.emit(f"[{opt}] = {deopt},")
self.out.emit("")
self.out.emit("#define EXTRA_CASES \\")
valid_opcodes = set(self.opmap.values())
with self.out.indent():
for op in range(256):
if op not in valid_opcodes:
self.out.emit(f"case {op}: \\")
self.out.emit(" ;\n")
with open(pymetadata_filename, "w") as f:
# Create formatter
self.out = Formatter(f, 0, comment="#")
self.write_provenance_header()
# emit specializations
specialized_ops = set()
self.out.emit("")
self.out.emit("_specializations = {")
for name, family in self.families.items():
@ -392,6 +570,7 @@ class Generator(Analyzer):
with self.out.indent():
for m in family.members:
self.out.emit(f'"{m}",')
specialized_ops.update(family.members)
self.out.emit(f"],")
self.out.emit("}")
@ -402,14 +581,26 @@ class Generator(Analyzer):
'_specializations["BINARY_OP"].append('
'"BINARY_OP_INPLACE_ADD_UNICODE")'
)
specialized_ops.add("BINARY_OP_INPLACE_ADD_UNICODE")
# Make list of specialized instructions
ops = sorted((id, name) for (name, id) in self.opmap.items())
# emit specialized opmap
self.out.emit("")
self.out.emit(
"_specialized_instructions = ["
"opcode for family in _specializations.values() for opcode in family"
"]"
)
with self.out.block("_specialized_opmap ="):
for op, name in ops:
if name in specialized_ops:
self.out.emit(f"'{name}': {op},")
# emit opmap
self.out.emit("")
with self.out.block("opmap ="):
for op, name in ops:
if name not in specialized_ops:
self.out.emit(f"'{name}': {op},")
for name in ['MIN_INSTRUMENTED_OPCODE', 'HAVE_ARGUMENT']:
self.out.emit(f"{name} = {self.markers[name]}")
def write_pseudo_instrs(self) -> None:
"""Write the IS_PSEUDO_INSTR macro"""
@ -683,6 +874,9 @@ def main():
# These raise OSError if output can't be written
a.write_instructions(args.output, args.emit_line_directives)
a.assign_opcode_ids()
a.write_opcode_ids(args.opcode_ids_h, args.opcode_targets_h)
a.write_metadata(args.metadata, args.pymetadata)
a.write_executor_instructions(args.executor_cases, args.emit_line_directives)
a.write_abstract_interpreter_instructions(args.abstract_interpreter_cases,

View File

@ -17,7 +17,7 @@ else:
DEFAULT_DIR = "/tmp/py_stats/"
#Create list of all instruction names
specialized = iter(opcode._specialized_instructions)
specialized = iter(opcode._specialized_opmap.keys())
opname = ["<0>"]
for name in opcode.opname[1:]:
if name.startswith("<"):
@ -244,7 +244,7 @@ def categorized_counts(opcode_stats):
specialized = 0
not_specialized = 0
specialized_instructions = {
op for op in opcode._specialized_instructions
op for op in opcode._specialized_opmap.keys()
if "__" not in op}
for i, opcode_stat in enumerate(opcode_stats):
if "execution_count" not in opcode_stat: