@@ -99,7 +99,7 @@ sym_new(JitOptContext *ctx)
99
99
}
100
100
ctx -> t_arena .ty_curr_number ++ ;
101
101
self -> tag = JIT_SYM_UNKNOWN_TAG ;
102
- self -> skip_refcount = DONT_SKIP_REFCOUNT ;
102
+ self -> strong_ref_held_by_someone_else = WE_MIGHT_BE_THE_ONLY_STRONG_REF ;
103
103
return self ;
104
104
}
105
105
@@ -109,7 +109,7 @@ static void make_const(JitOptSymbol *sym, PyObject *val)
109
109
sym -> value .value = Py_NewRef (val );
110
110
// Constants don't need to be refcounted, as they are always
111
111
// kept alive by co_consts.
112
- sym -> skip_refcount = SKIP_REFCOUNT ;
112
+ sym -> strong_ref_held_by_someone_else = SOMEONE_ELSE_HAS_A_VALID_STRONG_REF ;
113
113
}
114
114
115
115
static inline void
@@ -386,22 +386,23 @@ _Py_uop_sym_set_non_null(JitOptContext *ctx, JitOptSymbol *sym)
386
386
}
387
387
388
388
void
389
- _Py_uop_sym_set_skip_refcount (JitOptContext * ctx , JitOptSymbol * sym )
389
+ _Py_uop_sym_set_strong_ref_is_held_by_someone_else (JitOptContext * ctx , JitOptSymbol * sym )
390
390
{
391
- sym -> skip_refcount = SKIP_REFCOUNT ;
391
+ sym -> strong_ref_held_by_someone_else = SOMEONE_ELSE_HAS_A_VALID_STRONG_REF ;
392
392
}
393
393
394
394
void
395
- _Py_uop_sym_set_dont_skip_refcount (JitOptContext * ctx , JitOptSymbol * sym )
395
+ _Py_uop_sym_set_strong_ref_might_be_this_sym (JitOptContext * ctx , JitOptSymbol * sym )
396
396
{
397
- sym -> skip_refcount = DONT_SKIP_REFCOUNT ;
397
+ sym -> strong_ref_held_by_someone_else = WE_MIGHT_BE_THE_ONLY_STRONG_REF ;
398
398
}
399
399
400
400
bool
401
- _Py_uop_sym_is_skip_refcount (JitOptContext * ctx , JitOptSymbol * sym )
401
+ _Py_uop_sym_is_strong_ref_held_by_someone_else (JitOptContext * ctx , JitOptSymbol * sym )
402
402
{
403
- assert (sym -> skip_refcount == SKIP_REFCOUNT || sym -> skip_refcount == DONT_SKIP_REFCOUNT );
404
- return sym -> skip_refcount == SKIP_REFCOUNT ;
403
+ assert (sym -> strong_ref_held_by_someone_else == SOMEONE_ELSE_HAS_A_VALID_STRONG_REF ||
404
+ sym -> strong_ref_held_by_someone_else == WE_MIGHT_BE_THE_ONLY_STRONG_REF );
405
+ return sym -> strong_ref_held_by_someone_else == SOMEONE_ELSE_HAS_A_VALID_STRONG_REF ;
405
406
}
406
407
407
408
@@ -794,7 +795,7 @@ _Py_uop_symbols_test(PyObject *Py_UNUSED(self), PyObject *Py_UNUSED(ignored))
794
795
if (sym == NULL ) {
795
796
goto fail ;
796
797
}
797
- TEST_PREDICATE (!_Py_uop_sym_is_skip_refcount (ctx , sym ), "top is refcounted" );
798
+ TEST_PREDICATE (!_Py_uop_sym_is_strong_ref_held_by_someone_else (ctx , sym ), "top is refcounted" );
798
799
TEST_PREDICATE (!_Py_uop_sym_is_null (sym ), "top is NULL" );
799
800
TEST_PREDICATE (!_Py_uop_sym_is_not_null (sym ), "top is not NULL" );
800
801
TEST_PREDICATE (!_Py_uop_sym_matches_type (sym , & PyLong_Type ), "top matches a type" );
@@ -843,7 +844,7 @@ _Py_uop_symbols_test(PyObject *Py_UNUSED(self), PyObject *Py_UNUSED(ignored))
843
844
goto fail ;
844
845
}
845
846
_Py_uop_sym_set_const (ctx , sym , val_42 );
846
- TEST_PREDICATE (_Py_uop_sym_is_skip_refcount (ctx , sym ), "42 isn't refcounted" );
847
+ TEST_PREDICATE (_Py_uop_sym_is_strong_ref_held_by_someone_else (ctx , sym ), "42 isn't refcounted" );
847
848
TEST_PREDICATE (_Py_uop_sym_truthiness (ctx , sym ) == 1 , "bool(42) is not True" );
848
849
TEST_PREDICATE (!_Py_uop_sym_is_null (sym ), "42 is NULL" );
849
850
TEST_PREDICATE (_Py_uop_sym_is_not_null (sym ), "42 isn't not NULL" );
@@ -876,12 +877,12 @@ _Py_uop_symbols_test(PyObject *Py_UNUSED(self), PyObject *Py_UNUSED(ignored))
876
877
if (sym == NULL ) {
877
878
goto fail ;
878
879
}
879
- TEST_PREDICATE (!_Py_uop_sym_is_skip_refcount (ctx , sym ), "type should be refcounted" );
880
- _Py_uop_sym_set_skip_refcount (ctx , sym );
881
- TEST_PREDICATE (_Py_uop_sym_is_skip_refcount (ctx , sym ), "type should not be refcounted" );
880
+ TEST_PREDICATE (!_Py_uop_sym_is_strong_ref_held_by_someone_else (ctx , sym ), "type should be refcounted" );
881
+ _Py_uop_sym_set_strong_ref_is_held_by_someone_else (ctx , sym );
882
+ TEST_PREDICATE (_Py_uop_sym_is_strong_ref_held_by_someone_else (ctx , sym ), "type should not be refcounted" );
882
883
883
884
sym = _Py_uop_sym_new_const (ctx , Py_None );
884
- TEST_PREDICATE (_Py_uop_sym_is_skip_refcount (ctx , sym ), "None should not be refcounted" );
885
+ TEST_PREDICATE (_Py_uop_sym_is_strong_ref_held_by_someone_else (ctx , sym ), "None should not be refcounted" );
885
886
TEST_PREDICATE (_Py_uop_sym_truthiness (ctx , sym ) == 0 , "bool(None) is not False" );
886
887
sym = _Py_uop_sym_new_const (ctx , Py_False );
887
888
TEST_PREDICATE (_Py_uop_sym_truthiness (ctx , sym ) == 0 , "bool(False) is not False" );
0 commit comments