diff options
author | Amit Lavon <amitlavon1.spam@gmail.com> | 2025-03-30 16:07:25 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-03-30 16:07:25 -0700 |
commit | 685fd74f81e673dc0430120f50009636b0e437a5 (patch) | |
tree | a415606ec816fdc47d597231184e3880309a56c5 /Python/optimizer_cases.c.h | |
parent | 39fa19a4ccb4c75d2421187e5b8d83c73b48ca4d (diff) | |
download | cpython-685fd74f81e673dc0430120f50009636b0e437a5.tar.gz cpython-685fd74f81e673dc0430120f50009636b0e437a5.zip |
GH-131798: Remove type checks for _TO_BOOL_STR (GH-131816)
Diffstat (limited to 'Python/optimizer_cases.c.h')
-rw-r--r-- | Python/optimizer_cases.c.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/Python/optimizer_cases.c.h b/Python/optimizer_cases.c.h index 85fa8f4a2a7..6a8ac75b63e 100644 --- a/Python/optimizer_cases.c.h +++ b/Python/optimizer_cases.c.h @@ -208,13 +208,22 @@ break; } + case _GUARD_TOS_UNICODE: { + JitOptSymbol *value; + value = stack_pointer[-1]; + if (sym_matches_type(value, &PyUnicode_Type)) { + REPLACE_OP(this_instr, _NOP, 0, 0); + } + sym_set_type(value, &PyUnicode_Type); + break; + } + case _TO_BOOL_STR: { JitOptSymbol *value; JitOptSymbol *res; value = stack_pointer[-1]; if (!optimize_to_bool(this_instr, ctx, value, &res)) { res = sym_new_truthiness(ctx, value, true); - sym_set_type(value, &PyUnicode_Type); } stack_pointer[-1] = res; break; |