Skip to content

Commit 57f6c39

Browse files
committed
Address code review
1 parent 917c6f0 commit 57f6c39

File tree

2 files changed

+4
-10
lines changed

2 files changed

+4
-10
lines changed

Include/internal/pycore_optimizer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ PyAPI_FUNC(void) _Py_Executors_InvalidateCold(PyInterpreterState *interp);
119119
#define JIT_CLEANUP_THRESHOLD 100000
120120

121121
// This is the length of the trace we project initially.
122-
#define UOP_MAX_TRACE_LENGTH 800
122+
#define UOP_MAX_TRACE_LENGTH 1200
123123

124124
#define TRACE_STACK_SIZE 5
125125

Python/optimizer.c

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -550,8 +550,7 @@ translate_bytecode_to_trace(
550550
_Py_CODEUNIT *instr,
551551
_PyUOpInstruction *trace,
552552
int buffer_size,
553-
_PyBloomFilter *dependencies, bool progress_needed,
554-
bool is_noopt)
553+
_PyBloomFilter *dependencies, bool progress_needed)
555554
{
556555
bool first = true;
557556
PyCodeObject *code = _PyFrame_GetCode(frame);
@@ -592,12 +591,7 @@ translate_bytecode_to_trace(
592591

593592
for (;;) {
594593
target = INSTR_IP(instr, code);
595-
if (is_noopt) {
596-
max_length-=2;
597-
}
598-
else {
599-
max_length--;
600-
}
594+
max_length-=2;
601595
uint32_t opcode = instr->op.code;
602596
uint32_t oparg = instr->op.arg;
603597

@@ -1292,7 +1286,7 @@ uop_optimize(
12921286
if (env_var == NULL || *env_var == '\0' || *env_var > '0') {
12931287
is_noopt = false;
12941288
}
1295-
int length = translate_bytecode_to_trace(frame, instr, buffer, UOP_MAX_TRACE_LENGTH, &dependencies, progress_needed, is_noopt);
1289+
int length = translate_bytecode_to_trace(frame, instr, buffer, UOP_MAX_TRACE_LENGTH, &dependencies, progress_needed);
12961290
if (length <= 0) {
12971291
// Error or nothing translated
12981292
return length;

0 commit comments

Comments
 (0)