]> granicus.if.org Git - python/commit
Add lookup_name() to optimize use of stack frames
authorJeremy Hylton <jeremy@alum.mit.edu>
Mon, 27 Aug 2001 21:02:51 +0000 (21:02 +0000)
committerJeremy Hylton <jeremy@alum.mit.edu>
Mon, 27 Aug 2001 21:02:51 +0000 (21:02 +0000)
commit7e30c9bb5a6a44829d1df01354523f5c3467583d
tree1e292a0ddc847287e282e09f941f2bf8c5ca75c0
parent058a5adad02f5ae4652d1cd1d0e5ad4ece04fa85
Add lookup_name() to optimize use of stack frames

The use of com_node() introduces a lot of extra stack frames, enough
to cause a stack overflow compiling test.test_parser with the standard
interpreter recursionlimit.  The com_node() is a convenience function
that hides the dispatch details, but comes at a very high cost.  It is
more efficient to dispatch directly in the callers.  In these cases,
use lookup_node() and call the dispatched node directly.

Also handle yield_stmt in a way that will work with Python 2.1
(suggested by Shane Hathaway)
Lib/compiler/transformer.py
Tools/compiler/compiler/transformer.py