@@ -140,7 +140,7 @@ dummy_func(
140
140
DECREF_INPUTS ();
141
141
}
142
142
143
- inst (PUSH_NULL , (-- res )) {
143
+ inst (PUSH_NULL , (-- res : NULL )) {
144
144
res = NULL ;
145
145
}
146
146
@@ -184,7 +184,7 @@ dummy_func(
184
184
};
185
185
186
186
187
- inst (BINARY_OP_MULTIPLY_INT , (unused /1 , left , right -- prod )) {
187
+ inst (BINARY_OP_MULTIPLY_INT , (unused /1 , left , right -- prod : PyLong_Type )) {
188
188
assert (cframe .use_tracing == 0 );
189
189
DEOPT_IF (!PyLong_CheckExact (left ), BINARY_OP );
190
190
DEOPT_IF (!PyLong_CheckExact (right ), BINARY_OP );
@@ -195,7 +195,7 @@ dummy_func(
195
195
ERROR_IF (prod == NULL , error );
196
196
}
197
197
198
- inst (BINARY_OP_MULTIPLY_FLOAT , (unused /1 , left , right -- prod )) {
198
+ inst (BINARY_OP_MULTIPLY_FLOAT , (unused /1 , left , right -- prod : PyFloat_Type )) {
199
199
assert (cframe .use_tracing == 0 );
200
200
DEOPT_IF (!PyFloat_CheckExact (left ), BINARY_OP );
201
201
DEOPT_IF (!PyFloat_CheckExact (right ), BINARY_OP );
@@ -208,7 +208,7 @@ dummy_func(
208
208
ERROR_IF (prod == NULL , error );
209
209
}
210
210
211
- inst (BINARY_OP_SUBTRACT_INT , (unused /1 , left , right -- sub )) {
211
+ inst (BINARY_OP_SUBTRACT_INT , (unused /1 , left , right -- sub : PyLong_Type )) {
212
212
assert (cframe .use_tracing == 0 );
213
213
DEOPT_IF (!PyLong_CheckExact (left ), BINARY_OP );
214
214
DEOPT_IF (!PyLong_CheckExact (right ), BINARY_OP );
@@ -219,7 +219,7 @@ dummy_func(
219
219
ERROR_IF (sub == NULL , error );
220
220
}
221
221
222
- inst (BINARY_OP_SUBTRACT_FLOAT , (unused /1 , left , right -- sub )) {
222
+ inst (BINARY_OP_SUBTRACT_FLOAT , (unused /1 , left , right -- sub : PyFloat_Type )) {
223
223
assert (cframe .use_tracing == 0 );
224
224
DEOPT_IF (!PyFloat_CheckExact (left ), BINARY_OP );
225
225
DEOPT_IF (!PyFloat_CheckExact (right ), BINARY_OP );
@@ -231,7 +231,7 @@ dummy_func(
231
231
ERROR_IF (sub == NULL , error );
232
232
}
233
233
234
- inst (BINARY_OP_ADD_UNICODE , (unused /1 , left , right -- res )) {
234
+ inst (BINARY_OP_ADD_UNICODE , (unused /1 , left , right -- res : PyUnicode_Type )) {
235
235
assert (cframe .use_tracing == 0 );
236
236
DEOPT_IF (!PyUnicode_CheckExact (left ), BINARY_OP );
237
237
DEOPT_IF (Py_TYPE (right ) != Py_TYPE (left ), BINARY_OP );
@@ -278,7 +278,7 @@ dummy_func(
278
278
JUMPBY (INLINE_CACHE_ENTRIES_BINARY_OP + 1 );
279
279
}
280
280
281
- inst (BINARY_OP_ADD_FLOAT , (unused /1 , left , right -- sum )) {
281
+ inst (BINARY_OP_ADD_FLOAT , (unused /1 , left , right -- sum : PyFloat_Type )) {
282
282
assert (cframe .use_tracing == 0 );
283
283
DEOPT_IF (!PyFloat_CheckExact (left ), BINARY_OP );
284
284
DEOPT_IF (Py_TYPE (right ) != Py_TYPE (left ), BINARY_OP );
@@ -291,7 +291,7 @@ dummy_func(
291
291
ERROR_IF (sum == NULL , error );
292
292
}
293
293
294
- macro_inst (BINARY_OP_ADD_INT , (unused /1 , left , right -- sum )) {
294
+ macro_inst (BINARY_OP_ADD_INT , (unused /1 , left , right -- sum : PyLong_Type )) {
295
295
assert (cframe .use_tracing == 0 );
296
296
DEOPT_IF (!PyLong_CheckExact (left ), BINARY_OP );
297
297
DEOPT_IF (Py_TYPE (right ) != Py_TYPE (left ), BINARY_OP );
@@ -303,7 +303,7 @@ dummy_func(
303
303
bb_test = PyLong_CheckExact (left ) && (Py_TYPE (left ) == Py_TYPE (right ));
304
304
}
305
305
306
- u_inst (BINARY_OP_ADD_INT_REST , (left : PyLong_Type , right : PyLong_Type -- sum : PyLong_Type )) {
306
+ u_inst (BINARY_OP_ADD_INT_REST , (left , right -- sum : PyLong_Type )) {
307
307
STAT_INC (BINARY_OP , hit );
308
308
sum = _PyLong_Add ((PyLongObject * )left , (PyLongObject * )right );
309
309
_Py_DECREF_SPECIALIZED (right , (destructor )PyObject_Free );
@@ -1274,20 +1274,20 @@ dummy_func(
1274
1274
}
1275
1275
}
1276
1276
1277
- inst (BUILD_STRING , (pieces [oparg ] -- str )) {
1277
+ inst (BUILD_STRING , (pieces [oparg ] -- str : PyUnicode_Type )) {
1278
1278
str = _PyUnicode_JoinArray (& _Py_STR (empty ), pieces , oparg );
1279
1279
for (int i = 0 ; i < oparg ; i ++ ) {
1280
1280
Py_DECREF (pieces [i ]);
1281
1281
}
1282
1282
ERROR_IF (str == NULL , error );
1283
1283
}
1284
1284
1285
- inst (BUILD_TUPLE , (values [oparg ] -- tup )) {
1285
+ inst (BUILD_TUPLE , (values [oparg ] -- tup : PyTuple_Type )) {
1286
1286
tup = _PyTuple_FromArraySteal (values , oparg );
1287
1287
ERROR_IF (tup == NULL , error );
1288
1288
}
1289
1289
1290
- inst (BUILD_LIST , (values [oparg ] -- list )) {
1290
+ inst (BUILD_LIST , (values [oparg ] -- list : PyList_Type )) {
1291
1291
list = _PyList_FromArraySteal (values , oparg );
1292
1292
ERROR_IF (list == NULL , error );
1293
1293
}
@@ -1316,7 +1316,7 @@ dummy_func(
1316
1316
ERROR_IF (err < 0 , error );
1317
1317
}
1318
1318
1319
- inst (BUILD_SET , (values [oparg ] -- set )) {
1319
+ inst (BUILD_SET , (values [oparg ] -- set : PySet_Type )) {
1320
1320
set = PySet_New (NULL );
1321
1321
if (set == NULL )
1322
1322
goto error ;
@@ -1333,7 +1333,7 @@ dummy_func(
1333
1333
}
1334
1334
}
1335
1335
1336
- inst (BUILD_MAP , (values [oparg * 2 ] -- map )) {
1336
+ inst (BUILD_MAP , (values [oparg * 2 ] -- map : PyDict_Type )) {
1337
1337
map = _PyDict_FromItems (
1338
1338
values , 2 ,
1339
1339
values + 1 , 2 ,
@@ -1390,7 +1390,7 @@ dummy_func(
1390
1390
}
1391
1391
}
1392
1392
1393
- inst (BUILD_CONST_KEY_MAP , (values [oparg ], keys -- map )) {
1393
+ inst (BUILD_CONST_KEY_MAP , (values [oparg ], keys -- map : PyDict_Type )) {
1394
1394
if (!PyTuple_CheckExact (keys ) ||
1395
1395
PyTuple_GET_SIZE (keys ) != (Py_ssize_t )oparg ) {
1396
1396
_PyErr_SetString (tstate , PyExc_SystemError ,
@@ -1833,13 +1833,13 @@ dummy_func(
1833
1833
}
1834
1834
}
1835
1835
1836
- inst (IS_OP , (left , right -- b )) {
1836
+ inst (IS_OP , (left , right -- b : PyBool_Type )) {
1837
1837
int res = Py_Is (left , right ) ^ oparg ;
1838
1838
DECREF_INPUTS ();
1839
1839
b = Py_NewRef (res ? Py_True : Py_False );
1840
1840
}
1841
1841
1842
- inst (CONTAINS_OP , (left , right -- b )) {
1842
+ inst (CONTAINS_OP , (left , right -- b : PyBool_Type )) {
1843
1843
int res = PySequence_Contains (right , left );
1844
1844
DECREF_INPUTS ();
1845
1845
ERROR_IF (res < 0 , error );
@@ -1867,7 +1867,7 @@ dummy_func(
1867
1867
}
1868
1868
}
1869
1869
1870
- inst (CHECK_EXC_MATCH , (left , right -- left , b )) {
1870
+ inst (CHECK_EXC_MATCH , (left , right -- left , b : PyBool_Type )) {
1871
1871
assert (PyExceptionInstance_Check (left ));
1872
1872
if (check_except_type_valid (tstate , right ) < 0 ) {
1873
1873
DECREF_INPUTS ();
@@ -2153,7 +2153,7 @@ dummy_func(
2153
2153
JUMPBY (- oparg );
2154
2154
}
2155
2155
2156
- inst (GET_LEN , (obj -- obj , len_o )) {
2156
+ inst (GET_LEN , (obj -- obj , len_o : PyLong_Type )) {
2157
2157
// PUSH(len(TOS))
2158
2158
Py_ssize_t len_i = PyObject_Length (obj );
2159
2159
ERROR_IF (len_i < 0 , error );
@@ -2176,13 +2176,13 @@ dummy_func(
2176
2176
}
2177
2177
}
2178
2178
2179
- inst (MATCH_MAPPING , (subject -- subject , res )) {
2179
+ inst (MATCH_MAPPING , (subject -- subject , res : PyBool_Type )) {
2180
2180
int match = Py_TYPE (subject )-> tp_flags & Py_TPFLAGS_MAPPING ;
2181
2181
res = Py_NewRef (match ? Py_True : Py_False );
2182
2182
PREDICT (POP_JUMP_IF_FALSE );
2183
2183
}
2184
2184
2185
- inst (MATCH_SEQUENCE , (subject -- subject , res )) {
2185
+ inst (MATCH_SEQUENCE , (subject -- subject , res : PyBool_Type )) {
2186
2186
int match = Py_TYPE (subject )-> tp_flags & Py_TPFLAGS_SEQUENCE ;
2187
2187
res = Py_NewRef (match ? Py_True : Py_False );
2188
2188
PREDICT (POP_JUMP_IF_FALSE );
@@ -2453,7 +2453,7 @@ dummy_func(
2453
2453
}
2454
2454
}
2455
2455
2456
- inst (WITH_EXCEPT_START , (exit_func , lasti , unused , val -- exit_func , lasti , unused , val , res )) {
2456
+ inst (WITH_EXCEPT_START , (exit_func , lasti , unused , val -- exit_func , lasti : PyLong_Type , unused , val , res )) {
2457
2457
/* At the top of the stack are 4 values:
2458
2458
- val: TOP = exc_info()
2459
2459
- unused: SECOND = previous exception
@@ -3245,7 +3245,7 @@ dummy_func(
3245
3245
}
3246
3246
}
3247
3247
3248
- inst (COPY , (bottom , unused [oparg - 1 ] -- bottom , unused [oparg - 1 ], top )) {
3248
+ inst (COPY , (bottom , unused [oparg - 1 ] -- bottom , unused [oparg - 1 ], top : * bottom )) {
3249
3249
assert (oparg > 0 );
3250
3250
top = Py_NewRef (bottom );
3251
3251
}
@@ -3272,7 +3272,7 @@ dummy_func(
3272
3272
}
3273
3273
3274
3274
inst (SWAP , (bottom , unused [oparg - 2 ], top --
3275
- top , unused [oparg - 2 ], bottom )) {
3275
+ top : * top , unused [oparg - 2 ], bottom : * bottom )) {
3276
3276
assert (oparg >= 2 );
3277
3277
}
3278
3278
0 commit comments