GH-96793: Change FOR_ITER to not pop the iterator on exhaustion. (GH-96801)

Change FOR_ITER to have the same stack effect regardless of whether it branches or not.
Performance is unchanged as FOR_ITER (and specialized forms jump over the cleanup code).
This commit is contained in:
Mark Shannon 2022-10-27 03:55:03 -07:00 committed by GitHub
parent e60892f9db
commit 22863df7ca
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 277 additions and 247 deletions

View file

@ -1,7 +1,7 @@
// Auto-generated by Programs/freeze_test_frozenmain.py
unsigned char M_test_frozenmain[] = {
227,0,0,0,0,0,0,0,0,0,0,0,0,8,0,0,
0,0,0,0,0,243,182,0,0,0,151,0,100,0,100,1,
0,0,0,0,0,243,184,0,0,0,151,0,100,0,100,1,
108,0,90,0,100,0,100,1,108,1,90,1,2,0,101,2,
100,2,171,1,0,0,0,0,0,0,0,0,1,0,2,0,
101,2,100,3,101,0,106,6,0,0,0,0,0,0,0,0,
@ -12,31 +12,31 @@ unsigned char M_test_frozenmain[] = {
0,0,0,0,90,5,100,5,68,0,93,23,0,0,90,6,
2,0,101,2,100,6,101,6,155,0,100,7,101,5,101,6,
25,0,0,0,0,0,0,0,0,0,155,0,157,4,171,1,
0,0,0,0,0,0,0,0,1,0,140,25,100,1,83,0,
41,8,233,0,0,0,0,78,122,18,70,114,111,122,101,110,
32,72,101,108,108,111,32,87,111,114,108,100,122,8,115,121,
115,46,97,114,103,118,218,6,99,111,110,102,105,103,41,5,
218,12,112,114,111,103,114,97,109,95,110,97,109,101,218,10,
101,120,101,99,117,116,97,98,108,101,218,15,117,115,101,95,
101,110,118,105,114,111,110,109,101,110,116,218,17,99,111,110,
102,105,103,117,114,101,95,99,95,115,116,100,105,111,218,14,
98,117,102,102,101,114,101,100,95,115,116,100,105,111,122,7,
99,111,110,102,105,103,32,122,2,58,32,41,7,218,3,115,
121,115,218,17,95,116,101,115,116,105,110,116,101,114,110,97,
108,99,97,112,105,218,5,112,114,105,110,116,218,4,97,114,
103,118,218,11,103,101,116,95,99,111,110,102,105,103,115,114,
3,0,0,0,218,3,107,101,121,169,0,243,0,0,0,0,
250,18,116,101,115,116,95,102,114,111,122,101,110,109,97,105,
110,46,112,121,250,8,60,109,111,100,117,108,101,62,114,18,
0,0,0,1,0,0,0,115,149,0,0,0,240,3,1,1,
1,240,8,0,1,11,128,10,128,10,128,10,216,0,24,208,
0,24,208,0,24,208,0,24,224,0,5,128,5,208,6,26,
212,0,27,208,0,27,216,0,5,128,5,128,106,144,35,151,
40,145,40,212,0,27,208,0,27,216,9,38,208,9,26,215,
9,38,209,9,38,212,9,40,168,24,212,9,50,128,6,240,
2,6,12,2,240,0,7,1,42,241,0,7,1,42,128,67,
240,14,0,5,10,128,69,208,10,40,144,67,208,10,40,208,
10,40,152,54,160,35,156,59,208,10,40,208,10,40,212,4,
41,208,4,41,208,4,41,240,15,7,1,42,240,0,7,1,
42,114,16,0,0,0,
0,0,0,0,0,0,0,0,1,0,140,25,4,0,100,1,
83,0,41,8,233,0,0,0,0,78,122,18,70,114,111,122,
101,110,32,72,101,108,108,111,32,87,111,114,108,100,122,8,
115,121,115,46,97,114,103,118,218,6,99,111,110,102,105,103,
41,5,218,12,112,114,111,103,114,97,109,95,110,97,109,101,
218,10,101,120,101,99,117,116,97,98,108,101,218,15,117,115,
101,95,101,110,118,105,114,111,110,109,101,110,116,218,17,99,
111,110,102,105,103,117,114,101,95,99,95,115,116,100,105,111,
218,14,98,117,102,102,101,114,101,100,95,115,116,100,105,111,
122,7,99,111,110,102,105,103,32,122,2,58,32,41,7,218,
3,115,121,115,218,17,95,116,101,115,116,105,110,116,101,114,
110,97,108,99,97,112,105,218,5,112,114,105,110,116,218,4,
97,114,103,118,218,11,103,101,116,95,99,111,110,102,105,103,
115,114,3,0,0,0,218,3,107,101,121,169,0,243,0,0,
0,0,250,18,116,101,115,116,95,102,114,111,122,101,110,109,
97,105,110,46,112,121,250,8,60,109,111,100,117,108,101,62,
114,18,0,0,0,1,0,0,0,115,154,0,0,0,240,3,
1,1,1,240,8,0,1,11,128,10,128,10,128,10,216,0,
24,208,0,24,208,0,24,208,0,24,224,0,5,128,5,208,
6,26,212,0,27,208,0,27,216,0,5,128,5,128,106,144,
35,151,40,145,40,212,0,27,208,0,27,216,9,38,208,9,
26,215,9,38,209,9,38,212,9,40,168,24,212,9,50,128,
6,240,2,6,12,2,240,0,7,1,42,241,0,7,1,42,
128,67,240,14,0,5,10,128,69,208,10,40,144,67,208,10,
40,208,10,40,152,54,160,35,156,59,208,10,40,208,10,40,
212,4,41,208,4,41,208,4,41,240,15,7,1,42,240,0,
7,1,42,240,0,7,1,42,114,16,0,0,0,
};