mirror of
https://github.com/python/cpython.git
synced 2025-08-23 18:24:46 +00:00
GH-131798: Remove type checks for _TO_BOOL_STR (GH-131816)
This commit is contained in:
parent
39fa19a4cc
commit
685fd74f81
10 changed files with 185 additions and 125 deletions
11
Python/optimizer_cases.c.h
generated
11
Python/optimizer_cases.c.h
generated
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue