[issue45757] compiler emits EXTENDED_ARG + NOP sequence in 3.10
Irit Katriel
report at bugs.python.org
Tue Nov 9 17:14:11 EST 2021
Irit Katriel <iritkatriel at gmail.com> added the comment:
> I don't think that it does, since oparg gets totally reassigned each time
> we load a new instruction. EXTENDED_ARG actually needs to hack around
> this by advancing the instruction itself, updating oparg, and jumping
> straight into the next opcode.
Right, it's like this:
TARGET(EXTENDED_ARG) {
int oldoparg = oparg;
NEXTOPARG();
oparg |= oldoparg << 8;
PRE_DISPATCH_GOTO();
DISPATCH_GOTO();
}
It's seems correct (the next arg will be NOP so nothing happens). But it's wasteful.
----------
title: dis module incorrectly handles EXTENDED_ARG + NOP sequence -> compiler emits EXTENDED_ARG + NOP sequence in 3.10
_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45757>
_______________________________________
More information about the Python-bugs-list
mailing list