diff --git a/Include/internal/pycore_uop_ids.h b/Include/internal/pycore_uop_ids.h index 42793d940b51b7..0c7b77fedb5a94 100644 --- a/Include/internal/pycore_uop_ids.h +++ b/Include/internal/pycore_uop_ids.h @@ -906,212 +906,216 @@ extern "C" { #define _LOAD_FAST_BORROW_LOAD_FAST_BORROW_r02 1099 #define _LOAD_FAST_BORROW_LOAD_FAST_BORROW_r13 1100 #define _LOAD_FAST_CHECK_r01 1101 -#define _LOAD_FAST_LOAD_FAST_r02 1102 -#define _LOAD_FAST_LOAD_FAST_r13 1103 -#define _LOAD_FROM_DICT_OR_DEREF_r11 1104 -#define _LOAD_FROM_DICT_OR_GLOBALS_r11 1105 -#define _LOAD_GLOBAL_r00 1106 -#define _LOAD_GLOBAL_BUILTINS_r01 1107 -#define _LOAD_GLOBAL_MODULE_r01 1108 -#define _LOAD_LOCALS_r01 1109 -#define _LOAD_NAME_r01 1110 -#define _LOAD_SMALL_INT_r01 1111 -#define _LOAD_SMALL_INT_r12 1112 -#define _LOAD_SMALL_INT_r23 1113 -#define _LOAD_SMALL_INT_0_r01 1114 -#define _LOAD_SMALL_INT_0_r12 1115 -#define _LOAD_SMALL_INT_0_r23 1116 -#define _LOAD_SMALL_INT_1_r01 1117 -#define _LOAD_SMALL_INT_1_r12 1118 -#define _LOAD_SMALL_INT_1_r23 1119 -#define _LOAD_SMALL_INT_2_r01 1120 -#define _LOAD_SMALL_INT_2_r12 1121 -#define _LOAD_SMALL_INT_2_r23 1122 -#define _LOAD_SMALL_INT_3_r01 1123 -#define _LOAD_SMALL_INT_3_r12 1124 -#define _LOAD_SMALL_INT_3_r23 1125 -#define _LOAD_SPECIAL_r00 1126 -#define _LOAD_SUPER_ATTR_ATTR_r31 1127 -#define _LOAD_SUPER_ATTR_METHOD_r32 1128 -#define _MAKE_CALLARGS_A_TUPLE_r33 1129 -#define _MAKE_CELL_r00 1130 -#define _MAKE_FUNCTION_r11 1131 -#define _MAKE_WARM_r00 1132 -#define _MAKE_WARM_r11 1133 -#define _MAKE_WARM_r22 1134 -#define _MAKE_WARM_r33 1135 -#define _MAP_ADD_r20 1136 -#define _MATCH_CLASS_r31 1137 -#define _MATCH_KEYS_r23 1138 -#define _MATCH_MAPPING_r02 1139 -#define _MATCH_MAPPING_r12 1140 -#define _MATCH_MAPPING_r23 1141 -#define _MATCH_SEQUENCE_r02 1142 -#define _MATCH_SEQUENCE_r12 1143 -#define _MATCH_SEQUENCE_r23 1144 -#define _MAYBE_EXPAND_METHOD_r00 1145 -#define _MAYBE_EXPAND_METHOD_KW_r11 1146 -#define _MONITOR_CALL_r00 1147 -#define _MONITOR_CALL_KW_r11 1148 -#define _MONITOR_JUMP_BACKWARD_r00 1149 -#define _MONITOR_JUMP_BACKWARD_r11 1150 -#define _MONITOR_JUMP_BACKWARD_r22 1151 -#define _MONITOR_JUMP_BACKWARD_r33 1152 -#define _MONITOR_RESUME_r00 1153 -#define _NOP_r00 1154 -#define _NOP_r11 1155 -#define _NOP_r22 1156 -#define _NOP_r33 1157 -#define _POP_CALL_r20 1158 -#define _POP_CALL_LOAD_CONST_INLINE_BORROW_r21 1159 -#define _POP_CALL_ONE_r30 1160 -#define _POP_CALL_ONE_LOAD_CONST_INLINE_BORROW_r31 1161 -#define _POP_CALL_TWO_r30 1162 -#define _POP_CALL_TWO_LOAD_CONST_INLINE_BORROW_r31 1163 -#define _POP_EXCEPT_r10 1164 -#define _POP_ITER_r20 1165 -#define _POP_JUMP_IF_FALSE_r00 1166 -#define _POP_JUMP_IF_FALSE_r10 1167 -#define _POP_JUMP_IF_FALSE_r21 1168 -#define _POP_JUMP_IF_FALSE_r32 1169 -#define _POP_JUMP_IF_TRUE_r00 1170 -#define _POP_JUMP_IF_TRUE_r10 1171 -#define _POP_JUMP_IF_TRUE_r21 1172 -#define _POP_JUMP_IF_TRUE_r32 1173 -#define _POP_TOP_r10 1174 -#define _POP_TOP_FLOAT_r00 1175 -#define _POP_TOP_FLOAT_r10 1176 -#define _POP_TOP_FLOAT_r21 1177 -#define _POP_TOP_FLOAT_r32 1178 -#define _POP_TOP_INT_r00 1179 -#define _POP_TOP_INT_r10 1180 -#define _POP_TOP_INT_r21 1181 -#define _POP_TOP_INT_r32 1182 -#define _POP_TOP_LOAD_CONST_INLINE_r11 1183 -#define _POP_TOP_LOAD_CONST_INLINE_BORROW_r11 1184 -#define _POP_TOP_NOP_r00 1185 -#define _POP_TOP_NOP_r10 1186 -#define _POP_TOP_NOP_r21 1187 -#define _POP_TOP_NOP_r32 1188 -#define _POP_TOP_UNICODE_r00 1189 -#define _POP_TOP_UNICODE_r10 1190 -#define _POP_TOP_UNICODE_r21 1191 -#define _POP_TOP_UNICODE_r32 1192 -#define _POP_TWO_r20 1193 -#define _POP_TWO_LOAD_CONST_INLINE_BORROW_r21 1194 -#define _PUSH_EXC_INFO_r02 1195 -#define _PUSH_EXC_INFO_r12 1196 -#define _PUSH_EXC_INFO_r23 1197 -#define _PUSH_FRAME_r10 1198 -#define _PUSH_NULL_r01 1199 -#define _PUSH_NULL_r12 1200 -#define _PUSH_NULL_r23 1201 -#define _PUSH_NULL_CONDITIONAL_r00 1202 -#define _PY_FRAME_GENERAL_r01 1203 -#define _PY_FRAME_KW_r11 1204 -#define _QUICKEN_RESUME_r00 1205 -#define _QUICKEN_RESUME_r11 1206 -#define _QUICKEN_RESUME_r22 1207 -#define _QUICKEN_RESUME_r33 1208 -#define _REPLACE_WITH_TRUE_r11 1209 -#define _RESUME_CHECK_r00 1210 -#define _RESUME_CHECK_r11 1211 -#define _RESUME_CHECK_r22 1212 -#define _RESUME_CHECK_r33 1213 -#define _RETURN_GENERATOR_r01 1214 -#define _RETURN_VALUE_r11 1215 -#define _SAVE_RETURN_OFFSET_r00 1216 -#define _SAVE_RETURN_OFFSET_r11 1217 -#define _SAVE_RETURN_OFFSET_r22 1218 -#define _SAVE_RETURN_OFFSET_r33 1219 -#define _SEND_r22 1220 -#define _SEND_GEN_FRAME_r22 1221 -#define _SETUP_ANNOTATIONS_r00 1222 -#define _SET_ADD_r10 1223 -#define _SET_FUNCTION_ATTRIBUTE_r01 1224 -#define _SET_FUNCTION_ATTRIBUTE_r11 1225 -#define _SET_FUNCTION_ATTRIBUTE_r21 1226 -#define _SET_FUNCTION_ATTRIBUTE_r32 1227 -#define _SET_IP_r00 1228 -#define _SET_IP_r11 1229 -#define _SET_IP_r22 1230 -#define _SET_IP_r33 1231 -#define _SET_UPDATE_r10 1232 -#define _SPILL_OR_RELOAD_r01 1233 -#define _SPILL_OR_RELOAD_r02 1234 -#define _SPILL_OR_RELOAD_r03 1235 -#define _SPILL_OR_RELOAD_r10 1236 -#define _SPILL_OR_RELOAD_r12 1237 -#define _SPILL_OR_RELOAD_r13 1238 -#define _SPILL_OR_RELOAD_r20 1239 -#define _SPILL_OR_RELOAD_r21 1240 -#define _SPILL_OR_RELOAD_r23 1241 -#define _SPILL_OR_RELOAD_r30 1242 -#define _SPILL_OR_RELOAD_r31 1243 -#define _SPILL_OR_RELOAD_r32 1244 -#define _START_EXECUTOR_r00 1245 -#define _STORE_ATTR_r20 1246 -#define _STORE_ATTR_INSTANCE_VALUE_r20 1247 -#define _STORE_ATTR_SLOT_r20 1248 -#define _STORE_ATTR_WITH_HINT_r20 1249 -#define _STORE_DEREF_r10 1250 -#define _STORE_FAST_r10 1251 -#define _STORE_FAST_0_r10 1252 -#define _STORE_FAST_1_r10 1253 -#define _STORE_FAST_2_r10 1254 -#define _STORE_FAST_3_r10 1255 -#define _STORE_FAST_4_r10 1256 -#define _STORE_FAST_5_r10 1257 -#define _STORE_FAST_6_r10 1258 -#define _STORE_FAST_7_r10 1259 -#define _STORE_FAST_LOAD_FAST_r11 1260 -#define _STORE_FAST_STORE_FAST_r20 1261 -#define _STORE_GLOBAL_r10 1262 -#define _STORE_NAME_r10 1263 -#define _STORE_SLICE_r30 1264 -#define _STORE_SUBSCR_r30 1265 -#define _STORE_SUBSCR_DICT_r31 1266 -#define _STORE_SUBSCR_LIST_INT_r32 1267 -#define _SWAP_r11 1268 -#define _SWAP_2_r02 1269 -#define _SWAP_2_r12 1270 -#define _SWAP_2_r22 1271 -#define _SWAP_2_r33 1272 -#define _SWAP_3_r03 1273 -#define _SWAP_3_r13 1274 -#define _SWAP_3_r23 1275 -#define _SWAP_3_r33 1276 -#define _TIER2_RESUME_CHECK_r00 1277 -#define _TIER2_RESUME_CHECK_r11 1278 -#define _TIER2_RESUME_CHECK_r22 1279 -#define _TIER2_RESUME_CHECK_r33 1280 -#define _TO_BOOL_r11 1281 -#define _TO_BOOL_BOOL_r01 1282 -#define _TO_BOOL_BOOL_r11 1283 -#define _TO_BOOL_BOOL_r22 1284 -#define _TO_BOOL_BOOL_r33 1285 -#define _TO_BOOL_INT_r11 1286 -#define _TO_BOOL_LIST_r11 1287 -#define _TO_BOOL_NONE_r01 1288 -#define _TO_BOOL_NONE_r11 1289 -#define _TO_BOOL_NONE_r22 1290 -#define _TO_BOOL_NONE_r33 1291 -#define _TO_BOOL_STR_r11 1292 -#define _TRACE_RECORD_r00 1293 -#define _UNARY_INVERT_r11 1294 -#define _UNARY_NEGATIVE_r11 1295 -#define _UNARY_NOT_r01 1296 -#define _UNARY_NOT_r11 1297 -#define _UNARY_NOT_r22 1298 -#define _UNARY_NOT_r33 1299 -#define _UNPACK_EX_r10 1300 -#define _UNPACK_SEQUENCE_r10 1301 -#define _UNPACK_SEQUENCE_LIST_r10 1302 -#define _UNPACK_SEQUENCE_TUPLE_r10 1303 -#define _UNPACK_SEQUENCE_TWO_TUPLE_r12 1304 -#define _WITH_EXCEPT_START_r33 1305 -#define _YIELD_VALUE_r11 1306 -#define MAX_UOP_REGS_ID 1306 +#define _LOAD_FAST_CHECK_r12 1102 +#define _LOAD_FAST_CHECK_r23 1103 +#define _LOAD_FAST_LOAD_FAST_r02 1104 +#define _LOAD_FAST_LOAD_FAST_r13 1105 +#define _LOAD_FROM_DICT_OR_DEREF_r11 1106 +#define _LOAD_FROM_DICT_OR_GLOBALS_r11 1107 +#define _LOAD_GLOBAL_r00 1108 +#define _LOAD_GLOBAL_BUILTINS_r01 1109 +#define _LOAD_GLOBAL_MODULE_r01 1110 +#define _LOAD_LOCALS_r01 1111 +#define _LOAD_LOCALS_r12 1112 +#define _LOAD_LOCALS_r23 1113 +#define _LOAD_NAME_r01 1114 +#define _LOAD_SMALL_INT_r01 1115 +#define _LOAD_SMALL_INT_r12 1116 +#define _LOAD_SMALL_INT_r23 1117 +#define _LOAD_SMALL_INT_0_r01 1118 +#define _LOAD_SMALL_INT_0_r12 1119 +#define _LOAD_SMALL_INT_0_r23 1120 +#define _LOAD_SMALL_INT_1_r01 1121 +#define _LOAD_SMALL_INT_1_r12 1122 +#define _LOAD_SMALL_INT_1_r23 1123 +#define _LOAD_SMALL_INT_2_r01 1124 +#define _LOAD_SMALL_INT_2_r12 1125 +#define _LOAD_SMALL_INT_2_r23 1126 +#define _LOAD_SMALL_INT_3_r01 1127 +#define _LOAD_SMALL_INT_3_r12 1128 +#define _LOAD_SMALL_INT_3_r23 1129 +#define _LOAD_SPECIAL_r00 1130 +#define _LOAD_SUPER_ATTR_ATTR_r31 1131 +#define _LOAD_SUPER_ATTR_METHOD_r32 1132 +#define _MAKE_CALLARGS_A_TUPLE_r33 1133 +#define _MAKE_CELL_r00 1134 +#define _MAKE_FUNCTION_r11 1135 +#define _MAKE_WARM_r00 1136 +#define _MAKE_WARM_r11 1137 +#define _MAKE_WARM_r22 1138 +#define _MAKE_WARM_r33 1139 +#define _MAP_ADD_r20 1140 +#define _MATCH_CLASS_r31 1141 +#define _MATCH_KEYS_r23 1142 +#define _MATCH_MAPPING_r02 1143 +#define _MATCH_MAPPING_r12 1144 +#define _MATCH_MAPPING_r23 1145 +#define _MATCH_SEQUENCE_r02 1146 +#define _MATCH_SEQUENCE_r12 1147 +#define _MATCH_SEQUENCE_r23 1148 +#define _MAYBE_EXPAND_METHOD_r00 1149 +#define _MAYBE_EXPAND_METHOD_KW_r11 1150 +#define _MONITOR_CALL_r00 1151 +#define _MONITOR_CALL_KW_r11 1152 +#define _MONITOR_JUMP_BACKWARD_r00 1153 +#define _MONITOR_JUMP_BACKWARD_r11 1154 +#define _MONITOR_JUMP_BACKWARD_r22 1155 +#define _MONITOR_JUMP_BACKWARD_r33 1156 +#define _MONITOR_RESUME_r00 1157 +#define _NOP_r00 1158 +#define _NOP_r11 1159 +#define _NOP_r22 1160 +#define _NOP_r33 1161 +#define _POP_CALL_r20 1162 +#define _POP_CALL_LOAD_CONST_INLINE_BORROW_r21 1163 +#define _POP_CALL_ONE_r30 1164 +#define _POP_CALL_ONE_LOAD_CONST_INLINE_BORROW_r31 1165 +#define _POP_CALL_TWO_r30 1166 +#define _POP_CALL_TWO_LOAD_CONST_INLINE_BORROW_r31 1167 +#define _POP_EXCEPT_r10 1168 +#define _POP_ITER_r20 1169 +#define _POP_JUMP_IF_FALSE_r00 1170 +#define _POP_JUMP_IF_FALSE_r10 1171 +#define _POP_JUMP_IF_FALSE_r21 1172 +#define _POP_JUMP_IF_FALSE_r32 1173 +#define _POP_JUMP_IF_TRUE_r00 1174 +#define _POP_JUMP_IF_TRUE_r10 1175 +#define _POP_JUMP_IF_TRUE_r21 1176 +#define _POP_JUMP_IF_TRUE_r32 1177 +#define _POP_TOP_r10 1178 +#define _POP_TOP_FLOAT_r00 1179 +#define _POP_TOP_FLOAT_r10 1180 +#define _POP_TOP_FLOAT_r21 1181 +#define _POP_TOP_FLOAT_r32 1182 +#define _POP_TOP_INT_r00 1183 +#define _POP_TOP_INT_r10 1184 +#define _POP_TOP_INT_r21 1185 +#define _POP_TOP_INT_r32 1186 +#define _POP_TOP_LOAD_CONST_INLINE_r11 1187 +#define _POP_TOP_LOAD_CONST_INLINE_BORROW_r11 1188 +#define _POP_TOP_NOP_r00 1189 +#define _POP_TOP_NOP_r10 1190 +#define _POP_TOP_NOP_r21 1191 +#define _POP_TOP_NOP_r32 1192 +#define _POP_TOP_UNICODE_r00 1193 +#define _POP_TOP_UNICODE_r10 1194 +#define _POP_TOP_UNICODE_r21 1195 +#define _POP_TOP_UNICODE_r32 1196 +#define _POP_TWO_r20 1197 +#define _POP_TWO_LOAD_CONST_INLINE_BORROW_r21 1198 +#define _PUSH_EXC_INFO_r02 1199 +#define _PUSH_EXC_INFO_r12 1200 +#define _PUSH_EXC_INFO_r23 1201 +#define _PUSH_FRAME_r10 1202 +#define _PUSH_NULL_r01 1203 +#define _PUSH_NULL_r12 1204 +#define _PUSH_NULL_r23 1205 +#define _PUSH_NULL_CONDITIONAL_r00 1206 +#define _PY_FRAME_GENERAL_r01 1207 +#define _PY_FRAME_KW_r11 1208 +#define _QUICKEN_RESUME_r00 1209 +#define _QUICKEN_RESUME_r11 1210 +#define _QUICKEN_RESUME_r22 1211 +#define _QUICKEN_RESUME_r33 1212 +#define _REPLACE_WITH_TRUE_r11 1213 +#define _RESUME_CHECK_r00 1214 +#define _RESUME_CHECK_r11 1215 +#define _RESUME_CHECK_r22 1216 +#define _RESUME_CHECK_r33 1217 +#define _RETURN_GENERATOR_r01 1218 +#define _RETURN_VALUE_r11 1219 +#define _SAVE_RETURN_OFFSET_r00 1220 +#define _SAVE_RETURN_OFFSET_r11 1221 +#define _SAVE_RETURN_OFFSET_r22 1222 +#define _SAVE_RETURN_OFFSET_r33 1223 +#define _SEND_r22 1224 +#define _SEND_GEN_FRAME_r22 1225 +#define _SETUP_ANNOTATIONS_r00 1226 +#define _SET_ADD_r10 1227 +#define _SET_FUNCTION_ATTRIBUTE_r01 1228 +#define _SET_FUNCTION_ATTRIBUTE_r11 1229 +#define _SET_FUNCTION_ATTRIBUTE_r21 1230 +#define _SET_FUNCTION_ATTRIBUTE_r32 1231 +#define _SET_IP_r00 1232 +#define _SET_IP_r11 1233 +#define _SET_IP_r22 1234 +#define _SET_IP_r33 1235 +#define _SET_UPDATE_r10 1236 +#define _SPILL_OR_RELOAD_r01 1237 +#define _SPILL_OR_RELOAD_r02 1238 +#define _SPILL_OR_RELOAD_r03 1239 +#define _SPILL_OR_RELOAD_r10 1240 +#define _SPILL_OR_RELOAD_r12 1241 +#define _SPILL_OR_RELOAD_r13 1242 +#define _SPILL_OR_RELOAD_r20 1243 +#define _SPILL_OR_RELOAD_r21 1244 +#define _SPILL_OR_RELOAD_r23 1245 +#define _SPILL_OR_RELOAD_r30 1246 +#define _SPILL_OR_RELOAD_r31 1247 +#define _SPILL_OR_RELOAD_r32 1248 +#define _START_EXECUTOR_r00 1249 +#define _STORE_ATTR_r20 1250 +#define _STORE_ATTR_INSTANCE_VALUE_r20 1251 +#define _STORE_ATTR_SLOT_r20 1252 +#define _STORE_ATTR_WITH_HINT_r20 1253 +#define _STORE_DEREF_r10 1254 +#define _STORE_FAST_r10 1255 +#define _STORE_FAST_0_r10 1256 +#define _STORE_FAST_1_r10 1257 +#define _STORE_FAST_2_r10 1258 +#define _STORE_FAST_3_r10 1259 +#define _STORE_FAST_4_r10 1260 +#define _STORE_FAST_5_r10 1261 +#define _STORE_FAST_6_r10 1262 +#define _STORE_FAST_7_r10 1263 +#define _STORE_FAST_LOAD_FAST_r11 1264 +#define _STORE_FAST_STORE_FAST_r20 1265 +#define _STORE_GLOBAL_r10 1266 +#define _STORE_NAME_r10 1267 +#define _STORE_SLICE_r30 1268 +#define _STORE_SUBSCR_r30 1269 +#define _STORE_SUBSCR_DICT_r31 1270 +#define _STORE_SUBSCR_LIST_INT_r32 1271 +#define _SWAP_r11 1272 +#define _SWAP_2_r02 1273 +#define _SWAP_2_r12 1274 +#define _SWAP_2_r22 1275 +#define _SWAP_2_r33 1276 +#define _SWAP_3_r03 1277 +#define _SWAP_3_r13 1278 +#define _SWAP_3_r23 1279 +#define _SWAP_3_r33 1280 +#define _TIER2_RESUME_CHECK_r00 1281 +#define _TIER2_RESUME_CHECK_r11 1282 +#define _TIER2_RESUME_CHECK_r22 1283 +#define _TIER2_RESUME_CHECK_r33 1284 +#define _TO_BOOL_r11 1285 +#define _TO_BOOL_BOOL_r01 1286 +#define _TO_BOOL_BOOL_r11 1287 +#define _TO_BOOL_BOOL_r22 1288 +#define _TO_BOOL_BOOL_r33 1289 +#define _TO_BOOL_INT_r11 1290 +#define _TO_BOOL_LIST_r11 1291 +#define _TO_BOOL_NONE_r01 1292 +#define _TO_BOOL_NONE_r11 1293 +#define _TO_BOOL_NONE_r22 1294 +#define _TO_BOOL_NONE_r33 1295 +#define _TO_BOOL_STR_r11 1296 +#define _TRACE_RECORD_r00 1297 +#define _UNARY_INVERT_r11 1298 +#define _UNARY_NEGATIVE_r11 1299 +#define _UNARY_NOT_r01 1300 +#define _UNARY_NOT_r11 1301 +#define _UNARY_NOT_r22 1302 +#define _UNARY_NOT_r33 1303 +#define _UNPACK_EX_r10 1304 +#define _UNPACK_SEQUENCE_r10 1305 +#define _UNPACK_SEQUENCE_LIST_r10 1306 +#define _UNPACK_SEQUENCE_TUPLE_r10 1307 +#define _UNPACK_SEQUENCE_TWO_TUPLE_r12 1308 +#define _WITH_EXCEPT_START_r33 1309 +#define _YIELD_VALUE_r11 1310 +#define MAX_UOP_REGS_ID 1310 #ifdef __cplusplus } diff --git a/Include/internal/pycore_uop_metadata.h b/Include/internal/pycore_uop_metadata.h index ec47c526ff122d..08e1c7d533e8d3 100644 --- a/Include/internal/pycore_uop_metadata.h +++ b/Include/internal/pycore_uop_metadata.h @@ -405,11 +405,11 @@ const _PyUopCachingInfo _PyUop_Caching[MAX_UOP_ID+1] = { }, }, [_LOAD_FAST_CHECK] = { - .best = { 0, 0, 0, 0 }, + .best = { 0, 1, 2, 2 }, .entries = { { 1, 0, _LOAD_FAST_CHECK_r01 }, - { -1, -1, -1 }, - { -1, -1, -1 }, + { 2, 1, _LOAD_FAST_CHECK_r12 }, + { 3, 2, _LOAD_FAST_CHECK_r23 }, { -1, -1, -1 }, }, }, @@ -813,7 +813,7 @@ const _PyUopCachingInfo _PyUop_Caching[MAX_UOP_ID+1] = { .best = { 1, 1, 1, 1 }, .entries = { { -1, -1, -1 }, - { 1, 0, _UNARY_NEGATIVE_r11 }, + { 1, 1, _UNARY_NEGATIVE_r11 }, { -1, -1, -1 }, { -1, -1, -1 }, }, @@ -831,7 +831,7 @@ const _PyUopCachingInfo _PyUop_Caching[MAX_UOP_ID+1] = { .best = { 1, 1, 1, 1 }, .entries = { { -1, -1, -1 }, - { 1, 0, _TO_BOOL_r11 }, + { 1, 1, _TO_BOOL_r11 }, { -1, -1, -1 }, { -1, -1, -1 }, }, @@ -939,7 +939,7 @@ const _PyUopCachingInfo _PyUop_Caching[MAX_UOP_ID+1] = { .best = { 1, 1, 1, 1 }, .entries = { { -1, -1, -1 }, - { 1, 0, _UNARY_INVERT_r11 }, + { 1, 1, _UNARY_INVERT_r11 }, { -1, -1, -1 }, { -1, -1, -1 }, }, @@ -1093,7 +1093,7 @@ const _PyUopCachingInfo _PyUop_Caching[MAX_UOP_ID+1] = { .entries = { { -1, -1, -1 }, { -1, -1, -1 }, - { 0, 0, _BINARY_OP_INPLACE_ADD_UNICODE_r20 }, + { 0, 2, _BINARY_OP_INPLACE_ADD_UNICODE_r20 }, { -1, -1, -1 }, }, }, @@ -1102,7 +1102,7 @@ const _PyUopCachingInfo _PyUop_Caching[MAX_UOP_ID+1] = { .entries = { { -1, -1, -1 }, { -1, -1, -1 }, - { 2, 0, _GUARD_BINARY_OP_EXTEND_r22 }, + { 2, 2, _GUARD_BINARY_OP_EXTEND_r22 }, { -1, -1, -1 }, }, }, @@ -1111,7 +1111,7 @@ const _PyUopCachingInfo _PyUop_Caching[MAX_UOP_ID+1] = { .entries = { { -1, -1, -1 }, { -1, -1, -1 }, - { 1, 0, _BINARY_OP_EXTEND_r21 }, + { 1, 2, _BINARY_OP_EXTEND_r21 }, { -1, -1, -1 }, }, }, @@ -1121,7 +1121,7 @@ const _PyUopCachingInfo _PyUop_Caching[MAX_UOP_ID+1] = { { -1, -1, -1 }, { -1, -1, -1 }, { -1, -1, -1 }, - { 1, 0, _BINARY_SLICE_r31 }, + { 1, 3, _BINARY_SLICE_r31 }, }, }, [_STORE_SLICE] = { @@ -1130,7 +1130,7 @@ const _PyUopCachingInfo _PyUop_Caching[MAX_UOP_ID+1] = { { -1, -1, -1 }, { -1, -1, -1 }, { -1, -1, -1 }, - { 0, 0, _STORE_SLICE_r30 }, + { 0, 3, _STORE_SLICE_r30 }, }, }, [_BINARY_OP_SUBSCR_LIST_INT] = { @@ -1138,7 +1138,7 @@ const _PyUopCachingInfo _PyUop_Caching[MAX_UOP_ID+1] = { .entries = { { -1, -1, -1 }, { -1, -1, -1 }, - { 1, 0, _BINARY_OP_SUBSCR_LIST_INT_r21 }, + { 1, 2, _BINARY_OP_SUBSCR_LIST_INT_r21 }, { -1, -1, -1 }, }, }, @@ -1147,7 +1147,7 @@ const _PyUopCachingInfo _PyUop_Caching[MAX_UOP_ID+1] = { .entries = { { -1, -1, -1 }, { -1, -1, -1 }, - { 1, 0, _BINARY_OP_SUBSCR_LIST_SLICE_r21 }, + { 1, 2, _BINARY_OP_SUBSCR_LIST_SLICE_r21 }, { -1, -1, -1 }, }, }, @@ -1210,7 +1210,7 @@ const _PyUopCachingInfo _PyUop_Caching[MAX_UOP_ID+1] = { .entries = { { -1, -1, -1 }, { -1, -1, -1 }, - { 1, 0, _BINARY_OP_SUBSCR_DICT_r21 }, + { 1, 2, _BINARY_OP_SUBSCR_DICT_r21 }, { -1, -1, -1 }, }, }, @@ -1245,7 +1245,7 @@ const _PyUopCachingInfo _PyUop_Caching[MAX_UOP_ID+1] = { .best = { 1, 1, 1, 1 }, .entries = { { -1, -1, -1 }, - { 0, 0, _SET_ADD_r10 }, + { 0, 1, _SET_ADD_r10 }, { -1, -1, -1 }, { -1, -1, -1 }, }, @@ -1256,7 +1256,7 @@ const _PyUopCachingInfo _PyUop_Caching[MAX_UOP_ID+1] = { { -1, -1, -1 }, { -1, -1, -1 }, { -1, -1, -1 }, - { 0, 0, _STORE_SUBSCR_r30 }, + { 0, 3, _STORE_SUBSCR_r30 }, }, }, [_STORE_SUBSCR_LIST_INT] = { @@ -1274,7 +1274,7 @@ const _PyUopCachingInfo _PyUop_Caching[MAX_UOP_ID+1] = { { -1, -1, -1 }, { -1, -1, -1 }, { -1, -1, -1 }, - { 1, 0, _STORE_SUBSCR_DICT_r31 }, + { 1, 3, _STORE_SUBSCR_DICT_r31 }, }, }, [_DELETE_SUBSCR] = { @@ -1282,7 +1282,7 @@ const _PyUopCachingInfo _PyUop_Caching[MAX_UOP_ID+1] = { .entries = { { -1, -1, -1 }, { -1, -1, -1 }, - { 0, 0, _DELETE_SUBSCR_r20 }, + { 0, 2, _DELETE_SUBSCR_r20 }, { -1, -1, -1 }, }, }, @@ -1290,7 +1290,7 @@ const _PyUopCachingInfo _PyUop_Caching[MAX_UOP_ID+1] = { .best = { 1, 1, 1, 1 }, .entries = { { -1, -1, -1 }, - { 1, 0, _CALL_INTRINSIC_1_r11 }, + { 1, 1, _CALL_INTRINSIC_1_r11 }, { -1, -1, -1 }, { -1, -1, -1 }, }, @@ -1300,7 +1300,7 @@ const _PyUopCachingInfo _PyUop_Caching[MAX_UOP_ID+1] = { .entries = { { -1, -1, -1 }, { -1, -1, -1 }, - { 1, 0, _CALL_INTRINSIC_2_r21 }, + { 1, 2, _CALL_INTRINSIC_2_r21 }, { -1, -1, -1 }, }, }, @@ -1308,7 +1308,7 @@ const _PyUopCachingInfo _PyUop_Caching[MAX_UOP_ID+1] = { .best = { 1, 1, 1, 1 }, .entries = { { -1, -1, -1 }, - { 1, 0, _RETURN_VALUE_r11 }, + { 1, 1, _RETURN_VALUE_r11 }, { -1, -1, -1 }, { -1, -1, -1 }, }, @@ -1317,7 +1317,7 @@ const _PyUopCachingInfo _PyUop_Caching[MAX_UOP_ID+1] = { .best = { 1, 1, 1, 1 }, .entries = { { -1, -1, -1 }, - { 1, 0, _GET_AITER_r11 }, + { 1, 1, _GET_AITER_r11 }, { -1, -1, -1 }, { -1, -1, -1 }, }, @@ -1326,7 +1326,7 @@ const _PyUopCachingInfo _PyUop_Caching[MAX_UOP_ID+1] = { .best = { 1, 1, 1, 1 }, .entries = { { -1, -1, -1 }, - { 2, 0, _GET_ANEXT_r12 }, + { 2, 1, _GET_ANEXT_r12 }, { -1, -1, -1 }, { -1, -1, -1 }, }, @@ -1335,7 +1335,7 @@ const _PyUopCachingInfo _PyUop_Caching[MAX_UOP_ID+1] = { .best = { 1, 1, 1, 1 }, .entries = { { -1, -1, -1 }, - { 1, 0, _GET_AWAITABLE_r11 }, + { 1, 1, _GET_AWAITABLE_r11 }, { -1, -1, -1 }, { -1, -1, -1 }, }, @@ -1362,7 +1362,7 @@ const _PyUopCachingInfo _PyUop_Caching[MAX_UOP_ID+1] = { .best = { 1, 1, 1, 1 }, .entries = { { -1, -1, -1 }, - { 0, 0, _POP_EXCEPT_r10 }, + { 0, 1, _POP_EXCEPT_r10 }, { -1, -1, -1 }, { -1, -1, -1 }, }, @@ -1389,7 +1389,7 @@ const _PyUopCachingInfo _PyUop_Caching[MAX_UOP_ID+1] = { .best = { 1, 1, 1, 1 }, .entries = { { -1, -1, -1 }, - { 0, 0, _STORE_NAME_r10 }, + { 0, 1, _STORE_NAME_r10 }, { -1, -1, -1 }, { -1, -1, -1 }, }, @@ -1407,7 +1407,7 @@ const _PyUopCachingInfo _PyUop_Caching[MAX_UOP_ID+1] = { .best = { 1, 1, 1, 1 }, .entries = { { -1, -1, -1 }, - { 0, 0, _UNPACK_SEQUENCE_r10 }, + { 0, 1, _UNPACK_SEQUENCE_r10 }, { -1, -1, -1 }, { -1, -1, -1 }, }, @@ -1443,7 +1443,7 @@ const _PyUopCachingInfo _PyUop_Caching[MAX_UOP_ID+1] = { .best = { 1, 1, 1, 1 }, .entries = { { -1, -1, -1 }, - { 0, 0, _UNPACK_EX_r10 }, + { 0, 1, _UNPACK_EX_r10 }, { -1, -1, -1 }, { -1, -1, -1 }, }, @@ -1453,7 +1453,7 @@ const _PyUopCachingInfo _PyUop_Caching[MAX_UOP_ID+1] = { .entries = { { -1, -1, -1 }, { -1, -1, -1 }, - { 0, 0, _STORE_ATTR_r20 }, + { 0, 2, _STORE_ATTR_r20 }, { -1, -1, -1 }, }, }, @@ -1461,7 +1461,7 @@ const _PyUopCachingInfo _PyUop_Caching[MAX_UOP_ID+1] = { .best = { 1, 1, 1, 1 }, .entries = { { -1, -1, -1 }, - { 0, 0, _DELETE_ATTR_r10 }, + { 0, 1, _DELETE_ATTR_r10 }, { -1, -1, -1 }, { -1, -1, -1 }, }, @@ -1470,7 +1470,7 @@ const _PyUopCachingInfo _PyUop_Caching[MAX_UOP_ID+1] = { .best = { 1, 1, 1, 1 }, .entries = { { -1, -1, -1 }, - { 0, 0, _STORE_GLOBAL_r10 }, + { 0, 1, _STORE_GLOBAL_r10 }, { -1, -1, -1 }, { -1, -1, -1 }, }, @@ -1485,11 +1485,11 @@ const _PyUopCachingInfo _PyUop_Caching[MAX_UOP_ID+1] = { }, }, [_LOAD_LOCALS] = { - .best = { 0, 0, 0, 0 }, + .best = { 0, 1, 2, 2 }, .entries = { { 1, 0, _LOAD_LOCALS_r01 }, - { -1, -1, -1 }, - { -1, -1, -1 }, + { 2, 1, _LOAD_LOCALS_r12 }, + { 3, 2, _LOAD_LOCALS_r23 }, { -1, -1, -1 }, }, }, @@ -1578,7 +1578,7 @@ const _PyUopCachingInfo _PyUop_Caching[MAX_UOP_ID+1] = { .best = { 1, 1, 1, 1 }, .entries = { { -1, -1, -1 }, - { 1, 0, _LOAD_FROM_DICT_OR_DEREF_r11 }, + { 1, 1, _LOAD_FROM_DICT_OR_DEREF_r11 }, { -1, -1, -1 }, { -1, -1, -1 }, }, @@ -1596,7 +1596,7 @@ const _PyUopCachingInfo _PyUop_Caching[MAX_UOP_ID+1] = { .best = { 1, 1, 1, 1 }, .entries = { { -1, -1, -1 }, - { 0, 0, _STORE_DEREF_r10 }, + { 0, 1, _STORE_DEREF_r10 }, { -1, -1, -1 }, { -1, -1, -1 }, }, @@ -1633,7 +1633,7 @@ const _PyUopCachingInfo _PyUop_Caching[MAX_UOP_ID+1] = { .entries = { { -1, -1, -1 }, { -1, -1, -1 }, - { 1, 0, _BUILD_TEMPLATE_r21 }, + { 1, 2, _BUILD_TEMPLATE_r21 }, { -1, -1, -1 }, }, }, @@ -1659,7 +1659,7 @@ const _PyUopCachingInfo _PyUop_Caching[MAX_UOP_ID+1] = { .best = { 1, 1, 1, 1 }, .entries = { { -1, -1, -1 }, - { 0, 0, _LIST_EXTEND_r10 }, + { 0, 1, _LIST_EXTEND_r10 }, { -1, -1, -1 }, { -1, -1, -1 }, }, @@ -1668,7 +1668,7 @@ const _PyUopCachingInfo _PyUop_Caching[MAX_UOP_ID+1] = { .best = { 1, 1, 1, 1 }, .entries = { { -1, -1, -1 }, - { 0, 0, _SET_UPDATE_r10 }, + { 0, 1, _SET_UPDATE_r10 }, { -1, -1, -1 }, { -1, -1, -1 }, }, @@ -1704,7 +1704,7 @@ const _PyUopCachingInfo _PyUop_Caching[MAX_UOP_ID+1] = { .best = { 1, 1, 1, 1 }, .entries = { { -1, -1, -1 }, - { 0, 0, _DICT_UPDATE_r10 }, + { 0, 1, _DICT_UPDATE_r10 }, { -1, -1, -1 }, { -1, -1, -1 }, }, @@ -1713,7 +1713,7 @@ const _PyUopCachingInfo _PyUop_Caching[MAX_UOP_ID+1] = { .best = { 1, 1, 1, 1 }, .entries = { { -1, -1, -1 }, - { 0, 0, _DICT_MERGE_r10 }, + { 0, 1, _DICT_MERGE_r10 }, { -1, -1, -1 }, { -1, -1, -1 }, }, @@ -1723,7 +1723,7 @@ const _PyUopCachingInfo _PyUop_Caching[MAX_UOP_ID+1] = { .entries = { { -1, -1, -1 }, { -1, -1, -1 }, - { 0, 0, _MAP_ADD_r20 }, + { 0, 2, _MAP_ADD_r20 }, { -1, -1, -1 }, }, }, @@ -1733,7 +1733,7 @@ const _PyUopCachingInfo _PyUop_Caching[MAX_UOP_ID+1] = { { -1, -1, -1 }, { -1, -1, -1 }, { -1, -1, -1 }, - { 1, 0, _LOAD_SUPER_ATTR_ATTR_r31 }, + { 1, 3, _LOAD_SUPER_ATTR_ATTR_r31 }, }, }, [_LOAD_SUPER_ATTR_METHOD] = { @@ -1742,14 +1742,14 @@ const _PyUopCachingInfo _PyUop_Caching[MAX_UOP_ID+1] = { { -1, -1, -1 }, { -1, -1, -1 }, { -1, -1, -1 }, - { 2, 0, _LOAD_SUPER_ATTR_METHOD_r32 }, + { 2, 3, _LOAD_SUPER_ATTR_METHOD_r32 }, }, }, [_LOAD_ATTR] = { .best = { 1, 1, 1, 1 }, .entries = { { -1, -1, -1 }, - { 0, 0, _LOAD_ATTR_r10 }, + { 0, 1, _LOAD_ATTR_r10 }, { -1, -1, -1 }, { -1, -1, -1 }, }, @@ -1867,7 +1867,7 @@ const _PyUopCachingInfo _PyUop_Caching[MAX_UOP_ID+1] = { .entries = { { -1, -1, -1 }, { -1, -1, -1 }, - { 0, 0, _STORE_ATTR_WITH_HINT_r20 }, + { 0, 2, _STORE_ATTR_WITH_HINT_r20 }, { -1, -1, -1 }, }, }, @@ -1885,7 +1885,7 @@ const _PyUopCachingInfo _PyUop_Caching[MAX_UOP_ID+1] = { .entries = { { -1, -1, -1 }, { -1, -1, -1 }, - { 1, 0, _COMPARE_OP_r21 }, + { 1, 2, _COMPARE_OP_r21 }, { -1, -1, -1 }, }, }, @@ -1930,7 +1930,7 @@ const _PyUopCachingInfo _PyUop_Caching[MAX_UOP_ID+1] = { .entries = { { -1, -1, -1 }, { -1, -1, -1 }, - { 1, 0, _CONTAINS_OP_r21 }, + { 1, 2, _CONTAINS_OP_r21 }, { -1, -1, -1 }, }, }, @@ -1948,7 +1948,7 @@ const _PyUopCachingInfo _PyUop_Caching[MAX_UOP_ID+1] = { .entries = { { -1, -1, -1 }, { -1, -1, -1 }, - { 1, 0, _CONTAINS_OP_SET_r21 }, + { 1, 2, _CONTAINS_OP_SET_r21 }, { -1, -1, -1 }, }, }, @@ -1957,7 +1957,7 @@ const _PyUopCachingInfo _PyUop_Caching[MAX_UOP_ID+1] = { .entries = { { -1, -1, -1 }, { -1, -1, -1 }, - { 1, 0, _CONTAINS_OP_DICT_r21 }, + { 1, 2, _CONTAINS_OP_DICT_r21 }, { -1, -1, -1 }, }, }, @@ -1966,7 +1966,7 @@ const _PyUopCachingInfo _PyUop_Caching[MAX_UOP_ID+1] = { .entries = { { -1, -1, -1 }, { -1, -1, -1 }, - { 2, 0, _CHECK_EG_MATCH_r22 }, + { 2, 2, _CHECK_EG_MATCH_r22 }, { -1, -1, -1 }, }, }, @@ -1975,7 +1975,7 @@ const _PyUopCachingInfo _PyUop_Caching[MAX_UOP_ID+1] = { .entries = { { -1, -1, -1 }, { -1, -1, -1 }, - { 2, 0, _CHECK_EXC_MATCH_r22 }, + { 2, 2, _CHECK_EXC_MATCH_r22 }, { -1, -1, -1 }, }, }, @@ -1984,7 +1984,7 @@ const _PyUopCachingInfo _PyUop_Caching[MAX_UOP_ID+1] = { .entries = { { -1, -1, -1 }, { -1, -1, -1 }, - { 1, 0, _IMPORT_NAME_r21 }, + { 1, 2, _IMPORT_NAME_r21 }, { -1, -1, -1 }, }, }, @@ -1992,7 +1992,7 @@ const _PyUopCachingInfo _PyUop_Caching[MAX_UOP_ID+1] = { .best = { 1, 1, 1, 1 }, .entries = { { -1, -1, -1 }, - { 2, 0, _IMPORT_FROM_r12 }, + { 2, 1, _IMPORT_FROM_r12 }, { -1, -1, -1 }, { -1, -1, -1 }, }, @@ -2010,7 +2010,7 @@ const _PyUopCachingInfo _PyUop_Caching[MAX_UOP_ID+1] = { .best = { 1, 1, 1, 1 }, .entries = { { -1, -1, -1 }, - { 2, 0, _GET_LEN_r12 }, + { 2, 1, _GET_LEN_r12 }, { -1, -1, -1 }, { -1, -1, -1 }, }, @@ -2021,7 +2021,7 @@ const _PyUopCachingInfo _PyUop_Caching[MAX_UOP_ID+1] = { { -1, -1, -1 }, { -1, -1, -1 }, { -1, -1, -1 }, - { 1, 0, _MATCH_CLASS_r31 }, + { 1, 3, _MATCH_CLASS_r31 }, }, }, [_MATCH_MAPPING] = { @@ -2047,7 +2047,7 @@ const _PyUopCachingInfo _PyUop_Caching[MAX_UOP_ID+1] = { .entries = { { -1, -1, -1 }, { -1, -1, -1 }, - { 3, 0, _MATCH_KEYS_r23 }, + { 3, 2, _MATCH_KEYS_r23 }, { -1, -1, -1 }, }, }, @@ -2055,7 +2055,7 @@ const _PyUopCachingInfo _PyUop_Caching[MAX_UOP_ID+1] = { .best = { 1, 1, 1, 1 }, .entries = { { -1, -1, -1 }, - { 2, 0, _GET_ITER_r12 }, + { 2, 1, _GET_ITER_r12 }, { -1, -1, -1 }, { -1, -1, -1 }, }, @@ -2064,7 +2064,7 @@ const _PyUopCachingInfo _PyUop_Caching[MAX_UOP_ID+1] = { .best = { 1, 1, 1, 1 }, .entries = { { -1, -1, -1 }, - { 1, 0, _GET_YIELD_FROM_ITER_r11 }, + { 1, 1, _GET_YIELD_FROM_ITER_r11 }, { -1, -1, -1 }, { -1, -1, -1 }, }, @@ -2074,7 +2074,7 @@ const _PyUopCachingInfo _PyUop_Caching[MAX_UOP_ID+1] = { .entries = { { -1, -1, -1 }, { -1, -1, -1 }, - { 3, 0, _FOR_ITER_TIER_TWO_r23 }, + { 3, 2, _FOR_ITER_TIER_TWO_r23 }, { -1, -1, -1 }, }, }, @@ -2101,7 +2101,7 @@ const _PyUopCachingInfo _PyUop_Caching[MAX_UOP_ID+1] = { .entries = { { -1, -1, -1 }, { -1, -1, -1 }, - { 3, 0, _ITER_NEXT_LIST_TIER_TWO_r23 }, + { 3, 2, _ITER_NEXT_LIST_TIER_TWO_r23 }, { -1, -1, -1 }, }, }, @@ -2192,7 +2192,7 @@ const _PyUopCachingInfo _PyUop_Caching[MAX_UOP_ID+1] = { { -1, -1, -1 }, { -1, -1, -1 }, { -1, -1, -1 }, - { 3, 0, _WITH_EXCEPT_START_r33 }, + { 3, 3, _WITH_EXCEPT_START_r33 }, }, }, [_PUSH_EXC_INFO] = { @@ -2288,7 +2288,7 @@ const _PyUopCachingInfo _PyUop_Caching[MAX_UOP_ID+1] = { [_PY_FRAME_GENERAL] = { .best = { 0, 0, 0, 0 }, .entries = { - { 1, 0, _PY_FRAME_GENERAL_r01 }, + { 1, 1, _PY_FRAME_GENERAL_r01 }, { -1, -1, -1 }, { -1, -1, -1 }, { -1, -1, -1 }, @@ -2525,7 +2525,7 @@ const _PyUopCachingInfo _PyUop_Caching[MAX_UOP_ID+1] = { { -1, -1, -1 }, { -1, -1, -1 }, { -1, -1, -1 }, - { 2, 0, _CALL_STR_1_r32 }, + { 2, 3, _CALL_STR_1_r32 }, }, }, [_GUARD_CALLABLE_TUPLE_1] = { @@ -2543,7 +2543,7 @@ const _PyUopCachingInfo _PyUop_Caching[MAX_UOP_ID+1] = { { -1, -1, -1 }, { -1, -1, -1 }, { -1, -1, -1 }, - { 2, 0, _CALL_TUPLE_1_r32 }, + { 2, 3, _CALL_TUPLE_1_r32 }, }, }, [_CHECK_AND_ALLOCATE_OBJECT] = { @@ -2558,7 +2558,7 @@ const _PyUopCachingInfo _PyUop_Caching[MAX_UOP_ID+1] = { [_CREATE_INIT_FRAME] = { .best = { 0, 0, 0, 0 }, .entries = { - { 1, 0, _CREATE_INIT_FRAME_r01 }, + { 1, 1, _CREATE_INIT_FRAME_r01 }, { -1, -1, -1 }, { -1, -1, -1 }, { -1, -1, -1 }, @@ -2568,7 +2568,7 @@ const _PyUopCachingInfo _PyUop_Caching[MAX_UOP_ID+1] = { .best = { 1, 1, 1, 1 }, .entries = { { -1, -1, -1 }, - { 0, 0, _EXIT_INIT_CHECK_r10 }, + { 0, 1, _EXIT_INIT_CHECK_r10 }, { -1, -1, -1 }, { -1, -1, -1 }, }, @@ -2624,7 +2624,7 @@ const _PyUopCachingInfo _PyUop_Caching[MAX_UOP_ID+1] = { { -1, -1, -1 }, { -1, -1, -1 }, { -1, -1, -1 }, - { 3, 0, _CALL_LEN_r33 }, + { 3, 3, _CALL_LEN_r33 }, }, }, [_GUARD_CALLABLE_ISINSTANCE] = { @@ -2642,7 +2642,7 @@ const _PyUopCachingInfo _PyUop_Caching[MAX_UOP_ID+1] = { { -1, -1, -1 }, { -1, -1, -1 }, { -1, -1, -1 }, - { 1, 0, _CALL_ISINSTANCE_r31 }, + { 1, 3, _CALL_ISINSTANCE_r31 }, }, }, [_GUARD_CALLABLE_LIST_APPEND] = { @@ -2712,7 +2712,7 @@ const _PyUopCachingInfo _PyUop_Caching[MAX_UOP_ID+1] = { .best = { 1, 1, 1, 1 }, .entries = { { -1, -1, -1 }, - { 1, 0, _PY_FRAME_KW_r11 }, + { 1, 1, _PY_FRAME_KW_r11 }, { -1, -1, -1 }, { -1, -1, -1 }, }, @@ -2757,7 +2757,7 @@ const _PyUopCachingInfo _PyUop_Caching[MAX_UOP_ID+1] = { .best = { 1, 1, 1, 1 }, .entries = { { -1, -1, -1 }, - { 1, 0, _CALL_KW_NON_PY_r11 }, + { 1, 1, _CALL_KW_NON_PY_r11 }, { -1, -1, -1 }, { -1, -1, -1 }, }, @@ -2768,14 +2768,14 @@ const _PyUopCachingInfo _PyUop_Caching[MAX_UOP_ID+1] = { { -1, -1, -1 }, { -1, -1, -1 }, { -1, -1, -1 }, - { 3, 0, _MAKE_CALLARGS_A_TUPLE_r33 }, + { 3, 3, _MAKE_CALLARGS_A_TUPLE_r33 }, }, }, [_MAKE_FUNCTION] = { .best = { 1, 1, 1, 1 }, .entries = { { -1, -1, -1 }, - { 1, 0, _MAKE_FUNCTION_r11 }, + { 1, 1, _MAKE_FUNCTION_r11 }, { -1, -1, -1 }, { -1, -1, -1 }, }, @@ -2811,7 +2811,7 @@ const _PyUopCachingInfo _PyUop_Caching[MAX_UOP_ID+1] = { .best = { 1, 1, 1, 1 }, .entries = { { -1, -1, -1 }, - { 1, 0, _CONVERT_VALUE_r11 }, + { 1, 1, _CONVERT_VALUE_r11 }, { -1, -1, -1 }, { -1, -1, -1 }, }, @@ -2820,7 +2820,7 @@ const _PyUopCachingInfo _PyUop_Caching[MAX_UOP_ID+1] = { .best = { 1, 1, 1, 1 }, .entries = { { -1, -1, -1 }, - { 1, 0, _FORMAT_SIMPLE_r11 }, + { 1, 1, _FORMAT_SIMPLE_r11 }, { -1, -1, -1 }, { -1, -1, -1 }, }, @@ -2830,7 +2830,7 @@ const _PyUopCachingInfo _PyUop_Caching[MAX_UOP_ID+1] = { .entries = { { -1, -1, -1 }, { -1, -1, -1 }, - { 1, 0, _FORMAT_WITH_SPEC_r21 }, + { 1, 2, _FORMAT_WITH_SPEC_r21 }, { -1, -1, -1 }, }, }, @@ -2875,7 +2875,7 @@ const _PyUopCachingInfo _PyUop_Caching[MAX_UOP_ID+1] = { .entries = { { -1, -1, -1 }, { -1, -1, -1 }, - { 1, 0, _BINARY_OP_r21 }, + { 1, 2, _BINARY_OP_r21 }, { -1, -1, -1 }, }, }, @@ -3253,6 +3253,8 @@ const uint16_t _PyUop_Uncached[MAX_UOP_REGS_ID+1] = { [_RESUME_CHECK_r22] = _RESUME_CHECK, [_RESUME_CHECK_r33] = _RESUME_CHECK, [_LOAD_FAST_CHECK_r01] = _LOAD_FAST_CHECK, + [_LOAD_FAST_CHECK_r12] = _LOAD_FAST_CHECK, + [_LOAD_FAST_CHECK_r23] = _LOAD_FAST_CHECK, [_LOAD_FAST_0_r01] = _LOAD_FAST_0, [_LOAD_FAST_0_r12] = _LOAD_FAST_0, [_LOAD_FAST_0_r23] = _LOAD_FAST_0, @@ -3526,6 +3528,8 @@ const uint16_t _PyUop_Uncached[MAX_UOP_REGS_ID+1] = { [_STORE_GLOBAL_r10] = _STORE_GLOBAL, [_DELETE_GLOBAL_r00] = _DELETE_GLOBAL, [_LOAD_LOCALS_r01] = _LOAD_LOCALS, + [_LOAD_LOCALS_r12] = _LOAD_LOCALS, + [_LOAD_LOCALS_r23] = _LOAD_LOCALS, [_LOAD_NAME_r01] = _LOAD_NAME, [_LOAD_GLOBAL_r00] = _LOAD_GLOBAL, [_PUSH_NULL_CONDITIONAL_r00] = _PUSH_NULL_CONDITIONAL, @@ -4653,6 +4657,8 @@ const char *const _PyOpcode_uop_name[MAX_UOP_REGS_ID+1] = { [_LOAD_FAST_BORROW_7_r23] = "_LOAD_FAST_BORROW_7_r23", [_LOAD_FAST_CHECK] = "_LOAD_FAST_CHECK", [_LOAD_FAST_CHECK_r01] = "_LOAD_FAST_CHECK_r01", + [_LOAD_FAST_CHECK_r12] = "_LOAD_FAST_CHECK_r12", + [_LOAD_FAST_CHECK_r23] = "_LOAD_FAST_CHECK_r23", [_LOAD_FROM_DICT_OR_DEREF] = "_LOAD_FROM_DICT_OR_DEREF", [_LOAD_FROM_DICT_OR_DEREF_r11] = "_LOAD_FROM_DICT_OR_DEREF_r11", [_LOAD_GLOBAL] = "_LOAD_GLOBAL", @@ -4663,6 +4669,8 @@ const char *const _PyOpcode_uop_name[MAX_UOP_REGS_ID+1] = { [_LOAD_GLOBAL_MODULE_r01] = "_LOAD_GLOBAL_MODULE_r01", [_LOAD_LOCALS] = "_LOAD_LOCALS", [_LOAD_LOCALS_r01] = "_LOAD_LOCALS_r01", + [_LOAD_LOCALS_r12] = "_LOAD_LOCALS_r12", + [_LOAD_LOCALS_r23] = "_LOAD_LOCALS_r23", [_LOAD_NAME] = "_LOAD_NAME", [_LOAD_NAME_r01] = "_LOAD_NAME_r01", [_LOAD_SMALL_INT] = "_LOAD_SMALL_INT", diff --git a/Lib/test/test_capi/test_opt.py b/Lib/test/test_capi/test_opt.py index e17367ca71ea38..613cde747de5ba 100644 --- a/Lib/test/test_capi/test_opt.py +++ b/Lib/test/test_capi/test_opt.py @@ -2812,6 +2812,28 @@ def write(id0): pool.submit(write, (1,)) """)) + def test_handling_of_tos_cache_with_side_exits(self): + # https://github.com/python/cpython/issues/142718 + class EvilAttr: + def __init__(self, d): + self.d = d + + def __del__(self): + try: + del self.d['attr'] + except Exception: + pass + + class Obj: + pass + + obj = Obj() + obj.__dict__ = {} + + for _ in range(TIER2_THRESHOLD+1): + obj.attr = EvilAttr(obj.__dict__) + + def global_identity(x): return x diff --git a/Misc/NEWS.d/next/Core_and_Builtins/2025-12-15-15-07-40.gh-issue-142718.zjiGjS.rst b/Misc/NEWS.d/next/Core_and_Builtins/2025-12-15-15-07-40.gh-issue-142718.zjiGjS.rst new file mode 100644 index 00000000000000..022707fe33e8d5 --- /dev/null +++ b/Misc/NEWS.d/next/Core_and_Builtins/2025-12-15-15-07-40.gh-issue-142718.zjiGjS.rst @@ -0,0 +1 @@ +JIT: Fix segfault caused by not flushing the stack to memory at side exits. diff --git a/Python/executor_cases.c.h b/Python/executor_cases.c.h index e7f6bb2ed0ce0d..4a8344698af85a 100644 --- a/Python/executor_cases.c.h +++ b/Python/executor_cases.c.h @@ -136,6 +136,7 @@ #if defined(__EMSCRIPTEN__) if (_Py_emscripten_signal_clock == 0) { UOP_STAT_INC(uopcode, miss); + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(1); JUMP_TO_JUMP_TARGET(); } @@ -146,6 +147,7 @@ assert((version & _PY_EVAL_EVENTS_MASK) == 0); if (eval_breaker != version) { UOP_STAT_INC(uopcode, miss); + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(1); JUMP_TO_JUMP_TARGET(); } @@ -153,6 +155,7 @@ if (frame->tlbc_index != ((_PyThreadStateImpl *)tstate)->tlbc_index) { UOP_STAT_INC(uopcode, miss); + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(1); JUMP_TO_JUMP_TARGET(); } @@ -171,6 +174,8 @@ #if defined(__EMSCRIPTEN__) if (_Py_emscripten_signal_clock == 0) { UOP_STAT_INC(uopcode, miss); + _tos_cache1 = _stack_item_1; + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(2); JUMP_TO_JUMP_TARGET(); } @@ -181,6 +186,8 @@ assert((version & _PY_EVAL_EVENTS_MASK) == 0); if (eval_breaker != version) { UOP_STAT_INC(uopcode, miss); + _tos_cache1 = _stack_item_1; + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(2); JUMP_TO_JUMP_TARGET(); } @@ -188,6 +195,8 @@ if (frame->tlbc_index != ((_PyThreadStateImpl *)tstate)->tlbc_index) { UOP_STAT_INC(uopcode, miss); + _tos_cache1 = _stack_item_1; + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(2); JUMP_TO_JUMP_TARGET(); } @@ -208,6 +217,9 @@ #if defined(__EMSCRIPTEN__) if (_Py_emscripten_signal_clock == 0) { UOP_STAT_INC(uopcode, miss); + _tos_cache2 = _stack_item_2; + _tos_cache1 = _stack_item_1; + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(3); JUMP_TO_JUMP_TARGET(); } @@ -218,6 +230,9 @@ assert((version & _PY_EVAL_EVENTS_MASK) == 0); if (eval_breaker != version) { UOP_STAT_INC(uopcode, miss); + _tos_cache2 = _stack_item_2; + _tos_cache1 = _stack_item_1; + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(3); JUMP_TO_JUMP_TARGET(); } @@ -225,6 +240,9 @@ if (frame->tlbc_index != ((_PyThreadStateImpl *)tstate)->tlbc_index) { UOP_STAT_INC(uopcode, miss); + _tos_cache2 = _stack_item_2; + _tos_cache1 = _stack_item_1; + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(3); JUMP_TO_JUMP_TARGET(); } @@ -262,6 +280,65 @@ break; } + case _LOAD_FAST_CHECK_r12: { + CHECK_CURRENT_CACHED_VALUES(1); + assert(WITHIN_STACK_BOUNDS_WITH_CACHE()); + _PyStackRef value; + _PyStackRef _stack_item_0 = _tos_cache0; + oparg = CURRENT_OPARG(); + _PyStackRef value_s = GETLOCAL(oparg); + if (PyStackRef_IsNull(value_s)) { + stack_pointer[0] = _stack_item_0; + stack_pointer += 1; + ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__); + _PyFrame_SetStackPointer(frame, stack_pointer); + _PyEval_FormatExcCheckArg(tstate, PyExc_UnboundLocalError, + UNBOUNDLOCAL_ERROR_MSG, + PyTuple_GetItem(_PyFrame_GetCode(frame)->co_localsplusnames, oparg) + ); + stack_pointer = _PyFrame_GetStackPointer(frame); + SET_CURRENT_CACHED_VALUES(0); + JUMP_TO_ERROR(); + } + value = PyStackRef_DUP(value_s); + _tos_cache1 = value; + _tos_cache0 = _stack_item_0; + SET_CURRENT_CACHED_VALUES(2); + assert(WITHIN_STACK_BOUNDS_WITH_CACHE()); + break; + } + + case _LOAD_FAST_CHECK_r23: { + CHECK_CURRENT_CACHED_VALUES(2); + assert(WITHIN_STACK_BOUNDS_WITH_CACHE()); + _PyStackRef value; + _PyStackRef _stack_item_0 = _tos_cache0; + _PyStackRef _stack_item_1 = _tos_cache1; + oparg = CURRENT_OPARG(); + _PyStackRef value_s = GETLOCAL(oparg); + if (PyStackRef_IsNull(value_s)) { + stack_pointer[0] = _stack_item_0; + stack_pointer[1] = _stack_item_1; + stack_pointer += 2; + ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__); + _PyFrame_SetStackPointer(frame, stack_pointer); + _PyEval_FormatExcCheckArg(tstate, PyExc_UnboundLocalError, + UNBOUNDLOCAL_ERROR_MSG, + PyTuple_GetItem(_PyFrame_GetCode(frame)->co_localsplusnames, oparg) + ); + stack_pointer = _PyFrame_GetStackPointer(frame); + SET_CURRENT_CACHED_VALUES(0); + JUMP_TO_ERROR(); + } + value = PyStackRef_DUP(value_s); + _tos_cache2 = value; + _tos_cache1 = _stack_item_1; + _tos_cache0 = _stack_item_0; + SET_CURRENT_CACHED_VALUES(3); + assert(WITHIN_STACK_BOUNDS_WITH_CACHE()); + break; + } + case _LOAD_FAST_0_r01: { CHECK_CURRENT_CACHED_VALUES(0); assert(WITHIN_STACK_BOUNDS_WITH_CACHE()); @@ -2195,6 +2272,7 @@ value = _stack_item_0; if (!PyStackRef_BoolCheck(value)) { UOP_STAT_INC(uopcode, miss); + _tos_cache0 = value; SET_CURRENT_CACHED_VALUES(1); JUMP_TO_JUMP_TARGET(); } @@ -2214,6 +2292,8 @@ value = _stack_item_1; if (!PyStackRef_BoolCheck(value)) { UOP_STAT_INC(uopcode, miss); + _tos_cache1 = value; + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(2); JUMP_TO_JUMP_TARGET(); } @@ -2235,6 +2315,9 @@ value = _stack_item_2; if (!PyStackRef_BoolCheck(value)) { UOP_STAT_INC(uopcode, miss); + _tos_cache2 = value; + _tos_cache1 = _stack_item_1; + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(3); JUMP_TO_JUMP_TARGET(); } @@ -2257,6 +2340,7 @@ PyObject *value_o = PyStackRef_AsPyObjectBorrow(value); if (!PyLong_CheckExact(value_o)) { UOP_STAT_INC(uopcode, miss); + _tos_cache0 = value; SET_CURRENT_CACHED_VALUES(1); JUMP_TO_JUMP_TARGET(); } @@ -2308,6 +2392,7 @@ PyObject *o = PyStackRef_AsPyObjectBorrow(nos); if (!PyList_CheckExact(o)) { UOP_STAT_INC(uopcode, miss); + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(1); JUMP_TO_JUMP_TARGET(); } @@ -2330,6 +2415,8 @@ PyObject *o = PyStackRef_AsPyObjectBorrow(nos); if (!PyList_CheckExact(o)) { UOP_STAT_INC(uopcode, miss); + _tos_cache1 = _stack_item_1; + _tos_cache0 = nos; SET_CURRENT_CACHED_VALUES(2); JUMP_TO_JUMP_TARGET(); } @@ -2351,6 +2438,9 @@ PyObject *o = PyStackRef_AsPyObjectBorrow(nos); if (!PyList_CheckExact(o)) { UOP_STAT_INC(uopcode, miss); + _tos_cache2 = _stack_item_2; + _tos_cache1 = nos; + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(3); JUMP_TO_JUMP_TARGET(); } @@ -2390,6 +2480,7 @@ PyObject *o = PyStackRef_AsPyObjectBorrow(tos); if (!PyList_CheckExact(o)) { UOP_STAT_INC(uopcode, miss); + _tos_cache0 = tos; SET_CURRENT_CACHED_VALUES(1); JUMP_TO_JUMP_TARGET(); } @@ -2409,6 +2500,8 @@ PyObject *o = PyStackRef_AsPyObjectBorrow(tos); if (!PyList_CheckExact(o)) { UOP_STAT_INC(uopcode, miss); + _tos_cache1 = tos; + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(2); JUMP_TO_JUMP_TARGET(); } @@ -2430,6 +2523,9 @@ PyObject *o = PyStackRef_AsPyObjectBorrow(tos); if (!PyList_CheckExact(o)) { UOP_STAT_INC(uopcode, miss); + _tos_cache2 = tos; + _tos_cache1 = _stack_item_1; + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(3); JUMP_TO_JUMP_TARGET(); } @@ -2469,6 +2565,7 @@ PyObject *o = PyStackRef_AsPyObjectBorrow(tos); if (!PySlice_Check(o)) { UOP_STAT_INC(uopcode, miss); + _tos_cache0 = tos; SET_CURRENT_CACHED_VALUES(1); JUMP_TO_JUMP_TARGET(); } @@ -2488,6 +2585,8 @@ PyObject *o = PyStackRef_AsPyObjectBorrow(tos); if (!PySlice_Check(o)) { UOP_STAT_INC(uopcode, miss); + _tos_cache1 = tos; + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(2); JUMP_TO_JUMP_TARGET(); } @@ -2509,6 +2608,9 @@ PyObject *o = PyStackRef_AsPyObjectBorrow(tos); if (!PySlice_Check(o)) { UOP_STAT_INC(uopcode, miss); + _tos_cache2 = tos; + _tos_cache1 = _stack_item_1; + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(3); JUMP_TO_JUMP_TARGET(); } @@ -2580,6 +2682,7 @@ value = _stack_item_0; if (!PyStackRef_IsNone(value)) { UOP_STAT_INC(uopcode, miss); + _tos_cache0 = value; SET_CURRENT_CACHED_VALUES(1); JUMP_TO_JUMP_TARGET(); } @@ -2601,6 +2704,8 @@ value = _stack_item_1; if (!PyStackRef_IsNone(value)) { UOP_STAT_INC(uopcode, miss); + _tos_cache1 = value; + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(2); JUMP_TO_JUMP_TARGET(); } @@ -2624,6 +2729,9 @@ value = _stack_item_2; if (!PyStackRef_IsNone(value)) { UOP_STAT_INC(uopcode, miss); + _tos_cache2 = value; + _tos_cache1 = _stack_item_1; + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(3); JUMP_TO_JUMP_TARGET(); } @@ -2666,6 +2774,7 @@ PyObject *o = PyStackRef_AsPyObjectBorrow(nos); if (!PyUnicode_CheckExact(o)) { UOP_STAT_INC(uopcode, miss); + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(1); JUMP_TO_JUMP_TARGET(); } @@ -2688,6 +2797,8 @@ PyObject *o = PyStackRef_AsPyObjectBorrow(nos); if (!PyUnicode_CheckExact(o)) { UOP_STAT_INC(uopcode, miss); + _tos_cache1 = _stack_item_1; + _tos_cache0 = nos; SET_CURRENT_CACHED_VALUES(2); JUMP_TO_JUMP_TARGET(); } @@ -2709,6 +2820,9 @@ PyObject *o = PyStackRef_AsPyObjectBorrow(nos); if (!PyUnicode_CheckExact(o)) { UOP_STAT_INC(uopcode, miss); + _tos_cache2 = _stack_item_2; + _tos_cache1 = nos; + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(3); JUMP_TO_JUMP_TARGET(); } @@ -2748,6 +2862,7 @@ PyObject *value_o = PyStackRef_AsPyObjectBorrow(value); if (!PyUnicode_CheckExact(value_o)) { UOP_STAT_INC(uopcode, miss); + _tos_cache0 = value; SET_CURRENT_CACHED_VALUES(1); JUMP_TO_JUMP_TARGET(); } @@ -2767,6 +2882,8 @@ PyObject *value_o = PyStackRef_AsPyObjectBorrow(value); if (!PyUnicode_CheckExact(value_o)) { UOP_STAT_INC(uopcode, miss); + _tos_cache1 = value; + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(2); JUMP_TO_JUMP_TARGET(); } @@ -2788,6 +2905,9 @@ PyObject *value_o = PyStackRef_AsPyObjectBorrow(value); if (!PyUnicode_CheckExact(value_o)) { UOP_STAT_INC(uopcode, miss); + _tos_cache2 = value; + _tos_cache1 = _stack_item_1; + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(3); JUMP_TO_JUMP_TARGET(); } @@ -2906,6 +3026,7 @@ PyObject *left_o = PyStackRef_AsPyObjectBorrow(left); if (!_PyLong_CheckExactAndCompact(left_o)) { UOP_STAT_INC(uopcode, miss); + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(1); JUMP_TO_JUMP_TARGET(); } @@ -2928,6 +3049,8 @@ PyObject *left_o = PyStackRef_AsPyObjectBorrow(left); if (!_PyLong_CheckExactAndCompact(left_o)) { UOP_STAT_INC(uopcode, miss); + _tos_cache1 = _stack_item_1; + _tos_cache0 = left; SET_CURRENT_CACHED_VALUES(2); JUMP_TO_JUMP_TARGET(); } @@ -2949,6 +3072,9 @@ PyObject *left_o = PyStackRef_AsPyObjectBorrow(left); if (!_PyLong_CheckExactAndCompact(left_o)) { UOP_STAT_INC(uopcode, miss); + _tos_cache2 = _stack_item_2; + _tos_cache1 = left; + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(3); JUMP_TO_JUMP_TARGET(); } @@ -2988,6 +3114,7 @@ PyObject *value_o = PyStackRef_AsPyObjectBorrow(value); if (!_PyLong_CheckExactAndCompact(value_o)) { UOP_STAT_INC(uopcode, miss); + _tos_cache0 = value; SET_CURRENT_CACHED_VALUES(1); JUMP_TO_JUMP_TARGET(); } @@ -3007,6 +3134,8 @@ PyObject *value_o = PyStackRef_AsPyObjectBorrow(value); if (!_PyLong_CheckExactAndCompact(value_o)) { UOP_STAT_INC(uopcode, miss); + _tos_cache1 = value; + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(2); JUMP_TO_JUMP_TARGET(); } @@ -3028,6 +3157,9 @@ PyObject *value_o = PyStackRef_AsPyObjectBorrow(value); if (!_PyLong_CheckExactAndCompact(value_o)) { UOP_STAT_INC(uopcode, miss); + _tos_cache2 = value; + _tos_cache1 = _stack_item_1; + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(3); JUMP_TO_JUMP_TARGET(); } @@ -3070,6 +3202,7 @@ assert(Py_TYPE(left_o) == &PyLong_Type); if (!_PyLong_IsCompact((PyLongObject *)left_o)) { UOP_STAT_INC(uopcode, miss); + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(1); JUMP_TO_JUMP_TARGET(); } @@ -3093,6 +3226,8 @@ assert(Py_TYPE(left_o) == &PyLong_Type); if (!_PyLong_IsCompact((PyLongObject *)left_o)) { UOP_STAT_INC(uopcode, miss); + _tos_cache1 = _stack_item_1; + _tos_cache0 = left; SET_CURRENT_CACHED_VALUES(2); JUMP_TO_JUMP_TARGET(); } @@ -3115,6 +3250,9 @@ assert(Py_TYPE(left_o) == &PyLong_Type); if (!_PyLong_IsCompact((PyLongObject *)left_o)) { UOP_STAT_INC(uopcode, miss); + _tos_cache2 = _stack_item_2; + _tos_cache1 = left; + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(3); JUMP_TO_JUMP_TARGET(); } @@ -3156,6 +3294,7 @@ assert(Py_TYPE(value_o) == &PyLong_Type); if (!_PyLong_IsCompact((PyLongObject *)value_o)) { UOP_STAT_INC(uopcode, miss); + _tos_cache0 = value; SET_CURRENT_CACHED_VALUES(1); JUMP_TO_JUMP_TARGET(); } @@ -3176,6 +3315,8 @@ assert(Py_TYPE(value_o) == &PyLong_Type); if (!_PyLong_IsCompact((PyLongObject *)value_o)) { UOP_STAT_INC(uopcode, miss); + _tos_cache1 = value; + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(2); JUMP_TO_JUMP_TARGET(); } @@ -3198,6 +3339,9 @@ assert(Py_TYPE(value_o) == &PyLong_Type); if (!_PyLong_IsCompact((PyLongObject *)value_o)) { UOP_STAT_INC(uopcode, miss); + _tos_cache2 = value; + _tos_cache1 = _stack_item_1; + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(3); JUMP_TO_JUMP_TARGET(); } @@ -3257,6 +3401,7 @@ res = _PyCompactLong_Multiply((PyLongObject *)left_o, (PyLongObject *)right_o); if (PyStackRef_IsNull(res)) { UOP_STAT_INC(uopcode, miss); + _tos_cache0 = right; SET_CURRENT_CACHED_VALUES(1); JUMP_TO_JUMP_TARGET(); } @@ -3289,6 +3434,8 @@ res = _PyCompactLong_Multiply((PyLongObject *)left_o, (PyLongObject *)right_o); if (PyStackRef_IsNull(res)) { UOP_STAT_INC(uopcode, miss); + _tos_cache1 = right; + _tos_cache0 = left; SET_CURRENT_CACHED_VALUES(2); JUMP_TO_JUMP_TARGET(); } @@ -3320,6 +3467,9 @@ res = _PyCompactLong_Multiply((PyLongObject *)left_o, (PyLongObject *)right_o); if (PyStackRef_IsNull(res)) { UOP_STAT_INC(uopcode, miss); + _tos_cache2 = right; + _tos_cache1 = left; + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(3); JUMP_TO_JUMP_TARGET(); } @@ -3380,6 +3530,7 @@ res = _PyCompactLong_Add((PyLongObject *)left_o, (PyLongObject *)right_o); if (PyStackRef_IsNull(res)) { UOP_STAT_INC(uopcode, miss); + _tos_cache0 = right; SET_CURRENT_CACHED_VALUES(1); JUMP_TO_JUMP_TARGET(); } @@ -3412,6 +3563,8 @@ res = _PyCompactLong_Add((PyLongObject *)left_o, (PyLongObject *)right_o); if (PyStackRef_IsNull(res)) { UOP_STAT_INC(uopcode, miss); + _tos_cache1 = right; + _tos_cache0 = left; SET_CURRENT_CACHED_VALUES(2); JUMP_TO_JUMP_TARGET(); } @@ -3443,6 +3596,9 @@ res = _PyCompactLong_Add((PyLongObject *)left_o, (PyLongObject *)right_o); if (PyStackRef_IsNull(res)) { UOP_STAT_INC(uopcode, miss); + _tos_cache2 = right; + _tos_cache1 = left; + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(3); JUMP_TO_JUMP_TARGET(); } @@ -3503,6 +3659,7 @@ res = _PyCompactLong_Subtract((PyLongObject *)left_o, (PyLongObject *)right_o); if (PyStackRef_IsNull(res)) { UOP_STAT_INC(uopcode, miss); + _tos_cache0 = right; SET_CURRENT_CACHED_VALUES(1); JUMP_TO_JUMP_TARGET(); } @@ -3535,6 +3692,8 @@ res = _PyCompactLong_Subtract((PyLongObject *)left_o, (PyLongObject *)right_o); if (PyStackRef_IsNull(res)) { UOP_STAT_INC(uopcode, miss); + _tos_cache1 = right; + _tos_cache0 = left; SET_CURRENT_CACHED_VALUES(2); JUMP_TO_JUMP_TARGET(); } @@ -3566,6 +3725,9 @@ res = _PyCompactLong_Subtract((PyLongObject *)left_o, (PyLongObject *)right_o); if (PyStackRef_IsNull(res)) { UOP_STAT_INC(uopcode, miss); + _tos_cache2 = right; + _tos_cache1 = left; + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(3); JUMP_TO_JUMP_TARGET(); } @@ -3607,6 +3769,7 @@ PyObject *left_o = PyStackRef_AsPyObjectBorrow(left); if (!PyFloat_CheckExact(left_o)) { UOP_STAT_INC(uopcode, miss); + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(1); JUMP_TO_JUMP_TARGET(); } @@ -3629,6 +3792,8 @@ PyObject *left_o = PyStackRef_AsPyObjectBorrow(left); if (!PyFloat_CheckExact(left_o)) { UOP_STAT_INC(uopcode, miss); + _tos_cache1 = _stack_item_1; + _tos_cache0 = left; SET_CURRENT_CACHED_VALUES(2); JUMP_TO_JUMP_TARGET(); } @@ -3650,6 +3815,9 @@ PyObject *left_o = PyStackRef_AsPyObjectBorrow(left); if (!PyFloat_CheckExact(left_o)) { UOP_STAT_INC(uopcode, miss); + _tos_cache2 = _stack_item_2; + _tos_cache1 = left; + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(3); JUMP_TO_JUMP_TARGET(); } @@ -3689,6 +3857,7 @@ PyObject *value_o = PyStackRef_AsPyObjectBorrow(value); if (!PyFloat_CheckExact(value_o)) { UOP_STAT_INC(uopcode, miss); + _tos_cache0 = value; SET_CURRENT_CACHED_VALUES(1); JUMP_TO_JUMP_TARGET(); } @@ -3708,6 +3877,8 @@ PyObject *value_o = PyStackRef_AsPyObjectBorrow(value); if (!PyFloat_CheckExact(value_o)) { UOP_STAT_INC(uopcode, miss); + _tos_cache1 = value; + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(2); JUMP_TO_JUMP_TARGET(); } @@ -3729,6 +3900,9 @@ PyObject *value_o = PyStackRef_AsPyObjectBorrow(value); if (!PyFloat_CheckExact(value_o)) { UOP_STAT_INC(uopcode, miss); + _tos_cache2 = value; + _tos_cache1 = _stack_item_1; + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(3); JUMP_TO_JUMP_TARGET(); } @@ -4651,7 +4825,9 @@ assert(PyUnicode_CheckExact(left_o)); if (PyStackRef_AsPyObjectBorrow(*target_local) != left_o) { UOP_STAT_INC(uopcode, miss); - SET_CURRENT_CACHED_VALUES(0); + _tos_cache1 = right; + _tos_cache0 = left; + SET_CURRENT_CACHED_VALUES(2); JUMP_TO_JUMP_TARGET(); } STAT_INC(BINARY_OP, hit); @@ -4707,7 +4883,11 @@ stack_pointer = _PyFrame_GetStackPointer(frame); if (!res) { UOP_STAT_INC(uopcode, miss); - SET_CURRENT_CACHED_VALUES(0); + _tos_cache1 = right; + _tos_cache0 = left; + SET_CURRENT_CACHED_VALUES(2); + stack_pointer += -2; + ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__); JUMP_TO_JUMP_TARGET(); } _tos_cache1 = right; @@ -4891,7 +5071,9 @@ assert(PyList_CheckExact(list)); if (!_PyLong_IsNonNegativeCompact((PyLongObject *)sub)) { UOP_STAT_INC(uopcode, miss); - SET_CURRENT_CACHED_VALUES(0); + _tos_cache1 = sub_st; + _tos_cache0 = list_st; + SET_CURRENT_CACHED_VALUES(2); JUMP_TO_JUMP_TARGET(); } Py_ssize_t index = ((PyLongObject*)sub)->long_value.ob_digit[0]; @@ -4905,7 +5087,11 @@ stack_pointer = _PyFrame_GetStackPointer(frame); if (res_o == NULL) { UOP_STAT_INC(uopcode, miss); - SET_CURRENT_CACHED_VALUES(0); + _tos_cache1 = sub_st; + _tos_cache0 = list_st; + SET_CURRENT_CACHED_VALUES(2); + stack_pointer += -2; + ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__); JUMP_TO_JUMP_TARGET(); } STAT_INC(BINARY_OP, hit); @@ -4913,7 +5099,9 @@ #else if (index >= PyList_GET_SIZE(list)) { UOP_STAT_INC(uopcode, miss); - SET_CURRENT_CACHED_VALUES(0); + _tos_cache1 = sub_st; + _tos_cache0 = list_st; + SET_CURRENT_CACHED_VALUES(2); JUMP_TO_JUMP_TARGET(); } STAT_INC(BINARY_OP, hit); @@ -5008,17 +5196,23 @@ assert(PyUnicode_CheckExact(str)); if (!_PyLong_IsNonNegativeCompact((PyLongObject *)sub)) { UOP_STAT_INC(uopcode, miss); + _tos_cache1 = sub_st; + _tos_cache0 = str_st; SET_CURRENT_CACHED_VALUES(2); JUMP_TO_JUMP_TARGET(); } Py_ssize_t index = ((PyLongObject*)sub)->long_value.ob_digit[0]; if (PyUnicode_GET_LENGTH(str) <= index) { UOP_STAT_INC(uopcode, miss); + _tos_cache1 = sub_st; + _tos_cache0 = str_st; SET_CURRENT_CACHED_VALUES(2); JUMP_TO_JUMP_TARGET(); } if (!PyUnicode_IS_COMPACT_ASCII(str)) { UOP_STAT_INC(uopcode, miss); + _tos_cache1 = sub_st; + _tos_cache0 = str_st; SET_CURRENT_CACHED_VALUES(2); JUMP_TO_JUMP_TARGET(); } @@ -5068,6 +5262,7 @@ PyObject *o = PyStackRef_AsPyObjectBorrow(nos); if (!PyTuple_CheckExact(o)) { UOP_STAT_INC(uopcode, miss); + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(1); JUMP_TO_JUMP_TARGET(); } @@ -5090,6 +5285,8 @@ PyObject *o = PyStackRef_AsPyObjectBorrow(nos); if (!PyTuple_CheckExact(o)) { UOP_STAT_INC(uopcode, miss); + _tos_cache1 = _stack_item_1; + _tos_cache0 = nos; SET_CURRENT_CACHED_VALUES(2); JUMP_TO_JUMP_TARGET(); } @@ -5111,6 +5308,9 @@ PyObject *o = PyStackRef_AsPyObjectBorrow(nos); if (!PyTuple_CheckExact(o)) { UOP_STAT_INC(uopcode, miss); + _tos_cache2 = _stack_item_2; + _tos_cache1 = nos; + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(3); JUMP_TO_JUMP_TARGET(); } @@ -5150,6 +5350,7 @@ PyObject *o = PyStackRef_AsPyObjectBorrow(tos); if (!PyTuple_CheckExact(o)) { UOP_STAT_INC(uopcode, miss); + _tos_cache0 = tos; SET_CURRENT_CACHED_VALUES(1); JUMP_TO_JUMP_TARGET(); } @@ -5169,6 +5370,8 @@ PyObject *o = PyStackRef_AsPyObjectBorrow(tos); if (!PyTuple_CheckExact(o)) { UOP_STAT_INC(uopcode, miss); + _tos_cache1 = tos; + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(2); JUMP_TO_JUMP_TARGET(); } @@ -5190,6 +5393,9 @@ PyObject *o = PyStackRef_AsPyObjectBorrow(tos); if (!PyTuple_CheckExact(o)) { UOP_STAT_INC(uopcode, miss); + _tos_cache2 = tos; + _tos_cache1 = _stack_item_1; + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(3); JUMP_TO_JUMP_TARGET(); } @@ -5217,12 +5423,16 @@ assert(PyTuple_CheckExact(tuple)); if (!_PyLong_IsNonNegativeCompact((PyLongObject *)sub)) { UOP_STAT_INC(uopcode, miss); + _tos_cache1 = sub_st; + _tos_cache0 = tuple_st; SET_CURRENT_CACHED_VALUES(2); JUMP_TO_JUMP_TARGET(); } Py_ssize_t index = ((PyLongObject*)sub)->long_value.ob_digit[0]; if (index >= PyTuple_GET_SIZE(tuple)) { UOP_STAT_INC(uopcode, miss); + _tos_cache1 = sub_st; + _tos_cache0 = tuple_st; SET_CURRENT_CACHED_VALUES(2); JUMP_TO_JUMP_TARGET(); } @@ -5279,6 +5489,7 @@ PyObject *o = PyStackRef_AsPyObjectBorrow(nos); if (!PyDict_CheckExact(o)) { UOP_STAT_INC(uopcode, miss); + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(1); JUMP_TO_JUMP_TARGET(); } @@ -5301,6 +5512,8 @@ PyObject *o = PyStackRef_AsPyObjectBorrow(nos); if (!PyDict_CheckExact(o)) { UOP_STAT_INC(uopcode, miss); + _tos_cache1 = _stack_item_1; + _tos_cache0 = nos; SET_CURRENT_CACHED_VALUES(2); JUMP_TO_JUMP_TARGET(); } @@ -5322,6 +5535,9 @@ PyObject *o = PyStackRef_AsPyObjectBorrow(nos); if (!PyDict_CheckExact(o)) { UOP_STAT_INC(uopcode, miss); + _tos_cache2 = _stack_item_2; + _tos_cache1 = nos; + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(3); JUMP_TO_JUMP_TARGET(); } @@ -5361,6 +5577,7 @@ PyObject *o = PyStackRef_AsPyObjectBorrow(tos); if (!PyDict_CheckExact(o)) { UOP_STAT_INC(uopcode, miss); + _tos_cache0 = tos; SET_CURRENT_CACHED_VALUES(1); JUMP_TO_JUMP_TARGET(); } @@ -5380,6 +5597,8 @@ PyObject *o = PyStackRef_AsPyObjectBorrow(tos); if (!PyDict_CheckExact(o)) { UOP_STAT_INC(uopcode, miss); + _tos_cache1 = tos; + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(2); JUMP_TO_JUMP_TARGET(); } @@ -5401,6 +5620,9 @@ PyObject *o = PyStackRef_AsPyObjectBorrow(tos); if (!PyDict_CheckExact(o)) { UOP_STAT_INC(uopcode, miss); + _tos_cache2 = tos; + _tos_cache1 = _stack_item_1; + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(3); JUMP_TO_JUMP_TARGET(); } @@ -5475,6 +5697,8 @@ PyTypeObject *tp = Py_TYPE(PyStackRef_AsPyObjectBorrow(container)); if (!PyType_HasFeature(tp, Py_TPFLAGS_HEAPTYPE)) { UOP_STAT_INC(uopcode, miss); + _tos_cache1 = _stack_item_1; + _tos_cache0 = container; SET_CURRENT_CACHED_VALUES(2); JUMP_TO_JUMP_TARGET(); } @@ -5482,6 +5706,8 @@ PyObject *getitem_o = FT_ATOMIC_LOAD_PTR_ACQUIRE(ht->_spec_cache.getitem); if (getitem_o == NULL) { UOP_STAT_INC(uopcode, miss); + _tos_cache1 = _stack_item_1; + _tos_cache0 = container; SET_CURRENT_CACHED_VALUES(2); JUMP_TO_JUMP_TARGET(); } @@ -5489,6 +5715,8 @@ uint32_t cached_version = FT_ATOMIC_LOAD_UINT32_RELAXED(ht->_spec_cache.getitem_version); if (((PyFunctionObject *)getitem_o)->func_version != cached_version) { UOP_STAT_INC(uopcode, miss); + _tos_cache1 = _stack_item_1; + _tos_cache0 = container; SET_CURRENT_CACHED_VALUES(2); JUMP_TO_JUMP_TARGET(); } @@ -5496,6 +5724,8 @@ assert(code->co_argcount == 2); if (!_PyThreadState_HasStackSpace(tstate, code->co_framesize)) { UOP_STAT_INC(uopcode, miss); + _tos_cache1 = _stack_item_1; + _tos_cache0 = container; SET_CURRENT_CACHED_VALUES(2); JUMP_TO_JUMP_TARGET(); } @@ -5723,12 +5953,18 @@ assert(PyList_CheckExact(list)); if (!_PyLong_IsNonNegativeCompact((PyLongObject *)sub)) { UOP_STAT_INC(uopcode, miss); + _tos_cache2 = sub_st; + _tos_cache1 = list_st; + _tos_cache0 = value; SET_CURRENT_CACHED_VALUES(3); JUMP_TO_JUMP_TARGET(); } Py_ssize_t index = ((PyLongObject*)sub)->long_value.ob_digit[0]; if (!LOCK_OBJECT(list)) { UOP_STAT_INC(uopcode, miss); + _tos_cache2 = sub_st; + _tos_cache1 = list_st; + _tos_cache0 = value; SET_CURRENT_CACHED_VALUES(3); JUMP_TO_JUMP_TARGET(); } @@ -5736,6 +5972,9 @@ UNLOCK_OBJECT(list); if (true) { UOP_STAT_INC(uopcode, miss); + _tos_cache2 = sub_st; + _tos_cache1 = list_st; + _tos_cache0 = value; SET_CURRENT_CACHED_VALUES(3); JUMP_TO_JUMP_TARGET(); } @@ -6098,11 +6337,15 @@ PyGenObject *gen = (PyGenObject *)PyStackRef_AsPyObjectBorrow(receiver); if (Py_TYPE(gen) != &PyGen_Type && Py_TYPE(gen) != &PyCoro_Type) { UOP_STAT_INC(uopcode, miss); + _tos_cache1 = v; + _tos_cache0 = receiver; SET_CURRENT_CACHED_VALUES(2); JUMP_TO_JUMP_TARGET(); } if (gen->gi_frame_state >= FRAME_EXECUTING) { UOP_STAT_INC(uopcode, miss); + _tos_cache1 = v; + _tos_cache0 = receiver; SET_CURRENT_CACHED_VALUES(2); JUMP_TO_JUMP_TARGET(); } @@ -6402,6 +6645,7 @@ assert(PyTuple_CheckExact(seq_o)); if (PyTuple_GET_SIZE(seq_o) != 2) { UOP_STAT_INC(uopcode, miss); + _tos_cache0 = seq; SET_CURRENT_CACHED_VALUES(1); JUMP_TO_JUMP_TARGET(); } @@ -6438,6 +6682,7 @@ assert(PyTuple_CheckExact(seq_o)); if (PyTuple_GET_SIZE(seq_o) != oparg) { UOP_STAT_INC(uopcode, miss); + _tos_cache0 = seq; SET_CURRENT_CACHED_VALUES(1); JUMP_TO_JUMP_TARGET(); } @@ -6472,6 +6717,7 @@ assert(PyList_CheckExact(seq_o)); if (!LOCK_OBJECT(seq_o)) { UOP_STAT_INC(uopcode, miss); + _tos_cache0 = seq; SET_CURRENT_CACHED_VALUES(1); JUMP_TO_JUMP_TARGET(); } @@ -6479,6 +6725,7 @@ UNLOCK_OBJECT(seq_o); if (true) { UOP_STAT_INC(uopcode, miss); + _tos_cache0 = seq; SET_CURRENT_CACHED_VALUES(1); JUMP_TO_JUMP_TARGET(); } @@ -6681,6 +6928,59 @@ break; } + case _LOAD_LOCALS_r12: { + CHECK_CURRENT_CACHED_VALUES(1); + assert(WITHIN_STACK_BOUNDS_WITH_CACHE()); + _PyStackRef locals; + _PyStackRef _stack_item_0 = _tos_cache0; + PyObject *l = LOCALS(); + if (l == NULL) { + stack_pointer[0] = _stack_item_0; + stack_pointer += 1; + ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__); + _PyFrame_SetStackPointer(frame, stack_pointer); + _PyErr_SetString(tstate, PyExc_SystemError, + "no locals found"); + stack_pointer = _PyFrame_GetStackPointer(frame); + SET_CURRENT_CACHED_VALUES(0); + JUMP_TO_ERROR(); + } + locals = PyStackRef_FromPyObjectNew(l); + _tos_cache1 = locals; + _tos_cache0 = _stack_item_0; + SET_CURRENT_CACHED_VALUES(2); + assert(WITHIN_STACK_BOUNDS_WITH_CACHE()); + break; + } + + case _LOAD_LOCALS_r23: { + CHECK_CURRENT_CACHED_VALUES(2); + assert(WITHIN_STACK_BOUNDS_WITH_CACHE()); + _PyStackRef locals; + _PyStackRef _stack_item_0 = _tos_cache0; + _PyStackRef _stack_item_1 = _tos_cache1; + PyObject *l = LOCALS(); + if (l == NULL) { + stack_pointer[0] = _stack_item_0; + stack_pointer[1] = _stack_item_1; + stack_pointer += 2; + ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__); + _PyFrame_SetStackPointer(frame, stack_pointer); + _PyErr_SetString(tstate, PyExc_SystemError, + "no locals found"); + stack_pointer = _PyFrame_GetStackPointer(frame); + SET_CURRENT_CACHED_VALUES(0); + JUMP_TO_ERROR(); + } + locals = PyStackRef_FromPyObjectNew(l); + _tos_cache2 = locals; + _tos_cache1 = _stack_item_1; + _tos_cache0 = _stack_item_0; + SET_CURRENT_CACHED_VALUES(3); + assert(WITHIN_STACK_BOUNDS_WITH_CACHE()); + break; + } + /* _LOAD_FROM_DICT_OR_GLOBALS is not a viable micro-op for tier 2 because it has both popping and not-popping errors */ case _LOAD_NAME_r01: { @@ -6775,12 +7075,14 @@ PyDictObject *dict = (PyDictObject *)GLOBALS(); if (!PyDict_CheckExact(dict)) { UOP_STAT_INC(uopcode, miss); + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(1); JUMP_TO_JUMP_TARGET(); } PyDictKeysObject *keys = FT_ATOMIC_LOAD_PTR_ACQUIRE(dict->ma_keys); if (FT_ATOMIC_LOAD_UINT32_RELAXED(keys->dk_version) != version) { UOP_STAT_INC(uopcode, miss); + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(1); JUMP_TO_JUMP_TARGET(); } @@ -6800,12 +7102,16 @@ PyDictObject *dict = (PyDictObject *)GLOBALS(); if (!PyDict_CheckExact(dict)) { UOP_STAT_INC(uopcode, miss); + _tos_cache1 = _stack_item_1; + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(2); JUMP_TO_JUMP_TARGET(); } PyDictKeysObject *keys = FT_ATOMIC_LOAD_PTR_ACQUIRE(dict->ma_keys); if (FT_ATOMIC_LOAD_UINT32_RELAXED(keys->dk_version) != version) { UOP_STAT_INC(uopcode, miss); + _tos_cache1 = _stack_item_1; + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(2); JUMP_TO_JUMP_TARGET(); } @@ -6827,12 +7133,18 @@ PyDictObject *dict = (PyDictObject *)GLOBALS(); if (!PyDict_CheckExact(dict)) { UOP_STAT_INC(uopcode, miss); + _tos_cache2 = _stack_item_2; + _tos_cache1 = _stack_item_1; + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(3); JUMP_TO_JUMP_TARGET(); } PyDictKeysObject *keys = FT_ATOMIC_LOAD_PTR_ACQUIRE(dict->ma_keys); if (FT_ATOMIC_LOAD_UINT32_RELAXED(keys->dk_version) != version) { UOP_STAT_INC(uopcode, miss); + _tos_cache2 = _stack_item_2; + _tos_cache1 = _stack_item_1; + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(3); JUMP_TO_JUMP_TARGET(); } @@ -7748,12 +8060,18 @@ assert(!(oparg & 1)); if (global_super != (PyObject *)&PySuper_Type) { UOP_STAT_INC(uopcode, miss); - SET_CURRENT_CACHED_VALUES(0); + _tos_cache2 = self_st; + _tos_cache1 = class_st; + _tos_cache0 = global_super_st; + SET_CURRENT_CACHED_VALUES(3); JUMP_TO_JUMP_TARGET(); } if (!PyType_Check(class)) { UOP_STAT_INC(uopcode, miss); - SET_CURRENT_CACHED_VALUES(0); + _tos_cache2 = self_st; + _tos_cache1 = class_st; + _tos_cache0 = global_super_st; + SET_CURRENT_CACHED_VALUES(3); JUMP_TO_JUMP_TARGET(); } STAT_INC(LOAD_SUPER_ATTR, hit); @@ -7814,12 +8132,18 @@ assert(oparg & 1); if (global_super != (PyObject *)&PySuper_Type) { UOP_STAT_INC(uopcode, miss); - SET_CURRENT_CACHED_VALUES(0); + _tos_cache2 = self_st; + _tos_cache1 = class_st; + _tos_cache0 = global_super_st; + SET_CURRENT_CACHED_VALUES(3); JUMP_TO_JUMP_TARGET(); } if (!PyType_Check(class)) { UOP_STAT_INC(uopcode, miss); - SET_CURRENT_CACHED_VALUES(0); + _tos_cache2 = self_st; + _tos_cache1 = class_st; + _tos_cache0 = global_super_st; + SET_CURRENT_CACHED_VALUES(3); JUMP_TO_JUMP_TARGET(); } STAT_INC(LOAD_SUPER_ATTR, hit); @@ -7975,6 +8299,7 @@ assert(type_version != 0); if (FT_ATOMIC_LOAD_UINT_RELAXED(tp->tp_version_tag) != type_version) { UOP_STAT_INC(uopcode, miss); + _tos_cache0 = owner; SET_CURRENT_CACHED_VALUES(1); JUMP_TO_JUMP_TARGET(); } @@ -7996,6 +8321,8 @@ assert(type_version != 0); if (FT_ATOMIC_LOAD_UINT_RELAXED(tp->tp_version_tag) != type_version) { UOP_STAT_INC(uopcode, miss); + _tos_cache1 = owner; + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(2); JUMP_TO_JUMP_TARGET(); } @@ -8019,6 +8346,9 @@ assert(type_version != 0); if (FT_ATOMIC_LOAD_UINT_RELAXED(tp->tp_version_tag) != type_version) { UOP_STAT_INC(uopcode, miss); + _tos_cache2 = owner; + _tos_cache1 = _stack_item_1; + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(3); JUMP_TO_JUMP_TARGET(); } @@ -8071,6 +8401,7 @@ assert(type_version != 0); if (!LOCK_OBJECT(owner_o)) { UOP_STAT_INC(uopcode, miss); + _tos_cache0 = owner; SET_CURRENT_CACHED_VALUES(1); JUMP_TO_JUMP_TARGET(); } @@ -8079,6 +8410,7 @@ UNLOCK_OBJECT(owner_o); if (true) { UOP_STAT_INC(uopcode, miss); + _tos_cache0 = owner; SET_CURRENT_CACHED_VALUES(1); JUMP_TO_JUMP_TARGET(); } @@ -8101,6 +8433,8 @@ assert(type_version != 0); if (!LOCK_OBJECT(owner_o)) { UOP_STAT_INC(uopcode, miss); + _tos_cache1 = owner; + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(2); JUMP_TO_JUMP_TARGET(); } @@ -8109,6 +8443,8 @@ UNLOCK_OBJECT(owner_o); if (true) { UOP_STAT_INC(uopcode, miss); + _tos_cache1 = owner; + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(2); JUMP_TO_JUMP_TARGET(); } @@ -8133,6 +8469,9 @@ assert(type_version != 0); if (!LOCK_OBJECT(owner_o)) { UOP_STAT_INC(uopcode, miss); + _tos_cache2 = owner; + _tos_cache1 = _stack_item_1; + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(3); JUMP_TO_JUMP_TARGET(); } @@ -8141,6 +8480,9 @@ UNLOCK_OBJECT(owner_o); if (true) { UOP_STAT_INC(uopcode, miss); + _tos_cache2 = owner; + _tos_cache1 = _stack_item_1; + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(3); JUMP_TO_JUMP_TARGET(); } @@ -8185,6 +8527,7 @@ assert(Py_TYPE(owner_o)->tp_flags & Py_TPFLAGS_INLINE_VALUES); if (!FT_ATOMIC_LOAD_UINT8(_PyObject_InlineValues(owner_o)->valid)) { UOP_STAT_INC(uopcode, miss); + _tos_cache0 = owner; SET_CURRENT_CACHED_VALUES(1); JUMP_TO_JUMP_TARGET(); } @@ -8206,6 +8549,8 @@ assert(Py_TYPE(owner_o)->tp_flags & Py_TPFLAGS_INLINE_VALUES); if (!FT_ATOMIC_LOAD_UINT8(_PyObject_InlineValues(owner_o)->valid)) { UOP_STAT_INC(uopcode, miss); + _tos_cache1 = owner; + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(2); JUMP_TO_JUMP_TARGET(); } @@ -8229,6 +8574,9 @@ assert(Py_TYPE(owner_o)->tp_flags & Py_TPFLAGS_INLINE_VALUES); if (!FT_ATOMIC_LOAD_UINT8(_PyObject_InlineValues(owner_o)->valid)) { UOP_STAT_INC(uopcode, miss); + _tos_cache2 = owner; + _tos_cache1 = _stack_item_1; + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(3); JUMP_TO_JUMP_TARGET(); } @@ -8253,6 +8601,7 @@ PyObject *attr_o = FT_ATOMIC_LOAD_PTR_ACQUIRE(*value_ptr); if (attr_o == NULL) { UOP_STAT_INC(uopcode, miss); + _tos_cache0 = owner; SET_CURRENT_CACHED_VALUES(1); JUMP_TO_JUMP_TARGET(); } @@ -8261,6 +8610,7 @@ if (!increfed) { if (true) { UOP_STAT_INC(uopcode, miss); + _tos_cache0 = owner; SET_CURRENT_CACHED_VALUES(1); JUMP_TO_JUMP_TARGET(); } @@ -8297,6 +8647,7 @@ PyObject *owner_o = PyStackRef_AsPyObjectBorrow(owner); if (Py_TYPE(owner_o)->tp_getattro != PyModule_Type.tp_getattro) { UOP_STAT_INC(uopcode, miss); + _tos_cache0 = owner; SET_CURRENT_CACHED_VALUES(1); JUMP_TO_JUMP_TARGET(); } @@ -8305,6 +8656,7 @@ PyDictKeysObject *keys = FT_ATOMIC_LOAD_PTR_ACQUIRE(dict->ma_keys); if (FT_ATOMIC_LOAD_UINT32_RELAXED(keys->dk_version) != dict_version) { UOP_STAT_INC(uopcode, miss); + _tos_cache0 = owner; SET_CURRENT_CACHED_VALUES(1); JUMP_TO_JUMP_TARGET(); } @@ -8314,6 +8666,7 @@ PyObject *attr_o = FT_ATOMIC_LOAD_PTR_RELAXED(ep->me_value); if (attr_o == NULL) { UOP_STAT_INC(uopcode, miss); + _tos_cache0 = owner; SET_CURRENT_CACHED_VALUES(1); JUMP_TO_JUMP_TARGET(); } @@ -8322,6 +8675,7 @@ if (!increfed) { if (true) { UOP_STAT_INC(uopcode, miss); + _tos_cache0 = owner; SET_CURRENT_CACHED_VALUES(1); JUMP_TO_JUMP_TARGET(); } @@ -8360,6 +8714,7 @@ PyDictObject *dict = _PyObject_GetManagedDict(owner_o); if (dict == NULL) { UOP_STAT_INC(uopcode, miss); + _tos_cache0 = owner; SET_CURRENT_CACHED_VALUES(1); JUMP_TO_JUMP_TARGET(); } @@ -8368,6 +8723,7 @@ #ifdef Py_GIL_DISABLED if (!_Py_IsOwnedByCurrentThread((PyObject *)dict) && !_PyObject_GC_IS_SHARED(dict)) { UOP_STAT_INC(uopcode, miss); + _tos_cache0 = owner; SET_CURRENT_CACHED_VALUES(1); JUMP_TO_JUMP_TARGET(); } @@ -8376,6 +8732,7 @@ if (hint >= (size_t)FT_ATOMIC_LOAD_SSIZE_RELAXED(dk->dk_nentries)) { if (true) { UOP_STAT_INC(uopcode, miss); + _tos_cache0 = owner; SET_CURRENT_CACHED_VALUES(1); JUMP_TO_JUMP_TARGET(); } @@ -8384,6 +8741,7 @@ if (dk->dk_kind != DICT_KEYS_UNICODE) { if (true) { UOP_STAT_INC(uopcode, miss); + _tos_cache0 = owner; SET_CURRENT_CACHED_VALUES(1); JUMP_TO_JUMP_TARGET(); } @@ -8392,6 +8750,7 @@ if (FT_ATOMIC_LOAD_PTR_RELAXED(ep->me_key) != name) { if (true) { UOP_STAT_INC(uopcode, miss); + _tos_cache0 = owner; SET_CURRENT_CACHED_VALUES(1); JUMP_TO_JUMP_TARGET(); } @@ -8400,6 +8759,7 @@ if (attr_o == NULL) { if (true) { UOP_STAT_INC(uopcode, miss); + _tos_cache0 = owner; SET_CURRENT_CACHED_VALUES(1); JUMP_TO_JUMP_TARGET(); } @@ -8410,6 +8770,7 @@ if (!increfed) { if (true) { UOP_STAT_INC(uopcode, miss); + _tos_cache0 = owner; SET_CURRENT_CACHED_VALUES(1); JUMP_TO_JUMP_TARGET(); } @@ -8446,6 +8807,7 @@ PyObject *attr_o = FT_ATOMIC_LOAD_PTR(*addr); if (attr_o == NULL) { UOP_STAT_INC(uopcode, miss); + _tos_cache0 = owner; SET_CURRENT_CACHED_VALUES(1); JUMP_TO_JUMP_TARGET(); } @@ -8453,6 +8815,7 @@ int increfed = _Py_TryIncrefCompareStackRef(addr, attr_o, &attr); if (!increfed) { UOP_STAT_INC(uopcode, miss); + _tos_cache0 = owner; SET_CURRENT_CACHED_VALUES(1); JUMP_TO_JUMP_TARGET(); } @@ -8515,12 +8878,14 @@ PyObject *owner_o = PyStackRef_AsPyObjectBorrow(owner); if (!PyType_Check(owner_o)) { UOP_STAT_INC(uopcode, miss); + _tos_cache0 = owner; SET_CURRENT_CACHED_VALUES(1); JUMP_TO_JUMP_TARGET(); } assert(type_version != 0); if (FT_ATOMIC_LOAD_UINT_RELAXED(((PyTypeObject *)owner_o)->tp_version_tag) != type_version) { UOP_STAT_INC(uopcode, miss); + _tos_cache0 = owner; SET_CURRENT_CACHED_VALUES(1); JUMP_TO_JUMP_TARGET(); } @@ -8541,12 +8906,16 @@ PyObject *owner_o = PyStackRef_AsPyObjectBorrow(owner); if (!PyType_Check(owner_o)) { UOP_STAT_INC(uopcode, miss); + _tos_cache1 = owner; + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(2); JUMP_TO_JUMP_TARGET(); } assert(type_version != 0); if (FT_ATOMIC_LOAD_UINT_RELAXED(((PyTypeObject *)owner_o)->tp_version_tag) != type_version) { UOP_STAT_INC(uopcode, miss); + _tos_cache1 = owner; + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(2); JUMP_TO_JUMP_TARGET(); } @@ -8569,12 +8938,18 @@ PyObject *owner_o = PyStackRef_AsPyObjectBorrow(owner); if (!PyType_Check(owner_o)) { UOP_STAT_INC(uopcode, miss); + _tos_cache2 = owner; + _tos_cache1 = _stack_item_1; + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(3); JUMP_TO_JUMP_TARGET(); } assert(type_version != 0); if (FT_ATOMIC_LOAD_UINT_RELAXED(((PyTypeObject *)owner_o)->tp_version_tag) != type_version) { UOP_STAT_INC(uopcode, miss); + _tos_cache2 = owner; + _tos_cache1 = _stack_item_1; + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(3); JUMP_TO_JUMP_TARGET(); } @@ -8631,21 +9006,25 @@ PyCodeObject *code = (PyCodeObject *)f->func_code; if ((code->co_flags & (CO_VARKEYWORDS | CO_VARARGS | CO_OPTIMIZED)) != CO_OPTIMIZED) { UOP_STAT_INC(uopcode, miss); + _tos_cache0 = owner; SET_CURRENT_CACHED_VALUES(1); JUMP_TO_JUMP_TARGET(); } if (code->co_kwonlyargcount) { UOP_STAT_INC(uopcode, miss); + _tos_cache0 = owner; SET_CURRENT_CACHED_VALUES(1); JUMP_TO_JUMP_TARGET(); } if (code->co_argcount != 1) { UOP_STAT_INC(uopcode, miss); + _tos_cache0 = owner; SET_CURRENT_CACHED_VALUES(1); JUMP_TO_JUMP_TARGET(); } if (!_PyThreadState_HasStackSpace(tstate, code->co_framesize)) { UOP_STAT_INC(uopcode, miss); + _tos_cache0 = owner; SET_CURRENT_CACHED_VALUES(1); JUMP_TO_JUMP_TARGET(); } @@ -8702,6 +9081,7 @@ UNLOCK_OBJECT(owner_o); if (true) { UOP_STAT_INC(uopcode, miss); + _tos_cache0 = owner; SET_CURRENT_CACHED_VALUES(1); JUMP_TO_JUMP_TARGET(); } @@ -8727,6 +9107,8 @@ UNLOCK_OBJECT(owner_o); if (true) { UOP_STAT_INC(uopcode, miss); + _tos_cache1 = owner; + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(2); JUMP_TO_JUMP_TARGET(); } @@ -8754,6 +9136,9 @@ UNLOCK_OBJECT(owner_o); if (true) { UOP_STAT_INC(uopcode, miss); + _tos_cache2 = owner; + _tos_cache1 = _stack_item_1; + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(3); JUMP_TO_JUMP_TARGET(); } @@ -8816,12 +9201,16 @@ PyDictObject *dict = _PyObject_GetManagedDict(owner_o); if (dict == NULL) { UOP_STAT_INC(uopcode, miss); - SET_CURRENT_CACHED_VALUES(0); + _tos_cache1 = owner; + _tos_cache0 = value; + SET_CURRENT_CACHED_VALUES(2); JUMP_TO_JUMP_TARGET(); } if (!LOCK_OBJECT(dict)) { UOP_STAT_INC(uopcode, miss); - SET_CURRENT_CACHED_VALUES(0); + _tos_cache1 = owner; + _tos_cache0 = value; + SET_CURRENT_CACHED_VALUES(2); JUMP_TO_JUMP_TARGET(); } assert(PyDict_CheckExact((PyObject *)dict)); @@ -8831,7 +9220,9 @@ UNLOCK_OBJECT(dict); if (true) { UOP_STAT_INC(uopcode, miss); - SET_CURRENT_CACHED_VALUES(0); + _tos_cache1 = owner; + _tos_cache0 = value; + SET_CURRENT_CACHED_VALUES(2); JUMP_TO_JUMP_TARGET(); } } @@ -8840,7 +9231,9 @@ UNLOCK_OBJECT(dict); if (true) { UOP_STAT_INC(uopcode, miss); - SET_CURRENT_CACHED_VALUES(0); + _tos_cache1 = owner; + _tos_cache0 = value; + SET_CURRENT_CACHED_VALUES(2); JUMP_TO_JUMP_TARGET(); } } @@ -8849,7 +9242,9 @@ UNLOCK_OBJECT(dict); if (true) { UOP_STAT_INC(uopcode, miss); - SET_CURRENT_CACHED_VALUES(0); + _tos_cache1 = owner; + _tos_cache0 = value; + SET_CURRENT_CACHED_VALUES(2); JUMP_TO_JUMP_TARGET(); } } @@ -8890,6 +9285,8 @@ PyObject *owner_o = PyStackRef_AsPyObjectBorrow(owner); if (!LOCK_OBJECT(owner_o)) { UOP_STAT_INC(uopcode, miss); + _tos_cache1 = owner; + _tos_cache0 = value; SET_CURRENT_CACHED_VALUES(2); JUMP_TO_JUMP_TARGET(); } @@ -9239,6 +9636,7 @@ PyObject *o = PyStackRef_AsPyObjectBorrow(tos); if (!PyAnySet_CheckExact(o)) { UOP_STAT_INC(uopcode, miss); + _tos_cache0 = tos; SET_CURRENT_CACHED_VALUES(1); JUMP_TO_JUMP_TARGET(); } @@ -9258,6 +9656,8 @@ PyObject *o = PyStackRef_AsPyObjectBorrow(tos); if (!PyAnySet_CheckExact(o)) { UOP_STAT_INC(uopcode, miss); + _tos_cache1 = tos; + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(2); JUMP_TO_JUMP_TARGET(); } @@ -9279,6 +9679,9 @@ PyObject *o = PyStackRef_AsPyObjectBorrow(tos); if (!PyAnySet_CheckExact(o)) { UOP_STAT_INC(uopcode, miss); + _tos_cache2 = tos; + _tos_cache1 = _stack_item_1; + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(3); JUMP_TO_JUMP_TARGET(); } @@ -9968,7 +10371,11 @@ } if (true) { UOP_STAT_INC(uopcode, miss); - SET_CURRENT_CACHED_VALUES(0); + _tos_cache1 = null_or_index; + _tos_cache0 = iter; + SET_CURRENT_CACHED_VALUES(2); + stack_pointer += -2; + ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__); JUMP_TO_JUMP_TARGET(); } } @@ -10026,6 +10433,7 @@ PyObject *iter_o = PyStackRef_AsPyObjectBorrow(iter); if (Py_TYPE(iter_o) != &PyList_Type) { UOP_STAT_INC(uopcode, miss); + _tos_cache0 = null_or_index; SET_CURRENT_CACHED_VALUES(1); JUMP_TO_JUMP_TARGET(); } @@ -10033,6 +10441,7 @@ #ifdef Py_GIL_DISABLED if (!_Py_IsOwnedByCurrentThread(iter_o) && !_PyObject_GC_IS_SHARED(iter_o)) { UOP_STAT_INC(uopcode, miss); + _tos_cache0 = null_or_index; SET_CURRENT_CACHED_VALUES(1); JUMP_TO_JUMP_TARGET(); } @@ -10058,6 +10467,8 @@ PyObject *iter_o = PyStackRef_AsPyObjectBorrow(iter); if (Py_TYPE(iter_o) != &PyList_Type) { UOP_STAT_INC(uopcode, miss); + _tos_cache1 = null_or_index; + _tos_cache0 = iter; SET_CURRENT_CACHED_VALUES(2); JUMP_TO_JUMP_TARGET(); } @@ -10065,6 +10476,8 @@ #ifdef Py_GIL_DISABLED if (!_Py_IsOwnedByCurrentThread(iter_o) && !_PyObject_GC_IS_SHARED(iter_o)) { UOP_STAT_INC(uopcode, miss); + _tos_cache1 = null_or_index; + _tos_cache0 = iter; SET_CURRENT_CACHED_VALUES(2); JUMP_TO_JUMP_TARGET(); } @@ -10089,6 +10502,9 @@ PyObject *iter_o = PyStackRef_AsPyObjectBorrow(iter); if (Py_TYPE(iter_o) != &PyList_Type) { UOP_STAT_INC(uopcode, miss); + _tos_cache2 = null_or_index; + _tos_cache1 = iter; + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(3); JUMP_TO_JUMP_TARGET(); } @@ -10096,6 +10512,9 @@ #ifdef Py_GIL_DISABLED if (!_Py_IsOwnedByCurrentThread(iter_o) && !_PyObject_GC_IS_SHARED(iter_o)) { UOP_STAT_INC(uopcode, miss); + _tos_cache2 = null_or_index; + _tos_cache1 = iter; + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(3); JUMP_TO_JUMP_TARGET(); } @@ -10148,6 +10567,7 @@ assert(Py_TYPE(list_o) == &PyList_Type); if ((size_t)PyStackRef_UntagInt(null_or_index) >= (size_t)PyList_GET_SIZE(list_o)) { UOP_STAT_INC(uopcode, miss); + _tos_cache0 = null_or_index; SET_CURRENT_CACHED_VALUES(1); JUMP_TO_JUMP_TARGET(); } @@ -10175,6 +10595,8 @@ assert(Py_TYPE(list_o) == &PyList_Type); if ((size_t)PyStackRef_UntagInt(null_or_index) >= (size_t)PyList_GET_SIZE(list_o)) { UOP_STAT_INC(uopcode, miss); + _tos_cache1 = null_or_index; + _tos_cache0 = iter; SET_CURRENT_CACHED_VALUES(2); JUMP_TO_JUMP_TARGET(); } @@ -10201,6 +10623,9 @@ assert(Py_TYPE(list_o) == &PyList_Type); if ((size_t)PyStackRef_UntagInt(null_or_index) >= (size_t)PyList_GET_SIZE(list_o)) { UOP_STAT_INC(uopcode, miss); + _tos_cache2 = null_or_index; + _tos_cache1 = iter; + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(3); JUMP_TO_JUMP_TARGET(); } @@ -10240,7 +10665,11 @@ stack_pointer = _PyFrame_GetStackPointer(frame); if (result <= 0) { UOP_STAT_INC(uopcode, miss); - SET_CURRENT_CACHED_VALUES(0); + _tos_cache1 = null_or_index; + _tos_cache0 = iter; + SET_CURRENT_CACHED_VALUES(2); + stack_pointer += -2; + ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__); JUMP_TO_JUMP_TARGET(); } #else @@ -10293,6 +10722,7 @@ PyObject *iter_o = PyStackRef_AsPyObjectBorrow(iter); if (Py_TYPE(iter_o) != &PyTuple_Type) { UOP_STAT_INC(uopcode, miss); + _tos_cache0 = null_or_index; SET_CURRENT_CACHED_VALUES(1); JUMP_TO_JUMP_TARGET(); } @@ -10318,6 +10748,8 @@ PyObject *iter_o = PyStackRef_AsPyObjectBorrow(iter); if (Py_TYPE(iter_o) != &PyTuple_Type) { UOP_STAT_INC(uopcode, miss); + _tos_cache1 = null_or_index; + _tos_cache0 = iter; SET_CURRENT_CACHED_VALUES(2); JUMP_TO_JUMP_TARGET(); } @@ -10342,6 +10774,9 @@ PyObject *iter_o = PyStackRef_AsPyObjectBorrow(iter); if (Py_TYPE(iter_o) != &PyTuple_Type) { UOP_STAT_INC(uopcode, miss); + _tos_cache2 = null_or_index; + _tos_cache1 = iter; + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(3); JUMP_TO_JUMP_TARGET(); } @@ -10391,6 +10826,7 @@ assert(Py_TYPE(tuple_o) == &PyTuple_Type); if ((size_t)PyStackRef_UntagInt(null_or_index) >= (size_t)PyTuple_GET_SIZE(tuple_o)) { UOP_STAT_INC(uopcode, miss); + _tos_cache0 = null_or_index; SET_CURRENT_CACHED_VALUES(1); JUMP_TO_JUMP_TARGET(); } @@ -10416,6 +10852,8 @@ assert(Py_TYPE(tuple_o) == &PyTuple_Type); if ((size_t)PyStackRef_UntagInt(null_or_index) >= (size_t)PyTuple_GET_SIZE(tuple_o)) { UOP_STAT_INC(uopcode, miss); + _tos_cache1 = null_or_index; + _tos_cache0 = iter; SET_CURRENT_CACHED_VALUES(2); JUMP_TO_JUMP_TARGET(); } @@ -10440,6 +10878,9 @@ assert(Py_TYPE(tuple_o) == &PyTuple_Type); if ((size_t)PyStackRef_UntagInt(null_or_index) >= (size_t)PyTuple_GET_SIZE(tuple_o)) { UOP_STAT_INC(uopcode, miss); + _tos_cache2 = null_or_index; + _tos_cache1 = iter; + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(3); JUMP_TO_JUMP_TARGET(); } @@ -10560,12 +11001,14 @@ _PyRangeIterObject *r = (_PyRangeIterObject *)PyStackRef_AsPyObjectBorrow(iter); if (Py_TYPE(r) != &PyRangeIter_Type) { UOP_STAT_INC(uopcode, miss); + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(1); JUMP_TO_JUMP_TARGET(); } #ifdef Py_GIL_DISABLED if (!_PyObject_IsUniquelyReferenced((PyObject *)r)) { UOP_STAT_INC(uopcode, miss); + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(1); JUMP_TO_JUMP_TARGET(); } @@ -10589,12 +11032,16 @@ _PyRangeIterObject *r = (_PyRangeIterObject *)PyStackRef_AsPyObjectBorrow(iter); if (Py_TYPE(r) != &PyRangeIter_Type) { UOP_STAT_INC(uopcode, miss); + _tos_cache1 = _stack_item_1; + _tos_cache0 = iter; SET_CURRENT_CACHED_VALUES(2); JUMP_TO_JUMP_TARGET(); } #ifdef Py_GIL_DISABLED if (!_PyObject_IsUniquelyReferenced((PyObject *)r)) { UOP_STAT_INC(uopcode, miss); + _tos_cache1 = _stack_item_1; + _tos_cache0 = iter; SET_CURRENT_CACHED_VALUES(2); JUMP_TO_JUMP_TARGET(); } @@ -10617,12 +11064,18 @@ _PyRangeIterObject *r = (_PyRangeIterObject *)PyStackRef_AsPyObjectBorrow(iter); if (Py_TYPE(r) != &PyRangeIter_Type) { UOP_STAT_INC(uopcode, miss); + _tos_cache2 = _stack_item_2; + _tos_cache1 = iter; + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(3); JUMP_TO_JUMP_TARGET(); } #ifdef Py_GIL_DISABLED if (!_PyObject_IsUniquelyReferenced((PyObject *)r)) { UOP_STAT_INC(uopcode, miss); + _tos_cache2 = _stack_item_2; + _tos_cache1 = iter; + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(3); JUMP_TO_JUMP_TARGET(); } @@ -10668,6 +11121,7 @@ assert(Py_TYPE(r) == &PyRangeIter_Type); if (r->len <= 0) { UOP_STAT_INC(uopcode, miss); + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(1); JUMP_TO_JUMP_TARGET(); } @@ -10691,6 +11145,8 @@ assert(Py_TYPE(r) == &PyRangeIter_Type); if (r->len <= 0) { UOP_STAT_INC(uopcode, miss); + _tos_cache1 = _stack_item_1; + _tos_cache0 = iter; SET_CURRENT_CACHED_VALUES(2); JUMP_TO_JUMP_TARGET(); } @@ -10713,6 +11169,9 @@ assert(Py_TYPE(r) == &PyRangeIter_Type); if (r->len <= 0) { UOP_STAT_INC(uopcode, miss); + _tos_cache2 = _stack_item_2; + _tos_cache1 = iter; + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(3); JUMP_TO_JUMP_TARGET(); } @@ -10837,6 +11296,8 @@ PyGenObject *gen = (PyGenObject *)PyStackRef_AsPyObjectBorrow(iter); if (Py_TYPE(gen) != &PyGen_Type) { UOP_STAT_INC(uopcode, miss); + _tos_cache1 = _stack_item_1; + _tos_cache0 = iter; SET_CURRENT_CACHED_VALUES(2); JUMP_TO_JUMP_TARGET(); } @@ -10844,12 +11305,16 @@ if (!_PyObject_IsUniquelyReferenced((PyObject *)gen)) { UOP_STAT_INC(uopcode, miss); + _tos_cache1 = _stack_item_1; + _tos_cache0 = iter; SET_CURRENT_CACHED_VALUES(2); JUMP_TO_JUMP_TARGET(); } #endif if (gen->gi_frame_state >= FRAME_EXECUTING) { UOP_STAT_INC(uopcode, miss); + _tos_cache1 = _stack_item_1; + _tos_cache0 = iter; SET_CURRENT_CACHED_VALUES(2); JUMP_TO_JUMP_TARGET(); } @@ -11085,6 +11550,7 @@ PyDictValues *ivs = _PyObject_InlineValues(owner_o); if (!FT_ATOMIC_LOAD_UINT8(ivs->valid)) { UOP_STAT_INC(uopcode, miss); + _tos_cache0 = owner; SET_CURRENT_CACHED_VALUES(1); JUMP_TO_JUMP_TARGET(); } @@ -11106,6 +11572,8 @@ PyDictValues *ivs = _PyObject_InlineValues(owner_o); if (!FT_ATOMIC_LOAD_UINT8(ivs->valid)) { UOP_STAT_INC(uopcode, miss); + _tos_cache1 = owner; + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(2); JUMP_TO_JUMP_TARGET(); } @@ -11129,6 +11597,9 @@ PyDictValues *ivs = _PyObject_InlineValues(owner_o); if (!FT_ATOMIC_LOAD_UINT8(ivs->valid)) { UOP_STAT_INC(uopcode, miss); + _tos_cache2 = owner; + _tos_cache1 = _stack_item_1; + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(3); JUMP_TO_JUMP_TARGET(); } @@ -11174,6 +11645,7 @@ PyDictKeysObject *keys = owner_heap_type->ht_cached_keys; if (FT_ATOMIC_LOAD_UINT32_RELAXED(keys->dk_version) != keys_version) { UOP_STAT_INC(uopcode, miss); + _tos_cache0 = owner; SET_CURRENT_CACHED_VALUES(1); JUMP_TO_JUMP_TARGET(); } @@ -11196,6 +11668,8 @@ PyDictKeysObject *keys = owner_heap_type->ht_cached_keys; if (FT_ATOMIC_LOAD_UINT32_RELAXED(keys->dk_version) != keys_version) { UOP_STAT_INC(uopcode, miss); + _tos_cache1 = owner; + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(2); JUMP_TO_JUMP_TARGET(); } @@ -11220,6 +11694,9 @@ PyDictKeysObject *keys = owner_heap_type->ht_cached_keys; if (FT_ATOMIC_LOAD_UINT32_RELAXED(keys->dk_version) != keys_version) { UOP_STAT_INC(uopcode, miss); + _tos_cache2 = owner; + _tos_cache1 = _stack_item_1; + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(3); JUMP_TO_JUMP_TARGET(); } @@ -11459,6 +11936,7 @@ PyObject *dict = FT_ATOMIC_LOAD_PTR_ACQUIRE(*(PyObject **)ptr); if (dict != NULL) { UOP_STAT_INC(uopcode, miss); + _tos_cache0 = owner; SET_CURRENT_CACHED_VALUES(1); JUMP_TO_JUMP_TARGET(); } @@ -11480,6 +11958,8 @@ PyObject *dict = FT_ATOMIC_LOAD_PTR_ACQUIRE(*(PyObject **)ptr); if (dict != NULL) { UOP_STAT_INC(uopcode, miss); + _tos_cache1 = owner; + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(2); JUMP_TO_JUMP_TARGET(); } @@ -11503,6 +11983,9 @@ PyObject *dict = FT_ATOMIC_LOAD_PTR_ACQUIRE(*(PyObject **)ptr); if (dict != NULL) { UOP_STAT_INC(uopcode, miss); + _tos_cache2 = owner; + _tos_cache1 = _stack_item_1; + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(3); JUMP_TO_JUMP_TARGET(); } @@ -11713,6 +12196,7 @@ PyFunctionObject *func = (PyFunctionObject *)callable_o; if (func->func_version != func_version) { UOP_STAT_INC(uopcode, miss); + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(1); JUMP_TO_JUMP_TARGET(); } @@ -11733,6 +12217,8 @@ PyFunctionObject *func = (PyFunctionObject *)callable_o; if (func->func_version != func_version) { UOP_STAT_INC(uopcode, miss); + _tos_cache1 = _stack_item_1; + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(2); JUMP_TO_JUMP_TARGET(); } @@ -11755,6 +12241,9 @@ PyFunctionObject *func = (PyFunctionObject *)callable_o; if (func->func_version != func_version) { UOP_STAT_INC(uopcode, miss); + _tos_cache2 = _stack_item_2; + _tos_cache1 = _stack_item_1; + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(3); JUMP_TO_JUMP_TARGET(); } @@ -11965,6 +12454,7 @@ _PyStackRef _stack_item_0 = _tos_cache0; if (tstate->interp->eval_frame) { UOP_STAT_INC(uopcode, miss); + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(1); JUMP_TO_JUMP_TARGET(); } @@ -11981,6 +12471,8 @@ _PyStackRef _stack_item_1 = _tos_cache1; if (tstate->interp->eval_frame) { UOP_STAT_INC(uopcode, miss); + _tos_cache1 = _stack_item_1; + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(2); JUMP_TO_JUMP_TARGET(); } @@ -11999,6 +12491,9 @@ _PyStackRef _stack_item_2 = _tos_cache2; if (tstate->interp->eval_frame) { UOP_STAT_INC(uopcode, miss); + _tos_cache2 = _stack_item_2; + _tos_cache1 = _stack_item_1; + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(3); JUMP_TO_JUMP_TARGET(); } @@ -12070,6 +12565,7 @@ _PyStackRef _stack_item_0 = _tos_cache0; if (tstate->py_recursion_remaining <= 1) { UOP_STAT_INC(uopcode, miss); + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(1); JUMP_TO_JUMP_TARGET(); } @@ -12086,6 +12582,8 @@ _PyStackRef _stack_item_1 = _tos_cache1; if (tstate->py_recursion_remaining <= 1) { UOP_STAT_INC(uopcode, miss); + _tos_cache1 = _stack_item_1; + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(2); JUMP_TO_JUMP_TARGET(); } @@ -12104,6 +12602,9 @@ _PyStackRef _stack_item_2 = _tos_cache2; if (tstate->py_recursion_remaining <= 1) { UOP_STAT_INC(uopcode, miss); + _tos_cache2 = _stack_item_2; + _tos_cache1 = _stack_item_1; + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(3); JUMP_TO_JUMP_TARGET(); } @@ -12336,6 +12837,7 @@ null = stack_pointer[-1]; if (!PyStackRef_IsNull(null)) { UOP_STAT_INC(uopcode, miss); + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(1); JUMP_TO_JUMP_TARGET(); } @@ -12357,6 +12859,8 @@ null = _stack_item_0; if (!PyStackRef_IsNull(null)) { UOP_STAT_INC(uopcode, miss); + _tos_cache1 = _stack_item_1; + _tos_cache0 = null; SET_CURRENT_CACHED_VALUES(2); JUMP_TO_JUMP_TARGET(); } @@ -12377,6 +12881,9 @@ null = _stack_item_1; if (!PyStackRef_IsNull(null)) { UOP_STAT_INC(uopcode, miss); + _tos_cache2 = _stack_item_2; + _tos_cache1 = null; + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(3); JUMP_TO_JUMP_TARGET(); } @@ -12417,6 +12924,7 @@ PyObject *o = PyStackRef_AsPyObjectBorrow(nos); if (o == NULL) { UOP_STAT_INC(uopcode, miss); + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(1); JUMP_TO_JUMP_TARGET(); } @@ -12439,6 +12947,8 @@ PyObject *o = PyStackRef_AsPyObjectBorrow(nos); if (o == NULL) { UOP_STAT_INC(uopcode, miss); + _tos_cache1 = _stack_item_1; + _tos_cache0 = nos; SET_CURRENT_CACHED_VALUES(2); JUMP_TO_JUMP_TARGET(); } @@ -12460,6 +12970,9 @@ PyObject *o = PyStackRef_AsPyObjectBorrow(nos); if (o == NULL) { UOP_STAT_INC(uopcode, miss); + _tos_cache2 = _stack_item_2; + _tos_cache1 = nos; + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(3); JUMP_TO_JUMP_TARGET(); } @@ -12499,6 +13012,7 @@ null = stack_pointer[-2]; if (!PyStackRef_IsNull(null)) { UOP_STAT_INC(uopcode, miss); + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(1); JUMP_TO_JUMP_TARGET(); } @@ -12521,6 +13035,8 @@ null = stack_pointer[-1]; if (!PyStackRef_IsNull(null)) { UOP_STAT_INC(uopcode, miss); + _tos_cache1 = _stack_item_1; + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(2); JUMP_TO_JUMP_TARGET(); } @@ -12544,6 +13060,9 @@ null = _stack_item_0; if (!PyStackRef_IsNull(null)) { UOP_STAT_INC(uopcode, miss); + _tos_cache2 = _stack_item_2; + _tos_cache1 = _stack_item_1; + _tos_cache0 = null; SET_CURRENT_CACHED_VALUES(3); JUMP_TO_JUMP_TARGET(); } @@ -12585,6 +13104,7 @@ PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable); if (callable_o != (PyObject *)&PyType_Type) { UOP_STAT_INC(uopcode, miss); + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(1); JUMP_TO_JUMP_TARGET(); } @@ -12608,6 +13128,8 @@ PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable); if (callable_o != (PyObject *)&PyType_Type) { UOP_STAT_INC(uopcode, miss); + _tos_cache1 = _stack_item_1; + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(2); JUMP_TO_JUMP_TARGET(); } @@ -12632,6 +13154,9 @@ PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable); if (callable_o != (PyObject *)&PyType_Type) { UOP_STAT_INC(uopcode, miss); + _tos_cache2 = _stack_item_2; + _tos_cache1 = _stack_item_1; + _tos_cache0 = callable; SET_CURRENT_CACHED_VALUES(3); JUMP_TO_JUMP_TARGET(); } @@ -12709,6 +13234,7 @@ PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable); if (callable_o != (PyObject *)&PyUnicode_Type) { UOP_STAT_INC(uopcode, miss); + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(1); JUMP_TO_JUMP_TARGET(); } @@ -12732,6 +13258,8 @@ PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable); if (callable_o != (PyObject *)&PyUnicode_Type) { UOP_STAT_INC(uopcode, miss); + _tos_cache1 = _stack_item_1; + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(2); JUMP_TO_JUMP_TARGET(); } @@ -12756,6 +13284,9 @@ PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable); if (callable_o != (PyObject *)&PyUnicode_Type) { UOP_STAT_INC(uopcode, miss); + _tos_cache2 = _stack_item_2; + _tos_cache1 = _stack_item_1; + _tos_cache0 = callable; SET_CURRENT_CACHED_VALUES(3); JUMP_TO_JUMP_TARGET(); } @@ -12835,6 +13366,7 @@ PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable); if (callable_o != (PyObject *)&PyTuple_Type) { UOP_STAT_INC(uopcode, miss); + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(1); JUMP_TO_JUMP_TARGET(); } @@ -12858,6 +13390,8 @@ PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable); if (callable_o != (PyObject *)&PyTuple_Type) { UOP_STAT_INC(uopcode, miss); + _tos_cache1 = _stack_item_1; + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(2); JUMP_TO_JUMP_TARGET(); } @@ -12882,6 +13416,9 @@ PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable); if (callable_o != (PyObject *)&PyTuple_Type) { UOP_STAT_INC(uopcode, miss); + _tos_cache2 = _stack_item_2; + _tos_cache1 = _stack_item_1; + _tos_cache0 = callable; SET_CURRENT_CACHED_VALUES(3); JUMP_TO_JUMP_TARGET(); } @@ -13311,6 +13848,7 @@ PyInterpreterState *interp = tstate->interp; if (callable_o != interp->callable_cache.len) { UOP_STAT_INC(uopcode, miss); + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(1); JUMP_TO_JUMP_TARGET(); } @@ -13335,6 +13873,8 @@ PyInterpreterState *interp = tstate->interp; if (callable_o != interp->callable_cache.len) { UOP_STAT_INC(uopcode, miss); + _tos_cache1 = _stack_item_1; + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(2); JUMP_TO_JUMP_TARGET(); } @@ -13360,6 +13900,9 @@ PyInterpreterState *interp = tstate->interp; if (callable_o != interp->callable_cache.len) { UOP_STAT_INC(uopcode, miss); + _tos_cache2 = _stack_item_2; + _tos_cache1 = _stack_item_1; + _tos_cache0 = callable; SET_CURRENT_CACHED_VALUES(3); JUMP_TO_JUMP_TARGET(); } @@ -13449,6 +13992,7 @@ PyInterpreterState *interp = tstate->interp; if (callable_o != interp->callable_cache.isinstance) { UOP_STAT_INC(uopcode, miss); + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(1); JUMP_TO_JUMP_TARGET(); } @@ -13473,6 +14017,8 @@ PyInterpreterState *interp = tstate->interp; if (callable_o != interp->callable_cache.isinstance) { UOP_STAT_INC(uopcode, miss); + _tos_cache1 = _stack_item_1; + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(2); JUMP_TO_JUMP_TARGET(); } @@ -13498,6 +14044,9 @@ PyInterpreterState *interp = tstate->interp; if (callable_o != interp->callable_cache.isinstance) { UOP_STAT_INC(uopcode, miss); + _tos_cache2 = _stack_item_2; + _tos_cache1 = _stack_item_1; + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(3); JUMP_TO_JUMP_TARGET(); } @@ -13597,6 +14146,7 @@ PyInterpreterState *interp = tstate->interp; if (callable_o != interp->callable_cache.list_append) { UOP_STAT_INC(uopcode, miss); + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(1); JUMP_TO_JUMP_TARGET(); } @@ -13621,6 +14171,8 @@ PyInterpreterState *interp = tstate->interp; if (callable_o != interp->callable_cache.list_append) { UOP_STAT_INC(uopcode, miss); + _tos_cache1 = _stack_item_1; + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(2); JUMP_TO_JUMP_TARGET(); } @@ -13646,6 +14198,9 @@ PyInterpreterState *interp = tstate->interp; if (callable_o != interp->callable_cache.list_append) { UOP_STAT_INC(uopcode, miss); + _tos_cache2 = _stack_item_2; + _tos_cache1 = _stack_item_1; + _tos_cache0 = callable; SET_CURRENT_CACHED_VALUES(3); JUMP_TO_JUMP_TARGET(); } @@ -13716,6 +14271,7 @@ PyObject *self_o = PyStackRef_AsPyObjectBorrow(self); if (!LOCK_OBJECT(self_o)) { UOP_STAT_INC(uopcode, miss); + _tos_cache0 = arg; SET_CURRENT_CACHED_VALUES(1); JUMP_TO_JUMP_TARGET(); } @@ -13762,6 +14318,8 @@ PyObject *self_o = PyStackRef_AsPyObjectBorrow(self); if (!LOCK_OBJECT(self_o)) { UOP_STAT_INC(uopcode, miss); + _tos_cache1 = arg; + _tos_cache0 = self; SET_CURRENT_CACHED_VALUES(2); JUMP_TO_JUMP_TARGET(); } @@ -13810,6 +14368,9 @@ PyObject *self_o = PyStackRef_AsPyObjectBorrow(self); if (!LOCK_OBJECT(self_o)) { UOP_STAT_INC(uopcode, miss); + _tos_cache2 = arg; + _tos_cache1 = self; + _tos_cache0 = callable; SET_CURRENT_CACHED_VALUES(3); JUMP_TO_JUMP_TARGET(); } @@ -14246,12 +14807,14 @@ PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable); if (!PyFunction_Check(callable_o)) { UOP_STAT_INC(uopcode, miss); + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(1); JUMP_TO_JUMP_TARGET(); } PyFunctionObject *func = (PyFunctionObject *)callable_o; if (func->func_version != func_version) { UOP_STAT_INC(uopcode, miss); + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(1); JUMP_TO_JUMP_TARGET(); } @@ -14274,22 +14837,26 @@ PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable); if (Py_TYPE(callable_o) != &PyMethod_Type) { UOP_STAT_INC(uopcode, miss); + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(1); JUMP_TO_JUMP_TARGET(); } PyObject *func = ((PyMethodObject *)callable_o)->im_func; if (!PyFunction_Check(func)) { UOP_STAT_INC(uopcode, miss); + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(1); JUMP_TO_JUMP_TARGET(); } if (((PyFunctionObject *)func)->func_version != func_version) { UOP_STAT_INC(uopcode, miss); + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(1); JUMP_TO_JUMP_TARGET(); } if (!PyStackRef_IsNull(null)) { UOP_STAT_INC(uopcode, miss); + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(1); JUMP_TO_JUMP_TARGET(); } @@ -14343,11 +14910,13 @@ PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable); if (PyFunction_Check(callable_o)) { UOP_STAT_INC(uopcode, miss); + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(1); JUMP_TO_JUMP_TARGET(); } if (Py_TYPE(callable_o) == &PyMethod_Type) { UOP_STAT_INC(uopcode, miss); + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(1); JUMP_TO_JUMP_TARGET(); } @@ -15599,11 +16168,13 @@ assert(framesize <= INT_MAX); if (!_PyThreadState_HasStackSpace(tstate, framesize)) { UOP_STAT_INC(uopcode, miss); + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(1); JUMP_TO_JUMP_TARGET(); } if (tstate->py_recursion_remaining <= 1) { UOP_STAT_INC(uopcode, miss); + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(1); JUMP_TO_JUMP_TARGET(); } @@ -15622,11 +16193,15 @@ assert(framesize <= INT_MAX); if (!_PyThreadState_HasStackSpace(tstate, framesize)) { UOP_STAT_INC(uopcode, miss); + _tos_cache1 = _stack_item_1; + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(2); JUMP_TO_JUMP_TARGET(); } if (tstate->py_recursion_remaining <= 1) { UOP_STAT_INC(uopcode, miss); + _tos_cache1 = _stack_item_1; + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(2); JUMP_TO_JUMP_TARGET(); } @@ -15647,11 +16222,17 @@ assert(framesize <= INT_MAX); if (!_PyThreadState_HasStackSpace(tstate, framesize)) { UOP_STAT_INC(uopcode, miss); + _tos_cache2 = _stack_item_2; + _tos_cache1 = _stack_item_1; + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(3); JUMP_TO_JUMP_TARGET(); } if (tstate->py_recursion_remaining <= 1) { UOP_STAT_INC(uopcode, miss); + _tos_cache2 = _stack_item_2; + _tos_cache1 = _stack_item_1; + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(3); JUMP_TO_JUMP_TARGET(); } @@ -16016,6 +16597,7 @@ _PyStackRef _stack_item_0 = _tos_cache0; if (!current_executor->vm_data.valid) { UOP_STAT_INC(uopcode, miss); + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(1); JUMP_TO_JUMP_TARGET(); } @@ -16032,6 +16614,8 @@ _PyStackRef _stack_item_1 = _tos_cache1; if (!current_executor->vm_data.valid) { UOP_STAT_INC(uopcode, miss); + _tos_cache1 = _stack_item_1; + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(2); JUMP_TO_JUMP_TARGET(); } @@ -16050,6 +16634,9 @@ _PyStackRef _stack_item_2 = _tos_cache2; if (!current_executor->vm_data.valid) { UOP_STAT_INC(uopcode, miss); + _tos_cache2 = _stack_item_2; + _tos_cache1 = _stack_item_1; + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(3); JUMP_TO_JUMP_TARGET(); } @@ -16968,6 +17555,7 @@ #if defined(__EMSCRIPTEN__) if (_Py_emscripten_signal_clock == 0) { UOP_STAT_INC(uopcode, miss); + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(1); JUMP_TO_JUMP_TARGET(); } @@ -16976,6 +17564,7 @@ uintptr_t eval_breaker = _Py_atomic_load_uintptr_relaxed(&tstate->eval_breaker); if (eval_breaker & _PY_EVAL_EVENTS_MASK) { UOP_STAT_INC(uopcode, miss); + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(1); JUMP_TO_JUMP_TARGET(); } @@ -16994,6 +17583,8 @@ #if defined(__EMSCRIPTEN__) if (_Py_emscripten_signal_clock == 0) { UOP_STAT_INC(uopcode, miss); + _tos_cache1 = _stack_item_1; + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(2); JUMP_TO_JUMP_TARGET(); } @@ -17002,6 +17593,8 @@ uintptr_t eval_breaker = _Py_atomic_load_uintptr_relaxed(&tstate->eval_breaker); if (eval_breaker & _PY_EVAL_EVENTS_MASK) { UOP_STAT_INC(uopcode, miss); + _tos_cache1 = _stack_item_1; + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(2); JUMP_TO_JUMP_TARGET(); } @@ -17022,6 +17615,9 @@ #if defined(__EMSCRIPTEN__) if (_Py_emscripten_signal_clock == 0) { UOP_STAT_INC(uopcode, miss); + _tos_cache2 = _stack_item_2; + _tos_cache1 = _stack_item_1; + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(3); JUMP_TO_JUMP_TARGET(); } @@ -17030,6 +17626,9 @@ uintptr_t eval_breaker = _Py_atomic_load_uintptr_relaxed(&tstate->eval_breaker); if (eval_breaker & _PY_EVAL_EVENTS_MASK) { UOP_STAT_INC(uopcode, miss); + _tos_cache2 = _stack_item_2; + _tos_cache1 = _stack_item_1; + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(3); JUMP_TO_JUMP_TARGET(); } @@ -17118,6 +17717,7 @@ frame->instr_ptr += OFFSET_OF__PUSH_FRAME; if (true) { UOP_STAT_INC(uopcode, miss); + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(1); JUMP_TO_JUMP_TARGET(); } @@ -17141,6 +17741,8 @@ frame->instr_ptr += OFFSET_OF__PUSH_FRAME; if (true) { UOP_STAT_INC(uopcode, miss); + _tos_cache1 = _stack_item_1; + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(2); JUMP_TO_JUMP_TARGET(); } @@ -17166,6 +17768,9 @@ frame->instr_ptr += OFFSET_OF__PUSH_FRAME; if (true) { UOP_STAT_INC(uopcode, miss); + _tos_cache2 = _stack_item_2; + _tos_cache1 = _stack_item_1; + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(3); JUMP_TO_JUMP_TARGET(); } @@ -17210,6 +17815,7 @@ frame->instr_ptr += OFFSET_OF_YIELD_VALUE; if (true) { UOP_STAT_INC(uopcode, miss); + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(1); JUMP_TO_JUMP_TARGET(); } @@ -17233,6 +17839,8 @@ frame->instr_ptr += OFFSET_OF_YIELD_VALUE; if (true) { UOP_STAT_INC(uopcode, miss); + _tos_cache1 = _stack_item_1; + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(2); JUMP_TO_JUMP_TARGET(); } @@ -17258,6 +17866,9 @@ frame->instr_ptr += OFFSET_OF_YIELD_VALUE; if (true) { UOP_STAT_INC(uopcode, miss); + _tos_cache2 = _stack_item_2; + _tos_cache1 = _stack_item_1; + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(3); JUMP_TO_JUMP_TARGET(); } @@ -17302,6 +17913,7 @@ frame->instr_ptr += OFFSET_OF_RETURN_VALUE; if (true) { UOP_STAT_INC(uopcode, miss); + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(1); JUMP_TO_JUMP_TARGET(); } @@ -17325,6 +17937,8 @@ frame->instr_ptr += OFFSET_OF_RETURN_VALUE; if (true) { UOP_STAT_INC(uopcode, miss); + _tos_cache1 = _stack_item_1; + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(2); JUMP_TO_JUMP_TARGET(); } @@ -17350,6 +17964,9 @@ frame->instr_ptr += OFFSET_OF_RETURN_VALUE; if (true) { UOP_STAT_INC(uopcode, miss); + _tos_cache2 = _stack_item_2; + _tos_cache1 = _stack_item_1; + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(3); JUMP_TO_JUMP_TARGET(); } @@ -17394,6 +18011,7 @@ frame->instr_ptr += OFFSET_OF_RETURN_GENERATOR; if (true) { UOP_STAT_INC(uopcode, miss); + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(1); JUMP_TO_JUMP_TARGET(); } @@ -17417,6 +18035,8 @@ frame->instr_ptr += OFFSET_OF_RETURN_GENERATOR; if (true) { UOP_STAT_INC(uopcode, miss); + _tos_cache1 = _stack_item_1; + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(2); JUMP_TO_JUMP_TARGET(); } @@ -17442,6 +18062,9 @@ frame->instr_ptr += OFFSET_OF_RETURN_GENERATOR; if (true) { UOP_STAT_INC(uopcode, miss); + _tos_cache2 = _stack_item_2; + _tos_cache1 = _stack_item_1; + _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(3); JUMP_TO_JUMP_TARGET(); } diff --git a/Tools/cases_generator/analyzer.py b/Tools/cases_generator/analyzer.py index f6575a93e47a31..445a87e49019fc 100644 --- a/Tools/cases_generator/analyzer.py +++ b/Tools/cases_generator/analyzer.py @@ -1372,11 +1372,6 @@ def get_uop_cache_depths(uop: Uop) -> Iterator[tuple[int, int, int]]: if uop.name == "_ERROR_POP_N": yield 0, 0, 0 return - non_decref_escape = False - for call in uop.properties.escaping_calls.values(): - if "DECREF" in call.call.text or "CLOSE" in call.call.text: - continue - non_decref_escape = True ideal_inputs = 0 has_array = False for item in reversed(uop.stack.inputs): @@ -1394,9 +1389,6 @@ def get_uop_cache_depths(uop: Uop) -> Iterator[tuple[int, int, int]]: ideal_inputs = MAX_CACHED_REGISTER if ideal_outputs > MAX_CACHED_REGISTER: ideal_outputs = MAX_CACHED_REGISTER - if non_decref_escape: - yield ideal_inputs, ideal_outputs, 0 - return at_end = uop.properties.sync_sp or uop.properties.side_exit_at_end exit_depth = ideal_outputs if at_end else ideal_inputs if uop.properties.escapes or uop.properties.sync_sp or has_array or is_large(uop): diff --git a/Tools/cases_generator/tier2_generator.py b/Tools/cases_generator/tier2_generator.py index 9c86382cdc5610..478dfcf943276a 100644 --- a/Tools/cases_generator/tier2_generator.py +++ b/Tools/cases_generator/tier2_generator.py @@ -95,7 +95,9 @@ def exit_if( next(tkn_iter) # Semi colon self.emit(") {\n") self.emit("UOP_STAT_INC(uopcode, miss);\n") - self.emit(f"SET_CURRENT_CACHED_VALUES({self.exit_cache_depth});\n") + storage = storage.copy() + self.cache_items(storage.stack, self.exit_cache_depth, False) + storage.stack.flush(self.out) self.emit("JUMP_TO_JUMP_TARGET();\n") self.emit("}\n") return not always_true(first_tkn) @@ -151,7 +153,7 @@ def tier2_to_tier2( inst: Instruction | None, ) -> bool: assert self.exit_cache_depth == 0, uop.name - cache_items(self, storage.stack, self.exit_cache_depth, False) + self.cache_items(storage.stack, self.exit_cache_depth, False) storage.flush(self.out) self.out.emit(tkn) lparen = next(tkn_iter) @@ -181,31 +183,31 @@ def exit_if_after( self.emit("UOP_STAT_INC(uopcode, miss);\n") storage = storage.copy() storage.clear_inputs("in AT_END_EXIT_IF") - cache_items(self, storage.stack, self.exit_cache_depth, False) + self.cache_items(storage.stack, self.exit_cache_depth, False) storage.flush(self.out) self.emit("JUMP_TO_JUMP_TARGET();\n") self.emit("}\n") return not always_true(first_tkn) - -def cache_items(emitter: Emitter, stack: Stack, cached_items: int, zero_regs: bool) -> None: - emitter.out.start_line() - i = cached_items - while i > 0: - emitter.out.start_line() - item = StackItem(f"_tos_cache{i-1}", "", False, True) - stack.pop(item, emitter.out) - i -= 1 - if zero_regs: - # TO DO -- For compilers that support it, - # replace this with a "clobber" to tell - # the compiler that these values are unused - # without having to emit any code. - for i in range(cached_items, MAX_CACHED_REGISTER): - emitter.out.emit(f"_tos_cache{i} = PyStackRef_ZERO_BITS;\n") - emitter.emit(f"SET_CURRENT_CACHED_VALUES({cached_items});\n") - -def write_uop(uop: Uop, emitter: Emitter, stack: Stack, offset_strs: dict[str, tuple[str, str]], cached_items: int = 0) -> tuple[bool, Stack]: + def cache_items(self, stack: Stack, cached_items: int, zero_regs: bool) -> None: + self.out.start_line() + i = cached_items + while i > 0: + self.out.start_line() + item = StackItem(f"_tos_cache{i-1}", "", False, True) + stack.pop(item, self.out) + i -= 1 + if zero_regs: + # TO DO -- For compilers that support it, + # replace this with a "clobber" to tell + # the compiler that these values are unused + # without having to emit any code. + for i in range(cached_items, MAX_CACHED_REGISTER): + self.out.emit(f"_tos_cache{i} = PyStackRef_ZERO_BITS;\n") + self.emit(f"SET_CURRENT_CACHED_VALUES({cached_items});\n") + + +def write_uop(uop: Uop, emitter: Tier2Emitter, stack: Stack, offset_strs: dict[str, tuple[str, str]], cached_items: int = 0) -> tuple[bool, Stack]: locals: dict[str, Local] = {} zero_regs = is_large(uop) or uop.properties.escapes try: @@ -233,7 +235,7 @@ def write_uop(uop: Uop, emitter: Emitter, stack: Stack, offset_strs: dict[str, t reachable, storage = emitter.emit_tokens(uop, storage, None, False) if reachable: storage.stack._print(emitter.out) - cache_items(emitter, storage.stack, cached_items, zero_regs) + emitter.cache_items(storage.stack, cached_items, zero_regs) storage.flush(emitter.out) if name_offset_pair: emitter.emit(f"#undef OFFSET_OF_{name_offset_pair[0]}\n")