GH-108614: Add `RESUME_CHECK` instruction (GH-108630)

This commit is contained in:
Mark Shannon 2023-09-07 14:39:03 +01:00 committed by GitHub
parent d485551c9d
commit 0858328ca2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
16 changed files with 519 additions and 482 deletions

View File

@ -82,6 +82,8 @@ int _PyOpcode_num_popped(int opcode, int oparg, bool jump) {
return 0;
case RESUME:
return 0;
case RESUME_CHECK:
return 0;
case INSTRUMENTED_RESUME:
return 0;
case LOAD_CLOSURE:
@ -614,6 +616,8 @@ int _PyOpcode_num_pushed(int opcode, int oparg, bool jump) {
return 0;
case RESUME:
return 0;
case RESUME_CHECK:
return 0;
case INSTRUMENTED_RESUME:
return 0;
case LOAD_CLOSURE:
@ -1207,6 +1211,7 @@ extern const struct opcode_metadata _PyOpcode_opcode_metadata[OPCODE_METADATA_SI
const struct opcode_metadata _PyOpcode_opcode_metadata[OPCODE_METADATA_SIZE] = {
[NOP] = { true, INSTR_FMT_IX, 0 },
[RESUME] = { true, INSTR_FMT_IB, HAS_ARG_FLAG | HAS_EVAL_BREAK_FLAG | HAS_ERROR_FLAG },
[RESUME_CHECK] = { true, INSTR_FMT_IX, HAS_DEOPT_FLAG },
[INSTRUMENTED_RESUME] = { true, INSTR_FMT_IB, HAS_ARG_FLAG | HAS_EVAL_BREAK_FLAG | HAS_ERROR_FLAG },
[LOAD_CLOSURE] = { true, INSTR_FMT_IB, HAS_ARG_FLAG | HAS_LOCAL_FLAG },
[LOAD_FAST_CHECK] = { true, INSTR_FMT_IB, HAS_ARG_FLAG | HAS_LOCAL_FLAG | HAS_ERROR_FLAG },
@ -1477,7 +1482,7 @@ extern const struct opcode_macro_expansion _PyOpcode_macro_expansion[OPCODE_MACR
#ifdef NEED_OPCODE_METADATA
const struct opcode_macro_expansion _PyOpcode_macro_expansion[OPCODE_MACRO_EXPANSION_SIZE] = {
[NOP] = { .nuops = 1, .uops = { { NOP, 0, 0 } } },
[RESUME] = { .nuops = 1, .uops = { { RESUME, 0, 0 } } },
[RESUME_CHECK] = { .nuops = 1, .uops = { { RESUME_CHECK, 0, 0 } } },
[LOAD_FAST_CHECK] = { .nuops = 1, .uops = { { LOAD_FAST_CHECK, 0, 0 } } },
[LOAD_FAST] = { .nuops = 1, .uops = { { LOAD_FAST, 0, 0 } } },
[LOAD_FAST_AND_CLEAR] = { .nuops = 1, .uops = { { LOAD_FAST_AND_CLEAR, 0, 0 } } },
@ -1716,6 +1721,7 @@ const char *const _PyOpcode_OpName[268] = {
[POP_TOP] = "POP_TOP",
[PUSH_EXC_INFO] = "PUSH_EXC_INFO",
[PUSH_NULL] = "PUSH_NULL",
[RESUME_CHECK] = "RESUME_CHECK",
[RETURN_GENERATOR] = "RETURN_GENERATOR",
[RETURN_VALUE] = "RETURN_VALUE",
[SETUP_ANNOTATIONS] = "SETUP_ANNOTATIONS",
@ -2077,6 +2083,7 @@ const uint8_t _PyOpcode_Deopt[256] = {
[RERAISE] = RERAISE,
[RESERVED] = RESERVED,
[RESUME] = RESUME,
[RESUME_CHECK] = RESUME,
[RETURN_CONST] = RETURN_CONST,
[RETURN_GENERATOR] = RETURN_GENERATOR,
[RETURN_VALUE] = RETURN_VALUE,
@ -2122,7 +2129,6 @@ const uint8_t _PyOpcode_Deopt[256] = {
#endif // NEED_OPCODE_METADATA
#define EXTRA_CASES \
case 188: \
case 189: \
case 190: \
case 191: \

283
Include/opcode_ids.h generated
View File

@ -57,148 +57,149 @@ extern "C" {
#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_CHECK 47
#define RETURN_GENERATOR 48
#define RETURN_VALUE 49
#define SETUP_ANNOTATIONS 50
#define STORE_ATTR_INSTANCE_VALUE 51
#define STORE_ATTR_SLOT 52
#define STORE_SLICE 53
#define STORE_SUBSCR 54
#define STORE_SUBSCR_DICT 55
#define STORE_SUBSCR_LIST_INT 56
#define TO_BOOL 57
#define TO_BOOL_ALWAYS_TRUE 58
#define TO_BOOL_BOOL 59
#define TO_BOOL_INT 60
#define TO_BOOL_LIST 61
#define TO_BOOL_NONE 62
#define TO_BOOL_STR 63
#define UNARY_INVERT 64
#define UNARY_NEGATIVE 65
#define UNARY_NOT 66
#define WITH_EXCEPT_START 67
#define HAVE_ARGUMENT 68
#define BINARY_OP 68
#define BUILD_CONST_KEY_MAP 69
#define BUILD_LIST 70
#define BUILD_MAP 71
#define BUILD_SET 72
#define BUILD_SLICE 73
#define BUILD_STRING 74
#define BUILD_TUPLE 75
#define CALL 76
#define CALL_BOUND_METHOD_EXACT_ARGS 77
#define CALL_BUILTIN_CLASS 78
#define CALL_BUILTIN_FAST_WITH_KEYWORDS 79
#define CALL_FUNCTION_EX 80
#define CALL_INTRINSIC_1 81
#define CALL_INTRINSIC_2 82
#define CALL_METHOD_DESCRIPTOR_FAST_WITH_KEYWORDS 83
#define CALL_NO_KW_ALLOC_AND_ENTER_INIT 84
#define CALL_NO_KW_BUILTIN_FAST 85
#define CALL_NO_KW_BUILTIN_O 86
#define CALL_NO_KW_ISINSTANCE 87
#define CALL_NO_KW_LEN 88
#define CALL_NO_KW_LIST_APPEND 89
#define CALL_NO_KW_METHOD_DESCRIPTOR_FAST 90
#define CALL_NO_KW_METHOD_DESCRIPTOR_NOARGS 91
#define CALL_NO_KW_METHOD_DESCRIPTOR_O 92
#define CALL_NO_KW_STR_1 93
#define CALL_NO_KW_TUPLE_1 94
#define CALL_NO_KW_TYPE_1 95
#define CALL_PY_EXACT_ARGS 96
#define CALL_PY_WITH_DEFAULTS 97
#define COMPARE_OP 98
#define COMPARE_OP_FLOAT 99
#define COMPARE_OP_INT 100
#define COMPARE_OP_STR 101
#define CONTAINS_OP 102
#define CONVERT_VALUE 103
#define COPY 104
#define COPY_FREE_VARS 105
#define DELETE_ATTR 106
#define DELETE_DEREF 107
#define DELETE_FAST 108
#define DELETE_GLOBAL 109
#define DELETE_NAME 110
#define DICT_MERGE 111
#define DICT_UPDATE 112
#define ENTER_EXECUTOR 113
#define EXTENDED_ARG 114
#define FOR_ITER 115
#define FOR_ITER_GEN 116
#define FOR_ITER_LIST 117
#define FOR_ITER_RANGE 118
#define FOR_ITER_TUPLE 119
#define GET_AWAITABLE 120
#define IMPORT_FROM 121
#define IMPORT_NAME 122
#define IS_OP 123
#define JUMP_BACKWARD 124
#define JUMP_BACKWARD_NO_INTERRUPT 125
#define JUMP_FORWARD 126
#define KW_NAMES 127
#define LIST_APPEND 128
#define LIST_EXTEND 129
#define LOAD_ATTR 130
#define LOAD_ATTR_CLASS 131
#define LOAD_ATTR_GETATTRIBUTE_OVERRIDDEN 132
#define LOAD_ATTR_INSTANCE_VALUE 133
#define LOAD_ATTR_METHOD_LAZY_DICT 134
#define LOAD_ATTR_METHOD_NO_DICT 135
#define LOAD_ATTR_METHOD_WITH_VALUES 136
#define LOAD_ATTR_MODULE 137
#define LOAD_ATTR_NONDESCRIPTOR_NO_DICT 138
#define LOAD_ATTR_NONDESCRIPTOR_WITH_VALUES 139
#define LOAD_ATTR_PROPERTY 140
#define LOAD_ATTR_SLOT 141
#define LOAD_ATTR_WITH_HINT 142
#define LOAD_CONST 143
#define LOAD_DEREF 144
#define LOAD_FAST 145
#define LOAD_FAST_AND_CLEAR 146
#define LOAD_FAST_CHECK 147
#define LOAD_FAST_LOAD_FAST 148
#define LOAD_FROM_DICT_OR_DEREF 149
#define LOAD_FROM_DICT_OR_GLOBALS 150
#define LOAD_GLOBAL 151
#define LOAD_GLOBAL_BUILTIN 152
#define LOAD_GLOBAL_MODULE 153
#define LOAD_NAME 154
#define LOAD_SUPER_ATTR 155
#define LOAD_SUPER_ATTR_ATTR 156
#define LOAD_SUPER_ATTR_METHOD 157
#define MAKE_CELL 158
#define MAP_ADD 159
#define MATCH_CLASS 160
#define POP_JUMP_IF_FALSE 161
#define POP_JUMP_IF_NONE 162
#define POP_JUMP_IF_NOT_NONE 163
#define POP_JUMP_IF_TRUE 164
#define RAISE_VARARGS 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 RERAISE 167
#define RETURN_CONST 168
#define SEND 169
#define SEND_GEN 170
#define SET_ADD 171
#define SET_FUNCTION_ATTRIBUTE 172
#define SET_UPDATE 173
#define STORE_ATTR 174
#define STORE_ATTR_WITH_HINT 175
#define STORE_DEREF 176
#define STORE_FAST 177
#define STORE_FAST_LOAD_FAST 178
#define STORE_FAST_STORE_FAST 179
#define STORE_GLOBAL 180
#define STORE_NAME 181
#define SWAP 182
#define UNPACK_EX 183
#define UNPACK_SEQUENCE 184
#define UNPACK_SEQUENCE_LIST 185
#define UNPACK_SEQUENCE_TUPLE 186
#define UNPACK_SEQUENCE_TWO_TUPLE 187
#define YIELD_VALUE 188
#define MIN_INSTRUMENTED_OPCODE 237
#define INSTRUMENTED_RESUME 237
#define INSTRUMENTED_END_FOR 238

286
Lib/_opcode_metadata.py generated
View File

@ -4,6 +4,9 @@
# Do not edit!
_specializations = {
"RESUME": [
"RESUME_CHECK",
],
"TO_BOOL": [
"TO_BOOL_ALWAYS_TRUE",
"TO_BOOL_BOOL",
@ -117,62 +120,63 @@ _specialized_opmap = {
'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,
'RESUME_CHECK': 47,
'STORE_ATTR_INSTANCE_VALUE': 51,
'STORE_ATTR_SLOT': 52,
'STORE_SUBSCR_DICT': 55,
'STORE_SUBSCR_LIST_INT': 56,
'TO_BOOL_ALWAYS_TRUE': 58,
'TO_BOOL_BOOL': 59,
'TO_BOOL_INT': 60,
'TO_BOOL_LIST': 61,
'TO_BOOL_NONE': 62,
'TO_BOOL_STR': 63,
'CALL_BOUND_METHOD_EXACT_ARGS': 77,
'CALL_BUILTIN_CLASS': 78,
'CALL_BUILTIN_FAST_WITH_KEYWORDS': 79,
'CALL_METHOD_DESCRIPTOR_FAST_WITH_KEYWORDS': 83,
'CALL_NO_KW_ALLOC_AND_ENTER_INIT': 84,
'CALL_NO_KW_BUILTIN_FAST': 85,
'CALL_NO_KW_BUILTIN_O': 86,
'CALL_NO_KW_ISINSTANCE': 87,
'CALL_NO_KW_LEN': 88,
'CALL_NO_KW_LIST_APPEND': 89,
'CALL_NO_KW_METHOD_DESCRIPTOR_FAST': 90,
'CALL_NO_KW_METHOD_DESCRIPTOR_NOARGS': 91,
'CALL_NO_KW_METHOD_DESCRIPTOR_O': 92,
'CALL_NO_KW_STR_1': 93,
'CALL_NO_KW_TUPLE_1': 94,
'CALL_NO_KW_TYPE_1': 95,
'CALL_PY_EXACT_ARGS': 96,
'CALL_PY_WITH_DEFAULTS': 97,
'COMPARE_OP_FLOAT': 99,
'COMPARE_OP_INT': 100,
'COMPARE_OP_STR': 101,
'FOR_ITER_GEN': 116,
'FOR_ITER_LIST': 117,
'FOR_ITER_RANGE': 118,
'FOR_ITER_TUPLE': 119,
'LOAD_ATTR_CLASS': 131,
'LOAD_ATTR_GETATTRIBUTE_OVERRIDDEN': 132,
'LOAD_ATTR_INSTANCE_VALUE': 133,
'LOAD_ATTR_METHOD_LAZY_DICT': 134,
'LOAD_ATTR_METHOD_NO_DICT': 135,
'LOAD_ATTR_METHOD_WITH_VALUES': 136,
'LOAD_ATTR_MODULE': 137,
'LOAD_ATTR_NONDESCRIPTOR_NO_DICT': 138,
'LOAD_ATTR_NONDESCRIPTOR_WITH_VALUES': 139,
'LOAD_ATTR_PROPERTY': 140,
'LOAD_ATTR_SLOT': 141,
'LOAD_ATTR_WITH_HINT': 142,
'LOAD_GLOBAL_BUILTIN': 152,
'LOAD_GLOBAL_MODULE': 153,
'LOAD_SUPER_ATTR_ATTR': 156,
'LOAD_SUPER_ATTR_METHOD': 157,
'SEND_GEN': 170,
'STORE_ATTR_WITH_HINT': 175,
'UNPACK_SEQUENCE_LIST': 185,
'UNPACK_SEQUENCE_TUPLE': 186,
'UNPACK_SEQUENCE_TWO_TUPLE': 187,
}
opmap = {
@ -210,91 +214,91 @@ opmap = {
'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,
'RETURN_GENERATOR': 48,
'RETURN_VALUE': 49,
'SETUP_ANNOTATIONS': 50,
'STORE_SLICE': 53,
'STORE_SUBSCR': 54,
'TO_BOOL': 57,
'UNARY_INVERT': 64,
'UNARY_NEGATIVE': 65,
'UNARY_NOT': 66,
'WITH_EXCEPT_START': 67,
'BINARY_OP': 68,
'BUILD_CONST_KEY_MAP': 69,
'BUILD_LIST': 70,
'BUILD_MAP': 71,
'BUILD_SET': 72,
'BUILD_SLICE': 73,
'BUILD_STRING': 74,
'BUILD_TUPLE': 75,
'CALL': 76,
'CALL_FUNCTION_EX': 80,
'CALL_INTRINSIC_1': 81,
'CALL_INTRINSIC_2': 82,
'COMPARE_OP': 98,
'CONTAINS_OP': 102,
'CONVERT_VALUE': 103,
'COPY': 104,
'COPY_FREE_VARS': 105,
'DELETE_ATTR': 106,
'DELETE_DEREF': 107,
'DELETE_FAST': 108,
'DELETE_GLOBAL': 109,
'DELETE_NAME': 110,
'DICT_MERGE': 111,
'DICT_UPDATE': 112,
'ENTER_EXECUTOR': 113,
'EXTENDED_ARG': 114,
'FOR_ITER': 115,
'GET_AWAITABLE': 120,
'IMPORT_FROM': 121,
'IMPORT_NAME': 122,
'IS_OP': 123,
'JUMP_BACKWARD': 124,
'JUMP_BACKWARD_NO_INTERRUPT': 125,
'JUMP_FORWARD': 126,
'KW_NAMES': 127,
'LIST_APPEND': 128,
'LIST_EXTEND': 129,
'LOAD_ATTR': 130,
'LOAD_CONST': 143,
'LOAD_DEREF': 144,
'LOAD_FAST': 145,
'LOAD_FAST_AND_CLEAR': 146,
'LOAD_FAST_CHECK': 147,
'LOAD_FAST_LOAD_FAST': 148,
'LOAD_FROM_DICT_OR_DEREF': 149,
'LOAD_FROM_DICT_OR_GLOBALS': 150,
'LOAD_GLOBAL': 151,
'LOAD_NAME': 154,
'LOAD_SUPER_ATTR': 155,
'MAKE_CELL': 158,
'MAP_ADD': 159,
'MATCH_CLASS': 160,
'POP_JUMP_IF_FALSE': 161,
'POP_JUMP_IF_NONE': 162,
'POP_JUMP_IF_NOT_NONE': 163,
'POP_JUMP_IF_TRUE': 164,
'RAISE_VARARGS': 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,
'RERAISE': 167,
'RETURN_CONST': 168,
'SEND': 169,
'SET_ADD': 171,
'SET_FUNCTION_ATTRIBUTE': 172,
'SET_UPDATE': 173,
'STORE_ATTR': 174,
'STORE_DEREF': 176,
'STORE_FAST': 177,
'STORE_FAST_LOAD_FAST': 178,
'STORE_FAST_STORE_FAST': 179,
'STORE_GLOBAL': 180,
'STORE_NAME': 181,
'SWAP': 182,
'UNPACK_EX': 183,
'UNPACK_SEQUENCE': 184,
'YIELD_VALUE': 188,
'INSTRUMENTED_RESUME': 237,
'INSTRUMENTED_END_FOR': 238,
'INSTRUMENTED_END_SEND': 239,
@ -327,4 +331,4 @@ opmap = {
'STORE_FAST_MAYBE_NULL': 267,
}
MIN_INSTRUMENTED_OPCODE = 237
HAVE_ARGUMENT = 67
HAVE_ARGUMENT = 68

View File

@ -788,7 +788,7 @@ def load_test(x, y=0):
return a, b
dis_load_test_quickened_code = """\
%3d 0 RESUME 0
%3d 0 RESUME_CHECK 0
%3d 2 LOAD_FAST_LOAD_FAST 1 (x, y)
4 STORE_FAST_STORE_FAST 50 (b, a)
@ -805,7 +805,7 @@ def loop_test():
load_test(i)
dis_loop_test_quickened_code = """\
%3d RESUME 0
%3d RESUME_CHECK 0
%3d BUILD_LIST 0
LOAD_CONST 1 ((1, 2, 3))
@ -1197,7 +1197,7 @@ class DisTests(DisTestBase):
@requires_specialization
def test_binary_specialize(self):
binary_op_quicken = """\
0 0 RESUME 0
0 0 RESUME_CHECK 0
1 2 LOAD_NAME 0 (a)
4 LOAD_NAME 1 (b)
@ -1215,7 +1215,7 @@ class DisTests(DisTestBase):
self.do_disassembly_compare(got, binary_op_quicken % "BINARY_OP_ADD_UNICODE 0 (+)", True)
binary_subscr_quicken = """\
0 0 RESUME 0
0 0 RESUME_CHECK 0
1 2 LOAD_NAME 0 (a)
4 LOAD_CONST 0 (0)
@ -1236,7 +1236,7 @@ class DisTests(DisTestBase):
@requires_specialization
def test_load_attr_specialize(self):
load_attr_quicken = """\
0 0 RESUME 0
0 0 RESUME_CHECK 0
1 2 LOAD_CONST 0 ('a')
4 LOAD_ATTR_SLOT 0 (__class__)
@ -1251,7 +1251,7 @@ class DisTests(DisTestBase):
@requires_specialization
def test_call_specialize(self):
call_quicken = """\
0 RESUME 0
0 RESUME_CHECK 0
1 LOAD_NAME 0 (str)
PUSH_NULL
@ -1640,197 +1640,197 @@ def _prepare_test_cases():
Instruction = dis.Instruction
expected_opinfo_outer = [
Instruction(opname='MAKE_CELL', opcode=157, arg=0, argval='a', argrepr='a', offset=0, start_offset=0, starts_line=True, line_number=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=False, line_number=None, is_jump_target=False, positions=None),
Instruction(opname='MAKE_CELL', opcode=158, arg=0, argval='a', argrepr='a', offset=0, start_offset=0, starts_line=True, line_number=None, is_jump_target=False, positions=None),
Instruction(opname='MAKE_CELL', opcode=158, arg=1, argval='b', argrepr='b', offset=2, start_offset=2, starts_line=False, line_number=None, is_jump_target=False, positions=None),
Instruction(opname='RESUME', opcode=166, arg=0, argval=0, argrepr='', offset=4, start_offset=4, starts_line=True, line_number=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=True, line_number=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=False, line_number=2, 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=False, line_number=2, is_jump_target=False, positions=None),
Instruction(opname='BUILD_TUPLE', opcode=74, arg=2, argval=2, argrepr='', offset=12, start_offset=12, starts_line=False, line_number=2, 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=False, line_number=2, is_jump_target=False, positions=None),
Instruction(opname='LOAD_CONST', opcode=143, arg=5, argval=(3, 4), argrepr='(3, 4)', offset=6, start_offset=6, starts_line=True, line_number=2, is_jump_target=False, positions=None),
Instruction(opname='LOAD_FAST', opcode=145, arg=0, argval='a', argrepr='a', offset=8, start_offset=8, starts_line=False, line_number=2, is_jump_target=False, positions=None),
Instruction(opname='LOAD_FAST', opcode=145, arg=1, argval='b', argrepr='b', offset=10, start_offset=10, starts_line=False, line_number=2, is_jump_target=False, positions=None),
Instruction(opname='BUILD_TUPLE', opcode=75, arg=2, argval=2, argrepr='', offset=12, start_offset=12, starts_line=False, line_number=2, is_jump_target=False, positions=None),
Instruction(opname='LOAD_CONST', opcode=143, arg=1, argval=code_object_f, argrepr=repr(code_object_f), offset=14, start_offset=14, starts_line=False, line_number=2, is_jump_target=False, positions=None),
Instruction(opname='MAKE_FUNCTION', opcode=38, arg=None, argval=None, argrepr='', offset=16, start_offset=16, starts_line=False, line_number=2, 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=False, line_number=2, 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=False, line_number=2, 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=False, line_number=2, 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=True, line_number=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=False, line_number=7, 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=False, line_number=7, is_jump_target=False, positions=None),
Instruction(opname='LOAD_CONST', opcode=142, arg=2, argval='', argrepr="''", offset=38, start_offset=38, starts_line=False, line_number=7, 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=False, line_number=7, is_jump_target=False, positions=None),
Instruction(opname='BUILD_LIST', opcode=69, arg=0, argval=0, argrepr='', offset=42, start_offset=42, starts_line=False, line_number=7, is_jump_target=False, positions=None),
Instruction(opname='BUILD_MAP', opcode=70, arg=0, argval=0, argrepr='', offset=44, start_offset=44, starts_line=False, line_number=7, 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=False, line_number=7, is_jump_target=False, positions=None),
Instruction(opname='CALL', opcode=75, arg=7, argval=7, argrepr='', offset=48, start_offset=48, starts_line=False, line_number=7, is_jump_target=False, positions=None),
Instruction(opname='SET_FUNCTION_ATTRIBUTE', opcode=172, arg=8, argval=8, argrepr='closure', offset=18, start_offset=18, starts_line=False, line_number=2, is_jump_target=False, positions=None),
Instruction(opname='SET_FUNCTION_ATTRIBUTE', opcode=172, arg=1, argval=1, argrepr='defaults', offset=20, start_offset=20, starts_line=False, line_number=2, is_jump_target=False, positions=None),
Instruction(opname='STORE_FAST', opcode=177, arg=2, argval='f', argrepr='f', offset=22, start_offset=22, starts_line=False, line_number=2, is_jump_target=False, positions=None),
Instruction(opname='LOAD_GLOBAL', opcode=151, arg=1, argval='print', argrepr='print + NULL', offset=24, start_offset=24, starts_line=True, line_number=7, is_jump_target=False, positions=None),
Instruction(opname='LOAD_DEREF', opcode=144, arg=0, argval='a', argrepr='a', offset=34, start_offset=34, starts_line=False, line_number=7, is_jump_target=False, positions=None),
Instruction(opname='LOAD_DEREF', opcode=144, arg=1, argval='b', argrepr='b', offset=36, start_offset=36, starts_line=False, line_number=7, is_jump_target=False, positions=None),
Instruction(opname='LOAD_CONST', opcode=143, arg=2, argval='', argrepr="''", offset=38, start_offset=38, starts_line=False, line_number=7, is_jump_target=False, positions=None),
Instruction(opname='LOAD_CONST', opcode=143, arg=3, argval=1, argrepr='1', offset=40, start_offset=40, starts_line=False, line_number=7, is_jump_target=False, positions=None),
Instruction(opname='BUILD_LIST', opcode=70, arg=0, argval=0, argrepr='', offset=42, start_offset=42, starts_line=False, line_number=7, is_jump_target=False, positions=None),
Instruction(opname='BUILD_MAP', opcode=71, arg=0, argval=0, argrepr='', offset=44, start_offset=44, starts_line=False, line_number=7, is_jump_target=False, positions=None),
Instruction(opname='LOAD_CONST', opcode=143, arg=4, argval='Hello world!', argrepr="'Hello world!'", offset=46, start_offset=46, starts_line=False, line_number=7, is_jump_target=False, positions=None),
Instruction(opname='CALL', opcode=76, arg=7, argval=7, argrepr='', offset=48, start_offset=48, starts_line=False, line_number=7, is_jump_target=False, positions=None),
Instruction(opname='POP_TOP', opcode=44, arg=None, argval=None, argrepr='', offset=56, start_offset=56, starts_line=False, line_number=7, 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=True, line_number=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=False, line_number=8, is_jump_target=False, positions=None),
Instruction(opname='LOAD_FAST', opcode=145, arg=2, argval='f', argrepr='f', offset=58, start_offset=58, starts_line=True, line_number=8, is_jump_target=False, positions=None),
Instruction(opname='RETURN_VALUE', opcode=49, arg=None, argval=None, argrepr='', offset=60, start_offset=60, starts_line=False, line_number=8, is_jump_target=False, positions=None),
]
expected_opinfo_f = [
Instruction(opname='COPY_FREE_VARS', opcode=104, arg=2, argval=2, argrepr='', offset=0, start_offset=0, starts_line=True, line_number=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=False, line_number=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=False, line_number=None, is_jump_target=False, positions=None),
Instruction(opname='COPY_FREE_VARS', opcode=105, arg=2, argval=2, argrepr='', offset=0, start_offset=0, starts_line=True, line_number=None, is_jump_target=False, positions=None),
Instruction(opname='MAKE_CELL', opcode=158, arg=0, argval='c', argrepr='c', offset=2, start_offset=2, starts_line=False, line_number=None, is_jump_target=False, positions=None),
Instruction(opname='MAKE_CELL', opcode=158, arg=1, argval='d', argrepr='d', offset=4, start_offset=4, starts_line=False, line_number=None, is_jump_target=False, positions=None),
Instruction(opname='RESUME', opcode=166, arg=0, argval=0, argrepr='', offset=6, start_offset=6, starts_line=True, line_number=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=True, line_number=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=False, line_number=3, 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=False, line_number=3, 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=False, line_number=3, 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=False, line_number=3, is_jump_target=False, positions=None),
Instruction(opname='BUILD_TUPLE', opcode=74, arg=4, argval=4, argrepr='', offset=18, start_offset=18, starts_line=False, line_number=3, 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=False, line_number=3, is_jump_target=False, positions=None),
Instruction(opname='LOAD_CONST', opcode=143, arg=2, argval=(5, 6), argrepr='(5, 6)', offset=8, start_offset=8, starts_line=True, line_number=3, is_jump_target=False, positions=None),
Instruction(opname='LOAD_FAST', opcode=145, arg=3, argval='a', argrepr='a', offset=10, start_offset=10, starts_line=False, line_number=3, is_jump_target=False, positions=None),
Instruction(opname='LOAD_FAST', opcode=145, arg=4, argval='b', argrepr='b', offset=12, start_offset=12, starts_line=False, line_number=3, is_jump_target=False, positions=None),
Instruction(opname='LOAD_FAST', opcode=145, arg=0, argval='c', argrepr='c', offset=14, start_offset=14, starts_line=False, line_number=3, is_jump_target=False, positions=None),
Instruction(opname='LOAD_FAST', opcode=145, arg=1, argval='d', argrepr='d', offset=16, start_offset=16, starts_line=False, line_number=3, is_jump_target=False, positions=None),
Instruction(opname='BUILD_TUPLE', opcode=75, arg=4, argval=4, argrepr='', offset=18, start_offset=18, starts_line=False, line_number=3, is_jump_target=False, positions=None),
Instruction(opname='LOAD_CONST', opcode=143, arg=1, argval=code_object_inner, argrepr=repr(code_object_inner), offset=20, start_offset=20, starts_line=False, line_number=3, is_jump_target=False, positions=None),
Instruction(opname='MAKE_FUNCTION', opcode=38, arg=None, argval=None, argrepr='', offset=22, start_offset=22, starts_line=False, line_number=3, 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=False, line_number=3, 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=False, line_number=3, 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=False, line_number=3, 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=True, line_number=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=False, line_number=5, 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=False, line_number=5, 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=False, line_number=5, 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=False, line_number=5, is_jump_target=False, positions=None),
Instruction(opname='CALL', opcode=75, arg=4, argval=4, argrepr='', offset=48, start_offset=48, starts_line=False, line_number=5, is_jump_target=False, positions=None),
Instruction(opname='SET_FUNCTION_ATTRIBUTE', opcode=172, arg=8, argval=8, argrepr='closure', offset=24, start_offset=24, starts_line=False, line_number=3, is_jump_target=False, positions=None),
Instruction(opname='SET_FUNCTION_ATTRIBUTE', opcode=172, arg=1, argval=1, argrepr='defaults', offset=26, start_offset=26, starts_line=False, line_number=3, is_jump_target=False, positions=None),
Instruction(opname='STORE_FAST', opcode=177, arg=2, argval='inner', argrepr='inner', offset=28, start_offset=28, starts_line=False, line_number=3, is_jump_target=False, positions=None),
Instruction(opname='LOAD_GLOBAL', opcode=151, arg=1, argval='print', argrepr='print + NULL', offset=30, start_offset=30, starts_line=True, line_number=5, is_jump_target=False, positions=None),
Instruction(opname='LOAD_DEREF', opcode=144, arg=3, argval='a', argrepr='a', offset=40, start_offset=40, starts_line=False, line_number=5, is_jump_target=False, positions=None),
Instruction(opname='LOAD_DEREF', opcode=144, arg=4, argval='b', argrepr='b', offset=42, start_offset=42, starts_line=False, line_number=5, is_jump_target=False, positions=None),
Instruction(opname='LOAD_DEREF', opcode=144, arg=0, argval='c', argrepr='c', offset=44, start_offset=44, starts_line=False, line_number=5, is_jump_target=False, positions=None),
Instruction(opname='LOAD_DEREF', opcode=144, arg=1, argval='d', argrepr='d', offset=46, start_offset=46, starts_line=False, line_number=5, is_jump_target=False, positions=None),
Instruction(opname='CALL', opcode=76, arg=4, argval=4, argrepr='', offset=48, start_offset=48, starts_line=False, line_number=5, is_jump_target=False, positions=None),
Instruction(opname='POP_TOP', opcode=44, arg=None, argval=None, argrepr='', offset=56, start_offset=56, starts_line=False, line_number=5, 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=True, line_number=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=False, line_number=6, is_jump_target=False, positions=None),
Instruction(opname='LOAD_FAST', opcode=145, arg=2, argval='inner', argrepr='inner', offset=58, start_offset=58, starts_line=True, line_number=6, is_jump_target=False, positions=None),
Instruction(opname='RETURN_VALUE', opcode=49, arg=None, argval=None, argrepr='', offset=60, start_offset=60, starts_line=False, line_number=6, is_jump_target=False, positions=None),
]
expected_opinfo_inner = [
Instruction(opname='COPY_FREE_VARS', opcode=104, arg=4, argval=4, argrepr='', offset=0, start_offset=0, starts_line=True, line_number=None, is_jump_target=False, positions=None),
Instruction(opname='COPY_FREE_VARS', opcode=105, arg=4, argval=4, argrepr='', offset=0, start_offset=0, starts_line=True, line_number=None, is_jump_target=False, positions=None),
Instruction(opname='RESUME', opcode=166, arg=0, argval=0, argrepr='', offset=2, start_offset=2, starts_line=True, line_number=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=True, line_number=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=False, line_number=4, 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=False, line_number=4, 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=False, line_number=4, 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=False, line_number=4, 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=False, line_number=4, is_jump_target=False, positions=None),
Instruction(opname='CALL', opcode=75, arg=6, argval=6, argrepr='', offset=24, start_offset=24, starts_line=False, line_number=4, is_jump_target=False, positions=None),
Instruction(opname='LOAD_GLOBAL', opcode=151, arg=1, argval='print', argrepr='print + NULL', offset=4, start_offset=4, starts_line=True, line_number=4, is_jump_target=False, positions=None),
Instruction(opname='LOAD_DEREF', opcode=144, arg=2, argval='a', argrepr='a', offset=14, start_offset=14, starts_line=False, line_number=4, is_jump_target=False, positions=None),
Instruction(opname='LOAD_DEREF', opcode=144, arg=3, argval='b', argrepr='b', offset=16, start_offset=16, starts_line=False, line_number=4, is_jump_target=False, positions=None),
Instruction(opname='LOAD_DEREF', opcode=144, arg=4, argval='c', argrepr='c', offset=18, start_offset=18, starts_line=False, line_number=4, is_jump_target=False, positions=None),
Instruction(opname='LOAD_DEREF', opcode=144, arg=5, argval='d', argrepr='d', offset=20, start_offset=20, starts_line=False, line_number=4, is_jump_target=False, positions=None),
Instruction(opname='LOAD_FAST_LOAD_FAST', opcode=148, arg=1, argval=('e', 'f'), argrepr='e, f', offset=22, start_offset=22, starts_line=False, line_number=4, is_jump_target=False, positions=None),
Instruction(opname='CALL', opcode=76, arg=6, argval=6, argrepr='', offset=24, start_offset=24, starts_line=False, line_number=4, is_jump_target=False, positions=None),
Instruction(opname='POP_TOP', opcode=44, arg=None, argval=None, argrepr='', offset=32, start_offset=32, starts_line=False, line_number=4, 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=False, line_number=4, is_jump_target=False, positions=None),
Instruction(opname='RETURN_CONST', opcode=168, arg=0, argval=None, argrepr='None', offset=34, start_offset=34, starts_line=False, line_number=4, is_jump_target=False, positions=None),
]
expected_opinfo_jumpy = [
Instruction(opname='RESUME', opcode=166, arg=0, argval=0, argrepr='', offset=0, start_offset=0, starts_line=True, line_number=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=True, line_number=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=False, line_number=3, is_jump_target=False, positions=None),
Instruction(opname='CALL', opcode=75, arg=1, argval=1, argrepr='', offset=14, start_offset=14, starts_line=False, line_number=3, is_jump_target=False, positions=None),
Instruction(opname='LOAD_GLOBAL', opcode=151, arg=1, argval='range', argrepr='range + NULL', offset=2, start_offset=2, starts_line=True, line_number=3, is_jump_target=False, positions=None),
Instruction(opname='LOAD_CONST', opcode=143, arg=1, argval=10, argrepr='10', offset=12, start_offset=12, starts_line=False, line_number=3, is_jump_target=False, positions=None),
Instruction(opname='CALL', opcode=76, arg=1, argval=1, argrepr='', offset=14, start_offset=14, starts_line=False, line_number=3, is_jump_target=False, positions=None),
Instruction(opname='GET_ITER', opcode=31, arg=None, argval=None, argrepr='', offset=22, start_offset=22, starts_line=False, line_number=3, 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=False, line_number=3, 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=False, line_number=3, 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=True, line_number=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=False, line_number=4, is_jump_target=False, positions=None),
Instruction(opname='CALL', opcode=75, arg=1, argval=1, argrepr='', offset=42, start_offset=42, starts_line=False, line_number=4, is_jump_target=False, positions=None),
Instruction(opname='FOR_ITER', opcode=115, arg=28, argval=84, argrepr='to 84', offset=24, start_offset=24, starts_line=False, line_number=3, is_jump_target=True, positions=None),
Instruction(opname='STORE_FAST', opcode=177, arg=0, argval='i', argrepr='i', offset=28, start_offset=28, starts_line=False, line_number=3, is_jump_target=False, positions=None),
Instruction(opname='LOAD_GLOBAL', opcode=151, arg=3, argval='print', argrepr='print + NULL', offset=30, start_offset=30, starts_line=True, line_number=4, is_jump_target=False, positions=None),
Instruction(opname='LOAD_FAST', opcode=145, arg=0, argval='i', argrepr='i', offset=40, start_offset=40, starts_line=False, line_number=4, is_jump_target=False, positions=None),
Instruction(opname='CALL', opcode=76, arg=1, argval=1, argrepr='', offset=42, start_offset=42, starts_line=False, line_number=4, is_jump_target=False, positions=None),
Instruction(opname='POP_TOP', opcode=44, arg=None, argval=None, argrepr='', offset=50, start_offset=50, starts_line=False, line_number=4, 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=True, line_number=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=False, line_number=5, is_jump_target=False, positions=None),
Instruction(opname='COMPARE_OP', opcode=97, arg=18, argval='<', argrepr='bool(<)', offset=56, start_offset=56, starts_line=False, line_number=5, 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=False, line_number=5, 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=True, line_number=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=True, line_number=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=False, line_number=7, is_jump_target=False, positions=None),
Instruction(opname='COMPARE_OP', opcode=97, arg=148, argval='>', argrepr='bool(>)', offset=70, start_offset=70, starts_line=False, line_number=7, 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=False, line_number=7, 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=False, line_number=7, is_jump_target=False, positions=None),
Instruction(opname='LOAD_FAST', opcode=145, arg=0, argval='i', argrepr='i', offset=52, start_offset=52, starts_line=True, line_number=5, is_jump_target=False, positions=None),
Instruction(opname='LOAD_CONST', opcode=143, arg=2, argval=4, argrepr='4', offset=54, start_offset=54, starts_line=False, line_number=5, is_jump_target=False, positions=None),
Instruction(opname='COMPARE_OP', opcode=98, arg=18, argval='<', argrepr='bool(<)', offset=56, start_offset=56, starts_line=False, line_number=5, is_jump_target=False, positions=None),
Instruction(opname='POP_JUMP_IF_FALSE', opcode=161, arg=2, argval=66, argrepr='to 66', offset=60, start_offset=60, starts_line=False, line_number=5, is_jump_target=False, positions=None),
Instruction(opname='JUMP_BACKWARD', opcode=124, arg=21, argval=24, argrepr='to 24', offset=62, start_offset=62, starts_line=True, line_number=6, is_jump_target=False, positions=None),
Instruction(opname='LOAD_FAST', opcode=145, arg=0, argval='i', argrepr='i', offset=66, start_offset=66, starts_line=True, line_number=7, is_jump_target=True, positions=None),
Instruction(opname='LOAD_CONST', opcode=143, arg=3, argval=6, argrepr='6', offset=68, start_offset=68, starts_line=False, line_number=7, is_jump_target=False, positions=None),
Instruction(opname='COMPARE_OP', opcode=98, arg=148, argval='>', argrepr='bool(>)', offset=70, start_offset=70, starts_line=False, line_number=7, is_jump_target=False, positions=None),
Instruction(opname='POP_JUMP_IF_TRUE', opcode=164, arg=2, argval=80, argrepr='to 80', offset=74, start_offset=74, starts_line=False, line_number=7, is_jump_target=False, positions=None),
Instruction(opname='JUMP_BACKWARD', opcode=124, arg=28, argval=24, argrepr='to 24', offset=76, start_offset=76, starts_line=False, line_number=7, is_jump_target=False, positions=None),
Instruction(opname='POP_TOP', opcode=44, arg=None, argval=None, argrepr='', offset=80, start_offset=80, starts_line=True, line_number=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=False, line_number=8, is_jump_target=False, positions=None),
Instruction(opname='JUMP_FORWARD', opcode=126, arg=12, argval=108, argrepr='to 108', offset=82, start_offset=82, starts_line=False, line_number=8, is_jump_target=False, positions=None),
Instruction(opname='END_FOR', opcode=24, arg=None, argval=None, argrepr='', offset=84, start_offset=84, starts_line=True, line_number=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=True, line_number=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=False, line_number=10, is_jump_target=False, positions=None),
Instruction(opname='CALL', opcode=75, arg=1, argval=1, argrepr='', offset=98, start_offset=98, starts_line=False, line_number=10, is_jump_target=False, positions=None),
Instruction(opname='LOAD_GLOBAL', opcode=151, arg=3, argval='print', argrepr='print + NULL', offset=86, start_offset=86, starts_line=True, line_number=10, is_jump_target=False, positions=None),
Instruction(opname='LOAD_CONST', opcode=143, arg=4, argval='I can haz else clause?', argrepr="'I can haz else clause?'", offset=96, start_offset=96, starts_line=False, line_number=10, is_jump_target=False, positions=None),
Instruction(opname='CALL', opcode=76, arg=1, argval=1, argrepr='', offset=98, start_offset=98, starts_line=False, line_number=10, is_jump_target=False, positions=None),
Instruction(opname='POP_TOP', opcode=44, arg=None, argval=None, argrepr='', offset=106, start_offset=106, starts_line=False, line_number=10, 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=True, line_number=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=False, line_number=11, 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=False, line_number=11, 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=True, line_number=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=False, line_number=12, is_jump_target=False, positions=None),
Instruction(opname='CALL', opcode=75, arg=1, argval=1, argrepr='', offset=132, start_offset=132, starts_line=False, line_number=12, is_jump_target=False, positions=None),
Instruction(opname='LOAD_FAST_CHECK', opcode=147, arg=0, argval='i', argrepr='i', offset=108, start_offset=108, starts_line=True, line_number=11, is_jump_target=True, positions=None),
Instruction(opname='TO_BOOL', opcode=57, arg=None, argval=None, argrepr='', offset=110, start_offset=110, starts_line=False, line_number=11, is_jump_target=False, positions=None),
Instruction(opname='POP_JUMP_IF_FALSE', opcode=161, arg=37, argval=194, argrepr='to 194', offset=118, start_offset=118, starts_line=False, line_number=11, is_jump_target=False, positions=None),
Instruction(opname='LOAD_GLOBAL', opcode=151, arg=3, argval='print', argrepr='print + NULL', offset=120, start_offset=120, starts_line=True, line_number=12, is_jump_target=True, positions=None),
Instruction(opname='LOAD_FAST', opcode=145, arg=0, argval='i', argrepr='i', offset=130, start_offset=130, starts_line=False, line_number=12, is_jump_target=False, positions=None),
Instruction(opname='CALL', opcode=76, arg=1, argval=1, argrepr='', offset=132, start_offset=132, starts_line=False, line_number=12, is_jump_target=False, positions=None),
Instruction(opname='POP_TOP', opcode=44, arg=None, argval=None, argrepr='', offset=140, start_offset=140, starts_line=False, line_number=12, 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=True, line_number=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=False, line_number=13, is_jump_target=False, positions=None),
Instruction(opname='BINARY_OP', opcode=67, arg=23, argval=23, argrepr='-=', offset=146, start_offset=146, starts_line=False, line_number=13, 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=False, line_number=13, 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=True, line_number=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=False, line_number=14, is_jump_target=False, positions=None),
Instruction(opname='COMPARE_OP', opcode=97, arg=148, argval='>', argrepr='bool(>)', offset=156, start_offset=156, starts_line=False, line_number=14, 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=False, line_number=14, 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=True, line_number=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=True, line_number=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=False, line_number=16, is_jump_target=False, positions=None),
Instruction(opname='COMPARE_OP', opcode=97, arg=18, argval='<', argrepr='bool(<)', offset=170, start_offset=170, starts_line=False, line_number=16, 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=False, line_number=16, 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=True, line_number=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=True, line_number=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=False, line_number=11, 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=False, line_number=11, 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=False, line_number=11, 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=True, line_number=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=False, line_number=19, is_jump_target=False, positions=None),
Instruction(opname='CALL', opcode=75, arg=1, argval=1, argrepr='', offset=206, start_offset=206, starts_line=False, line_number=19, is_jump_target=False, positions=None),
Instruction(opname='LOAD_FAST', opcode=145, arg=0, argval='i', argrepr='i', offset=142, start_offset=142, starts_line=True, line_number=13, is_jump_target=False, positions=None),
Instruction(opname='LOAD_CONST', opcode=143, arg=5, argval=1, argrepr='1', offset=144, start_offset=144, starts_line=False, line_number=13, is_jump_target=False, positions=None),
Instruction(opname='BINARY_OP', opcode=68, arg=23, argval=23, argrepr='-=', offset=146, start_offset=146, starts_line=False, line_number=13, is_jump_target=False, positions=None),
Instruction(opname='STORE_FAST', opcode=177, arg=0, argval='i', argrepr='i', offset=150, start_offset=150, starts_line=False, line_number=13, is_jump_target=False, positions=None),
Instruction(opname='LOAD_FAST', opcode=145, arg=0, argval='i', argrepr='i', offset=152, start_offset=152, starts_line=True, line_number=14, is_jump_target=False, positions=None),
Instruction(opname='LOAD_CONST', opcode=143, arg=3, argval=6, argrepr='6', offset=154, start_offset=154, starts_line=False, line_number=14, is_jump_target=False, positions=None),
Instruction(opname='COMPARE_OP', opcode=98, arg=148, argval='>', argrepr='bool(>)', offset=156, start_offset=156, starts_line=False, line_number=14, is_jump_target=False, positions=None),
Instruction(opname='POP_JUMP_IF_FALSE', opcode=161, arg=2, argval=166, argrepr='to 166', offset=160, start_offset=160, starts_line=False, line_number=14, is_jump_target=False, positions=None),
Instruction(opname='JUMP_BACKWARD', opcode=124, arg=29, argval=108, argrepr='to 108', offset=162, start_offset=162, starts_line=True, line_number=15, is_jump_target=False, positions=None),
Instruction(opname='LOAD_FAST', opcode=145, arg=0, argval='i', argrepr='i', offset=166, start_offset=166, starts_line=True, line_number=16, is_jump_target=True, positions=None),
Instruction(opname='LOAD_CONST', opcode=143, arg=2, argval=4, argrepr='4', offset=168, start_offset=168, starts_line=False, line_number=16, is_jump_target=False, positions=None),
Instruction(opname='COMPARE_OP', opcode=98, arg=18, argval='<', argrepr='bool(<)', offset=170, start_offset=170, starts_line=False, line_number=16, is_jump_target=False, positions=None),
Instruction(opname='POP_JUMP_IF_FALSE', opcode=161, arg=1, argval=178, argrepr='to 178', offset=174, start_offset=174, starts_line=False, line_number=16, is_jump_target=False, positions=None),
Instruction(opname='JUMP_FORWARD', opcode=126, arg=19, argval=216, argrepr='to 216', offset=176, start_offset=176, starts_line=True, line_number=17, is_jump_target=False, positions=None),
Instruction(opname='LOAD_FAST', opcode=145, arg=0, argval='i', argrepr='i', offset=178, start_offset=178, starts_line=True, line_number=11, is_jump_target=True, positions=None),
Instruction(opname='TO_BOOL', opcode=57, arg=None, argval=None, argrepr='', offset=180, start_offset=180, starts_line=False, line_number=11, is_jump_target=False, positions=None),
Instruction(opname='POP_JUMP_IF_FALSE', opcode=161, arg=2, argval=194, argrepr='to 194', offset=188, start_offset=188, starts_line=False, line_number=11, is_jump_target=False, positions=None),
Instruction(opname='JUMP_BACKWARD', opcode=124, arg=37, argval=120, argrepr='to 120', offset=190, start_offset=190, starts_line=False, line_number=11, is_jump_target=False, positions=None),
Instruction(opname='LOAD_GLOBAL', opcode=151, arg=3, argval='print', argrepr='print + NULL', offset=194, start_offset=194, starts_line=True, line_number=19, is_jump_target=True, positions=None),
Instruction(opname='LOAD_CONST', opcode=143, 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=False, line_number=19, is_jump_target=False, positions=None),
Instruction(opname='CALL', opcode=76, arg=1, argval=1, argrepr='', offset=206, start_offset=206, starts_line=False, line_number=19, is_jump_target=False, positions=None),
Instruction(opname='POP_TOP', opcode=44, arg=None, argval=None, argrepr='', offset=214, start_offset=214, starts_line=False, line_number=19, is_jump_target=False, positions=None),
Instruction(opname='NOP', opcode=42, arg=None, argval=None, argrepr='', offset=216, start_offset=216, starts_line=True, line_number=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=True, line_number=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=False, line_number=21, is_jump_target=False, positions=None),
Instruction(opname='BINARY_OP', opcode=67, arg=11, argval=11, argrepr='/', offset=222, start_offset=222, starts_line=False, line_number=21, is_jump_target=False, positions=None),
Instruction(opname='LOAD_CONST', opcode=143, arg=5, argval=1, argrepr='1', offset=218, start_offset=218, starts_line=True, line_number=21, is_jump_target=False, positions=None),
Instruction(opname='LOAD_CONST', opcode=143, arg=7, argval=0, argrepr='0', offset=220, start_offset=220, starts_line=False, line_number=21, is_jump_target=False, positions=None),
Instruction(opname='BINARY_OP', opcode=68, arg=11, argval=11, argrepr='/', offset=222, start_offset=222, starts_line=False, line_number=21, is_jump_target=False, positions=None),
Instruction(opname='POP_TOP', opcode=44, arg=None, argval=None, argrepr='', offset=226, start_offset=226, starts_line=False, line_number=21, 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=True, line_number=25, is_jump_target=False, positions=None),
Instruction(opname='LOAD_FAST', opcode=145, arg=0, argval='i', argrepr='i', offset=228, start_offset=228, starts_line=True, line_number=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=False, line_number=25, 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=False, line_number=25, 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=True, line_number=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=False, line_number=26, is_jump_target=False, positions=None),
Instruction(opname='CALL', opcode=75, arg=1, argval=1, argrepr='', offset=246, start_offset=246, starts_line=False, line_number=26, is_jump_target=False, positions=None),
Instruction(opname='STORE_FAST', opcode=177, arg=1, argval='dodgy', argrepr='dodgy', offset=232, start_offset=232, starts_line=False, line_number=25, is_jump_target=False, positions=None),
Instruction(opname='LOAD_GLOBAL', opcode=151, arg=3, argval='print', argrepr='print + NULL', offset=234, start_offset=234, starts_line=True, line_number=26, is_jump_target=False, positions=None),
Instruction(opname='LOAD_CONST', opcode=143, arg=8, argval='Never reach this', argrepr="'Never reach this'", offset=244, start_offset=244, starts_line=False, line_number=26, is_jump_target=False, positions=None),
Instruction(opname='CALL', opcode=76, arg=1, argval=1, argrepr='', offset=246, start_offset=246, starts_line=False, line_number=26, is_jump_target=False, positions=None),
Instruction(opname='POP_TOP', opcode=44, arg=None, argval=None, argrepr='', offset=254, start_offset=254, starts_line=False, line_number=26, 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=True, line_number=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=False, line_number=25, 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=False, line_number=25, is_jump_target=False, positions=None),
Instruction(opname='CALL', opcode=75, arg=2, argval=2, argrepr='', offset=262, start_offset=262, starts_line=False, line_number=25, is_jump_target=False, positions=None),
Instruction(opname='LOAD_CONST', opcode=143, arg=0, argval=None, argrepr='None', offset=256, start_offset=256, starts_line=True, line_number=25, is_jump_target=False, positions=None),
Instruction(opname='LOAD_CONST', opcode=143, arg=0, argval=None, argrepr='None', offset=258, start_offset=258, starts_line=False, line_number=25, is_jump_target=False, positions=None),
Instruction(opname='LOAD_CONST', opcode=143, arg=0, argval=None, argrepr='None', offset=260, start_offset=260, starts_line=False, line_number=25, is_jump_target=False, positions=None),
Instruction(opname='CALL', opcode=76, arg=2, argval=2, argrepr='', offset=262, start_offset=262, starts_line=False, line_number=25, is_jump_target=False, positions=None),
Instruction(opname='POP_TOP', opcode=44, arg=None, argval=None, argrepr='', offset=270, start_offset=270, starts_line=False, line_number=25, 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=True, line_number=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=False, line_number=28, is_jump_target=False, positions=None),
Instruction(opname='CALL', opcode=75, arg=1, argval=1, argrepr='', offset=284, start_offset=284, starts_line=False, line_number=28, is_jump_target=False, positions=None),
Instruction(opname='LOAD_GLOBAL', opcode=151, arg=3, argval='print', argrepr='print + NULL', offset=272, start_offset=272, starts_line=True, line_number=28, is_jump_target=True, positions=None),
Instruction(opname='LOAD_CONST', opcode=143, arg=10, argval="OK, now we're done", argrepr='"OK, now we\'re done"', offset=282, start_offset=282, starts_line=False, line_number=28, is_jump_target=False, positions=None),
Instruction(opname='CALL', opcode=76, arg=1, argval=1, argrepr='', offset=284, start_offset=284, starts_line=False, line_number=28, is_jump_target=False, positions=None),
Instruction(opname='POP_TOP', opcode=44, arg=None, argval=None, argrepr='', offset=292, start_offset=292, starts_line=False, line_number=28, 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=False, line_number=28, is_jump_target=False, positions=None),
Instruction(opname='RETURN_CONST', opcode=168, arg=0, argval=None, argrepr='None', offset=294, start_offset=294, starts_line=False, line_number=28, 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=True, line_number=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=False, line_number=25, is_jump_target=False, positions=None),
Instruction(opname='TO_BOOL', opcode=56, arg=None, argval=None, argrepr='', offset=300, start_offset=300, starts_line=False, line_number=25, 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=False, line_number=25, is_jump_target=False, positions=None),
Instruction(opname='RERAISE', opcode=165, arg=2, argval=2, argrepr='', offset=310, start_offset=310, starts_line=False, line_number=25, is_jump_target=False, positions=None),
Instruction(opname='WITH_EXCEPT_START', opcode=67, arg=None, argval=None, argrepr='', offset=298, start_offset=298, starts_line=False, line_number=25, is_jump_target=False, positions=None),
Instruction(opname='TO_BOOL', opcode=57, arg=None, argval=None, argrepr='', offset=300, start_offset=300, starts_line=False, line_number=25, is_jump_target=False, positions=None),
Instruction(opname='POP_JUMP_IF_TRUE', opcode=164, arg=1, argval=312, argrepr='to 312', offset=308, start_offset=308, starts_line=False, line_number=25, is_jump_target=False, positions=None),
Instruction(opname='RERAISE', opcode=167, arg=2, argval=2, argrepr='', offset=310, start_offset=310, starts_line=False, line_number=25, is_jump_target=False, positions=None),
Instruction(opname='POP_TOP', opcode=44, arg=None, argval=None, argrepr='', offset=312, start_offset=312, starts_line=False, line_number=25, is_jump_target=True, positions=None),
Instruction(opname='POP_EXCEPT', opcode=43, arg=None, argval=None, argrepr='', offset=314, start_offset=314, starts_line=False, line_number=25, is_jump_target=False, positions=None),
Instruction(opname='POP_TOP', opcode=44, arg=None, argval=None, argrepr='', offset=316, start_offset=316, starts_line=False, line_number=25, is_jump_target=False, positions=None),
Instruction(opname='POP_TOP', opcode=44, arg=None, argval=None, argrepr='', offset=318, start_offset=318, starts_line=False, line_number=25, 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=False, line_number=25, is_jump_target=False, positions=None),
Instruction(opname='COPY', opcode=103, arg=3, argval=3, argrepr='', offset=324, start_offset=324, starts_line=True, line_number=None, is_jump_target=False, positions=None),
Instruction(opname='JUMP_BACKWARD', opcode=124, arg=26, argval=272, argrepr='to 272', offset=320, start_offset=320, starts_line=False, line_number=25, is_jump_target=False, positions=None),
Instruction(opname='COPY', opcode=104, arg=3, argval=3, argrepr='', offset=324, start_offset=324, starts_line=True, line_number=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=False, line_number=None, is_jump_target=False, positions=None),
Instruction(opname='RERAISE', opcode=165, arg=1, argval=1, argrepr='', offset=328, start_offset=328, starts_line=False, line_number=None, is_jump_target=False, positions=None),
Instruction(opname='RERAISE', opcode=167, arg=1, argval=1, argrepr='', offset=328, start_offset=328, starts_line=False, line_number=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=False, line_number=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=True, line_number=22, is_jump_target=False, positions=None),
Instruction(opname='LOAD_GLOBAL', opcode=151, arg=4, argval='ZeroDivisionError', argrepr='ZeroDivisionError', offset=332, start_offset=332, starts_line=True, line_number=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=False, line_number=22, 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=False, line_number=22, is_jump_target=False, positions=None),
Instruction(opname='POP_JUMP_IF_FALSE', opcode=161, arg=15, argval=376, argrepr='to 376', offset=344, start_offset=344, starts_line=False, line_number=22, is_jump_target=False, positions=None),
Instruction(opname='POP_TOP', opcode=44, arg=None, argval=None, argrepr='', offset=346, start_offset=346, starts_line=False, line_number=22, 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=True, line_number=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=False, line_number=23, is_jump_target=False, positions=None),
Instruction(opname='CALL', opcode=75, arg=1, argval=1, argrepr='', offset=360, start_offset=360, starts_line=False, line_number=23, is_jump_target=False, positions=None),
Instruction(opname='LOAD_GLOBAL', opcode=151, arg=3, argval='print', argrepr='print + NULL', offset=348, start_offset=348, starts_line=True, line_number=23, is_jump_target=False, positions=None),
Instruction(opname='LOAD_CONST', opcode=143, 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=False, line_number=23, is_jump_target=False, positions=None),
Instruction(opname='CALL', opcode=76, arg=1, argval=1, argrepr='', offset=360, start_offset=360, starts_line=False, line_number=23, is_jump_target=False, positions=None),
Instruction(opname='POP_TOP', opcode=44, arg=None, argval=None, argrepr='', offset=368, start_offset=368, starts_line=False, line_number=23, is_jump_target=False, positions=None),
Instruction(opname='POP_EXCEPT', opcode=43, arg=None, argval=None, argrepr='', offset=370, start_offset=370, starts_line=False, line_number=23, 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=False, line_number=23, is_jump_target=False, positions=None),
Instruction(opname='RERAISE', opcode=165, arg=0, argval=0, argrepr='', offset=376, start_offset=376, starts_line=True, line_number=22, is_jump_target=True, positions=None),
Instruction(opname='COPY', opcode=103, arg=3, argval=3, argrepr='', offset=378, start_offset=378, starts_line=True, line_number=None, is_jump_target=False, positions=None),
Instruction(opname='JUMP_BACKWARD', opcode=124, arg=52, argval=272, argrepr='to 272', offset=372, start_offset=372, starts_line=False, line_number=23, is_jump_target=False, positions=None),
Instruction(opname='RERAISE', opcode=167, arg=0, argval=0, argrepr='', offset=376, start_offset=376, starts_line=True, line_number=22, is_jump_target=True, positions=None),
Instruction(opname='COPY', opcode=104, arg=3, argval=3, argrepr='', offset=378, start_offset=378, starts_line=True, line_number=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=False, line_number=None, is_jump_target=False, positions=None),
Instruction(opname='RERAISE', opcode=165, arg=1, argval=1, argrepr='', offset=382, start_offset=382, starts_line=False, line_number=None, is_jump_target=False, positions=None),
Instruction(opname='RERAISE', opcode=167, arg=1, argval=1, argrepr='', offset=382, start_offset=382, starts_line=False, line_number=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=False, line_number=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=True, line_number=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=False, line_number=28, is_jump_target=False, positions=None),
Instruction(opname='CALL', opcode=75, arg=1, argval=1, argrepr='', offset=398, start_offset=398, starts_line=False, line_number=28, is_jump_target=False, positions=None),
Instruction(opname='LOAD_GLOBAL', opcode=151, arg=3, argval='print', argrepr='print + NULL', offset=386, start_offset=386, starts_line=True, line_number=28, is_jump_target=False, positions=None),
Instruction(opname='LOAD_CONST', opcode=143, arg=10, argval="OK, now we're done", argrepr='"OK, now we\'re done"', offset=396, start_offset=396, starts_line=False, line_number=28, is_jump_target=False, positions=None),
Instruction(opname='CALL', opcode=76, arg=1, argval=1, argrepr='', offset=398, start_offset=398, starts_line=False, line_number=28, is_jump_target=False, positions=None),
Instruction(opname='POP_TOP', opcode=44, arg=None, argval=None, argrepr='', offset=406, start_offset=406, starts_line=False, line_number=28, is_jump_target=False, positions=None),
Instruction(opname='RERAISE', opcode=165, arg=0, argval=0, argrepr='', offset=408, start_offset=408, starts_line=False, line_number=28, is_jump_target=False, positions=None),
Instruction(opname='COPY', opcode=103, arg=3, argval=3, argrepr='', offset=410, start_offset=410, starts_line=False, line_number=28, is_jump_target=False, positions=None),
Instruction(opname='RERAISE', opcode=167, arg=0, argval=0, argrepr='', offset=408, start_offset=408, starts_line=False, line_number=28, is_jump_target=False, positions=None),
Instruction(opname='COPY', opcode=104, arg=3, argval=3, argrepr='', offset=410, start_offset=410, starts_line=False, line_number=28, is_jump_target=False, positions=None),
Instruction(opname='POP_EXCEPT', opcode=43, arg=None, argval=None, argrepr='', offset=412, start_offset=412, starts_line=False, line_number=28, is_jump_target=False, positions=None),
Instruction(opname='RERAISE', opcode=165, arg=1, argval=1, argrepr='', offset=414, start_offset=414, starts_line=False, line_number=28, is_jump_target=False, positions=None),
Instruction(opname='RERAISE', opcode=167, arg=1, argval=1, argrepr='', offset=414, start_offset=414, starts_line=False, line_number=28, 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=166, arg=0, argval=0, argrepr='', offset=0, start_offset=0, starts_line=True, line_number=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=False, line_number=simple.__code__.co_firstlineno, is_jump_target=False),
Instruction(opname='RETURN_CONST', opcode=168, arg=0, argval=None, argrepr='None', offset=2, start_offset=2, starts_line=False, line_number=simple.__code__.co_firstlineno, is_jump_target=False),
]

View File

@ -0,0 +1,2 @@
Add RESUME_CHECK instruction, to avoid having to handle instrumentation,
signals, and contexts switches in the tier 2 execution engine.

View File

@ -333,7 +333,11 @@ gen_close_iter(PyObject *yf)
static inline bool
is_resume(_Py_CODEUNIT *instr)
{
return instr->op.code == RESUME || instr->op.code == INSTRUMENTED_RESUME;
return (
instr->op.code == RESUME ||
instr->op.code == RESUME_CHECK ||
instr->op.code == INSTRUMENTED_RESUME
);
}
static inline bool

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,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,
0,0,0,0,0,243,164,0,0,0,166,0,143,0,143,1,
122,0,181,0,143,0,143,1,122,1,181,1,154,2,46,0,
143,2,76,1,0,0,0,0,0,0,44,0,154,2,46,0,
143,3,154,0,130,6,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,76,2,0,0,0,0,0,0,
44,0,154,1,130,8,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,46,0,76,0,0,0,0,0,
0,0,143,4,12,0,0,0,181,5,143,5,31,0,115,20,
0,0,181,6,154,2,46,0,143,6,154,6,27,0,143,7,
154,5,154,6,12,0,0,0,27,0,74,4,76,1,0,0,
0,0,0,0,44,0,124,22,0,0,24,0,168,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

@ -7,7 +7,7 @@
break;
}
case RESUME: {
case RESUME_CHECK: {
break;
}

View File

@ -132,24 +132,37 @@ dummy_func(
inst(NOP, (--)) {
}
family(RESUME, 0) = {
RESUME_CHECK,
};
inst(RESUME, (--)) {
TIER_ONE_ONLY
assert(frame == tstate->current_frame);
/* Possibly combine this with eval breaker */
if (_PyFrame_GetCode(frame)->_co_instrumentation_version != tstate->interp->monitoring_version) {
int err = _Py_Instrument(_PyFrame_GetCode(frame), tstate->interp);
ERROR_IF(err, error);
#if TIER_ONE
next_instr--;
#endif
#if TIER_TWO
goto deoptimize;
#endif
}
else if (oparg < 2) {
CHECK_EVAL_BREAKER();
else {
if (oparg < 2) {
CHECK_EVAL_BREAKER();
}
next_instr[-1].op.code = RESUME_CHECK;
}
}
inst(RESUME_CHECK, (--)) {
#if defined(__EMSCRIPTEN__)
DEOPT_IF(emscripten_signal_clock == 0, RESUME);
emscripten_signal_clock -= Py_EMSCRIPTEN_SIGNAL_HANDLING;
#endif
/* Possibly combine these two checks */
DEOPT_IF(_PyFrame_GetCode(frame)->_co_instrumentation_version
!= tstate->interp->monitoring_version, RESUME);
DEOPT_IF(_Py_atomic_load_relaxed_int32(&tstate->interp->ceval.eval_breaker), RESUME);
}
inst(INSTRUMENTED_RESUME, (--)) {
/* Possible performance enhancement:
* We need to check the eval breaker anyway, can we

View File

@ -374,6 +374,8 @@ static inline void _Py_LeaveRecursiveCallPy(PyThreadState *tstate) {
tstate->py_recursion_remaining++;
}
/* Marker to specify tier 1 only instructions */
#define TIER_ONE_ONLY
/* Implementation of "macros" that modify the instruction pointer,
* stack pointer, or frame pointer.

View File

@ -38,19 +38,17 @@ _Py_CheckEmscriptenSignals(void)
}
}
#define PY_EMSCRIPTEN_SIGNAL_INTERVAL 50
static int emscripten_signal_clock = PY_EMSCRIPTEN_SIGNAL_INTERVAL;
void
_Py_CheckEmscriptenSignalsPeriodically(void)
{
if (!Py_EMSCRIPTEN_SIGNAL_HANDLING) {
return;
}
emscripten_signal_clock--;
if (emscripten_signal_clock == 0) {
emscripten_signal_clock = PY_EMSCRIPTEN_SIGNAL_INTERVAL;
_Py_CheckEmscriptenSignals();
}
else if (Py_EMSCRIPTEN_SIGNAL_HANDLING) {
emscripten_signal_clock--;
}
}

View File

@ -7,22 +7,15 @@
break;
}
case RESUME: {
assert(frame == tstate->current_frame);
/* Possibly combine this with eval breaker */
if (_PyFrame_GetCode(frame)->_co_instrumentation_version != tstate->interp->monitoring_version) {
int err = _Py_Instrument(_PyFrame_GetCode(frame), tstate->interp);
if (err) goto error;
#if TIER_ONE
next_instr--;
#endif
#if TIER_TWO
goto deoptimize;
#endif
}
else if (oparg < 2) {
CHECK_EVAL_BREAKER();
}
case RESUME_CHECK: {
#if defined(__EMSCRIPTEN__)
DEOPT_IF(emscripten_signal_clock == 0, RESUME);
emscripten_signal_clock -= Py_EMSCRIPTEN_SIGNAL_HANDLING;
#endif
/* Possibly combine these two checks */
DEOPT_IF(_PyFrame_GetCode(frame)->_co_instrumentation_version
!= tstate->interp->monitoring_version, RESUME);
DEOPT_IF(_Py_atomic_load_relaxed_int32(&tstate->interp->ceval.eval_breaker), RESUME);
break;
}

View File

@ -8,24 +8,36 @@
}
TARGET(RESUME) {
PREDICTED(RESUME);
static_assert(0 == 0, "incorrect cache size");
TIER_ONE_ONLY
assert(frame == tstate->current_frame);
/* Possibly combine this with eval breaker */
if (_PyFrame_GetCode(frame)->_co_instrumentation_version != tstate->interp->monitoring_version) {
int err = _Py_Instrument(_PyFrame_GetCode(frame), tstate->interp);
if (err) goto error;
#if TIER_ONE
next_instr--;
#endif
#if TIER_TWO
goto deoptimize;
#endif
}
else if (oparg < 2) {
CHECK_EVAL_BREAKER();
else {
if (oparg < 2) {
CHECK_EVAL_BREAKER();
}
next_instr[-1].op.code = RESUME_CHECK;
}
DISPATCH();
}
TARGET(RESUME_CHECK) {
#if defined(__EMSCRIPTEN__)
DEOPT_IF(emscripten_signal_clock == 0, RESUME);
emscripten_signal_clock -= Py_EMSCRIPTEN_SIGNAL_HANDLING;
#endif
/* Possibly combine these two checks */
DEOPT_IF(_PyFrame_GetCode(frame)->_co_instrumentation_version
!= tstate->interp->monitoring_version, RESUME);
DEOPT_IF(_Py_atomic_load_relaxed_int32(&tstate->interp->ceval.eval_breaker), RESUME);
DISPATCH();
}
TARGET(INSTRUMENTED_RESUME) {
/* Possible performance enhancement:
* We need to check the eval breaker anyway, can we

View File

@ -46,6 +46,7 @@ static void *opcode_targets[256] = {
&&TARGET_POP_TOP,
&&TARGET_PUSH_EXC_INFO,
&&TARGET_PUSH_NULL,
&&TARGET_RESUME_CHECK,
&&TARGET_RETURN_GENERATOR,
&&TARGET_RETURN_VALUE,
&&TARGET_SETUP_ANNOTATIONS,
@ -164,8 +165,8 @@ static void *opcode_targets[256] = {
&&TARGET_POP_JUMP_IF_NOT_NONE,
&&TARGET_POP_JUMP_IF_TRUE,
&&TARGET_RAISE_VARARGS,
&&TARGET_RERAISE,
&&TARGET_RESUME,
&&TARGET_RERAISE,
&&TARGET_RETURN_CONST,
&&TARGET_SEND,
&&TARGET_SEND_GEN,
@ -235,7 +236,6 @@ static void *opcode_targets[256] = {
&&_unknown_opcode,
&&_unknown_opcode,
&&_unknown_opcode,
&&_unknown_opcode,
&&TARGET_INSTRUMENTED_RESUME,
&&TARGET_INSTRUMENTED_END_FOR,
&&TARGET_INSTRUMENTED_END_SEND,

View File

@ -37,6 +37,7 @@ FORBIDDEN_NAMES_IN_UOPS = (
"import_from",
"import_name",
"_PyObject_CallNoArgs", # Proxy for BEFORE_WITH
"TIER_ONE_ONLY",
)

View File

@ -362,7 +362,8 @@ class Parser(PLexer):
if tkn := self.expect(lx.IDENTIFIER):
if self.expect(lx.COMMA):
if not (size := self.expect(lx.IDENTIFIER)):
raise self.make_syntax_error("Expected identifier")
if not (size := self.expect(lx.NUMBER)):
raise self.make_syntax_error("Expected identifier or number")
if self.expect(lx.RPAREN):
if self.expect(lx.EQUALS):
if not self.expect(lx.LBRACE):