@@ -376,7 +376,7 @@ dummy_func(
376
376
377
377
pure inst (UNARY_NOT , (value -- res )) {
378
378
assert (PyStackRef_BoolCheck (value ));
379
- res = PyStackRef_Is (value , PyStackRef_False )
379
+ res = PyStackRef_IsFalse (value )
380
380
? PyStackRef_True : PyStackRef_False ;
381
381
DEAD (value );
382
382
}
@@ -441,7 +441,7 @@ dummy_func(
441
441
442
442
inst (TO_BOOL_NONE , (unused /1 , unused /2 , value -- res )) {
443
443
// This one is a bit weird, because we expect *some* failures:
444
- EXIT_IF (!PyStackRef_Is (value , PyStackRef_None ));
444
+ EXIT_IF (!PyStackRef_IsNone (value ));
445
445
DEAD (value );
446
446
STAT_INC (TO_BOOL , hit );
447
447
res = PyStackRef_False ;
@@ -651,9 +651,7 @@ dummy_func(
651
651
// specializations, but there is no output.
652
652
// At the end we just skip over the STORE_FAST.
653
653
op (_BINARY_OP_INPLACE_ADD_UNICODE , (left , right -- )) {
654
- #ifndef NDEBUG
655
654
PyObject * left_o = PyStackRef_AsPyObjectBorrow (left );
656
- #endif
657
655
PyObject * right_o = PyStackRef_AsPyObjectBorrow (right );
658
656
659
657
int next_oparg ;
@@ -664,7 +662,7 @@ dummy_func(
664
662
next_oparg = CURRENT_OPERAND0 ();
665
663
#endif
666
664
_PyStackRef * target_local = & GETLOCAL (next_oparg );
667
- DEOPT_IF (! PyStackRef_Is (* target_local , left ) );
665
+ DEOPT_IF (PyStackRef_AsPyObjectBorrow (* target_local ) != left_o );
668
666
STAT_INC (BINARY_OP , hit );
669
667
/* Handle `left = left + right` or `left += right` for str.
670
668
*
@@ -1141,7 +1139,7 @@ dummy_func(
1141
1139
gen_frame -> previous = frame ;
1142
1140
DISPATCH_INLINED (gen_frame );
1143
1141
}
1144
- if (PyStackRef_Is ( v , PyStackRef_None ) && PyIter_Check (receiver_o )) {
1142
+ if (PyStackRef_IsNone ( v ) && PyIter_Check (receiver_o )) {
1145
1143
retval_o = Py_TYPE (receiver_o )-> tp_iternext (receiver_o );
1146
1144
}
1147
1145
else {
@@ -1249,7 +1247,7 @@ dummy_func(
1249
1247
inst (POP_EXCEPT , (exc_value -- )) {
1250
1248
_PyErr_StackItem * exc_info = tstate -> exc_info ;
1251
1249
Py_XSETREF (exc_info -> exc_value ,
1252
- PyStackRef_Is (exc_value , PyStackRef_None )
1250
+ PyStackRef_IsNone (exc_value )
1253
1251
? NULL : PyStackRef_AsPyObjectSteal (exc_value ));
1254
1252
}
1255
1253
@@ -2502,13 +2500,7 @@ dummy_func(
2502
2500
}
2503
2501
2504
2502
inst (IS_OP , (left , right -- b )) {
2505
- #ifdef Py_GIL_DISABLED
2506
- // On free-threaded builds, objects are conditionally immortalized.
2507
- // So their bits don't always compare equally.
2508
2503
int res = Py_Is (PyStackRef_AsPyObjectBorrow (left ), PyStackRef_AsPyObjectBorrow (right )) ^ oparg ;
2509
- #else
2510
- int res = PyStackRef_Is (left , right ) ^ oparg ;
2511
- #endif
2512
2504
DECREF_INPUTS ();
2513
2505
b = res ? PyStackRef_True : PyStackRef_False ;
2514
2506
}
@@ -2715,22 +2707,22 @@ dummy_func(
2715
2707
2716
2708
replaced op (_POP_JUMP_IF_FALSE , (cond -- )) {
2717
2709
assert (PyStackRef_BoolCheck (cond ));
2718
- int flag = PyStackRef_Is (cond , PyStackRef_False );
2710
+ int flag = PyStackRef_IsFalse (cond );
2719
2711
DEAD (cond );
2720
2712
RECORD_BRANCH_TAKEN (this_instr [1 ].cache , flag );
2721
2713
JUMPBY (oparg * flag );
2722
2714
}
2723
2715
2724
2716
replaced op (_POP_JUMP_IF_TRUE , (cond -- )) {
2725
2717
assert (PyStackRef_BoolCheck (cond ));
2726
- int flag = PyStackRef_Is (cond , PyStackRef_True );
2718
+ int flag = PyStackRef_IsTrue (cond );
2727
2719
DEAD (cond );
2728
2720
RECORD_BRANCH_TAKEN (this_instr [1 ].cache , flag );
2729
2721
JUMPBY (oparg * flag );
2730
2722
}
2731
2723
2732
2724
op (_IS_NONE , (value -- b )) {
2733
- if (PyStackRef_Is (value , PyStackRef_None )) {
2725
+ if (PyStackRef_IsNone (value )) {
2734
2726
b = PyStackRef_True ;
2735
2727
DEAD (value );
2736
2728
}
@@ -3774,7 +3766,7 @@ dummy_func(
3774
3766
3775
3767
inst (EXIT_INIT_CHECK , (should_be_none -- )) {
3776
3768
assert (STACK_LEVEL () == 2 );
3777
- if (!PyStackRef_Is (should_be_none , PyStackRef_None )) {
3769
+ if (!PyStackRef_IsNone (should_be_none )) {
3778
3770
PyErr_Format (PyExc_TypeError ,
3779
3771
"__init__() should return None, not '%.200s'" ,
3780
3772
Py_TYPE (PyStackRef_AsPyObjectBorrow (should_be_none ))-> tp_name );
@@ -4734,7 +4726,7 @@ dummy_func(
4734
4726
inst (INSTRUMENTED_POP_JUMP_IF_TRUE , (unused /1 -- )) {
4735
4727
_PyStackRef cond = POP ();
4736
4728
assert (PyStackRef_BoolCheck (cond ));
4737
- int flag = PyStackRef_Is (cond , PyStackRef_True );
4729
+ int flag = PyStackRef_IsTrue (cond );
4738
4730
int offset = flag * oparg ;
4739
4731
RECORD_BRANCH_TAKEN (this_instr [1 ].cache , flag );
4740
4732
INSTRUMENTED_JUMP (this_instr , next_instr + offset , PY_MONITORING_EVENT_BRANCH );
@@ -4743,15 +4735,15 @@ dummy_func(
4743
4735
inst (INSTRUMENTED_POP_JUMP_IF_FALSE , (unused /1 -- )) {
4744
4736
_PyStackRef cond = POP ();
4745
4737
assert (PyStackRef_BoolCheck (cond ));
4746
- int flag = PyStackRef_Is (cond , PyStackRef_False );
4738
+ int flag = PyStackRef_IsFalse (cond );
4747
4739
int offset = flag * oparg ;
4748
4740
RECORD_BRANCH_TAKEN (this_instr [1 ].cache , flag );
4749
4741
INSTRUMENTED_JUMP (this_instr , next_instr + offset , PY_MONITORING_EVENT_BRANCH );
4750
4742
}
4751
4743
4752
4744
inst (INSTRUMENTED_POP_JUMP_IF_NONE , (unused /1 -- )) {
4753
4745
_PyStackRef value_stackref = POP ();
4754
- int flag = PyStackRef_Is (value_stackref , PyStackRef_None );
4746
+ int flag = PyStackRef_IsNone (value_stackref );
4755
4747
int offset ;
4756
4748
if (flag ) {
4757
4749
offset = oparg ;
@@ -4767,7 +4759,7 @@ dummy_func(
4767
4759
inst (INSTRUMENTED_POP_JUMP_IF_NOT_NONE , (unused /1 -- )) {
4768
4760
_PyStackRef value_stackref = POP ();
4769
4761
int offset ;
4770
- int nflag = PyStackRef_Is (value_stackref , PyStackRef_None );
4762
+ int nflag = PyStackRef_IsNone (value_stackref );
4771
4763
if (nflag ) {
4772
4764
offset = 0 ;
4773
4765
}
@@ -4802,21 +4794,21 @@ dummy_func(
4802
4794
///////// Tier-2 only opcodes /////////
4803
4795
4804
4796
op (_GUARD_IS_TRUE_POP , (flag -- )) {
4805
- int is_true = PyStackRef_Is (flag , PyStackRef_True );
4797
+ int is_true = PyStackRef_IsTrue (flag );
4806
4798
DEAD (flag );
4807
4799
SYNC_SP ();
4808
4800
EXIT_IF (!is_true );
4809
4801
}
4810
4802
4811
4803
op (_GUARD_IS_FALSE_POP , (flag -- )) {
4812
- int is_false = PyStackRef_Is (flag , PyStackRef_False );
4804
+ int is_false = PyStackRef_IsFalse (flag );
4813
4805
DEAD (flag );
4814
4806
SYNC_SP ();
4815
4807
EXIT_IF (!is_false );
4816
4808
}
4817
4809
4818
4810
op (_GUARD_IS_NONE_POP , (val -- )) {
4819
- int is_none = PyStackRef_Is (val , PyStackRef_None );
4811
+ int is_none = PyStackRef_IsNone (val );
4820
4812
if (!is_none ) {
4821
4813
PyStackRef_CLOSE (val );
4822
4814
SYNC_SP ();
@@ -4826,7 +4818,7 @@ dummy_func(
4826
4818
}
4827
4819
4828
4820
op (_GUARD_IS_NOT_NONE_POP , (val -- )) {
4829
- int is_none = PyStackRef_Is (val , PyStackRef_None );
4821
+ int is_none = PyStackRef_IsNone (val );
4830
4822
PyStackRef_CLOSE (val );
4831
4823
SYNC_SP ();
4832
4824
EXIT_IF (is_none );
0 commit comments