I think you guys are forgetting about FOR_ITER, listcomps, and the like.
That is, IIRC, the reason loops use the block stack is because they put
things on the regular stack, that need to be cleared off the stack when the
loop is exited (whether normally or via an exception).
Good point.
Hello,
Am I missing something? Does SETUP_LOOP serve any other purpose?
Not to my knowledge.
Similarly, it looks like BREAK_LOOP and CONTINUE_LOOP are just jumps
that respect try/finally blocks (i.e. jumping out of try executes
finally). Is there more semantics to them than this?
There
There are also with blocks :-) (which use separate opcodes, although
they are similar in principle to try/finally blocks)
IIUC they use separate opcode, but the same block type (SETUP_FINALLY).
There may be complications with nested try/finally blocks. You either
need to generate separate
At 08:25 AM 3/12/2011 -0500, Eugene Toder wrote:
Right, I'm not suggesting to remove all blocks, only SETUP_LOOP
blocks. Do you see the problem in that case?
I think you guys are forgetting about FOR_ITER, listcomps, and the like.
That is, IIRC, the reason loops use the block stack is because
Hello,
What is the purpose of SETUP_LOOP instruction? From a quick look it
seems like it just pushes the size of the loop into blocks stack; that
size is only used by BREAK_LOOP instruction.
BREAK_LOOP could just contain the target address directly, like
CONTINUE_LOOP does. This would avoid