GH-118093: Handle some polymorphism before requiring progress in tier two (GH-122843)

This commit is contained in:
Brandt Bucher 2024-08-12 12:39:31 -07:00 committed by GitHub
parent 503af8fe9a
commit 9621a7d017
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 73 additions and 42 deletions

View file

@ -2501,7 +2501,7 @@ dummy_func(
start--;
}
_PyExecutorObject *executor;
int optimized = _PyOptimizer_Optimize(frame, start, stack_pointer, &executor);
int optimized = _PyOptimizer_Optimize(frame, start, stack_pointer, &executor, 0);
ERROR_IF(optimized < 0, error);
if (optimized) {
assert(tstate->previous_executor == NULL);
@ -4543,7 +4543,8 @@ dummy_func(
Py_INCREF(executor);
}
else {
int optimized = _PyOptimizer_Optimize(frame, target, stack_pointer, &executor);
int chain_depth = current_executor->vm_data.chain_depth + 1;
int optimized = _PyOptimizer_Optimize(frame, target, stack_pointer, &executor, chain_depth);
if (optimized <= 0) {
exit->temperature = restart_backoff_counter(temperature);
if (optimized < 0) {
@ -4626,7 +4627,7 @@ dummy_func(
exit->temperature = advance_backoff_counter(exit->temperature);
GOTO_TIER_ONE(target);
}
int optimized = _PyOptimizer_Optimize(frame, target, stack_pointer, &executor);
int optimized = _PyOptimizer_Optimize(frame, target, stack_pointer, &executor, 0);
if (optimized <= 0) {
exit->temperature = restart_backoff_counter(exit->temperature);
if (optimized < 0) {