mirror of
https://github.com/python/cpython.git
synced 2025-10-17 04:08:28 +00:00
gh-115999: Add free-threaded specialization for `TO_BOOL
` (gh-126616)
This commit is contained in:
parent
09c240f20c
commit
78a530a578
7 changed files with 168 additions and 69 deletions
6
Python/generated_cases.c.h
generated
6
Python/generated_cases.c.h
generated
|
@ -7758,7 +7758,7 @@
|
|||
value = stack_pointer[-1];
|
||||
uint16_t counter = read_u16(&this_instr[1].cache);
|
||||
(void)counter;
|
||||
#if ENABLE_SPECIALIZATION
|
||||
#if ENABLE_SPECIALIZATION_FT
|
||||
if (ADAPTIVE_COUNTER_TRIGGERS(counter)) {
|
||||
next_instr = this_instr;
|
||||
_PyFrame_SetStackPointer(frame, stack_pointer);
|
||||
|
@ -7768,7 +7768,7 @@
|
|||
}
|
||||
OPCODE_DEFERRED_INC(TO_BOOL);
|
||||
ADVANCE_ADAPTIVE_COUNTER(this_instr[1].counter);
|
||||
#endif /* ENABLE_SPECIALIZATION */
|
||||
#endif /* ENABLE_SPECIALIZATION_FT */
|
||||
}
|
||||
/* Skip 2 cache entries */
|
||||
// _TO_BOOL
|
||||
|
@ -7863,7 +7863,7 @@
|
|||
PyObject *value_o = PyStackRef_AsPyObjectBorrow(value);
|
||||
DEOPT_IF(!PyList_CheckExact(value_o), TO_BOOL);
|
||||
STAT_INC(TO_BOOL, hit);
|
||||
res = Py_SIZE(value_o) ? PyStackRef_True : PyStackRef_False;
|
||||
res = PyList_GET_SIZE(value_o) ? PyStackRef_True : PyStackRef_False;
|
||||
PyStackRef_CLOSE(value);
|
||||
stack_pointer[-1] = res;
|
||||
DISPATCH();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue