mirror of
https://github.com/python/cpython.git
synced 2025-08-24 10:45:53 +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/executor_cases.c.h
generated
11
Python/executor_cases.c.h
generated
|
@ -653,16 +653,23 @@
|
|||
break;
|
||||
}
|
||||
|
||||
case _TO_BOOL_STR: {
|
||||
case _GUARD_TOS_UNICODE: {
|
||||
_PyStackRef value;
|
||||
_PyStackRef res;
|
||||
value = stack_pointer[-1];
|
||||
PyObject *value_o = PyStackRef_AsPyObjectBorrow(value);
|
||||
if (!PyUnicode_CheckExact(value_o)) {
|
||||
UOP_STAT_INC(uopcode, miss);
|
||||
JUMP_TO_JUMP_TARGET();
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case _TO_BOOL_STR: {
|
||||
_PyStackRef value;
|
||||
_PyStackRef res;
|
||||
value = stack_pointer[-1];
|
||||
STAT_INC(TO_BOOL, hit);
|
||||
PyObject *value_o = PyStackRef_AsPyObjectBorrow(value);
|
||||
if (value_o == &_Py_STR(empty)) {
|
||||
assert(_Py_IsImmortal(value_o));
|
||||
res = PyStackRef_False;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue