Construct FunctionCreationGeneratorClosure

Performance Diagrams

Construct FunctionCreationGeneratorClosure 001000000010000000200000002000000030000000300000004000000040000000CPython 2.7Nuitka (historic)Nuitka (master)Nuitka (develop)Nuitka (factory)4496823973.61538461538461275.4744343090871CPython 2.748601721196.30769230769232257.0Nuitka (historic)12653041319.0000000000001439.7810147837231Nuitka (master)12651929441.69230769230774439.7866687462174Nuitka (develop)12652085564.3846153846155439.78587556442864Nuitka (factory)Construct FunctionCreationGeneratorClosureTicks Construct FunctionCreationGeneratorClosure 0010000000100000002000000020000000300000003000000040000000400000005000000050000000CPython 3.5Nuitka (historic)Nuitka (master)Nuitka (develop)Nuitka (factory)5639723473.61538461538461257.0CPython 3.50196.30769230769232504.11538461538464Nuitka (historic)15804002319.0000000000001434.8670943057516Nuitka (master)15811307441.69230769230774434.83508603590246Nuitka (develop)15813475564.3846153846155434.8255865247412Nuitka (factory)Construct FunctionCreationGeneratorClosureTicks

Source Code with Construct

module_var = None

def calledRepeatedly():
    # We measure making a local function that will remain unused.
    closure_var = module_var

# construct_begin
    def empty():
        yield closure_var

# construct_alternative



    return empty, closure_var


for x in xrange(50000):
    calledRepeatedly()

print("OK.")

Source Code without Construct

module_var = None

def calledRepeatedly():
    # We measure making a local function that will remain unused.
    closure_var = module_var

# construct_begin



# construct_alternative
    empty = 1
# construct_end

    return empty, closure_var


for x in xrange(50000):
    calledRepeatedly()

print("OK.")

Context Diff of Source Code


Construct
Baseline
23 def calledRepeatedly(): 23 def calledRepeatedly():
24     # We measure making a local function that will remain unused. 24     # We measure making a local function that will remain unused.
25     closure_var = module_var 25     closure_var = module_var
26 26
27 # construct_begin 27 # construct_begin
n 28     def empty(): n 28  
29         yield closure_var 29  
30 30
31 # construct_alternative 31 # construct_alternative
t 32   t 32     empty = 1
33   33 # construct_end
34 34
35     return empty, closure_var 35     return empty, closure_var
36 36
37 37
38 for x in xrange(50000): 38 for x in xrange(50000):

Context Diff of Generated Code


