@@ -224,9 +224,7 @@ dummy_func(void) {
224
224
}
225
225
226
226
op (_BINARY_OP_ADD_INT , (left , right -- res )) {
227
- if (sym_is_const (ctx , left ) && sym_is_const (ctx , right ) &&
228
- sym_matches_type (left , & PyLong_Type ) && sym_matches_type (right , & PyLong_Type ))
229
- {
227
+ if (sym_is_const (ctx , left ) && sym_is_const (ctx , right )) {
230
228
assert (PyLong_CheckExact (sym_get_const (ctx , left )));
231
229
assert (PyLong_CheckExact (sym_get_const (ctx , right )));
232
230
PyObject * temp = _PyLong_Add ((PyLongObject * )sym_get_const (ctx , left ),
@@ -245,9 +243,7 @@ dummy_func(void) {
245
243
}
246
244
247
245
op (_BINARY_OP_SUBTRACT_INT , (left , right -- res )) {
248
- if (sym_is_const (ctx , left ) && sym_is_const (ctx , right ) &&
249
- sym_matches_type (left , & PyLong_Type ) && sym_matches_type (right , & PyLong_Type ))
250
- {
246
+ if (sym_is_const (ctx , left ) && sym_is_const (ctx , right )) {
251
247
assert (PyLong_CheckExact (sym_get_const (ctx , left )));
252
248
assert (PyLong_CheckExact (sym_get_const (ctx , right )));
253
249
PyObject * temp = _PyLong_Subtract ((PyLongObject * )sym_get_const (ctx , left ),
@@ -266,9 +262,7 @@ dummy_func(void) {
266
262
}
267
263
268
264
op (_BINARY_OP_MULTIPLY_INT , (left , right -- res )) {
269
- if (sym_is_const (ctx , left ) && sym_is_const (ctx , right ) &&
270
- sym_matches_type (left , & PyLong_Type ) && sym_matches_type (right , & PyLong_Type ))
271
- {
265
+ if (sym_is_const (ctx , left ) && sym_is_const (ctx , right )) {
272
266
assert (PyLong_CheckExact (sym_get_const (ctx , left )));
273
267
assert (PyLong_CheckExact (sym_get_const (ctx , right )));
274
268
PyObject * temp = _PyLong_Multiply ((PyLongObject * )sym_get_const (ctx , left ),
@@ -287,9 +281,7 @@ dummy_func(void) {
287
281
}
288
282
289
283
op (_BINARY_OP_ADD_FLOAT , (left , right -- res )) {
290
- if (sym_is_const (ctx , left ) && sym_is_const (ctx , right ) &&
291
- sym_matches_type (left , & PyFloat_Type ) && sym_matches_type (right , & PyFloat_Type ))
292
- {
284
+ if (sym_is_const (ctx , left ) && sym_is_const (ctx , right )) {
293
285
assert (PyFloat_CheckExact (sym_get_const (ctx , left )));
294
286
assert (PyFloat_CheckExact (sym_get_const (ctx , right )));
295
287
PyObject * temp = PyFloat_FromDouble (
@@ -309,9 +301,7 @@ dummy_func(void) {
309
301
}
310
302
311
303
op (_BINARY_OP_SUBTRACT_FLOAT , (left , right -- res )) {
312
- if (sym_is_const (ctx , left ) && sym_is_const (ctx , right ) &&
313
- sym_matches_type (left , & PyFloat_Type ) && sym_matches_type (right , & PyFloat_Type ))
314
- {
304
+ if (sym_is_const (ctx , left ) && sym_is_const (ctx , right )) {
315
305
assert (PyFloat_CheckExact (sym_get_const (ctx , left )));
316
306
assert (PyFloat_CheckExact (sym_get_const (ctx , right )));
317
307
PyObject * temp = PyFloat_FromDouble (
@@ -331,9 +321,7 @@ dummy_func(void) {
331
321
}
332
322
333
323
op (_BINARY_OP_MULTIPLY_FLOAT , (left , right -- res )) {
334
- if (sym_is_const (ctx , left ) && sym_is_const (ctx , right ) &&
335
- sym_matches_type (left , & PyFloat_Type ) && sym_matches_type (right , & PyFloat_Type ))
336
- {
324
+ if (sym_is_const (ctx , left ) && sym_is_const (ctx , right )) {
337
325
assert (PyFloat_CheckExact (sym_get_const (ctx , left )));
338
326
assert (PyFloat_CheckExact (sym_get_const (ctx , right )));
339
327
PyObject * temp = PyFloat_FromDouble (
@@ -353,8 +341,9 @@ dummy_func(void) {
353
341
}
354
342
355
343
op (_BINARY_OP_ADD_UNICODE , (left , right -- res )) {
356
- if (sym_is_const (ctx , left ) && sym_is_const (ctx , right ) &&
357
- sym_matches_type (left , & PyUnicode_Type ) && sym_matches_type (right , & PyUnicode_Type )) {
344
+ if (sym_is_const (ctx , left ) && sym_is_const (ctx , right )) {
345
+ assert (PyUnicode_CheckExact (sym_get_const (ctx , left )));
346
+ assert (PyUnicode_CheckExact (sym_get_const (ctx , right )));
358
347
PyObject * temp = PyUnicode_Concat (sym_get_const (ctx , left ), sym_get_const (ctx , right ));
359
348
if (temp == NULL ) {
360
349
goto error ;
@@ -369,8 +358,9 @@ dummy_func(void) {
369
358
370
359
op (_BINARY_OP_INPLACE_ADD_UNICODE , (left , right -- )) {
371
360
JitOptSymbol * res ;
372
- if (sym_is_const (ctx , left ) && sym_is_const (ctx , right ) &&
373
- sym_matches_type (left , & PyUnicode_Type ) && sym_matches_type (right , & PyUnicode_Type )) {
361
+ if (sym_is_const (ctx , left ) && sym_is_const (ctx , right )) {
362
+ assert (PyUnicode_CheckExact (sym_get_const (ctx , left )));
363
+ assert (PyUnicode_CheckExact (sym_get_const (ctx , right )));
374
364
PyObject * temp = PyUnicode_Concat (sym_get_const (ctx , left ), sym_get_const (ctx , right ));
375
365
if (temp == NULL ) {
376
366
goto error ;
@@ -446,8 +436,7 @@ dummy_func(void) {
446
436
}
447
437
448
438
op (_COMPARE_OP_INT , (left , right -- res )) {
449
- if (sym_is_const (ctx , left ) && sym_is_const (ctx , right ))
450
- {
439
+ if (sym_is_const (ctx , left ) && sym_is_const (ctx , right )) {
451
440
assert (PyLong_CheckExact (sym_get_const (ctx , left )));
452
441
assert (PyLong_CheckExact (sym_get_const (ctx , right )));
453
442
PyObject * tmp = PyObject_RichCompare (sym_get_const (ctx , left ),
0 commit comments