@@ -107,13 +107,13 @@ _Py_uop_sym_is_const(JitOptContext *ctx, JitOptSymbol *sym)
107107 if (sym -> tag == JIT_SYM_KNOWN_VALUE_TAG ) {
108108 return true;
109109 }
110- if (sym -> tag == JIT_SYM_TRUTH_TAG ) {
111- JitOptSymbol * value = allocation_base (ctx ) + sym -> truth .value ;
112- int truth = _Py_uop_sym_truthiness (ctx , value );
113- if (truth < 0 ) {
110+ if (sym -> tag == JIT_SYM_TRUTHINESS_TAG ) {
111+ JitOptSymbol * value = allocation_base (ctx ) + sym -> truthiness .value ;
112+ int truthiness = _Py_uop_sym_truthiness (ctx , value );
113+ if (truthiness < 0 ) {
114114 return false;
115115 }
116- make_const (sym , (truth ^ sym -> truth .not ) ? Py_True : Py_False );
116+ make_const (sym , (truthiness ^ sym -> truthiness .not ) ? Py_True : Py_False );
117117 return true;
118118 }
119119 return false;
@@ -132,13 +132,13 @@ _Py_uop_sym_get_const(JitOptContext *ctx, JitOptSymbol *sym)
132132 if (sym -> tag == JIT_SYM_KNOWN_VALUE_TAG ) {
133133 return sym -> value .value ;
134134 }
135- if (sym -> tag == JIT_SYM_TRUTH_TAG ) {
136- JitOptSymbol * value = allocation_base (ctx ) + sym -> truth .value ;
137- int truth = _Py_uop_sym_truthiness (ctx , value );
138- if (truth < 0 ) {
135+ if (sym -> tag == JIT_SYM_TRUTHINESS_TAG ) {
136+ JitOptSymbol * value = allocation_base (ctx ) + sym -> truthiness .value ;
137+ int truthiness = _Py_uop_sym_truthiness (ctx , value );
138+ if (truthiness < 0 ) {
139139 return NULL ;
140140 }
141- PyObject * res = (truth ^ sym -> truth .not ) ? Py_True : Py_False ;
141+ PyObject * res = (truthiness ^ sym -> truthiness .not ) ? Py_True : Py_False ;
142142 make_const (sym , res );
143143 return res ;
144144 }
@@ -187,7 +187,7 @@ _Py_uop_sym_set_type(JitOptContext *ctx, JitOptSymbol *sym, PyTypeObject *typ)
187187 sym -> cls .version = 0 ;
188188 sym -> cls .type = typ ;
189189 return ;
190- case JIT_SYM_TRUTH_TAG :
190+ case JIT_SYM_TRUTHINESS_TAG :
191191 if (typ != & PyBool_Type ) {
192192 sym_set_bottom (ctx , sym );
193193 }
@@ -232,7 +232,7 @@ _Py_uop_sym_set_type_version(JitOptContext *ctx, JitOptSymbol *sym, unsigned int
232232 sym -> tag = JIT_SYM_TYPE_VERSION_TAG ;
233233 sym -> version .version = version ;
234234 return true;
235- case JIT_SYM_TRUTH_TAG :
235+ case JIT_SYM_TRUTHINESS_TAG :
236236 if (version != PyBool_Type .tp_version_tag ) {
237237 sym_set_bottom (ctx , sym );
238238 return false;
@@ -279,17 +279,17 @@ _Py_uop_sym_set_const(JitOptContext *ctx, JitOptSymbol *sym, PyObject *const_val
279279 case JIT_SYM_UNKNOWN_TAG :
280280 make_const (sym , const_val );
281281 return ;
282- case JIT_SYM_TRUTH_TAG :
282+ case JIT_SYM_TRUTHINESS_TAG :
283283 if (!PyBool_Check (const_val ) ||
284284 (_Py_uop_sym_is_const (ctx , sym ) &&
285285 _Py_uop_sym_get_const (ctx , sym ) != const_val ))
286286 {
287287 sym_set_bottom (ctx , sym );
288288 return ;
289289 }
290- JitOptSymbol * value = allocation_base (ctx ) + sym -> truth .value ;
290+ JitOptSymbol * value = allocation_base (ctx ) + sym -> truthiness .value ;
291291 PyTypeObject * type = _Py_uop_sym_get_type (value );
292- if (const_val == (sym -> truth .not ? Py_False : Py_True )) {
292+ if (const_val == (sym -> truthiness .not ? Py_False : Py_True )) {
293293 // value is truthy. This is only useful for bool:
294294 if (type == & PyBool_Type ) {
295295 _Py_uop_sym_set_const (ctx , value , Py_True );
@@ -401,7 +401,7 @@ _Py_uop_sym_get_type(JitOptSymbol *sym)
401401 return Py_TYPE (sym -> value .value );
402402 case JIT_SYM_TUPLE_TAG :
403403 return & PyTuple_Type ;
404- case JIT_SYM_TRUTH_TAG :
404+ case JIT_SYM_TRUTHINESS_TAG :
405405 return & PyBool_Type ;
406406 }
407407 Py_UNREACHABLE ();
@@ -425,7 +425,7 @@ _Py_uop_sym_get_type_version(JitOptSymbol *sym)
425425 return Py_TYPE (sym -> value .value )-> tp_version_tag ;
426426 case JIT_SYM_TUPLE_TAG :
427427 return PyTuple_Type .tp_version_tag ;
428- case JIT_SYM_TRUTH_TAG :
428+ case JIT_SYM_TRUTHINESS_TAG :
429429 return PyBool_Type .tp_version_tag ;
430430 }
431431 Py_UNREACHABLE ();
@@ -445,7 +445,7 @@ _Py_uop_sym_has_type(JitOptSymbol *sym)
445445 case JIT_SYM_KNOWN_CLASS_TAG :
446446 case JIT_SYM_KNOWN_VALUE_TAG :
447447 case JIT_SYM_TUPLE_TAG :
448- case JIT_SYM_TRUTH_TAG :
448+ case JIT_SYM_TRUTHINESS_TAG :
449449 return true;
450450 }
451451 Py_UNREACHABLE ();
@@ -483,16 +483,16 @@ _Py_uop_sym_truthiness(JitOptContext *ctx, JitOptSymbol *sym)
483483 break ;
484484 case JIT_SYM_TUPLE_TAG :
485485 return sym -> tuple .length != 0 ;
486- case JIT_SYM_TRUTH_TAG :
486+ case JIT_SYM_TRUTHINESS_TAG :
487487 ;
488- JitOptSymbol * value = allocation_base (ctx ) + sym -> truth .value ;
489- int truth = _Py_uop_sym_truthiness (ctx , value );
490- if (truth < 0 ) {
491- return truth ;
488+ JitOptSymbol * value = allocation_base (ctx ) + sym -> truthiness .value ;
489+ int truthiness = _Py_uop_sym_truthiness (ctx , value );
490+ if (truthiness < 0 ) {
491+ return truthiness ;
492492 }
493- truth ^= sym -> truth .not ;
494- make_const (sym , truth ? Py_True : Py_False );
495- return truth ;
493+ truthiness ^= sym -> truthiness .not ;
494+ make_const (sym , truthiness ? Py_True : Py_False );
495+ return truthiness ;
496496 }
497497 PyObject * value = sym -> value .value ;
498498 /* Only handle a few known safe types */
@@ -578,23 +578,23 @@ _Py_uop_sym_is_immortal(JitOptSymbol *sym)
578578}
579579
580580JitOptSymbol *
581- _Py_uop_sym_new_truth (JitOptContext * ctx , JitOptSymbol * value , bool not )
581+ _Py_uop_sym_new_truthiness (JitOptContext * ctx , JitOptSymbol * value , bool not )
582582{
583- if (value -> tag == JIT_SYM_TRUTH_TAG && value -> truth .not == not ) {
583+ if (value -> tag == JIT_SYM_TRUTHINESS_TAG && value -> truthiness .not == not ) {
584584 return value ;
585585 }
586586 JitOptSymbol * res = sym_new (ctx );
587587 if (res == NULL ) {
588588 return out_of_space (ctx );
589589 }
590- int truth = _Py_uop_sym_truthiness (ctx , value );
591- if (truth < 0 ) {
592- res -> tag = JIT_SYM_TRUTH_TAG ;
593- res -> truth .not = not ;
594- res -> truth .value = (uint16_t )(value - allocation_base (ctx ));
590+ int truthiness = _Py_uop_sym_truthiness (ctx , value );
591+ if (truthiness < 0 ) {
592+ res -> tag = JIT_SYM_TRUTHINESS_TAG ;
593+ res -> truthiness .not = not ;
594+ res -> truthiness .value = (uint16_t )(value - allocation_base (ctx ));
595595 }
596596 else {
597- make_const (res , (truth ^ not ) ? Py_True : Py_False );
597+ make_const (res , (truthiness ^ not ) ? Py_True : Py_False );
598598 }
599599 return res ;
600600}
0 commit comments