diff options
author | Jeremy Hylton <jeremy@alum.mit.edu> | 2001-10-17 13:37:29 (GMT) |
---|---|---|
committer | Jeremy Hylton <jeremy@alum.mit.edu> | 2001-10-17 13:37:29 (GMT) |
commit | 138d90eb73415e48a0e7f09a7c9603b1164bcaed (patch) | |
tree | b631166b29128e07e71b263e145634a6870c47a8 /Lib/keyword.py | |
parent | d114261608f986b5c797eef4330fbe32041d3eb6 (diff) | |
download | cpython-138d90eb73415e48a0e7f09a7c9603b1164bcaed.zip cpython-138d90eb73415e48a0e7f09a7c9603b1164bcaed.tar.gz cpython-138d90eb73415e48a0e7f09a7c9603b1164bcaed.tar.bz2 |
Vastly improved stacksize calculation.
There are now no known cases where the compiler package computes a
stack depth lower than the one computed by the builtin compiler. (To
achieve this state, we had to fix bugs in both compilers :-).
The chief change is to do the depth calculations with respect to basic
blocks. The stack effect of block is calculated. Then the flow graph
is traversed using breadth-first search to find the max weight path
through the graph.
Had to fix the StackDepthTracker to calculate the right info for
several opcodes: LOAD_ATTR, CALL_FUNCTION (and friends), MAKE_CLOSURE,
and DUP_TOPX.
XXX Still need to handle free variables in MAKE_CLOSURE.
XXX There are still a lot of places where the computed stack depth is
larger than for the builtin compiler. These won't cause the
interpreter to overflow the frame, but they waste space.
Diffstat (limited to 'Lib/keyword.py')
0 files changed, 0 insertions, 0 deletions