mirror of
https://github.com/python/cpython.git
synced 2025-08-26 19:55:24 +00:00
GH-115685: Split _TO_BOOL_ALWAYS_TRUE
into micro-ops (GH-116352)
This commit is contained in:
parent
0c81ce1360
commit
23db9c6227
8 changed files with 50 additions and 44 deletions
7
Python/executor_cases.c.h
generated
7
Python/executor_cases.c.h
generated
|
@ -383,15 +383,10 @@
|
|||
break;
|
||||
}
|
||||
|
||||
case _TO_BOOL_ALWAYS_TRUE: {
|
||||
case _REPLACE_WITH_TRUE: {
|
||||
PyObject *value;
|
||||
PyObject *res;
|
||||
value = stack_pointer[-1];
|
||||
uint32_t version = (uint32_t)CURRENT_OPERAND();
|
||||
// This one is a bit weird, because we expect *some* failures:
|
||||
assert(version);
|
||||
if (Py_TYPE(value)->tp_version_tag != version) goto side_exit;
|
||||
STAT_INC(TO_BOOL, hit);
|
||||
Py_DECREF(value);
|
||||
res = Py_True;
|
||||
stack_pointer[-1] = res;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue