mirror of
https://github.com/python/cpython.git
synced 2025-08-23 18:24:46 +00:00
gh-115999: Specialize LOAD_SUPER_ATTR
in free-threaded builds (gh-127128)
Use existing helpers to atomically modify the bytecode. Add unit tests to ensure specializing is happening as expected. Add test_specialize.py that can be used with ThreadSanitizer to detect data races. Fix thread safety issue with cell_set_contents().
This commit is contained in:
parent
8ba9f5bca9
commit
0cb5222079
6 changed files with 51 additions and 21 deletions
4
Python/generated_cases.c.h
generated
4
Python/generated_cases.c.h
generated
|
@ -6330,7 +6330,7 @@
|
|||
global_super_st = stack_pointer[-3];
|
||||
uint16_t counter = read_u16(&this_instr[1].cache);
|
||||
(void)counter;
|
||||
#if ENABLE_SPECIALIZATION
|
||||
#if ENABLE_SPECIALIZATION_FT
|
||||
int load_method = oparg & 1;
|
||||
if (ADAPTIVE_COUNTER_TRIGGERS(counter)) {
|
||||
next_instr = this_instr;
|
||||
|
@ -6341,7 +6341,7 @@
|
|||
}
|
||||
OPCODE_DEFERRED_INC(LOAD_SUPER_ATTR);
|
||||
ADVANCE_ADAPTIVE_COUNTER(this_instr[1].counter);
|
||||
#endif /* ENABLE_SPECIALIZATION */
|
||||
#endif /* ENABLE_SPECIALIZATION_FT */
|
||||
}
|
||||
// _LOAD_SUPER_ATTR
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue