Skip to content

Commit c5de275

Browse files
move strange control flow detection up
1 parent 5cfc7a9 commit c5de275

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

Python/optimizer.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -628,6 +628,14 @@ _PyJit_translate_single_bytecode_to_trace(
628628
goto done;
629629
}
630630

631+
// Strange control-flow
632+
bool has_dynamic_jump_taken = OPCODE_HAS_UNPREDICTABLE_JUMP(opcode) &&
633+
(next_instr != this_instr + 1 + _PyOpcode_Caches[_PyOpcode_Deopt[opcode]]);
634+
if (has_dynamic_jump_taken) {
635+
DPRINTF(2, "Unsupported: dynamic jump taken\n");
636+
goto unsupported;
637+
}
638+
631639
/* Special case the first instruction,
632640
* so that we can guarantee forward progress */
633641
if (progress_needed && tstate->interp->jit_state.code_curr_size <= 2) {
@@ -638,14 +646,6 @@ _PyJit_translate_single_bytecode_to_trace(
638646
assert(!OPCODE_HAS_DEOPT(opcode));
639647
}
640648

641-
// Strange control-flow
642-
bool has_dynamic_jump_taken = OPCODE_HAS_UNPREDICTABLE_JUMP(opcode) &&
643-
(next_instr != this_instr + 1 + _PyOpcode_Caches[_PyOpcode_Deopt[opcode]]);
644-
if (has_dynamic_jump_taken) {
645-
DPRINTF(2, "Unsupported: dynamic jump taken\n");
646-
goto unsupported;
647-
}
648-
649649
// This happens when a recursive call happens that we can't trace. Such as Python -> C -> Python calls
650650
// If we haven't guarded the IP, then it's untraceable.
651651
if (frame != tstate->interp->jit_state.prev_instr_frame && !needs_guard_ip) {

0 commit comments

Comments
 (0)