Message383505
Yes, this is change is deliberate.
PEP 626 states that *all* executed code gets traced.
Occasionally that will result in NOPs in the code, that are necessary
for correctness, but cannot be removed by the optimizer.
Is this a problem in practice?
In fact this NOP can be removed by rewriting the bytecode to:
2 0 LOAD_CONST 0 (10)
2 STORE_NAME 0 (x)
3 4 LOAD_CONST 3 (20)
5 6 STORE_NAME 2 (y)
8 LOAD_CONST 4 (None)
10 RETURN_VALUE
but that is a relatively rare case where the proceeding or following instruction has no observable side-effects.
It is also non-trivial to implement, as the NOP and LOAD_CONST are in different basic blocks. |
|
Date |
User |
Action |
Args |
2020-12-21 10:06:17 | Mark.Shannon | set | recipients:
+ Mark.Shannon, rhettinger, nedbat, serhiy.storchaka |
2020-12-21 10:06:17 | Mark.Shannon | set | messageid: <1608545177.34.0.495752828959.issue42693@roundup.psfhosted.org> |
2020-12-21 10:06:17 | Mark.Shannon | link | issue42693 messages |
2020-12-21 10:06:17 | Mark.Shannon | create | |
|