Construct GeneratorExpressionCreation

Performance Diagrams

Construct GeneratorExpressionCreation 002000000020000000400000004000000060000000600000008000000080000000100000000100000000120000000120000000140000000140000000160000000160000000180000000180000000CPython 3.10Nuitka (main)Nuitka (develop)Nuitka (factory)18584376488.11538461538461257.0CPython 3.1046597074240.03846153846155442.1555231940375Nuitka (main)46598083391.96153846153845442.154181532538Nuitka (develop)46603895543.8846153846154442.14645334955Nuitka (factory)Construct GeneratorExpressionCreationTicks Construct GeneratorExpressionCreation 002000000020000000400000004000000060000000600000008000000080000000100000000100000000120000000120000000140000000140000000160000000160000000180000000180000000CPython 3.8Nuitka (main)Nuitka (develop)Nuitka (factory)18944351988.11538461538461257.0CPython 3.847590361240.03846153846155442.03719674926924Nuitka (main)47590231391.96153846153845442.03736632487767Nuitka (develop)47595458543.8846153846154442.0305480809905Nuitka (factory)Construct GeneratorExpressionCreationTicks Construct GeneratorExpressionCreation 002000000020000000400000004000000060000000600000008000000080000000100000000100000000120000000120000000140000000140000000160000000160000000CPython 2.7Nuitka (main)Nuitka (develop)Nuitka (factory)17936737088.11538461538461257.0CPython 2.741102273240.03846153846155447.48856335485357Nuitka (main)41102245391.96153846153845447.4886019306033Nuitka (develop)41102265543.8846153846154447.48857437649633Nuitka (factory)Construct GeneratorExpressionCreationTicks

Source Code with Construct

for x in itertools.repeat(None, 50000):
    calledRepeatedly()

print("OK.")

#     Python test originally created or extracted from other peoples work. The
#     parts from me are licensed as below. It is at least Free Software where
#     it's copied from other people. In these cases, that will normally be
#     indicated.
#
#     Licensed under the Apache License, Version 2.0 (the "License");
#     you may not use this file except in compliance with the License.
#     You may obtain a copy of the License at
#
#         http://www.apache.org/licenses/LICENSE-2.0
#
#     Unless required by applicable law or agreed to in writing, software
#     distributed under the License is distributed on an "AS IS" BASIS,
#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#     See the License for the specific language governing permissions and
#     limitations under the License.

Source Code without Construct

for x in itertools.repeat(None, 50000):
    calledRepeatedly()

print("OK.")

#     Python test originally created or extracted from other peoples work. The
#     parts from me are licensed as below. It is at least Free Software where
#     it's copied from other people. In these cases, that will normally be
#     indicated.
#
#     Licensed under the Apache License, Version 2.0 (the "License");
#     you may not use this file except in compliance with the License.
#     You may obtain a copy of the License at
#
#         http://www.apache.org/licenses/LICENSE-2.0
#
#     Unless required by applicable law or agreed to in writing, software
#     distributed under the License is distributed on an "AS IS" BASIS,
#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#     See the License for the specific language governing permissions and
#     limitations under the License.

Context Diff of Source Code


Construct
Baseline
5 5
6 6
7 def calledRepeatedly(): 7 def calledRepeatedly():
8     # We measure making a generator iterator step or not. 8     # We measure making a generator iterator step or not.
9     # construct_begin 9     # construct_begin
n 10     gen = (x for x in range(3)) n 10  
11     # construct_alternative 11     # construct_alternative
t 12   t 12     gen = iter((1, 2, 3))
13   13     # construct_end
14 14
15     x = next(gen) 15     x = next(gen)
16     next(gen) 16     next(gen)
17 17
18     return x 18     return x

Context Diff of Generated Code


