@@ -2790,13 +2790,13 @@ dummy_func(
2790
2790
}
2791
2791
2792
2792
inst (MATCH_MAPPING , (subject -- subject , res )) {
2793
- int match = Py_TYPE ( PyStackRef_AsPyObjectBorrow ( subject ) )-> tp_flags & Py_TPFLAGS_MAPPING ;
2794
- res = PyStackRef_FromPyObjectSteal ( match ? Py_True : Py_False );
2793
+ int match = PyStackRef_TYPE ( subject )-> tp_flags & Py_TPFLAGS_MAPPING ;
2794
+ res = match ? PyStackRef_True () : PyStackRef_False ( );
2795
2795
}
2796
2796
2797
2797
inst (MATCH_SEQUENCE , (subject -- subject , res )) {
2798
- int match = Py_TYPE ( PyStackRef_AsPyObjectBorrow ( subject ) )-> tp_flags & Py_TPFLAGS_SEQUENCE ;
2799
- res = PyStackRef_FromPyObjectSteal ( match ? Py_True : Py_False );
2798
+ int match = PyStackRef_TYPE ( subject )-> tp_flags & Py_TPFLAGS_SEQUENCE ;
2799
+ res = match ? PyStackRef_True () : PyStackRef_False ( );
2800
2800
}
2801
2801
2802
2802
inst (MATCH_KEYS , (subject , keys -- subject , keys , values_or_none )) {
@@ -3894,7 +3894,6 @@ dummy_func(
3894
3894
DECREF_INPUTS ();
3895
3895
ERROR_IF (true, error );
3896
3896
}
3897
- ERROR_IF (args_o == NULL , error );
3898
3897
PyObject * res_o = ((PyCFunctionFast )(void (* )(void ))cfunc )(
3899
3898
PyCFunction_GET_SELF (callable_o ),
3900
3899
args_o ,
@@ -4008,15 +4007,11 @@ dummy_func(
4008
4007
if (retval < 0 ) {
4009
4008
ERROR_NO_POP ();
4010
4009
}
4011
- PyObject * res_o = PyBool_FromLong (retval );
4012
- assert ((res_o != NULL ) ^ (_PyErr_Occurred (tstate ) != NULL ));
4013
- if (res_o == NULL ) {
4014
- GOTO_ERROR (error );
4015
- }
4010
+ res = retval ? PyStackRef_True () : PyStackRef_False ();
4011
+ assert ((!PyStackRef_IsNull (res )) ^ (_PyErr_Occurred (tstate ) != NULL ));
4016
4012
PyStackRef_CLOSE (inst_stackref );
4017
4013
PyStackRef_CLOSE (cls_stackref );
4018
4014
PyStackRef_CLOSE (callable );
4019
- res = PyStackRef_FromPyObjectSteal (res_o );
4020
4015
}
4021
4016
4022
4017
// This is secretly a super-instruction
@@ -4559,9 +4554,9 @@ dummy_func(
4559
4554
}
4560
4555
4561
4556
inst (INSTRUMENTED_POP_JUMP_IF_TRUE , (unused /1 -- )) {
4562
- PyObject * cond = PyStackRef_AsPyObjectBorrow ( POP () );
4563
- assert (PyBool_Check (cond ));
4564
- int flag = Py_IsTrue (cond );
4557
+ _PyStackRef cond = POP ();
4558
+ assert (PyBool_Check (PyStackRef_AsPyObjectBorrow ( cond ) ));
4559
+ int flag = PyStackRef_IsTrue (cond );
4565
4560
int offset = flag * oparg ;
4566
4561
#if ENABLE_SPECIALIZATION
4567
4562
this_instr [1 ].cache = (this_instr [1 ].cache << 1 ) | flag ;
@@ -4570,9 +4565,9 @@ dummy_func(
4570
4565
}
4571
4566
4572
4567
inst (INSTRUMENTED_POP_JUMP_IF_FALSE , (unused /1 -- )) {
4573
- PyObject * cond = PyStackRef_AsPyObjectBorrow ( POP () );
4574
- assert (PyBool_Check (cond ));
4575
- int flag = Py_IsFalse (cond );
4568
+ _PyStackRef cond = POP ();
4569
+ assert (PyBool_Check (PyStackRef_AsPyObjectBorrow ( cond ) ));
4570
+ int flag = PyStackRef_IsFalse (cond );
4576
4571
int offset = flag * oparg ;
4577
4572
#if ENABLE_SPECIALIZATION
4578
4573
this_instr [1 ].cache = (this_instr [1 ].cache << 1 ) | flag ;
@@ -4635,23 +4630,18 @@ dummy_func(
4635
4630
///////// Tier-2 only opcodes /////////
4636
4631
4637
4632
op (_GUARD_IS_TRUE_POP , (flag -- )) {
4638
- PyObject * flag_o = PyStackRef_AsPyObjectBorrow (flag );
4639
-
4640
4633
SYNC_SP ();
4641
- EXIT_IF (!Py_IsTrue ( flag_o ));
4642
- assert (Py_IsTrue ( flag_o ));
4634
+ EXIT_IF (!PyStackRef_IsTrue ( flag ));
4635
+ assert (PyStackRef_IsTrue ( flag ));
4643
4636
}
4644
4637
4645
4638
op (_GUARD_IS_FALSE_POP , (flag -- )) {
4646
- PyObject * flag_o = PyStackRef_AsPyObjectBorrow (flag );
4647
-
4648
4639
SYNC_SP ();
4649
- EXIT_IF (!Py_IsFalse ( flag_o ));
4650
- assert (Py_IsFalse ( flag_o ));
4640
+ EXIT_IF (!PyStackRef_IsFalse ( flag ));
4641
+ assert (PyStackRef_IsFalse ( flag ));
4651
4642
}
4652
4643
4653
4644
op (_GUARD_IS_NONE_POP , (val -- )) {
4654
-
4655
4645
SYNC_SP ();
4656
4646
if (!PyStackRef_IsNone (value )) {
4657
4647
PyStackRef_CLOSE (val );
@@ -4660,7 +4650,6 @@ dummy_func(
4660
4650
}
4661
4651
4662
4652
op (_GUARD_IS_NOT_NONE_POP , (val -- )) {
4663
-
4664
4653
SYNC_SP ();
4665
4654
EXIT_IF (PyStackRef_IsNone (val ));
4666
4655
PyStackRef_CLOSE (val );
0 commit comments