| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -202,7 +202,7 @@ typedef struct _jit_opt_tuple { | |||
| 202 | 202 | ||
| 203 | 203 | typedef struct { | |
| 204 | 204 | uint8_t tag; | |
| 205 | - bool not; | ||
| 205 | + bool invert; | ||
| 206 | 206 | uint16_t value; | |
| 207 | 207 | } JitOptTruthiness; | |
| 208 | 208 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -115,7 +115,7 @@ _Py_uop_sym_is_const(JitOptContext *ctx, JitOptSymbol *sym) | |||
| 115 | 115 | if (truthiness < 0) { | |
| 116 | 116 | return false; | |
| 117 | 117 | } | |
| 118 | - make_const(sym, (truthiness ^ sym->truthiness.not) ? Py_True : Py_False); | ||
| 118 | + make_const(sym, (truthiness ^ sym->truthiness.invert) ? Py_True : Py_False); | ||
| 119 | 119 | return true; | |
| 120 | 120 | } | |
| 121 | 121 | return false; | |
@@ -140,7 +140,7 @@ _Py_uop_sym_get_const(JitOptContext *ctx, JitOptSymbol *sym) | |||
| 140 | 140 | if (truthiness < 0) { | |
| 141 | 141 | return NULL; | |
| 142 | 142 | } | |
| 143 | - PyObject *res = (truthiness ^ sym->truthiness.not) ? Py_True : Py_False; | ||
| 143 | + PyObject *res = (truthiness ^ sym->truthiness.invert) ? Py_True : Py_False; | ||
| 144 | 144 | make_const(sym, res); | |
| 145 | 145 | return res; | |
| 146 | 146 | } | |
@@ -291,7 +291,7 @@ _Py_uop_sym_set_const(JitOptContext *ctx, JitOptSymbol *sym, PyObject *const_val | |||
| 291 | 291 | } | |
| 292 | 292 | JitOptSymbol *value = allocation_base(ctx) + sym->truthiness.value; | |
| 293 | 293 | PyTypeObject *type = _Py_uop_sym_get_type(value); | |
| 294 | - if (const_val == (sym->truthiness.not ? Py_False : Py_True)) { | ||
| 294 | + if (const_val == (sym->truthiness.invert ? Py_False : Py_True)) { | ||
| 295 | 295 | // value is truthy. This is only useful for bool: | |
| 296 | 296 | if (type == &PyBool_Type) { | |
| 297 | 297 | _Py_uop_sym_set_const(ctx, value, Py_True); | |
@@ -498,7 +498,7 @@ _Py_uop_sym_truthiness(JitOptContext *ctx, JitOptSymbol *sym) | |||
| 498 | 498 | if (truthiness < 0) { | |
| 499 | 499 | return truthiness; | |
| 500 | 500 | } | |
| 501 | - truthiness ^= sym->truthiness.not; | ||
| 501 | + truthiness ^= sym->truthiness.invert; | ||
| 502 | 502 | make_const(sym, truthiness ? Py_True : Py_False); | |
| 503 | 503 | return truthiness; | |
| 504 | 504 | } | |
@@ -592,8 +592,8 @@ JitOptSymbol * | |||
| 592 | 592 | _Py_uop_sym_new_truthiness(JitOptContext *ctx, JitOptSymbol *value, bool truthy) | |
| 593 | 593 | { | |
| 594 | 594 | // It's clearer to invert this in the signature: | |
| 595 | - bool not = !truthy; | ||
| 596 | - if (value->tag == JIT_SYM_TRUTHINESS_TAG && value->truthiness.not == not) { | ||
| 595 | + bool invert = !truthy; | ||
| 596 | + if (value->tag == JIT_SYM_TRUTHINESS_TAG && value->truthiness.invert == invert) { | ||
| 597 | 597 | return value; | |
| 598 | 598 | } | |
| 599 | 599 | JitOptSymbol *res = sym_new(ctx); | |
@@ -603,11 +603,11 @@ _Py_uop_sym_new_truthiness(JitOptContext *ctx, JitOptSymbol *value, bool truthy) | |||
| 603 | 603 | int truthiness = _Py_uop_sym_truthiness(ctx, value); | |
| 604 | 604 | if (truthiness < 0) { | |
| 605 | 605 | res->tag = JIT_SYM_TRUTHINESS_TAG; | |
| 606 | - res->truthiness.not = not; | ||
| 606 | + res->truthiness.invert = invert; | ||
| 607 | 607 | res->truthiness.value = (uint16_t)(value - allocation_base(ctx)); | |
| 608 | 608 | } | |
| 609 | 609 | else { | |
| 610 | - make_const(res, (truthiness ^ not) ? Py_True : Py_False); | ||
| 610 | + make_const(res, (truthiness ^ invert) ? Py_True : Py_False); | ||
| 611 | 611 | } | |
| 612 | 612 | return res; | |
| 613 | 613 | } | |
| Back | FazBrowse Home | New Git URL |
0 commit comments