Construct
Baseline
31 31
32 PyObject *module___main__; 32 PyObject *module___main__;
33 PyDictObject *moduledict___main__; 33 PyDictObject *moduledict___main__;
34 34
35 /* The declarations of module constants used, if any. */ 35 /* The declarations of module constants used, if any. */
n 36 static PyObject *mod_consts[15]; n 36 static PyObject *mod_consts[12];
37 #ifndef __NUITKA_NO_ASSERT__ 37 #ifndef __NUITKA_NO_ASSERT__
n 38 static Py_hash_t mod_consts_hash[15]; n 38 static Py_hash_t mod_consts_hash[12];
39 #endif 39 #endif
40 40
41 static PyObject *module_filename_obj = NULL; 41 static PyObject *module_filename_obj = NULL;
42 42
43 /* Indicator if this modules private constants were created yet. */ 43 /* Indicator if this modules private constants were created yet. */
48     if (constants_created == false) { 48     if (constants_created == false) {
49         loadConstantsBlob(tstate, &mod_consts[0], UNTRANSLATE("__main__")); 49         loadConstantsBlob(tstate, &mod_consts[0], UNTRANSLATE("__main__"));
50         constants_created = true; 50         constants_created = true;
51 51
52 #ifndef __NUITKA_NO_ASSERT__ 52 #ifndef __NUITKA_NO_ASSERT__
n 53         for (int i = 0; i < 15; i++) { n 53         for (int i = 0; i < 12; i++) {
54             mod_consts_hash[i] = DEEP_HASH(tstate, mod_consts[i]); 54             mod_consts_hash[i] = DEEP_HASH(tstate, mod_consts[i]);
55         } 55         }
56 #endif 56 #endif
57     } 57     }
58 } 58 }
68 #ifndef __NUITKA_NO_ASSERT__ 68 #ifndef __NUITKA_NO_ASSERT__
69 void checkModuleConstants___main__(PyThreadState *tstate) { 69 void checkModuleConstants___main__(PyThreadState *tstate) {
70     // The module may not have been used at all, then ignore this. 70     // The module may not have been used at all, then ignore this.
71     if (constants_created == false) return; 71     if (constants_created == false) return;
72 72
n 73     for (int i = 0; i < 15; i++) { n 73     for (int i = 0; i < 12; i++) {
74         assert(mod_consts_hash[i] == DEEP_HASH(tstate, mod_consts[i])); 74         assert(mod_consts_hash[i] == DEEP_HASH(tstate, mod_consts[i]));
75         CHECK_OBJECT_DEEP(mod_consts[i]); 75         CHECK_OBJECT_DEEP(mod_consts[i]);
76     } 76     }
77 } 77 }
78 #endif 78 #endif
79 79
80 // The module code objects. 80 // The module code objects.
n 81 static PyCodeObject *codeobj_0fa6953b6eeae63f074efff2aa57a1f0; n
82 static PyCodeObject *codeobj_a617d6ca5dd1ca73f4900f78f493f907; 81 static PyCodeObject *codeobj_a617d6ca5dd1ca73f4900f78f493f907;
83 static PyCodeObject *codeobj_c4bfb120e2824075da27acecd202ea07; 82 static PyCodeObject *codeobj_c4bfb120e2824075da27acecd202ea07;
84 /* For use in "MainProgram.c". */ 83 /* For use in "MainProgram.c". */
85 PyCodeObject *codeobj_main = NULL; 84 PyCodeObject *codeobj_main = NULL;
86 85
87 static void createModuleCodeObjects(void) { 86 static void createModuleCodeObjects(void) {
n 88     module_filename_obj = mod_consts[3]; CHECK_OBJECT(module_filename_obj); n 87     module_filename_obj = mod_consts[2]; CHECK_OBJECT(module_filename_obj);
89     codeobj_0fa6953b6eeae63f074efff2aa57a1f0 = MAKE_CODE_OBJECT(module_filename_obj, 10, CO_GENERATOR | CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE, mod_consts[1], mod_consts[11], mod_consts[12], NULL, 1, 0, 0);
90     codeobj_a617d6ca5dd1ca73f4900f78f493f907 = MAKE_CODE_OBJECT(module_filename_obj, 1, CO_NOFREE, mod_consts[13], mod_consts[13], NULL, NULL, 0, 0, 0); 88     codeobj_a617d6ca5dd1ca73f4900f78f493f907 = MAKE_CODE_OBJECT(module_filename_obj, 1, CO_NOFREE, mod_consts[10], mod_consts[10], NULL, NULL, 0, 0, 0);
91     codeobj_main = codeobj_a617d6ca5dd1ca73f4900f78f493f907; 89     codeobj_main = codeobj_a617d6ca5dd1ca73f4900f78f493f907;
n 92     codeobj_c4bfb120e2824075da27acecd202ea07 = MAKE_CODE_OBJECT(module_filename_obj, 7, CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE, mod_consts[6], mod_consts[6], mod_consts[14], NULL, 0, 0, 0); n 90     codeobj_c4bfb120e2824075da27acecd202ea07 = MAKE_CODE_OBJECT(module_filename_obj, 7, CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE, mod_consts[5], mod_consts[5], mod_consts[11], NULL, 0, 0, 0);
93 } 91 }
94 92
95 // The module function declarations. 93 // The module function declarations.
n 96 static PyObject *MAKE_GENERATOR___main__$$$function__1_calledRepeatedly$$$genexpr__1_genexpr(struct Nuitka_CellObject **closure); n
97  
98  
99 static PyObject *MAKE_FUNCTION___main__$$$function__1_calledRepeatedly(); 94 static PyObject *MAKE_FUNCTION___main__$$$function__1_calledRepeatedly();
100 95
101 96
102 // The module function definitions. 97 // The module function definitions.
103 static PyObject *impl___main__$$$function__1_calledRepeatedly(PyThreadState *tstate, struct Nuitka_FunctionObject const *self, PyObject **python_pars) { 98 static PyObject *impl___main__$$$function__1_calledRepeatedly(PyThreadState *tstate, struct Nuitka_FunctionObject const *self, PyObject **python_pars) {
107 #endif 102 #endif
108 103
109     // Local variable declarations. 104     // Local variable declarations.
110     PyObject *var_gen = NULL; 105     PyObject *var_gen = NULL;
111     PyObject *var_x = NULL; 106     PyObject *var_x = NULL;
n 112     PyObject *tmp_genexpr_1__$0 = NULL; n
113     struct Nuitka_FrameObject *frame_c4bfb120e2824075da27acecd202ea07; 107     struct Nuitka_FrameObject *frame_c4bfb120e2824075da27acecd202ea07;
114     NUITKA_MAY_BE_UNUSED char const *type_description_1 = NULL; 108     NUITKA_MAY_BE_UNUSED char const *type_description_1 = NULL;
115     PyObject *exception_type = NULL; 109     PyObject *exception_type = NULL;
116     PyObject *exception_value = NULL; 110     PyObject *exception_value = NULL;
117     PyTracebackObject *exception_tb = NULL; 111     PyTracebackObject *exception_tb = NULL;
125     NUITKA_MAY_BE_UNUSED int exception_keeper_lineno_1; 119     NUITKA_MAY_BE_UNUSED int exception_keeper_lineno_1;
126 120
127     // Actual function body. 121     // Actual function body.
128     { 122     {
129         PyObject *tmp_assign_source_1; 123         PyObject *tmp_assign_source_1;
n 130         { n
131             PyObject *tmp_assign_source_2;
132             PyObject *tmp_iter_arg_1; 124         PyObject *tmp_iter_arg_1;
133             tmp_iter_arg_1 = mod_consts[0]; 125         tmp_iter_arg_1 = mod_consts[0];
134             tmp_assign_source_2 = MAKE_ITERATOR_INFALLIBLE(tmp_iter_arg_1); 126         tmp_assign_source_1 = MAKE_ITERATOR_INFALLIBLE(tmp_iter_arg_1);
135             assert(!(tmp_assign_source_2 == NULL)); 127         assert(!(tmp_assign_source_1 == NULL));
136             assert(tmp_genexpr_1__$0 == NULL);
137             tmp_genexpr_1__$0 = tmp_assign_source_2;
138         }
139         // Tried code:
140         {
141             struct Nuitka_CellObject *tmp_closure_1[1];
142  
143             tmp_closure_1[0] = Nuitka_Cell_New0(tmp_genexpr_1__$0);
144  
145             tmp_assign_source_1 = MAKE_GENERATOR___main__$$$function__1_calledRepeatedly$$$genexpr__1_genexpr(tmp_closure_1);
146  
147             goto try_return_handler_1;
148         }
149         NUITKA_CANNOT_GET_HERE("tried codes exits in all cases");
150         return NULL;
151         // Return handler code:
152         try_return_handler_1:;
153         CHECK_OBJECT(tmp_genexpr_1__$0);
154         Py_DECREF(tmp_genexpr_1__$0);
155         tmp_genexpr_1__$0 = NULL;
156         goto outline_result_1;
157         // End of try:
158         NUITKA_CANNOT_GET_HERE("Return statement must have exited already.");
159         return NULL;
160         outline_result_1:;
161         assert(var_gen == NULL); 128         assert(var_gen == NULL);
162         var_gen = tmp_assign_source_1; 129         var_gen = tmp_assign_source_1;
163     } 130     }
164     // Tried code: 131     // Tried code:
165     if (isFrameUnusable(cache_frame_c4bfb120e2824075da27acecd202ea07)) { 132     if (isFrameUnusable(cache_frame_c4bfb120e2824075da27acecd202ea07)) {
188     pushFrameStackCompiledFrame(tstate, frame_c4bfb120e2824075da27acecd202ea07); 155     pushFrameStackCompiledFrame(tstate, frame_c4bfb120e2824075da27acecd202ea07);
189     assert(Py_REFCNT(frame_c4bfb120e2824075da27acecd202ea07) == 2); 156     assert(Py_REFCNT(frame_c4bfb120e2824075da27acecd202ea07) == 2);
190 157
191     // Framed code: 158     // Framed code:
192     { 159     {
n 193         PyObject *tmp_assign_source_3; n 160         PyObject *tmp_assign_source_2;
194         PyObject *tmp_value_value_1; 161         PyObject *tmp_value_value_1;
195         CHECK_OBJECT(var_gen); 162         CHECK_OBJECT(var_gen);
196         tmp_value_value_1 = var_gen; 163         tmp_value_value_1 = var_gen;
n 197         tmp_assign_source_3 = ITERATOR_NEXT(tmp_value_value_1); n 164         tmp_assign_source_2 = ITERATOR_NEXT(tmp_value_value_1);
198         if (tmp_assign_source_3 == NULL) { 165         if (tmp_assign_source_2 == NULL) {
199             if (!HAS_ERROR_OCCURRED(tstate)) { 166             if (!HAS_ERROR_OCCURRED(tstate)) {
200                 exception_type = PyExc_StopIteration; 167                 exception_type = PyExc_StopIteration;
201                 Py_INCREF(exception_type); 168                 Py_INCREF(exception_type);
202                 exception_value = NULL; 169                 exception_value = NULL;
203                 exception_tb = NULL; 170                 exception_tb = NULL;
209             type_description_1 = "oo"; 176             type_description_1 = "oo";
210             exception_lineno = 15; 177             exception_lineno = 15;
211             goto frame_exception_exit_1; 178             goto frame_exception_exit_1;
212         } 179         }
213         assert(var_x == NULL); 180         assert(var_x == NULL);
n 214         var_x = tmp_assign_source_3; n 181         var_x = tmp_assign_source_2;
215     } 182     }
216     { 183     {
217         PyObject *tmp_value_value_2; 184         PyObject *tmp_value_value_2;
218         PyObject *tmp_next_value_1; 185         PyObject *tmp_next_value_1;
219         CHECK_OBJECT(var_gen); 186         CHECK_OBJECT(var_gen);
274 241
275     // Put the previous frame back on top. 242     // Put the previous frame back on top.
276     popFrameStack(tstate); 243     popFrameStack(tstate);
277 244
278     // Return the error. 245     // Return the error.
n 279     goto try_except_handler_2; n 246     goto try_except_handler_1;
280     frame_no_exception_1:; 247     frame_no_exception_1:;
281     CHECK_OBJECT(var_x); 248     CHECK_OBJECT(var_x);
282     tmp_return_value = var_x; 249     tmp_return_value = var_x;
283     Py_INCREF(tmp_return_value); 250     Py_INCREF(tmp_return_value);
n 284     goto try_return_handler_2; n 251     goto try_return_handler_1;
285     NUITKA_CANNOT_GET_HERE("tried codes exits in all cases"); 252     NUITKA_CANNOT_GET_HERE("tried codes exits in all cases");
286     return NULL; 253     return NULL;
287     // Return handler code: 254     // Return handler code:
n 288     try_return_handler_2:; n 255     try_return_handler_1:;
289     CHECK_OBJECT(var_gen); 256     CHECK_OBJECT(var_gen);
290     Py_DECREF(var_gen); 257     Py_DECREF(var_gen);
291     var_gen = NULL; 258     var_gen = NULL;
292     CHECK_OBJECT(var_x); 259     CHECK_OBJECT(var_x);
293     Py_DECREF(var_x); 260     Py_DECREF(var_x);
294     var_x = NULL; 261     var_x = NULL;
295     goto function_return_exit; 262     goto function_return_exit;
296     // Exception handler code: 263     // Exception handler code:
n 297     try_except_handler_2:; n 264     try_except_handler_1:;
298     exception_keeper_type_1 = exception_type; 265     exception_keeper_type_1 = exception_type;
299     exception_keeper_value_1 = exception_value; 266     exception_keeper_value_1 = exception_value;
300     exception_keeper_tb_1 = exception_tb; 267     exception_keeper_tb_1 = exception_tb;
301     exception_keeper_lineno_1 = exception_lineno; 268     exception_keeper_lineno_1 = exception_lineno;
302     exception_type = NULL; 269     exception_type = NULL;
339    return tmp_return_value; 306    return tmp_return_value;
340 } 307 }
341 308
342 309
343 310
n 344 #if 1 n
345 struct __main__$$$function__1_calledRepeatedly$$$genexpr__1_genexpr_locals {
346     PyObject *var_x;
347     PyObject *tmp_iter_value_0;
348     char const *type_description_1;
349     PyObject *exception_type;
350     PyObject *exception_value;
351     PyTracebackObject *exception_tb;
352     int exception_lineno;
353     PyObject *exception_keeper_type_1;
354     PyObject *exception_keeper_value_1;
355     PyTracebackObject *exception_keeper_tb_1;
356     int exception_keeper_lineno_1;
357     PyObject *exception_keeper_type_2;
358     PyObject *exception_keeper_value_2;
359     PyTracebackObject *exception_keeper_tb_2;
360     int exception_keeper_lineno_2;
361 };
362 #endif
363  
364 static PyObject *__main__$$$function__1_calledRepeatedly$$$genexpr__1_genexpr_context(PyThreadState *tstate, struct Nuitka_GeneratorObject *generator, PyObject *yield_return_value) {
365     CHECK_OBJECT(generator);
366     assert(Nuitka_Generator_Check((PyObject *)generator));
367     CHECK_OBJECT_X(yield_return_value);
368  
369 #if 1
370     // Heap access.
371     struct __main__$$$function__1_calledRepeatedly$$$genexpr__1_genexpr_locals *generator_heap = (struct __main__$$$function__1_calledRepeatedly$$$genexpr__1_genexpr_locals *)generator->m_heap_storage;
372 #endif
373  
374     // Dispatch to yield based on return label index:
375     switch(generator->m_yield_return_index) {
376     case 1: goto yield_return_1;
377     }
378  
379     // Local variable initialization
380     NUITKA_MAY_BE_UNUSED nuitka_void tmp_unused;
381     static struct Nuitka_FrameObject *cache_m_frame = NULL;
382     generator_heap->var_x = NULL;
383     generator_heap->tmp_iter_value_0 = NULL;
384     generator_heap->type_description_1 = NULL;
385     generator_heap->exception_type = NULL;
386     generator_heap->exception_value = NULL;
387     generator_heap->exception_tb = NULL;
388     generator_heap->exception_lineno = 0;
389  
390     // Actual generator function body.
391     // Tried code:
392     if (isFrameUnusable(cache_m_frame)) {
393         Py_XDECREF(cache_m_frame);
394  
395 #if _DEBUG_REFCOUNTS
396         if (cache_m_frame == NULL) {
397             count_active_frame_cache_instances += 1;
398         } else {
399             count_released_frame_cache_instances += 1;
400         }
401         count_allocated_frame_cache_instances += 1;
402 #endif
403         cache_m_frame = MAKE_FUNCTION_FRAME(tstate, codeobj_0fa6953b6eeae63f074efff2aa57a1f0, module___main__, sizeof(void *)+sizeof(void *));
404 #if _DEBUG_REFCOUNTS
405     } else {
406         count_hit_frame_cache_instances += 1;
407 #endif
408     }
409  
410     assert(cache_m_frame->m_type_description == NULL);
411     generator->m_frame = cache_m_frame;
412     // Mark the frame object as in use, ref count 1 will be up for reuse.
413     Py_INCREF(generator->m_frame);
414     assert(Py_REFCNT(generator->m_frame) == 2); // Frame stack
415  
416  
417     assert(generator->m_frame->m_frame.f_back == NULL);
418  
419     // Push the new frame as the currently active one, and we should be exclusively
420     // owning it.
421     pushFrameStackGeneratorCompiledFrame(tstate, generator->m_frame);
422     assert(Py_REFCNT(generator->m_frame) == 2);
423  
424     // Framed code:
425     // Tried code:
426     loop_start_1:;
427     {
428         PyObject *tmp_next_source_1;
429         PyObject *tmp_assign_source_1;
430         CHECK_OBJECT(Nuitka_Cell_GET(generator->m_closure[0]));
431         tmp_next_source_1 = Nuitka_Cell_GET(generator->m_closure[0]);
432         tmp_assign_source_1 = ITERATOR_NEXT(tmp_next_source_1);
433         if (tmp_assign_source_1 == NULL) {
434             if (CHECK_AND_CLEAR_STOP_ITERATION_OCCURRED(tstate)) {
435  
436                 goto loop_end_1;
437             } else {
438  
439                 FETCH_ERROR_OCCURRED(tstate, &generator_heap->exception_type, &generator_heap->exception_value, &generator_heap->exception_tb);
440                 generator_heap->type_description_1 = "No";
441                 generator_heap->exception_lineno = 10;
442                 goto try_except_handler_2;
443             }
444         }
445  
446         {
447             PyObject *old = generator_heap->tmp_iter_value_0;
448             generator_heap->tmp_iter_value_0 = tmp_assign_source_1;
449             Py_XDECREF(old);
450         }
451  
452     }
453     {
454         PyObject *tmp_assign_source_2;
455         CHECK_OBJECT(generator_heap->tmp_iter_value_0);
456         tmp_assign_source_2 = generator_heap->tmp_iter_value_0;
457         {
458             PyObject *old = generator_heap->var_x;
459             generator_heap->var_x = tmp_assign_source_2;
460             Py_INCREF(generator_heap->var_x);
461             Py_XDECREF(old);
462         }
463  
464     }
465     {
466         PyObject *tmp_expression_value_1;
467         NUITKA_MAY_BE_UNUSED PyObject *tmp_yield_result_1;
468         CHECK_OBJECT(generator_heap->var_x);
469         tmp_expression_value_1 = generator_heap->var_x;
470         Py_INCREF(tmp_expression_value_1);
471         generator->m_yield_return_index = 1;
472         return tmp_expression_value_1;
473         yield_return_1:
474         if (yield_return_value == NULL) {
475             assert(HAS_ERROR_OCCURRED(tstate));
476  
477             FETCH_ERROR_OCCURRED(tstate, &generator_heap->exception_type, &generator_heap->exception_value, &generator_heap->exception_tb);
478  
479  
480             generator_heap->exception_lineno = 10;
481             generator_heap->type_description_1 = "No";
482             goto try_except_handler_2;
483         }
484         tmp_yield_result_1 = yield_return_value;
485         Py_DECREF(tmp_yield_result_1);
486     }
487     if (CONSIDER_THREADING(tstate) == false) {
488         assert(HAS_ERROR_OCCURRED(tstate));
489  
490         FETCH_ERROR_OCCURRED(tstate, &generator_heap->exception_type, &generator_heap->exception_value, &generator_heap->exception_tb);
491  
492  
493         generator_heap->exception_lineno = 10;
494         generator_heap->type_description_1 = "No";
495         goto try_except_handler_2;
496     }
497     goto loop_start_1;
498     loop_end_1:;
499     goto try_end_1;
500     // Exception handler code:
501     try_except_handler_2:;
502     generator_heap->exception_keeper_type_1 = generator_heap->exception_type;
503     generator_heap->exception_keeper_value_1 = generator_heap->exception_value;
504     generator_heap->exception_keeper_tb_1 = generator_heap->exception_tb;
505     generator_heap->exception_keeper_lineno_1 = generator_heap->exception_lineno;
506     generator_heap->exception_type = NULL;
507     generator_heap->exception_value = NULL;
508     generator_heap->exception_tb = NULL;
509     generator_heap->exception_lineno = 0;
510  
511     Py_XDECREF(generator_heap->tmp_iter_value_0);
512     generator_heap->tmp_iter_value_0 = NULL;
513     // Re-raise.
514     generator_heap->exception_type = generator_heap->exception_keeper_type_1;
515     generator_heap->exception_value = generator_heap->exception_keeper_value_1;
516     generator_heap->exception_tb = generator_heap->exception_keeper_tb_1;
517     generator_heap->exception_lineno = generator_heap->exception_keeper_lineno_1;
518  
519     goto frame_exception_exit_1;
520     // End of try:
521     try_end_1:;
522  
523  
524  
525     goto frame_no_exception_1;
526     frame_exception_exit_1:;
527  
528     // If it's not an exit exception, consider and create a traceback for it.
529     if (!EXCEPTION_MATCH_GENERATOR(tstate, generator_heap->exception_type)) {
530         if (generator_heap->exception_tb == NULL) {
531             generator_heap->exception_tb = MAKE_TRACEBACK(generator->m_frame, generator_heap->exception_lineno);
532         } else if (generator_heap->exception_tb->tb_frame != &generator->m_frame->m_frame) {
533             generator_heap->exception_tb = ADD_TRACEBACK(generator_heap->exception_tb, generator->m_frame, generator_heap->exception_lineno);
534         }
535  
536         Nuitka_Frame_AttachLocals(
537             generator->m_frame,
538             generator_heap->type_description_1,
539             NULL,
540             generator_heap->var_x
541         );
542  
543  
544         // Release cached frame if used for exception.
545         if (generator->m_frame == cache_m_frame) {
546 #if _DEBUG_REFCOUNTS
547             count_active_frame_cache_instances -= 1;
548             count_released_frame_cache_instances += 1;
549 #endif
550  
551             Py_DECREF(cache_m_frame);
552             cache_m_frame = NULL;
553         }
554  
555         assertFrameObject(generator->m_frame);
556     }
557  
558 #if PYTHON_VERSION >= 0x300
559 #if PYTHON_VERSION < 0x3b0
560     Py_CLEAR(EXC_TYPE_F(generator));
561 #endif
562     Py_CLEAR(EXC_VALUE_F(generator));
563 #if PYTHON_VERSION < 0x3b0
564     Py_CLEAR(EXC_TRACEBACK_F(generator));
565 #endif
566 #endif
567  
568     // Return the error.
569     goto try_except_handler_1;
570  
571     frame_no_exception_1:;
572     goto try_end_2;
573     // Exception handler code:
574     try_except_handler_1:;
575     generator_heap->exception_keeper_type_2 = generator_heap->exception_type;
576     generator_heap->exception_keeper_value_2 = generator_heap->exception_value;
577     generator_heap->exception_keeper_tb_2 = generator_heap->exception_tb;
578     generator_heap->exception_keeper_lineno_2 = generator_heap->exception_lineno;
579     generator_heap->exception_type = NULL;
580     generator_heap->exception_value = NULL;
581     generator_heap->exception_tb = NULL;
582     generator_heap->exception_lineno = 0;
583  
584     Py_XDECREF(generator_heap->var_x);
585     generator_heap->var_x = NULL;
586     // Re-raise.
587     generator_heap->exception_type = generator_heap->exception_keeper_type_2;
588     generator_heap->exception_value = generator_heap->exception_keeper_value_2;
589     generator_heap->exception_tb = generator_heap->exception_keeper_tb_2;
590     generator_heap->exception_lineno = generator_heap->exception_keeper_lineno_2;
591  
592     goto function_exception_exit;
593     // End of try:
594     try_end_2:;
595     Py_XDECREF(generator_heap->tmp_iter_value_0);
596     generator_heap->tmp_iter_value_0 = NULL;
597     Py_XDECREF(generator_heap->var_x);
598     generator_heap->var_x = NULL;
599  
600  
601     return NULL;
602  
603     function_exception_exit:
604  
605     assert(generator_heap->exception_type);
606     RESTORE_ERROR_OCCURRED(tstate, generator_heap->exception_type, generator_heap->exception_value, generator_heap->exception_tb);
607  
608     return NULL;
609  
610 }
611  
612 static PyObject *MAKE_GENERATOR___main__$$$function__1_calledRepeatedly$$$genexpr__1_genexpr(struct Nuitka_CellObject **closure) {
613     return Nuitka_Generator_New(
614         __main__$$$function__1_calledRepeatedly$$$genexpr__1_genexpr_context,
615         module___main__,
616         mod_consts[1],
617 #if PYTHON_VERSION >= 0x350
618         NULL,
619 #endif
620         codeobj_0fa6953b6eeae63f074efff2aa57a1f0,
621         closure,
622         1,
623 #if 1
624         sizeof(struct __main__$$$function__1_calledRepeatedly$$$genexpr__1_genexpr_locals)
625 #else
626         0
627 #endif
628     );
629 }
630  
631  
632  
633 static PyObject *MAKE_FUNCTION___main__$$$function__1_calledRepeatedly() { 311 static PyObject *MAKE_FUNCTION___main__$$$function__1_calledRepeatedly() {
634     struct Nuitka_FunctionObject *result = Nuitka_Function_New( 312     struct Nuitka_FunctionObject *result = Nuitka_Function_New(
635         impl___main__$$$function__1_calledRepeatedly, 313         impl___main__$$$function__1_calledRepeatedly,
n 636         mod_consts[6], n 314         mod_consts[5],
637 #if PYTHON_VERSION >= 0x300 315 #if PYTHON_VERSION >= 0x300
638         NULL, 316         NULL,
639 #endif 317 #endif
640         codeobj_c4bfb120e2824075da27acecd202ea07, 318         codeobj_c4bfb120e2824075da27acecd202ea07,
641         NULL, 319         NULL,
1013 691
1014     // Module code. 692     // Module code.
1015     { 693     {
1016         PyObject *tmp_assign_source_1; 694         PyObject *tmp_assign_source_1;
1017         tmp_assign_source_1 = Py_None; 695         tmp_assign_source_1 = Py_None;
n 1018         UPDATE_STRING_DICT0(moduledict___main__, (Nuitka_StringObject *)mod_consts[2], tmp_assign_source_1); n 696         UPDATE_STRING_DICT0(moduledict___main__, (Nuitka_StringObject *)mod_consts[1], tmp_assign_source_1);
1019     } 697     }
1020     { 698     {
1021         PyObject *tmp_assign_source_2; 699         PyObject *tmp_assign_source_2;
n 1022         tmp_assign_source_2 = mod_consts[3]; n 700         tmp_assign_source_2 = mod_consts[2];
1023         UPDATE_STRING_DICT0(moduledict___main__, (Nuitka_StringObject *)mod_consts[4], tmp_assign_source_2); 701         UPDATE_STRING_DICT0(moduledict___main__, (Nuitka_StringObject *)mod_consts[3], tmp_assign_source_2);
1024     } 702     }
1025     frame_a617d6ca5dd1ca73f4900f78f493f907 = MAKE_MODULE_FRAME(codeobj_a617d6ca5dd1ca73f4900f78f493f907, module___main__); 703     frame_a617d6ca5dd1ca73f4900f78f493f907 = MAKE_MODULE_FRAME(codeobj_a617d6ca5dd1ca73f4900f78f493f907, module___main__);
1026 704
1027     // Push the new frame as the currently active one, and we should be exclusively 705     // Push the new frame as the currently active one, and we should be exclusively
1028     // owning it. 706     // owning it.
1034         PyObject *tmp_assign_source_3; 712         PyObject *tmp_assign_source_3;
1035         PyObject *tmp_name_value_1; 713         PyObject *tmp_name_value_1;
1036         PyObject *tmp_globals_arg_value_1; 714         PyObject *tmp_globals_arg_value_1;
1037         PyObject *tmp_locals_arg_value_1; 715         PyObject *tmp_locals_arg_value_1;
1038         PyObject *tmp_fromlist_value_1; 716         PyObject *tmp_fromlist_value_1;
n 1039         tmp_name_value_1 = mod_consts[5]; n 717         tmp_name_value_1 = mod_consts[4];
1040         tmp_globals_arg_value_1 = (PyObject *)moduledict___main__; 718         tmp_globals_arg_value_1 = (PyObject *)moduledict___main__;
1041         tmp_locals_arg_value_1 = Py_None; 719         tmp_locals_arg_value_1 = Py_None;
1042         tmp_fromlist_value_1 = Py_None; 720         tmp_fromlist_value_1 = Py_None;
1043         frame_a617d6ca5dd1ca73f4900f78f493f907->m_frame.f_lineno = 4; 721         frame_a617d6ca5dd1ca73f4900f78f493f907->m_frame.f_lineno = 4;
1044         tmp_assign_source_3 = IMPORT_MODULE4(tstate, tmp_name_value_1, tmp_globals_arg_value_1, tmp_locals_arg_value_1, tmp_fromlist_value_1); 722         tmp_assign_source_3 = IMPORT_MODULE4(tstate, tmp_name_value_1, tmp_globals_arg_value_1, tmp_locals_arg_value_1, tmp_fromlist_value_1);
1050 728
1051             exception_lineno = 4; 729             exception_lineno = 4;
1052 730
1053             goto frame_exception_exit_1; 731             goto frame_exception_exit_1;
1054         } 732         }
n 1055         UPDATE_STRING_DICT1(moduledict___main__, (Nuitka_StringObject *)mod_consts[5], tmp_assign_source_3); n 733         UPDATE_STRING_DICT1(moduledict___main__, (Nuitka_StringObject *)mod_consts[4], tmp_assign_source_3);
1056     } 734     }
1057     { 735     {
1058         PyObject *tmp_assign_source_4; 736         PyObject *tmp_assign_source_4;
1059 737
1060 738
1061         tmp_assign_source_4 = MAKE_FUNCTION___main__$$$function__1_calledRepeatedly(); 739         tmp_assign_source_4 = MAKE_FUNCTION___main__$$$function__1_calledRepeatedly();
1062 740
n 1063         UPDATE_STRING_DICT1(moduledict___main__, (Nuitka_StringObject *)mod_consts[6], tmp_assign_source_4); n 741         UPDATE_STRING_DICT1(moduledict___main__, (Nuitka_StringObject *)mod_consts[5], tmp_assign_source_4);
1064     } 742     }
1065     { 743     {
1066         PyObject *tmp_assign_source_5; 744         PyObject *tmp_assign_source_5;
1067         PyObject *tmp_iter_arg_1; 745         PyObject *tmp_iter_arg_1;
1068         PyObject *tmp_called_instance_1; 746         PyObject *tmp_called_instance_1;
n 1069         tmp_called_instance_1 = GET_STRING_DICT_VALUE(moduledict___main__, (Nuitka_StringObject *)mod_consts[5]); n 747         tmp_called_instance_1 = GET_STRING_DICT_VALUE(moduledict___main__, (Nuitka_StringObject *)mod_consts[4]);
1070 748
1071         if (unlikely(tmp_called_instance_1 == NULL)) { 749         if (unlikely(tmp_called_instance_1 == NULL)) {
n 1072             tmp_called_instance_1 = GET_MODULE_VARIABLE_VALUE_FALLBACK(tstate, mod_consts[5]); n 750             tmp_called_instance_1 = GET_MODULE_VARIABLE_VALUE_FALLBACK(tstate, mod_consts[4]);
1073         } 751         }
1074 752
1075         assert(!(tmp_called_instance_1 == NULL)); 753         assert(!(tmp_called_instance_1 == NULL));
1076         frame_a617d6ca5dd1ca73f4900f78f493f907->m_frame.f_lineno = 21; 754         frame_a617d6ca5dd1ca73f4900f78f493f907->m_frame.f_lineno = 21;
1077         tmp_iter_arg_1 = CALL_METHOD_WITH_ARGS2( 755         tmp_iter_arg_1 = CALL_METHOD_WITH_ARGS2(
1078             tstate, 756             tstate,
1079             tmp_called_instance_1, 757             tmp_called_instance_1,
n 1080             mod_consts[7], n 758             mod_consts[6],
1081             &PyTuple_GET_ITEM(mod_consts[8], 0) 759             &PyTuple_GET_ITEM(mod_consts[7], 0)
1082         ); 760         );
1083 761
1084         if (tmp_iter_arg_1 == NULL) { 762         if (tmp_iter_arg_1 == NULL) {
1085             assert(HAS_ERROR_OCCURRED(tstate)); 763             assert(HAS_ERROR_OCCURRED(tstate));
1086 764
1136     } 814     }
1137     { 815     {
1138         PyObject *tmp_assign_source_7; 816         PyObject *tmp_assign_source_7;
1139         CHECK_OBJECT(tmp_for_loop_1__iter_value); 817         CHECK_OBJECT(tmp_for_loop_1__iter_value);
1140         tmp_assign_source_7 = tmp_for_loop_1__iter_value; 818         tmp_assign_source_7 = tmp_for_loop_1__iter_value;
n 1141         UPDATE_STRING_DICT0(moduledict___main__, (Nuitka_StringObject *)mod_consts[9], tmp_assign_source_7); n 819         UPDATE_STRING_DICT0(moduledict___main__, (Nuitka_StringObject *)mod_consts[8], tmp_assign_source_7);
1142     } 820     }
1143     { 821     {
1144         PyObject *tmp_called_value_1; 822         PyObject *tmp_called_value_1;
1145         PyObject *tmp_call_result_1; 823         PyObject *tmp_call_result_1;
n 1146         tmp_called_value_1 = GET_STRING_DICT_VALUE(moduledict___main__, (Nuitka_StringObject *)mod_consts[6]); n 824         tmp_called_value_1 = GET_STRING_DICT_VALUE(moduledict___main__, (Nuitka_StringObject *)mod_consts[5]);
1147 825
1148         if (unlikely(tmp_called_value_1 == NULL)) { 826         if (unlikely(tmp_called_value_1 == NULL)) {
n 1149             tmp_called_value_1 = GET_MODULE_VARIABLE_VALUE_FALLBACK(tstate, mod_consts[6]); n 827             tmp_called_value_1 = GET_MODULE_VARIABLE_VALUE_FALLBACK(tstate, mod_consts[5]);
1150         } 828         }
1151 829
1152         if (tmp_called_value_1 == NULL) { 830         if (tmp_called_value_1 == NULL) {
1153             assert(HAS_ERROR_OCCURRED(tstate)); 831             assert(HAS_ERROR_OCCURRED(tstate));
1154 832
1214     Py_XDECREF(tmp_for_loop_1__iter_value); 892     Py_XDECREF(tmp_for_loop_1__iter_value);
1215     tmp_for_loop_1__iter_value = NULL; 893     tmp_for_loop_1__iter_value = NULL;
1216     CHECK_OBJECT(tmp_for_loop_1__for_iterator); 894     CHECK_OBJECT(tmp_for_loop_1__for_iterator);
1217     Py_DECREF(tmp_for_loop_1__for_iterator); 895     Py_DECREF(tmp_for_loop_1__for_iterator);
1218     tmp_for_loop_1__for_iterator = NULL; 896     tmp_for_loop_1__for_iterator = NULL;
t 1219     tmp_print_value = mod_consts[10]; t 897     tmp_print_value = mod_consts[9];
1220     tmp_result = PRINT_ITEM(tmp_print_value); 898     tmp_result = PRINT_ITEM(tmp_print_value);
1221     if (tmp_result == false) { 899     if (tmp_result == false) {
1222         assert(HAS_ERROR_OCCURRED(tstate)); 900         assert(HAS_ERROR_OCCURRED(tstate));
1223 901
1224         FETCH_ERROR_OCCURRED(tstate, &exception_type, &exception_value, &exception_tb); 902         FETCH_ERROR_OCCURRED(tstate, &exception_type, &exception_value, &exception_tb);