Skip to content

Commit 897edf5

Browse files
remove two chain depths
1 parent ffa2b72 commit 897edf5

File tree

2 files changed

+1
-9
lines changed

2 files changed

+1
-9
lines changed

Include/internal/pycore_optimizer.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,9 +132,6 @@ static inline uint16_t uop_get_error_target(const _PyUOpInstruction *inst)
132132
// handle before rejoining the rest of the program.
133133
#define MAX_CHAIN_DEPTH 4
134134

135-
// The maximum number of side exits arising from unpredictable control-flow.
136-
#define MAX_DYNAMIC_CHAIN_DEPTH 6
137-
138135
/* Symbols */
139136
/* See explanation in optimizer_symbols.c */
140137

Python/optimizer.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -133,12 +133,7 @@ _PyOptimizer_Optimize(
133133
// make progress in order to avoid infinite loops or excessively-long
134134
// side-exit chains. We can only insert the executor into the bytecode if
135135
// this is true, since a deopt won't infinitely re-enter the executor:
136-
if (tstate->interp->jit_state.code_buffer[0].opcode == _START_DYNAMIC_EXECUTOR) {
137-
chain_depth %= MAX_DYNAMIC_CHAIN_DEPTH;
138-
}
139-
else {
140-
chain_depth %= MAX_CHAIN_DEPTH;
141-
}
136+
chain_depth %= MAX_CHAIN_DEPTH;
142137
bool progress_needed = chain_depth == 0;
143138
PyCodeObject *code = (PyCodeObject *)tstate->interp->jit_state.initial_code;
144139
_Py_CODEUNIT *start = tstate->interp->jit_state.insert_exec_instr;

0 commit comments

Comments
 (0)