Construct
Baseline
41 extern PyObject *const_int_0; 41 extern PyObject *const_int_0;
42 static PyObject *const_tuple_str_plain_closure_var_str_plain_empty_tuple; 42 static PyObject *const_tuple_str_plain_closure_var_str_plain_empty_tuple;
43 static PyObject *const_xrange_0_50000; 43 static PyObject *const_xrange_0_50000;
44 static PyObject *const_str_plain_empty; 44 static PyObject *const_str_plain_empty;
45 extern PyObject *const_str_plain_print; 45 extern PyObject *const_str_plain_print;
n 46 static PyObject *const_str_digest_30e4724e0d508bc0c811d26a46d4b6cd; n
47 static PyObject *const_int_pos_50000; 46 static PyObject *const_int_pos_50000;
48 static PyObject *const_tuple_str_digest_5ed1392909ad16e6227b8230f4582352_tuple; 47 static PyObject *const_tuple_str_digest_5ed1392909ad16e6227b8230f4582352_tuple;
49 static PyObject *const_str_plain_calledRepeatedly; 48 static PyObject *const_str_plain_calledRepeatedly;
50 static PyObject *const_str_angle_module; 49 static PyObject *const_str_angle_module;
51 static PyObject *const_str_plain_x; 50 static PyObject *const_str_plain_x;
69     PyTuple_SET_ITEM( const_tuple_str_plain_closure_var_str_plain_empty_tuple, 0, const_str_plain_closure_var ); Py_INCREF( const_str_plain_closure_var ); 68     PyTuple_SET_ITEM( const_tuple_str_plain_closure_var_str_plain_empty_tuple, 0, const_str_plain_closure_var ); Py_INCREF( const_str_plain_closure_var );
70     const_str_plain_empty = UNSTREAM_STRING( &constant_bin[ 122 ], 5, 1 ); 69     const_str_plain_empty = UNSTREAM_STRING( &constant_bin[ 122 ], 5, 1 );
71     PyTuple_SET_ITEM( const_tuple_str_plain_closure_var_str_plain_empty_tuple, 1, const_str_plain_empty ); Py_INCREF( const_str_plain_empty ); 70     PyTuple_SET_ITEM( const_tuple_str_plain_closure_var_str_plain_empty_tuple, 1, const_str_plain_empty ); Py_INCREF( const_str_plain_empty );
72     const_int_pos_50000 = PyLong_FromUnsignedLong( 50000ul ); 71     const_int_pos_50000 = PyLong_FromUnsignedLong( 50000ul );
73     const_xrange_0_50000 = BUILTIN_XRANGE3( const_int_0, const_int_pos_50000, const_int_pos_1 ); 72     const_xrange_0_50000 = BUILTIN_XRANGE3( const_int_0, const_int_pos_50000, const_int_pos_1 );
n 74     const_str_digest_30e4724e0d508bc0c811d26a46d4b6cd = UNSTREAM_STRING( &constant_bin[ 127 ], 31, 0 ); n
75     const_tuple_str_digest_5ed1392909ad16e6227b8230f4582352_tuple = PyTuple_New( 1 ); 73     const_tuple_str_digest_5ed1392909ad16e6227b8230f4582352_tuple = PyTuple_New( 1 );
n 76     const_str_digest_5ed1392909ad16e6227b8230f4582352 = UNSTREAM_STRING( &constant_bin[ 158 ], 3, 0 ); n 74     const_str_digest_5ed1392909ad16e6227b8230f4582352 = UNSTREAM_STRING( &constant_bin[ 127 ], 3, 0 );
77     PyTuple_SET_ITEM( const_tuple_str_digest_5ed1392909ad16e6227b8230f4582352_tuple, 0, const_str_digest_5ed1392909ad16e6227b8230f4582352 ); Py_INCREF( const_str_digest_5ed1392909ad16e6227b8230f4582352 ); 75     PyTuple_SET_ITEM( const_tuple_str_digest_5ed1392909ad16e6227b8230f4582352_tuple, 0, const_str_digest_5ed1392909ad16e6227b8230f4582352 ); Py_INCREF( const_str_digest_5ed1392909ad16e6227b8230f4582352 );
n 78     const_str_plain_calledRepeatedly = UNSTREAM_STRING( &constant_bin[ 127 ], 16, 1 ); n 76     const_str_plain_calledRepeatedly = UNSTREAM_STRING( &constant_bin[ 130 ], 16, 1 );
79     const_str_angle_module = UNSTREAM_STRING( &constant_bin[ 161 ], 8, 0 ); 77     const_str_angle_module = UNSTREAM_STRING( &constant_bin[ 146 ], 8, 0 );
80     const_str_plain_x = UNSTREAM_STRING( &constant_bin[ 46 ], 1, 1 ); 78     const_str_plain_x = UNSTREAM_STRING( &constant_bin[ 46 ], 1, 1 );
81 79
82     constants_created = true; 80     constants_created = true;
83 } 81 }
84 82
93 #endif 91 #endif
94 92
95 // The module code objects. 93 // The module code objects.
96 static PyCodeObject *codeobj_ee34c2803e44a4b017306b2f321cd59b; 94 static PyCodeObject *codeobj_ee34c2803e44a4b017306b2f321cd59b;
97 static PyCodeObject *codeobj_a29043bde7450ce2c0a7cb57618c8d5a; 95 static PyCodeObject *codeobj_a29043bde7450ce2c0a7cb57618c8d5a;
n 98 static PyCodeObject *codeobj_262cf1b32b7b432431eb46844348a4b1; n
99 /* For use in "MainProgram.c". */ 96 /* For use in "MainProgram.c". */
100 PyCodeObject *codeobj_main = NULL; 97 PyCodeObject *codeobj_main = NULL;
101 98
102 static void createModuleCodeObjects(void) 99 static void createModuleCodeObjects(void)
103 { 100 {
104     module_filename_obj = const_str_digest_e074455cfd9c678faf1a95bfb8d717e5; 101     module_filename_obj = const_str_digest_e074455cfd9c678faf1a95bfb8d717e5;
105     codeobj_ee34c2803e44a4b017306b2f321cd59b = MAKE_CODEOBJ( module_filename_obj, const_str_angle_module, 1, const_tuple_empty, 0, 0, CO_NOFREE ); 102     codeobj_ee34c2803e44a4b017306b2f321cd59b = MAKE_CODEOBJ( module_filename_obj, const_str_angle_module, 1, const_tuple_empty, 0, 0, CO_NOFREE );
106     codeobj_main = codeobj_ee34c2803e44a4b017306b2f321cd59b; 103     codeobj_main = codeobj_ee34c2803e44a4b017306b2f321cd59b;
107     codeobj_a29043bde7450ce2c0a7cb57618c8d5a = MAKE_CODEOBJ( module_filename_obj, const_str_plain_calledRepeatedly, 23, const_tuple_str_plain_closure_var_str_plain_empty_tuple, 0, 0, CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE ); 104     codeobj_a29043bde7450ce2c0a7cb57618c8d5a = MAKE_CODEOBJ( module_filename_obj, const_str_plain_calledRepeatedly, 23, const_tuple_str_plain_closure_var_str_plain_empty_tuple, 0, 0, CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE );
n 108     codeobj_262cf1b32b7b432431eb46844348a4b1 = MAKE_CODEOBJ( module_filename_obj, const_str_plain_empty, 28, const_tuple_empty, 0, 0, CO_GENERATOR | CO_OPTIMIZED | CO_NEWLOCALS ); n
109 } 105 }
110 106
111 // The module function declarations. 107 // The module function declarations.
n 112 static void __main__$$$function_1_calledRepeatedly$$$function_1_empty$$$genobj_1_empty_context( struct Nuitka_GeneratorObject *generator ); n
113  
114  
115 static PyObject *MAKE_FUNCTION___main__$$$function_1_calledRepeatedly(  ); 108 static PyObject *MAKE_FUNCTION___main__$$$function_1_calledRepeatedly(  );
n 116   n
117  
118 static PyObject *MAKE_FUNCTION___main__$$$function_1_calledRepeatedly$$$function_1_empty( struct Nuitka_CellObject *closure_closure_var );
119 109
120 110
121 // The module function definitions. 111 // The module function definitions.
122 static PyObject *impl___main__$$$function_1_calledRepeatedly( struct Nuitka_FunctionObject const *self, PyObject **python_pars ) 112 static PyObject *impl___main__$$$function_1_calledRepeatedly( struct Nuitka_FunctionObject const *self, PyObject **python_pars )
123 { 113 {
125 #ifndef __NUITKA_NO_ASSERT__ 115 #ifndef __NUITKA_NO_ASSERT__
126     NUITKA_MAY_BE_UNUSED bool had_error = ERROR_OCCURRED(); 116     NUITKA_MAY_BE_UNUSED bool had_error = ERROR_OCCURRED();
127 #endif 117 #endif
128 118
129     // Local variable declarations. 119     // Local variable declarations.
n 130     struct Nuitka_CellObject *var_closure_var = PyCell_EMPTY(); n
131     PyObject *var_empty = NULL; 120     PyObject *var_closure_var = NULL;
132     PyObject *exception_type = NULL, *exception_value = NULL; 121     PyObject *exception_type = NULL, *exception_value = NULL;
133     PyTracebackObject *exception_tb = NULL; 122     PyTracebackObject *exception_tb = NULL;
134     NUITKA_MAY_BE_UNUSED int exception_lineno = -1; 123     NUITKA_MAY_BE_UNUSED int exception_lineno = -1;
135     PyObject *exception_keeper_type_1; 124     PyObject *exception_keeper_type_1;
136     PyObject *exception_keeper_value_1; 125     PyObject *exception_keeper_value_1;
137     PyTracebackObject *exception_keeper_tb_1; 126     PyTracebackObject *exception_keeper_tb_1;
138     NUITKA_MAY_BE_UNUSED int exception_keeper_lineno_1; 127     NUITKA_MAY_BE_UNUSED int exception_keeper_lineno_1;
139     PyObject *tmp_assign_source_1; 128     PyObject *tmp_assign_source_1;
n 140     PyObject *tmp_assign_source_2; n
141     PyObject *tmp_frame_locals; 129     PyObject *tmp_frame_locals;
142     PyObject *tmp_return_value; 130     PyObject *tmp_return_value;
143     PyObject *tmp_tuple_element_1; 131     PyObject *tmp_tuple_element_1;
144     static PyFrameObject *cache_frame_function = NULL; 132     static PyFrameObject *cache_frame_function = NULL;
145 133
183 171
184         exception_lineno = 25; 172         exception_lineno = 25;
185         goto frame_exception_exit_1; 173         goto frame_exception_exit_1;
186     } 174     }
187 175
n 188     { n 176     assert( var_closure_var == NULL );
189         PyObject *old = PyCell_GET( var_closure_var );
190         PyCell_SET( var_closure_var, tmp_assign_source_1 );
191         Py_INCREF( tmp_assign_source_1 ); 177     Py_INCREF( tmp_assign_source_1 );
192         Py_XDECREF( old );
193     }
194  
195     tmp_assign_source_2 = MAKE_FUNCTION___main__$$$function_1_calledRepeatedly$$$function_1_empty( var_closure_var );
196     assert( var_empty == NULL );
197     var_empty = tmp_assign_source_2; 178     var_closure_var = tmp_assign_source_1;
198 179
n 199     tmp_return_value = PyTuple_New( 2 ); n
200     tmp_tuple_element_1 = var_empty;
201  
202     Py_INCREF( tmp_tuple_element_1 );
203     PyTuple_SET_ITEM( tmp_return_value, 0, tmp_tuple_element_1 );
204     tmp_tuple_element_1 = PyCell_GET( var_closure_var );
205  
206     if ( tmp_tuple_element_1 == NULL )
207     {
208         Py_DECREF( tmp_return_value );
209         exception_type = PyExc_UnboundLocalError;
210         Py_INCREF( exception_type );
211         exception_value = PyUnicode_FromFormat( "local variable '%s' referenced before assignment", "closure_var" );
212         exception_tb = NULL;
213         NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb );
214         CHAIN_EXCEPTION( exception_value );
215  
216         exception_lineno = 35;
217         goto frame_exception_exit_1;
218     }
219  
220     Py_INCREF( tmp_tuple_element_1 );
221     PyTuple_SET_ITEM( tmp_return_value, 1, tmp_tuple_element_1 );
222     goto frame_return_exit_1;
223 180
224 #if 0 181 #if 0
225     RESTORE_FRAME_EXCEPTION( frame_function ); 182     RESTORE_FRAME_EXCEPTION( frame_function );
226 #endif 183 #endif
227     // Put the previous frame back on top. 184     // Put the previous frame back on top.
229 #if PYTHON_VERSION >= 340 186 #if PYTHON_VERSION >= 340
230     frame_function->f_executing -= 1; 187     frame_function->f_executing -= 1;
231 #endif 188 #endif
232     Py_DECREF( frame_function ); 189     Py_DECREF( frame_function );
233     goto frame_no_exception_1; 190     goto frame_no_exception_1;
n 234   n
235     frame_return_exit_1:;
236 #if 0
237     RESTORE_FRAME_EXCEPTION( frame_function );
238 #endif
239     popFrameStack();
240 #if PYTHON_VERSION >= 340
241     frame_function->f_executing -= 1;
242 #endif
243     Py_DECREF( frame_function );
244     goto try_return_handler_1;
245 191
246     frame_exception_exit_1:; 192     frame_exception_exit_1:;
247 #if 0 193 #if 0
248     RESTORE_FRAME_EXCEPTION( frame_function ); 194     RESTORE_FRAME_EXCEPTION( frame_function );
249 #endif 195 #endif
267 213
268         if (needs_detach) 214         if (needs_detach)
269         { 215         {
270 216
271             tmp_frame_locals = PyDict_New(); 217             tmp_frame_locals = PyDict_New();
n 272             if ( var_closure_var->ob_ref ) n 218             if ( var_closure_var )
273             { 219             {
274                 int res = PyDict_SetItem( 220                 int res = PyDict_SetItem(
275                     tmp_frame_locals, 221                     tmp_frame_locals,
276                     const_str_plain_closure_var, 222                     const_str_plain_closure_var,
n 277                     var_closure_var->ob_ref n 223                     var_closure_var
278                 ); 224                 );
279 225
280                 assert( res == 0 ); 226                 assert( res == 0 );
281             } 227             }
282 228
n 283             if ( var_empty ) n
284             {
285                 int res = PyDict_SetItem(
286                     tmp_frame_locals,
287                     const_str_plain_empty,
288                     var_empty
289                 );
290  
291                 assert( res == 0 );
292             }
293  
294 229
295 230
296             detachFrame( exception_tb, tmp_frame_locals ); 231             detachFrame( exception_tb, tmp_frame_locals );
297         } 232         }
298     } 233     }
307     // Return the error. 242     // Return the error.
308     goto try_except_handler_1; 243     goto try_except_handler_1;
309 244
310     frame_no_exception_1:; 245     frame_no_exception_1:;
311 246
n n 247     tmp_return_value = PyTuple_New( 2 );
248     tmp_tuple_element_1 = const_int_pos_1;
249     Py_INCREF( tmp_tuple_element_1 );
250     PyTuple_SET_ITEM( tmp_return_value, 0, tmp_tuple_element_1 );
251     tmp_tuple_element_1 = var_closure_var;
252  
253     Py_INCREF( tmp_tuple_element_1 );
254     PyTuple_SET_ITEM( tmp_return_value, 1, tmp_tuple_element_1 );
255     goto try_return_handler_1;
312     // tried codes exits in all cases 256     // tried codes exits in all cases
313     NUITKA_CANNOT_GET_HERE( __main__$$$function_1_calledRepeatedly ); 257     NUITKA_CANNOT_GET_HERE( __main__$$$function_1_calledRepeatedly );
314     return NULL; 258     return NULL;
315     // Return handler code: 259     // Return handler code:
316     try_return_handler_1:; 260     try_return_handler_1:;
317     CHECK_OBJECT( (PyObject *)var_closure_var ); 261     CHECK_OBJECT( (PyObject *)var_closure_var );
318     Py_DECREF( var_closure_var ); 262     Py_DECREF( var_closure_var );
319     var_closure_var = NULL; 263     var_closure_var = NULL;
n 320   n
321     Py_XDECREF( var_empty );
322     var_empty = NULL;
323 264
324     goto function_return_exit; 265     goto function_return_exit;
325     // Exception handler code: 266     // Exception handler code:
326     try_except_handler_1:; 267     try_except_handler_1:;
327     exception_keeper_type_1 = exception_type; 268     exception_keeper_type_1 = exception_type;
331     exception_type = NULL; 272     exception_type = NULL;
332     exception_value = NULL; 273     exception_value = NULL;
333     exception_tb = NULL; 274     exception_tb = NULL;
334     exception_lineno = -1; 275     exception_lineno = -1;
335 276
n 336     CHECK_OBJECT( (PyObject *)var_closure_var ); n
337     Py_DECREF( var_closure_var );
338     var_closure_var = NULL;
339  
340     Py_XDECREF( var_empty );
341     var_empty = NULL;
342  
343     // Re-raise. 277     // Re-raise.
344     exception_type = exception_keeper_type_1; 278     exception_type = exception_keeper_type_1;
345     exception_value = exception_keeper_value_1; 279     exception_value = exception_keeper_value_1;
346     exception_tb = exception_keeper_tb_1; 280     exception_tb = exception_keeper_tb_1;
347     exception_lineno = exception_keeper_lineno_1; 281     exception_lineno = exception_keeper_lineno_1;
362 296
363     CHECK_OBJECT( tmp_return_value ); 297     CHECK_OBJECT( tmp_return_value );
364     assert( had_error || !ERROR_OCCURRED() ); 298     assert( had_error || !ERROR_OCCURRED() );
365     return tmp_return_value; 299     return tmp_return_value;
366 300
n 367 } n
368  
369  
370 static PyObject *impl___main__$$$function_1_calledRepeatedly$$$function_1_empty( struct Nuitka_FunctionObject const *self, PyObject **python_pars )
371 {
372     // Preserve error status for checks
373 #ifndef __NUITKA_NO_ASSERT__
374     NUITKA_MAY_BE_UNUSED bool had_error = ERROR_OCCURRED();
375 #endif
376  
377     // Local variable declarations.
378     PyObject *tmp_return_value;
379     tmp_return_value = NULL;
380  
381     // Actual function code.
382     tmp_return_value = Nuitka_Generator_New(
383         __main__$$$function_1_calledRepeatedly$$$function_1_empty$$$genobj_1_empty_context,
384         module___main__,
385         self->m_name,
386 #if PYTHON_VERSION >= 350
387         self->m_qualname,
388 #endif
389         codeobj_262cf1b32b7b432431eb46844348a4b1,
390         1
391     );
392  
393     ((struct Nuitka_GeneratorObject *)tmp_return_value)->m_closure[0] = self->m_closure[0];
394     Py_INCREF( ((struct Nuitka_GeneratorObject *)tmp_return_value)->m_closure[0] );
395  
396  
397     goto function_return_exit;
398  
399     // Return statement must have exited already.
400     NUITKA_CANNOT_GET_HERE( __main__$$$function_1_calledRepeatedly$$$function_1_empty );
401     return NULL;
402  
403     function_return_exit:
404  
405     CHECK_OBJECT( tmp_return_value );
406     assert( had_error || !ERROR_OCCURRED() );
407     return tmp_return_value;
408  
409 }
410  
411  
412  
413 static void __main__$$$function_1_calledRepeatedly$$$function_1_empty$$$genobj_1_empty_context( struct Nuitka_GeneratorObject *generator )
414 {
415     CHECK_OBJECT( (PyObject *)generator );
416     assert( Nuitka_Generator_Check( (PyObject *)generator ) );
417  
418     // Local variable initialization
419     PyObject *exception_type = NULL, *exception_value = NULL;
420     PyTracebackObject *exception_tb = NULL;
421     NUITKA_MAY_BE_UNUSED int exception_lineno = -1;
422     PyObject *tmp_expression_name_1;
423     PyObject *tmp_frame_locals;
424     NUITKA_MAY_BE_UNUSED PyObject *tmp_unused;
425     static PyFrameObject *cache_frame_generator = NULL;
426  
427  
428     // Actual function code.
429     MAKE_OR_REUSE_FRAME( cache_frame_generator, codeobj_262cf1b32b7b432431eb46844348a4b1, module___main__ );
430     generator->m_frame = cache_frame_generator;
431     Py_INCREF( generator->m_frame );
432  
433 #if PYTHON_VERSION >= 340
434     generator->m_frame->f_gen = (PyObject *)generator;
435 #endif
436  
437     Py_CLEAR( generator->m_frame->f_back );
438  
439     generator->m_frame->f_back = PyThreadState_GET()->frame;
440     Py_INCREF( generator->m_frame->f_back );
441  
442     PyThreadState_GET()->frame = generator->m_frame;
443     Py_INCREF( generator->m_frame );
444  
445 #if PYTHON_VERSION >= 340
446     generator->m_frame->f_executing += 1;
447 #endif
448  
449 #if PYTHON_VERSION >= 300
450     // Accept currently existing exception as the one to publish again when we
451     // yield or yield from.
452  
453     PyThreadState *thread_state = PyThreadState_GET();
454  
455     generator->m_frame->f_exc_type = thread_state->exc_type;
456     if ( generator->m_frame->f_exc_type == Py_None ) generator->m_frame->f_exc_type = NULL;
457     Py_XINCREF( generator->m_frame->f_exc_type );
458     generator->m_frame->f_exc_value = thread_state->exc_value;
459     Py_XINCREF( generator->m_frame->f_exc_value );
460     generator->m_frame->f_exc_traceback = thread_state->exc_traceback;
461     Py_XINCREF( generator->m_frame->f_exc_traceback );
462 #endif
463  
464     // Framed code:
465     tmp_expression_name_1 = PyCell_GET( generator->m_closure[0] );
466  
467     if ( tmp_expression_name_1 == NULL )
468     {
469  
470         exception_type = PyExc_NameError;
471         Py_INCREF( exception_type );
472         exception_value = PyUnicode_FromFormat( "free variable '%s' referenced before assignment in enclosing scope", "closure_var" );
473         exception_tb = NULL;
474         NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb );
475         CHAIN_EXCEPTION( exception_value );
476  
477         exception_lineno = 29;
478         goto frame_exception_exit_1;
479     }
480  
481     tmp_unused = GENERATOR_YIELD( generator, INCREASE_REFCOUNT( tmp_expression_name_1 ) );
482     if ( tmp_unused == NULL )
483     {
484         assert( ERROR_OCCURRED() );
485  
486         FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb );
487  
488  
489         exception_lineno = 29;
490         goto frame_exception_exit_1;
491     }
492  
493 #if PYTHON_VERSION >= 340
494     generator->m_frame->f_executing -= 1;
495 #endif
496  
497 #if PYTHON_VERSION >= 300
498     Py_CLEAR( generator->m_frame->f_exc_type );
499     Py_CLEAR( generator->m_frame->f_exc_value );
500     Py_CLEAR( generator->m_frame->f_exc_traceback );
501 #endif
502  
503     Py_DECREF( generator->m_frame );
504     goto frame_no_exception_1;
505  
506     frame_exception_exit_1:;
507  
508     // If it's not an exit exception, consider and create a traceback for it.
509     if ( !EXCEPTION_MATCH_GENERATOR( exception_type ) )
510     {
511         int needs_detach = false;
512  
513         if ( exception_tb == NULL )
514         {
515             exception_tb = MAKE_TRACEBACK( generator->m_frame, exception_lineno );
516             needs_detach = true;
517         }
518         else if ( exception_tb->tb_frame != generator->m_frame )
519         {
520             PyTracebackObject *traceback_new = MAKE_TRACEBACK( generator->m_frame, exception_lineno );
521             traceback_new->tb_next = exception_tb;
522             exception_tb = traceback_new;
523  
524             needs_detach = true;
525         }
526  
527         if (needs_detach)
528         {
529  
530             tmp_frame_locals = PyDict_New();
531             if ( generator->m_closure[0]->ob_ref )
532             {
533                 int res = PyDict_SetItem(
534                     tmp_frame_locals,
535                     const_str_plain_closure_var,
536                     generator->m_closure[0]->ob_ref
537                 );
538  
539                 assert( res == 0 );
540             }
541  
542  
543  
544             detachFrame( exception_tb, tmp_frame_locals );
545         }
546     }
547  
548 #if PYTHON_VERSION >= 300
549     Py_CLEAR( generator->m_frame->f_exc_type );
550     Py_CLEAR( generator->m_frame->f_exc_value );
551     Py_CLEAR( generator->m_frame->f_exc_traceback );
552 #endif
553  
554     Py_DECREF( generator->m_frame );
555     // Return the error.
556     goto function_exception_exit;
557  
558     frame_no_exception_1:;
559  
560  
561     generator->m_yielded = NULL;
562     return;
563  
564     function_exception_exit:
565     assert( exception_type );
566     RESTORE_ERROR_OCCURRED( exception_type, exception_value, exception_tb );
567     generator->m_yielded = NULL;
568     return;
569 } 301 }
570 302
571 303
572 304
573 static PyObject *MAKE_FUNCTION___main__$$$function_1_calledRepeatedly(  ) 305 static PyObject *MAKE_FUNCTION___main__$$$function_1_calledRepeatedly(  )
587         module___main__, 319         module___main__,
588         Py_None, 320         Py_None,
589         0 321         0
590     ); 322     );
591 323
t 592   t
593     return (PyObject *)result;
594 }
595  
596  
597  
598 static PyObject *MAKE_FUNCTION___main__$$$function_1_calledRepeatedly$$$function_1_empty( struct Nuitka_CellObject *closure_closure_var )
599 {
600     struct Nuitka_FunctionObject *result = Nuitka_Function_New(
601         impl___main__$$$function_1_calledRepeatedly$$$function_1_empty,
602         const_str_plain_empty,
603 #if PYTHON_VERSION >= 330
604         const_str_digest_30e4724e0d508bc0c811d26a46d4b6cd,
605 #endif
606         codeobj_262cf1b32b7b432431eb46844348a4b1,
607         NULL,
608 #if PYTHON_VERSION >= 300
609         NULL,
610         const_dict_empty,
611 #endif
612         module___main__,
613         Py_None,
614         1
615     );
616  
617 result->m_closure[0] = closure_closure_var;
618 Py_INCREF( result->m_closure[0] );
619 324
620     return (PyObject *)result; 325     return (PyObject *)result;
621 } 326 }
622 327
623 328