@@ -99,7 +99,7 @@ sym_new(JitOptContext *ctx)
9999 }
100100 ctx -> t_arena .ty_curr_number ++ ;
101101 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 ;
103103 return self ;
104104}
105105
@@ -109,7 +109,7 @@ static void make_const(JitOptSymbol *sym, PyObject *val)
109109 sym -> value .value = Py_NewRef (val );
110110 // Constants don't need to be refcounted, as they are always
111111 // 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 ;
113113}
114114
115115static inline void
@@ -386,22 +386,23 @@ _Py_uop_sym_set_non_null(JitOptContext *ctx, JitOptSymbol *sym)
386386}
387387
388388void
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 )
390390{
391- sym -> skip_refcount = SKIP_REFCOUNT ;
391+ sym -> strong_ref_held_by_someone_else = SOMEONE_ELSE_HAS_A_VALID_STRONG_REF ;
392392}
393393
394394void
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 )
396396{
397- sym -> skip_refcount = DONT_SKIP_REFCOUNT ;
397+ sym -> strong_ref_held_by_someone_else = WE_MIGHT_BE_THE_ONLY_STRONG_REF ;
398398}
399399
400400bool
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 )
402402{
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 ;
405406}
406407
407408
@@ -794,7 +795,7 @@ _Py_uop_symbols_test(PyObject *Py_UNUSED(self), PyObject *Py_UNUSED(ignored))
794795 if (sym == NULL ) {
795796 goto fail ;
796797 }
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" );
798799 TEST_PREDICATE (!_Py_uop_sym_is_null (sym ), "top is NULL" );
799800 TEST_PREDICATE (!_Py_uop_sym_is_not_null (sym ), "top is not NULL" );
800801 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))
843844 goto fail ;
844845 }
845846 _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" );
847848 TEST_PREDICATE (_Py_uop_sym_truthiness (ctx , sym ) == 1 , "bool(42) is not True" );
848849 TEST_PREDICATE (!_Py_uop_sym_is_null (sym ), "42 is NULL" );
849850 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))
876877 if (sym == NULL ) {
877878 goto fail ;
878879 }
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" );
882883
883884 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" );
885886 TEST_PREDICATE (_Py_uop_sym_truthiness (ctx , sym ) == 0 , "bool(None) is not False" );
886887 sym = _Py_uop_sym_new_const (ctx , Py_False );
887888 TEST_PREDICATE (_Py_uop_sym_truthiness (ctx , sym ) == 0 , "bool(False) is not False" );
0 commit comments