@@ -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 -> strong_ref_held_by_someone_else = WE_MIGHT_BE_THE_ONLY_STRONG_REF ;
102+ self -> skip_refcount = DONT_SKIP_REFCOUNT ;
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 -> strong_ref_held_by_someone_else = SOMEONE_ELSE_HAS_A_VALID_STRONG_REF ;
112+ sym -> skip_refcount = SKIP_REFCOUNT ;
113113}
114114
115115static inline void
@@ -386,23 +386,22 @@ _Py_uop_sym_set_non_null(JitOptContext *ctx, JitOptSymbol *sym)
386386}
387387
388388void
389- _Py_uop_sym_set_strong_ref_is_held_by_someone_else (JitOptContext * ctx , JitOptSymbol * sym )
389+ _Py_uop_sym_set_skip_refcount (JitOptContext * ctx , JitOptSymbol * sym )
390390{
391- sym -> strong_ref_held_by_someone_else = SOMEONE_ELSE_HAS_A_VALID_STRONG_REF ;
391+ sym -> skip_refcount = SKIP_REFCOUNT ;
392392}
393393
394394void
395- _Py_uop_sym_set_strong_ref_might_be_this_sym (JitOptContext * ctx , JitOptSymbol * sym )
395+ _Py_uop_sym_set_dont_skip_refcount (JitOptContext * ctx , JitOptSymbol * sym )
396396{
397- sym -> strong_ref_held_by_someone_else = WE_MIGHT_BE_THE_ONLY_STRONG_REF ;
397+ sym -> skip_refcount = DONT_SKIP_REFCOUNT ;
398398}
399399
400400bool
401- _Py_uop_sym_is_strong_ref_held_by_someone_else (JitOptContext * ctx , JitOptSymbol * sym )
401+ _Py_uop_sym_is_skip_refcount (JitOptContext * ctx , JitOptSymbol * sym )
402402{
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 ;
403+ assert (sym -> skip_refcount == SKIP_REFCOUNT || sym -> skip_refcount == DONT_SKIP_REFCOUNT );
404+ return sym -> skip_refcount == SKIP_REFCOUNT ;
406405}
407406
408407
@@ -795,7 +794,7 @@ _Py_uop_symbols_test(PyObject *Py_UNUSED(self), PyObject *Py_UNUSED(ignored))
795794 if (sym == NULL ) {
796795 goto fail ;
797796 }
798- TEST_PREDICATE (!_Py_uop_sym_is_strong_ref_held_by_someone_else (ctx , sym ), "top is refcounted" );
797+ TEST_PREDICATE (!_Py_uop_sym_is_skip_refcount (ctx , sym ), "top is refcounted" );
799798 TEST_PREDICATE (!_Py_uop_sym_is_null (sym ), "top is NULL" );
800799 TEST_PREDICATE (!_Py_uop_sym_is_not_null (sym ), "top is not NULL" );
801800 TEST_PREDICATE (!_Py_uop_sym_matches_type (sym , & PyLong_Type ), "top matches a type" );
@@ -844,7 +843,7 @@ _Py_uop_symbols_test(PyObject *Py_UNUSED(self), PyObject *Py_UNUSED(ignored))
844843 goto fail ;
845844 }
846845 _Py_uop_sym_set_const (ctx , sym , val_42 );
847- TEST_PREDICATE (_Py_uop_sym_is_strong_ref_held_by_someone_else (ctx , sym ), "42 isn't refcounted" );
846+ TEST_PREDICATE (_Py_uop_sym_is_skip_refcount (ctx , sym ), "42 isn't refcounted" );
848847 TEST_PREDICATE (_Py_uop_sym_truthiness (ctx , sym ) == 1 , "bool(42) is not True" );
849848 TEST_PREDICATE (!_Py_uop_sym_is_null (sym ), "42 is NULL" );
850849 TEST_PREDICATE (_Py_uop_sym_is_not_null (sym ), "42 isn't not NULL" );
@@ -877,12 +876,12 @@ _Py_uop_symbols_test(PyObject *Py_UNUSED(self), PyObject *Py_UNUSED(ignored))
877876 if (sym == NULL ) {
878877 goto fail ;
879878 }
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" );
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" );
883882
884883 sym = _Py_uop_sym_new_const (ctx , Py_None );
885- TEST_PREDICATE (_Py_uop_sym_is_strong_ref_held_by_someone_else (ctx , sym ), "None should not be refcounted" );
884+ TEST_PREDICATE (_Py_uop_sym_is_skip_refcount (ctx , sym ), "None should not be refcounted" );
886885 TEST_PREDICATE (_Py_uop_sym_truthiness (ctx , sym ) == 0 , "bool(None) is not False" );
887886 sym = _Py_uop_sym_new_const (ctx , Py_False );
888887 TEST_PREDICATE (_Py_uop_sym_truthiness (ctx , sym ) == 0 , "bool(False) is not False" );
0 commit comments