Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 716c0c6

Browse files
committed
Fix tests
1 parent 451ae6c commit 716c0c6

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

Python/bytecodes.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2340,7 +2340,7 @@ dummy_func(
23402340
JUMPBY(-oparg);
23412341
#if ENABLE_SPECIALIZATION
23422342
uint16_t counter = this_instr[1].cache;
2343-
if (ADAPTIVE_COUNTER_IS_ZERO(counter) && this_instr->op.code == JUMP_BACKWARD) {
2343+
if (ADAPTIVE_COUNTER_IS_ZERO(counter)) {
23442344
if (counter == 0) {
23452345
// Dynamically initialize the counter
23462346
PyInterpreterState *interp = tstate->interp;
@@ -2350,7 +2350,7 @@ dummy_func(
23502350
this_instr[1].cache = counter;
23512351
}
23522352
}
2353-
else {
2353+
if (ADAPTIVE_COUNTER_IS_ZERO(counter) && this_instr->op.code == JUMP_BACKWARD) {
23542354
_Py_CODEUNIT *start = this_instr;
23552355
/* Back up over EXTENDED_ARGs so optimizer sees the whole instruction */
23562356
while (oparg > 255) {

Python/generated_cases.c.h

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Python/optimizer.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ shift_and_offset_threshold(uint32_t threshold)
136136
if (threshold == OPTIMIZER_UNREACHABLE_THRESHOLD) {
137137
return threshold;
138138
}
139-
return adaptive_counter_bits(threshold - 1, MIN_TIER2_BACKOFF);
139+
return adaptive_counter_bits(threshold, MIN_TIER2_BACKOFF);
140140
}
141141

142142
_PyOptimizerObject *

0 commit comments

Comments
 (0)