gh-100239: specialize BINARY_OP/SUBSCR for list-slice (#132626)

This commit is contained in:
Irit Katriel 2025-05-01 11:28:52 +01:00 committed by GitHub
parent 3831752689
commit 5529213d4e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
15 changed files with 552 additions and 354 deletions

148
Lib/_opcode_metadata.py generated
View file

@ -27,6 +27,7 @@ _specializations = {
"BINARY_OP_SUBTRACT_FLOAT",
"BINARY_OP_ADD_UNICODE",
"BINARY_OP_SUBSCR_LIST_INT",
"BINARY_OP_SUBSCR_LIST_SLICE",
"BINARY_OP_SUBSCR_TUPLE_INT",
"BINARY_OP_SUBSCR_STR_INT",
"BINARY_OP_SUBSCR_DICT",
@ -133,79 +134,80 @@ _specialized_opmap = {
'BINARY_OP_SUBSCR_DICT': 135,
'BINARY_OP_SUBSCR_GETITEM': 136,
'BINARY_OP_SUBSCR_LIST_INT': 137,
'BINARY_OP_SUBSCR_STR_INT': 138,
'BINARY_OP_SUBSCR_TUPLE_INT': 139,
'BINARY_OP_SUBTRACT_FLOAT': 140,
'BINARY_OP_SUBTRACT_INT': 141,
'CALL_ALLOC_AND_ENTER_INIT': 142,
'CALL_BOUND_METHOD_EXACT_ARGS': 143,
'CALL_BOUND_METHOD_GENERAL': 144,
'CALL_BUILTIN_CLASS': 145,
'CALL_BUILTIN_FAST': 146,
'CALL_BUILTIN_FAST_WITH_KEYWORDS': 147,
'CALL_BUILTIN_O': 148,
'CALL_ISINSTANCE': 149,
'CALL_KW_BOUND_METHOD': 150,
'CALL_KW_NON_PY': 151,
'CALL_KW_PY': 152,
'CALL_LEN': 153,
'CALL_LIST_APPEND': 154,
'CALL_METHOD_DESCRIPTOR_FAST': 155,
'CALL_METHOD_DESCRIPTOR_FAST_WITH_KEYWORDS': 156,
'CALL_METHOD_DESCRIPTOR_NOARGS': 157,
'CALL_METHOD_DESCRIPTOR_O': 158,
'CALL_NON_PY_GENERAL': 159,
'CALL_PY_EXACT_ARGS': 160,
'CALL_PY_GENERAL': 161,
'CALL_STR_1': 162,
'CALL_TUPLE_1': 163,
'CALL_TYPE_1': 164,
'COMPARE_OP_FLOAT': 165,
'COMPARE_OP_INT': 166,
'COMPARE_OP_STR': 167,
'CONTAINS_OP_DICT': 168,
'CONTAINS_OP_SET': 169,
'FOR_ITER_GEN': 170,
'FOR_ITER_LIST': 171,
'FOR_ITER_RANGE': 172,
'FOR_ITER_TUPLE': 173,
'JUMP_BACKWARD_JIT': 174,
'JUMP_BACKWARD_NO_JIT': 175,
'LOAD_ATTR_CLASS': 176,
'LOAD_ATTR_CLASS_WITH_METACLASS_CHECK': 177,
'LOAD_ATTR_GETATTRIBUTE_OVERRIDDEN': 178,
'LOAD_ATTR_INSTANCE_VALUE': 179,
'LOAD_ATTR_METHOD_LAZY_DICT': 180,
'LOAD_ATTR_METHOD_NO_DICT': 181,
'LOAD_ATTR_METHOD_WITH_VALUES': 182,
'LOAD_ATTR_MODULE': 183,
'LOAD_ATTR_NONDESCRIPTOR_NO_DICT': 184,
'LOAD_ATTR_NONDESCRIPTOR_WITH_VALUES': 185,
'LOAD_ATTR_PROPERTY': 186,
'LOAD_ATTR_SLOT': 187,
'LOAD_ATTR_WITH_HINT': 188,
'LOAD_CONST_IMMORTAL': 189,
'LOAD_CONST_MORTAL': 190,
'LOAD_GLOBAL_BUILTIN': 191,
'LOAD_GLOBAL_MODULE': 192,
'LOAD_SUPER_ATTR_ATTR': 193,
'LOAD_SUPER_ATTR_METHOD': 194,
'RESUME_CHECK': 195,
'SEND_GEN': 196,
'STORE_ATTR_INSTANCE_VALUE': 197,
'STORE_ATTR_SLOT': 198,
'STORE_ATTR_WITH_HINT': 199,
'STORE_SUBSCR_DICT': 200,
'STORE_SUBSCR_LIST_INT': 201,
'TO_BOOL_ALWAYS_TRUE': 202,
'TO_BOOL_BOOL': 203,
'TO_BOOL_INT': 204,
'TO_BOOL_LIST': 205,
'TO_BOOL_NONE': 206,
'TO_BOOL_STR': 207,
'UNPACK_SEQUENCE_LIST': 208,
'UNPACK_SEQUENCE_TUPLE': 209,
'UNPACK_SEQUENCE_TWO_TUPLE': 210,
'BINARY_OP_SUBSCR_LIST_SLICE': 138,
'BINARY_OP_SUBSCR_STR_INT': 139,
'BINARY_OP_SUBSCR_TUPLE_INT': 140,
'BINARY_OP_SUBTRACT_FLOAT': 141,
'BINARY_OP_SUBTRACT_INT': 142,
'CALL_ALLOC_AND_ENTER_INIT': 143,
'CALL_BOUND_METHOD_EXACT_ARGS': 144,
'CALL_BOUND_METHOD_GENERAL': 145,
'CALL_BUILTIN_CLASS': 146,
'CALL_BUILTIN_FAST': 147,
'CALL_BUILTIN_FAST_WITH_KEYWORDS': 148,
'CALL_BUILTIN_O': 149,
'CALL_ISINSTANCE': 150,
'CALL_KW_BOUND_METHOD': 151,
'CALL_KW_NON_PY': 152,
'CALL_KW_PY': 153,
'CALL_LEN': 154,
'CALL_LIST_APPEND': 155,
'CALL_METHOD_DESCRIPTOR_FAST': 156,
'CALL_METHOD_DESCRIPTOR_FAST_WITH_KEYWORDS': 157,
'CALL_METHOD_DESCRIPTOR_NOARGS': 158,
'CALL_METHOD_DESCRIPTOR_O': 159,
'CALL_NON_PY_GENERAL': 160,
'CALL_PY_EXACT_ARGS': 161,
'CALL_PY_GENERAL': 162,
'CALL_STR_1': 163,
'CALL_TUPLE_1': 164,
'CALL_TYPE_1': 165,
'COMPARE_OP_FLOAT': 166,
'COMPARE_OP_INT': 167,
'COMPARE_OP_STR': 168,
'CONTAINS_OP_DICT': 169,
'CONTAINS_OP_SET': 170,
'FOR_ITER_GEN': 171,
'FOR_ITER_LIST': 172,
'FOR_ITER_RANGE': 173,
'FOR_ITER_TUPLE': 174,
'JUMP_BACKWARD_JIT': 175,
'JUMP_BACKWARD_NO_JIT': 176,
'LOAD_ATTR_CLASS': 177,
'LOAD_ATTR_CLASS_WITH_METACLASS_CHECK': 178,
'LOAD_ATTR_GETATTRIBUTE_OVERRIDDEN': 179,
'LOAD_ATTR_INSTANCE_VALUE': 180,
'LOAD_ATTR_METHOD_LAZY_DICT': 181,
'LOAD_ATTR_METHOD_NO_DICT': 182,
'LOAD_ATTR_METHOD_WITH_VALUES': 183,
'LOAD_ATTR_MODULE': 184,
'LOAD_ATTR_NONDESCRIPTOR_NO_DICT': 185,
'LOAD_ATTR_NONDESCRIPTOR_WITH_VALUES': 186,
'LOAD_ATTR_PROPERTY': 187,
'LOAD_ATTR_SLOT': 188,
'LOAD_ATTR_WITH_HINT': 189,
'LOAD_CONST_IMMORTAL': 190,
'LOAD_CONST_MORTAL': 191,
'LOAD_GLOBAL_BUILTIN': 192,
'LOAD_GLOBAL_MODULE': 193,
'LOAD_SUPER_ATTR_ATTR': 194,
'LOAD_SUPER_ATTR_METHOD': 195,
'RESUME_CHECK': 196,
'SEND_GEN': 197,
'STORE_ATTR_INSTANCE_VALUE': 198,
'STORE_ATTR_SLOT': 199,
'STORE_ATTR_WITH_HINT': 200,
'STORE_SUBSCR_DICT': 201,
'STORE_SUBSCR_LIST_INT': 202,
'TO_BOOL_ALWAYS_TRUE': 203,
'TO_BOOL_BOOL': 204,
'TO_BOOL_INT': 205,
'TO_BOOL_LIST': 206,
'TO_BOOL_NONE': 207,
'TO_BOOL_STR': 208,
'UNPACK_SEQUENCE_LIST': 209,
'UNPACK_SEQUENCE_TUPLE': 210,
'UNPACK_SEQUENCE_TWO_TUPLE': 211,
}
opmap = {