Commit 7e30c9b
committed
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)1 parent 058a5ad commit 7e30c9b
2 files changed
Lines changed: 42 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
274 | 274 | | |
275 | 275 | | |
276 | 276 | | |
277 | | - | |
| 277 | + | |
| 278 | + | |
278 | 279 | | |
279 | 280 | | |
280 | 281 | | |
| |||
696 | 697 | | |
697 | 698 | | |
698 | 699 | | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
699 | 711 | | |
700 | 712 | | |
701 | 713 | | |
| |||
938 | 950 | | |
939 | 951 | | |
940 | 952 | | |
941 | | - | |
| 953 | + | |
| 954 | + | |
942 | 955 | | |
943 | 956 | | |
944 | | - | |
| 957 | + | |
| 958 | + | |
945 | 959 | | |
946 | 960 | | |
947 | 961 | | |
948 | | - | |
| 962 | + | |
949 | 963 | | |
950 | 964 | | |
951 | 965 | | |
| |||
1254 | 1268 | | |
1255 | 1269 | | |
1256 | 1270 | | |
1257 | | - | |
1258 | 1271 | | |
1259 | 1272 | | |
1260 | 1273 | | |
| |||
1281 | 1294 | | |
1282 | 1295 | | |
1283 | 1296 | | |
| 1297 | + | |
| 1298 | + | |
| 1299 | + | |
1284 | 1300 | | |
1285 | 1301 | | |
1286 | 1302 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
274 | 274 | | |
275 | 275 | | |
276 | 276 | | |
277 | | - | |
| 277 | + | |
| 278 | + | |
278 | 279 | | |
279 | 280 | | |
280 | 281 | | |
| |||
696 | 697 | | |
697 | 698 | | |
698 | 699 | | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
699 | 711 | | |
700 | 712 | | |
701 | 713 | | |
| |||
938 | 950 | | |
939 | 951 | | |
940 | 952 | | |
941 | | - | |
| 953 | + | |
| 954 | + | |
942 | 955 | | |
943 | 956 | | |
944 | | - | |
| 957 | + | |
| 958 | + | |
945 | 959 | | |
946 | 960 | | |
947 | 961 | | |
948 | | - | |
| 962 | + | |
949 | 963 | | |
950 | 964 | | |
951 | 965 | | |
| |||
1254 | 1268 | | |
1255 | 1269 | | |
1256 | 1270 | | |
1257 | | - | |
1258 | 1271 | | |
1259 | 1272 | | |
1260 | 1273 | | |
| |||
1281 | 1294 | | |
1282 | 1295 | | |
1283 | 1296 | | |
| 1297 | + | |
| 1298 | + | |
| 1299 | + | |
1284 | 1300 | | |
1285 | 1301 | | |
1286 | 1302 | | |
| |||
0 commit comments