@@ -1470,7 +1470,7 @@ dummy_func(
1470
1470
1471
1471
inst (STORE_GLOBAL , (v -- )) {
1472
1472
PyObject * name = GETITEM (FRAME_CO_NAMES , oparg );
1473
- int err = PyDict_SetItem (GLOBALS (), name , PyStackRef_AsPyObjectSteal (v ));
1473
+ int err = PyDict_SetItem (GLOBALS (), name , PyStackRef_AsPyObjectBorrow (v ));
1474
1474
DECREF_INPUTS ();
1475
1475
ERROR_IF (err , error );
1476
1476
}
@@ -1490,13 +1490,13 @@ dummy_func(
1490
1490
}
1491
1491
1492
1492
inst (LOAD_LOCALS , ( -- locals )) {
1493
- _PyStackRef locals_s = PyStackRef_FromPyObjectSteal ( LOCALS () );
1494
- if (PyStackRef_IsNull ( locals_s ) ) {
1493
+ PyObject * l = LOCALS ();
1494
+ if (l == NULL ) {
1495
1495
_PyErr_SetString (tstate , PyExc_SystemError ,
1496
1496
"no locals found" );
1497
1497
ERROR_IF (true, error );
1498
1498
}
1499
- locals = PyStackRef_DUP ( locals_s ) ;
1499
+ locals = PyStackRef_FromPyObjectNew ( l ); ;
1500
1500
}
1501
1501
1502
1502
inst (LOAD_FROM_DICT_OR_GLOBALS , (mod_or_class_dict -- v )) {
@@ -2479,7 +2479,7 @@ dummy_func(
2479
2479
int sign_ish = COMPARISON_BIT (dleft , dright );
2480
2480
_Py_DECREF_SPECIALIZED (left_o , _PyFloat_ExactDealloc );
2481
2481
_Py_DECREF_SPECIALIZED (right_o , _PyFloat_ExactDealloc );
2482
- res = PyStackRef_FromPyObjectSteal (( sign_ish & oparg ) ? Py_True : Py_False );
2482
+ res = ( sign_ish & oparg ) ? PyStackRef_True () : PyStackRef_False ( );
2483
2483
// It's always a bool, so we don't care about oparg & 16.
2484
2484
}
2485
2485
@@ -2499,7 +2499,7 @@ dummy_func(
2499
2499
int sign_ish = COMPARISON_BIT (ileft , iright );
2500
2500
_Py_DECREF_SPECIALIZED (left_o , (destructor )PyObject_Free );
2501
2501
_Py_DECREF_SPECIALIZED (right_o , (destructor )PyObject_Free );
2502
- res = PyStackRef_FromPyObjectSteal (( sign_ish & oparg ) ? Py_True : Py_False );
2502
+ res = ( sign_ish & oparg ) ? PyStackRef_True () : PyStackRef_False ( );
2503
2503
// It's always a bool, so we don't care about oparg & 16.
2504
2504
}
2505
2505
@@ -2516,7 +2516,7 @@ dummy_func(
2516
2516
assert (eq == 0 || eq == 1 );
2517
2517
assert ((oparg & 0xf ) == COMPARISON_NOT_EQUALS || (oparg & 0xf ) == COMPARISON_EQUALS );
2518
2518
assert (COMPARISON_NOT_EQUALS + 1 == COMPARISON_EQUALS );
2519
- res = PyStackRef_FromPyObjectSteal ((( COMPARISON_NOT_EQUALS + eq ) & oparg ) ? Py_True : Py_False );
2519
+ res = (( COMPARISON_NOT_EQUALS + eq ) & oparg ) ? PyStackRef_True () : PyStackRef_False ( );
2520
2520
// It's always a bool, so we don't care about oparg & 16.
2521
2521
}
2522
2522
@@ -2526,7 +2526,7 @@ dummy_func(
2526
2526
2527
2527
int res = Py_Is (left_o , right_o ) ^ oparg ;
2528
2528
DECREF_INPUTS ();
2529
- b = PyStackRef_FromPyObjectSteal ( res ? Py_True : Py_False );
2529
+ b = res ? PyStackRef_True () : PyStackRef_False ( );
2530
2530
}
2531
2531
2532
2532
family (CONTAINS_OP , INLINE_CACHE_ENTRIES_CONTAINS_OP ) = {
@@ -2541,7 +2541,7 @@ dummy_func(
2541
2541
int res = PySequence_Contains (right_o , left_o );
2542
2542
DECREF_INPUTS ();
2543
2543
ERROR_IF (res < 0 , error );
2544
- b = PyStackRef_FromPyObjectSteal (( res ^ oparg ) ? Py_True : Py_False );
2544
+ b = ( res ^ oparg ) ? PyStackRef_True () : PyStackRef_False ( );
2545
2545
}
2546
2546
2547
2547
specializing op (_SPECIALIZE_CONTAINS_OP , (counter /1 , left , right -- left , right )) {
@@ -2568,7 +2568,7 @@ dummy_func(
2568
2568
int res = _PySet_Contains ((PySetObject * )right_o , left_o );
2569
2569
DECREF_INPUTS ();
2570
2570
ERROR_IF (res < 0 , error );
2571
- b = PyStackRef_FromPyObjectSteal (( res ^ oparg ) ? Py_True : Py_False );
2571
+ b = ( res ^ oparg ) ? PyStackRef_True () : PyStackRef_False ( );
2572
2572
}
2573
2573
2574
2574
inst (CONTAINS_OP_DICT , (unused /1 , left , right -- b )) {
@@ -2580,7 +2580,7 @@ dummy_func(
2580
2580
int res = PyDict_Contains (right_o , left_o );
2581
2581
DECREF_INPUTS ();
2582
2582
ERROR_IF (res < 0 , error );
2583
- b = PyStackRef_FromPyObjectSteal (( res ^ oparg ) ? Py_True : Py_False );
2583
+ b = ( res ^ oparg ) ? PyStackRef_True () : PyStackRef_False ( );
2584
2584
}
2585
2585
2586
2586
inst (CHECK_EG_MATCH , (exc_value_st , match_type_st -- rest , match )) {
@@ -2621,7 +2621,7 @@ dummy_func(
2621
2621
2622
2622
int res = PyErr_GivenExceptionMatches (left_o , right_o );
2623
2623
DECREF_INPUTS ();
2624
- b = PyStackRef_FromPyObjectSteal ( res ? Py_True : Py_False );
2624
+ b = res ? PyStackRef_True () : PyStackRef_False ( );
2625
2625
}
2626
2626
2627
2627
tier1 inst (IMPORT_NAME , (level , fromlist -- res )) {
@@ -3503,17 +3503,17 @@ dummy_func(
3503
3503
assert (Py_TYPE (callable_o ) == & PyFunction_Type );
3504
3504
int code_flags = ((PyCodeObject * )PyFunction_GET_CODE (callable_o ))-> co_flags ;
3505
3505
PyObject * locals = code_flags & CO_OPTIMIZED ? NULL : Py_NewRef (PyFunction_GET_GLOBALS (callable_o ));
3506
- _PyInterpreterFrame * new_frame_o = _PyEvalFramePushAndInit (
3506
+ _PyInterpreterFrame * _new_frame = _PyEvalFramePushAndInit (
3507
3507
tstate , (PyFunctionObject * )PyStackRef_AsPyObjectSteal (callable ), locals ,
3508
3508
args , total_args , NULL
3509
3509
);
3510
3510
// The frame has stolen all the arguments from the stack,
3511
3511
// so there is no need to clean them up.
3512
3512
SYNC_SP ();
3513
- if (new_frame_o == NULL ) {
3513
+ if (_new_frame == NULL ) {
3514
3514
ERROR_NO_POP ();
3515
3515
}
3516
- new_frame = (_PyStackRef ) { .bits = (uintptr_t )new_frame_o };
3516
+ new_frame = (_PyStackRef ) { .bits = (uintptr_t )_new_frame };
3517
3517
}
3518
3518
3519
3519
op (_CHECK_FUNCTION_VERSION , (func_version /2 , callable , unused , unused [oparg ] -- callable , unused , unused [oparg ])) {
@@ -3647,13 +3647,13 @@ dummy_func(
3647
3647
int has_self = !PyStackRef_IsNull (self_or_null );
3648
3648
STAT_INC (CALL , hit );
3649
3649
PyFunctionObject * func = (PyFunctionObject * )callable_o ;
3650
- _PyInterpreterFrame * new_frame_o = _PyFrame_PushUnchecked (tstate , func , oparg + has_self );
3651
- _PyStackRef * first_non_self_local = new_frame_o -> localsplus + has_self ;
3652
- new_frame_o -> localsplus [0 ] = self_or_null ;
3650
+ _PyInterpreterFrame * _new_frame = _PyFrame_PushUnchecked (tstate , func , oparg + has_self );
3651
+ _PyStackRef * first_non_self_local = _new_frame -> localsplus + has_self ;
3652
+ _new_frame -> localsplus [0 ] = self_or_null ;
3653
3653
for (int i = 0 ; i < oparg ; i ++ ) {
3654
3654
first_non_self_local [i ] = args [i ];
3655
3655
}
3656
- new_frame = (_PyStackRef ) { .bits = (uintptr_t )new_frame_o };
3656
+ new_frame = (_PyStackRef ) { .bits = (uintptr_t )_new_frame };
3657
3657
}
3658
3658
3659
3659
op (_PUSH_FRAME , (new_frame -- )) {
@@ -3938,7 +3938,6 @@ dummy_func(
3938
3938
DECREF_INPUTS ();
3939
3939
ERROR_IF (true, error );
3940
3940
}
3941
- ERROR_IF (args_o == NULL , error );
3942
3941
PyObject * res_o = cfunc (PyCFunction_GET_SELF (callable_o ), args_o , total_args , NULL );
3943
3942
STACKREFS_TO_PYOBJECTS_CLEANUP (args_o );
3944
3943
0 commit comments