[issue17611] Move unwinding of stack for "pseudo exceptions" from interpreter to compiler.
Serhiy Storchaka
report at bugs.python.org
Mon Dec 4 08:16:14 EST 2017
Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:
> The problem is that makes the stack consumption of END_FINALLY variable.
> How about always consuming 6 items, even when most of them are unused
> padding?
Right. Though the value of the stack increment makes sense only for the case
1, because in other cases the next executed instruction is not the one
following END_FINALLY, but we need to reserve the stack for the case 3, and
counting additional "virtual" items in PUSH_NO_EXCEPT and END_FINALLY will
help to calculate the maximal stack consumption, even when in runtime they
push/pop only one item. This is yet one argument for special purposed opcode
PUSH_NO_EXCEPT (maybe I'll rename it to START_FINALLY or BEGIN_FINALLY). Other
reason -- this will help to determine bounds of finally blocks in the
frame.f_lineno setter.
----------
_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue17611>
_______________________________________
More information about the Python-bugs-list
mailing list