Jump-To-Jump elimination could be more aggressive. #93223
Labels
interpreter-core
Interpreter core (Objects, Python, Grammar, and Parser dirs)
type-feature
A feature request or enhancement
Example:
Something like this should suffice:
static bool jump_thread(struct instr *inst, struct instr *target, int opcode) { assert(!IS_VIRTUAL_OPCODE(opcode) || IS_VIRTUAL_JUMP_OPCODE(opcode)); assert(is_jump(inst)); assert(is_jump(target)); // bpo-45773: If inst->i_target == target->i_target, then nothing actually // changes (and we fall into an infinite loop): - if (inst->i_lineno == target->i_lineno && + if ((inst->i_lineno == target->i_lineno || target->i_lineno == -1) && inst->i_target != target->i_target) { inst->i_target = target->i_target; inst->i_opcode = opcode; return true; } return false; }cc @markshannon @iritkatriel @brandtbucher
The text was updated successfully, but these errors were encountered: