Construct FunctionCreationClosure

Performance Diagrams

Construct FunctionCreationClosure 001000000010000000200000002000000030000000300000004000000040000000CPython 2.7Nuitka (historic)Nuitka (master)Nuitka (develop)Nuitka (factory)4496563973.61538461538461274.77618027248604CPython 2.748450945196.30769230769232257.0Nuitka (historic)12652428319.0000000000001439.5839371577868Nuitka (master)12651941441.69230769230774439.58642101423806Nuitka (develop)12652428564.3846153846155439.5839371577868Nuitka (factory)Construct FunctionCreationClosureTicks Construct FunctionCreationClosure 0010000000100000002000000020000000300000003000000040000000400000005000000050000000CPython 3.5Nuitka (historic)Nuitka (master)Nuitka (develop)Nuitka (factory)5639346673.61538461538461257.0CPython 3.50196.30769230769232504.11538461538464Nuitka (historic)15864107319.0000000000001434.599088119535Nuitka (master)15861036441.69230769230774434.6125451988738Nuitka (develop)15857063564.3846153846155434.62995482968245Nuitka (factory)Construct FunctionCreationClosureTicks

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():
        return 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         return 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
31 PyDictObject *moduledict___main__; 31 PyDictObject *moduledict___main__;
32 32
33 /* The module constants used, if any. */ 33 /* The module constants used, if any. */
34 static PyObject *const_str_plain___package__; 34 static PyObject *const_str_plain___package__;
35 static PyObject *const_str_digest_0cbff08afafb6e811c4660d106778be3; 35 static PyObject *const_str_digest_0cbff08afafb6e811c4660d106778be3;
n 36 static PyObject *const_tuple_str_plain_closure_var_tuple; n
37 static PyObject *const_str_plain_module_var; 36 static PyObject *const_str_plain_module_var;
38 extern PyObject *const_int_pos_1; 37 extern PyObject *const_int_pos_1;
39 extern PyObject *const_dict_empty; 38 extern PyObject *const_dict_empty;
40 extern PyObject *const_str_plain___file__; 39 extern PyObject *const_str_plain___file__;
41 static PyObject *const_str_plain_closure_var; 40 static PyObject *const_str_plain_closure_var;
42 extern PyObject *const_int_0; 41 extern PyObject *const_int_0;
43 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;
44 static PyObject *const_xrange_0_50000; 43 static PyObject *const_xrange_0_50000;
45 static PyObject *const_str_plain_empty; 44 static PyObject *const_str_plain_empty;
46 extern PyObject *const_str_plain_print; 45 extern PyObject *const_str_plain_print;
n 47 static PyObject *const_str_digest_30e4724e0d508bc0c811d26a46d4b6cd; n
48 static PyObject *const_int_pos_50000; 46 static PyObject *const_int_pos_50000;
49 static PyObject *const_tuple_str_digest_5ed1392909ad16e6227b8230f4582352_tuple; 47 static PyObject *const_tuple_str_digest_5ed1392909ad16e6227b8230f4582352_tuple;
50 static PyObject *const_str_plain_calledRepeatedly; 48 static PyObject *const_str_plain_calledRepeatedly;
51 static PyObject *const_str_angle_module; 49 static PyObject *const_str_angle_module;
52 static PyObject *const_str_plain_x; 50 static PyObject *const_str_plain_x;
61 59
62 static void createModuleConstants( void ) 60 static void createModuleConstants( void )
63 { 61 {
64     const_str_plain___package__ = UNSTREAM_STRING( &constant_bin[ 0 ], 11, 1 ); 62     const_str_plain___package__ = UNSTREAM_STRING( &constant_bin[ 0 ], 11, 1 );
65     const_str_digest_0cbff08afafb6e811c4660d106778be3 = UNSTREAM_STRING( &constant_bin[ 11 ], 81, 0 ); 63     const_str_digest_0cbff08afafb6e811c4660d106778be3 = UNSTREAM_STRING( &constant_bin[ 11 ], 81, 0 );
n 66     const_tuple_str_plain_closure_var_tuple = PyTuple_New( 1 ); n 64     const_str_plain_module_var = UNSTREAM_STRING( &constant_bin[ 92 ], 10, 1 );
67     const_str_plain_closure_var = UNSTREAM_STRING( &constant_bin[ 92 ], 11, 1 ); 65     const_str_plain_closure_var = UNSTREAM_STRING( &constant_bin[ 102 ], 11, 1 );
68     PyTuple_SET_ITEM( const_tuple_str_plain_closure_var_tuple, 0, const_str_plain_closure_var ); Py_INCREF( const_str_plain_closure_var );
69     const_str_plain_module_var = UNSTREAM_STRING( &constant_bin[ 103 ], 10, 1 );
70     const_tuple_str_plain_closure_var_str_plain_empty_tuple = PyTuple_New( 2 ); 66     const_tuple_str_plain_closure_var_str_plain_empty_tuple = PyTuple_New( 2 );
71     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 ); 67     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 );
72     const_str_plain_empty = UNSTREAM_STRING( &constant_bin[ 113 ], 5, 1 ); 68     const_str_plain_empty = UNSTREAM_STRING( &constant_bin[ 113 ], 5, 1 );
73     PyTuple_SET_ITEM( const_tuple_str_plain_closure_var_str_plain_empty_tuple, 1, const_str_plain_empty ); Py_INCREF( const_str_plain_empty ); 69     PyTuple_SET_ITEM( const_tuple_str_plain_closure_var_str_plain_empty_tuple, 1, const_str_plain_empty ); Py_INCREF( const_str_plain_empty );
74     const_int_pos_50000 = PyLong_FromUnsignedLong( 50000ul ); 70     const_int_pos_50000 = PyLong_FromUnsignedLong( 50000ul );
75     const_xrange_0_50000 = BUILTIN_XRANGE3( const_int_0, const_int_pos_50000, const_int_pos_1 ); 71     const_xrange_0_50000 = BUILTIN_XRANGE3( const_int_0, const_int_pos_50000, const_int_pos_1 );
n 76     const_str_digest_30e4724e0d508bc0c811d26a46d4b6cd = UNSTREAM_STRING( &constant_bin[ 118 ], 31, 0 ); n
77     const_tuple_str_digest_5ed1392909ad16e6227b8230f4582352_tuple = PyTuple_New( 1 ); 72     const_tuple_str_digest_5ed1392909ad16e6227b8230f4582352_tuple = PyTuple_New( 1 );
n 78     const_str_digest_5ed1392909ad16e6227b8230f4582352 = UNSTREAM_STRING( &constant_bin[ 149 ], 3, 0 ); n 73     const_str_digest_5ed1392909ad16e6227b8230f4582352 = UNSTREAM_STRING( &constant_bin[ 118 ], 3, 0 );
79     PyTuple_SET_ITEM( const_tuple_str_digest_5ed1392909ad16e6227b8230f4582352_tuple, 0, const_str_digest_5ed1392909ad16e6227b8230f4582352 ); Py_INCREF( const_str_digest_5ed1392909ad16e6227b8230f4582352 ); 74     PyTuple_SET_ITEM( const_tuple_str_digest_5ed1392909ad16e6227b8230f4582352_tuple, 0, const_str_digest_5ed1392909ad16e6227b8230f4582352 ); Py_INCREF( const_str_digest_5ed1392909ad16e6227b8230f4582352 );
n 80     const_str_plain_calledRepeatedly = UNSTREAM_STRING( &constant_bin[ 118 ], 16, 1 ); n 75     const_str_plain_calledRepeatedly = UNSTREAM_STRING( &constant_bin[ 121 ], 16, 1 );
81     const_str_angle_module = UNSTREAM_STRING( &constant_bin[ 152 ], 8, 0 ); 76     const_str_angle_module = UNSTREAM_STRING( &constant_bin[ 137 ], 8, 0 );
82     const_str_plain_x = UNSTREAM_STRING( &constant_bin[ 36 ], 1, 1 ); 77     const_str_plain_x = UNSTREAM_STRING( &constant_bin[ 36 ], 1, 1 );
83 78
84     constants_created = true; 79     constants_created = true;
85 } 80 }
86 81
95 #endif 90 #endif
96 91
97 // The module code objects. 92 // The module code objects.
98 static PyCodeObject *codeobj_bcf7494d9e94f17013251a89f4aaf15a; 93 static PyCodeObject *codeobj_bcf7494d9e94f17013251a89f4aaf15a;
99 static PyCodeObject *codeobj_707a37e24a14085fbca5f31bb18b3c14; 94 static PyCodeObject *codeobj_707a37e24a14085fbca5f31bb18b3c14;
n 100 static PyCodeObject *codeobj_cf4aeacd6df87e67139d4aee116146b2; n
101 /* For use in "MainProgram.c". */ 95 /* For use in "MainProgram.c". */
102 PyCodeObject *codeobj_main = NULL; 96 PyCodeObject *codeobj_main = NULL;
103 97
104 static void createModuleCodeObjects(void) 98 static void createModuleCodeObjects(void)
105 { 99 {
106     module_filename_obj = const_str_digest_0cbff08afafb6e811c4660d106778be3; 100     module_filename_obj = const_str_digest_0cbff08afafb6e811c4660d106778be3;
107     codeobj_bcf7494d9e94f17013251a89f4aaf15a = MAKE_CODEOBJ( module_filename_obj, const_str_angle_module, 1, const_tuple_empty, 0, 0, CO_NOFREE ); 101     codeobj_bcf7494d9e94f17013251a89f4aaf15a = MAKE_CODEOBJ( module_filename_obj, const_str_angle_module, 1, const_tuple_empty, 0, 0, CO_NOFREE );
108     codeobj_main = codeobj_bcf7494d9e94f17013251a89f4aaf15a; 102     codeobj_main = codeobj_bcf7494d9e94f17013251a89f4aaf15a;
109     codeobj_707a37e24a14085fbca5f31bb18b3c14 = 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 ); 103     codeobj_707a37e24a14085fbca5f31bb18b3c14 = 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 110     codeobj_cf4aeacd6df87e67139d4aee116146b2 = MAKE_CODEOBJ( module_filename_obj, const_str_plain_empty, 28, const_tuple_str_plain_closure_var_tuple, 0, 0, CO_OPTIMIZED | CO_NEWLOCALS ); n
111 } 104 }
112 105
113 // The module function declarations. 106 // The module function declarations.
114 static PyObject *MAKE_FUNCTION___main__$$$function_1_calledRepeatedly(  ); 107 static PyObject *MAKE_FUNCTION___main__$$$function_1_calledRepeatedly(  );
n 115   n
116  
117 static PyObject *MAKE_FUNCTION___main__$$$function_1_calledRepeatedly$$$function_1_empty( struct Nuitka_CellObject *closure_closure_var );
118 108
119 109
120 // The module function definitions. 110 // The module function definitions.
121 static PyObject *impl___main__$$$function_1_calledRepeatedly( struct Nuitka_FunctionObject const *self, PyObject **python_pars ) 111 static PyObject *impl___main__$$$function_1_calledRepeatedly( struct Nuitka_FunctionObject const *self, PyObject **python_pars )
122 { 112 {
124 #ifndef __NUITKA_NO_ASSERT__ 114 #ifndef __NUITKA_NO_ASSERT__
125     NUITKA_MAY_BE_UNUSED bool had_error = ERROR_OCCURRED(); 115     NUITKA_MAY_BE_UNUSED bool had_error = ERROR_OCCURRED();
126 #endif 116 #endif
127 117
128     // Local variable declarations. 118     // Local variable declarations.
n 129     struct Nuitka_CellObject *var_closure_var = PyCell_EMPTY(); n
130     PyObject *var_empty = NULL; 119     PyObject *var_closure_var = NULL;
131     PyObject *exception_type = NULL, *exception_value = NULL; 120     PyObject *exception_type = NULL, *exception_value = NULL;
132     PyTracebackObject *exception_tb = NULL; 121     PyTracebackObject *exception_tb = NULL;
133     NUITKA_MAY_BE_UNUSED int exception_lineno = -1; 122     NUITKA_MAY_BE_UNUSED int exception_lineno = -1;
134     PyObject *exception_keeper_type_1; 123     PyObject *exception_keeper_type_1;
135     PyObject *exception_keeper_value_1; 124     PyObject *exception_keeper_value_1;
136     PyTracebackObject *exception_keeper_tb_1; 125     PyTracebackObject *exception_keeper_tb_1;
137     NUITKA_MAY_BE_UNUSED int exception_keeper_lineno_1; 126     NUITKA_MAY_BE_UNUSED int exception_keeper_lineno_1;
138     PyObject *tmp_assign_source_1; 127     PyObject *tmp_assign_source_1;
n 139     PyObject *tmp_assign_source_2; n
140     PyObject *tmp_return_value; 128     PyObject *tmp_return_value;
141     PyObject *tmp_tuple_element_1; 129     PyObject *tmp_tuple_element_1;
142     static struct Nuitka_FrameObject *cache_frame_707a37e24a14085fbca5f31bb18b3c14 = NULL; 130     static struct Nuitka_FrameObject *cache_frame_707a37e24a14085fbca5f31bb18b3c14 = NULL;
143 131
144     struct Nuitka_FrameObject *frame_707a37e24a14085fbca5f31bb18b3c14; 132     struct Nuitka_FrameObject *frame_707a37e24a14085fbca5f31bb18b3c14;
146     char const *type_description; 134     char const *type_description;
147     tmp_return_value = NULL; 135     tmp_return_value = NULL;
148 136
149     // Actual function code. 137     // Actual function code.
150     // Tried code: 138     // Tried code:
n 151     MAKE_OR_REUSE_FRAME( cache_frame_707a37e24a14085fbca5f31bb18b3c14, codeobj_707a37e24a14085fbca5f31bb18b3c14, module___main__, sizeof(struct Nuitka_CellObject *)+sizeof(PyObject *) ); n 139     MAKE_OR_REUSE_FRAME( cache_frame_707a37e24a14085fbca5f31bb18b3c14, codeobj_707a37e24a14085fbca5f31bb18b3c14, module___main__, sizeof(void *)+sizeof(PyObject *) );
152     frame_707a37e24a14085fbca5f31bb18b3c14 = cache_frame_707a37e24a14085fbca5f31bb18b3c14; 140     frame_707a37e24a14085fbca5f31bb18b3c14 = cache_frame_707a37e24a14085fbca5f31bb18b3c14;
153 141
154     // Push the new frame as the currently active one. 142     // Push the new frame as the currently active one.
155     pushFrameStack( frame_707a37e24a14085fbca5f31bb18b3c14 ); 143     pushFrameStack( frame_707a37e24a14085fbca5f31bb18b3c14 );
156 144
174         exception_tb = NULL; 162         exception_tb = NULL;
175         NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); 163         NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb );
176         CHAIN_EXCEPTION( exception_value ); 164         CHAIN_EXCEPTION( exception_value );
177 165
178         exception_lineno = 25; 166         exception_lineno = 25;
n 179         type_description = "co"; n 167         type_description = "oN";
180         goto frame_exception_exit_1; 168         goto frame_exception_exit_1;
181     } 169     }
182 170
n 183     { n 171     assert( var_closure_var == NULL );
184         PyObject *old = PyCell_GET( var_closure_var );
185         PyCell_SET( var_closure_var, tmp_assign_source_1 );
186         Py_INCREF( tmp_assign_source_1 ); 172     Py_INCREF( tmp_assign_source_1 );
187         Py_XDECREF( old ); 173     var_closure_var = tmp_assign_source_1;
188     }
189 174
190 175
191 #if 0 176 #if 0
192     RESTORE_FRAME_EXCEPTION( frame_707a37e24a14085fbca5f31bb18b3c14 ); 177     RESTORE_FRAME_EXCEPTION( frame_707a37e24a14085fbca5f31bb18b3c14 );
193 #endif 178 #endif
210     else if ( exception_tb->tb_frame != &frame_707a37e24a14085fbca5f31bb18b3c14->m_frame ) 195     else if ( exception_tb->tb_frame != &frame_707a37e24a14085fbca5f31bb18b3c14->m_frame )
211     { 196     {
212         exception_tb = ADD_TRACEBACK( exception_tb, frame_707a37e24a14085fbca5f31bb18b3c14, exception_lineno ); 197         exception_tb = ADD_TRACEBACK( exception_tb, frame_707a37e24a14085fbca5f31bb18b3c14, exception_lineno );
213     } 198     }
214 199
n 215     Nuitka_Frame_AttachLocals( (struct Nuitka_FrameObject *)frame_707a37e24a14085fbca5f31bb18b3c14, type_description ,var_closure_var, var_empty ); n 200     Nuitka_Frame_AttachLocals( (struct Nuitka_FrameObject *)frame_707a37e24a14085fbca5f31bb18b3c14, type_description ,var_closure_var, NULL );
216 201
217     // Release cached frame. 202     // Release cached frame.
218     if ( frame_707a37e24a14085fbca5f31bb18b3c14 == cache_frame_707a37e24a14085fbca5f31bb18b3c14 ) 203     if ( frame_707a37e24a14085fbca5f31bb18b3c14 == cache_frame_707a37e24a14085fbca5f31bb18b3c14 )
219     { 204     {
220         Py_DECREF( frame_707a37e24a14085fbca5f31bb18b3c14 ); 205         Py_DECREF( frame_707a37e24a14085fbca5f31bb18b3c14 );
230     // Return the error. 215     // Return the error.
231     goto try_except_handler_1; 216     goto try_except_handler_1;
232 217
233     frame_no_exception_1:; 218     frame_no_exception_1:;
234 219
n 235     tmp_assign_source_2 = MAKE_FUNCTION___main__$$$function_1_calledRepeatedly$$$function_1_empty( var_closure_var ); n
236     assert( var_empty == NULL );
237     var_empty = tmp_assign_source_2;
238  
239     tmp_return_value = PyTuple_New( 2 ); 220     tmp_return_value = PyTuple_New( 2 );
n 240     tmp_tuple_element_1 = var_empty; n 221     tmp_tuple_element_1 = const_int_pos_1;
241  
242     CHECK_OBJECT( tmp_tuple_element_1 );
243     Py_INCREF( tmp_tuple_element_1 ); 222     Py_INCREF( tmp_tuple_element_1 );
244     PyTuple_SET_ITEM( tmp_return_value, 0, tmp_tuple_element_1 ); 223     PyTuple_SET_ITEM( tmp_return_value, 0, tmp_tuple_element_1 );
n 245     if ( var_closure_var == NULL ) n
246     {
247         tmp_tuple_element_1 = NULL;
248     }
249     else
250     {
251         tmp_tuple_element_1 = PyCell_GET( var_closure_var ); 224     tmp_tuple_element_1 = var_closure_var;
252     }
253 225
n 254     if ( tmp_tuple_element_1 == NULL ) n 226     CHECK_OBJECT( tmp_tuple_element_1 );
255     {
256         Py_DECREF( tmp_return_value );
257         exception_type = PyExc_UnboundLocalError;
258         Py_INCREF( exception_type );
259         exception_value = PyUnicode_FromFormat( "local variable '%s' referenced before assignment", "closure_var" );
260         exception_tb = NULL;
261         NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb );
262         CHAIN_EXCEPTION( exception_value );
263  
264  
265  
266         goto try_except_handler_1;
267     }
268  
269     Py_INCREF( tmp_tuple_element_1 ); 227     Py_INCREF( tmp_tuple_element_1 );
270     PyTuple_SET_ITEM( tmp_return_value, 1, tmp_tuple_element_1 ); 228     PyTuple_SET_ITEM( tmp_return_value, 1, tmp_tuple_element_1 );
271     goto try_return_handler_1; 229     goto try_return_handler_1;
272     // tried codes exits in all cases 230     // tried codes exits in all cases
273     NUITKA_CANNOT_GET_HERE( __main__$$$function_1_calledRepeatedly ); 231     NUITKA_CANNOT_GET_HERE( __main__$$$function_1_calledRepeatedly );
276     try_return_handler_1:; 234     try_return_handler_1:;
277     CHECK_OBJECT( (PyObject *)var_closure_var ); 235     CHECK_OBJECT( (PyObject *)var_closure_var );
278     Py_DECREF( var_closure_var ); 236     Py_DECREF( var_closure_var );
279     var_closure_var = NULL; 237     var_closure_var = NULL;
280 238
n 281     Py_XDECREF( var_empty ); n
282     var_empty = NULL;
283  
284     goto function_return_exit; 239     goto function_return_exit;
285     // Exception handler code: 240     // Exception handler code:
286     try_except_handler_1:; 241     try_except_handler_1:;
287     exception_keeper_type_1 = exception_type; 242     exception_keeper_type_1 = exception_type;
288     exception_keeper_value_1 = exception_value; 243     exception_keeper_value_1 = exception_value;
318     return tmp_return_value; 273     return tmp_return_value;
319 274
320 } 275 }
321 276
322 277
n 323 static PyObject *impl___main__$$$function_1_calledRepeatedly$$$function_1_empty( struct Nuitka_FunctionObject const *self, PyObject **python_pars ) n
324 {
325     // Preserve error status for checks
326 #ifndef __NUITKA_NO_ASSERT__
327     NUITKA_MAY_BE_UNUSED bool had_error = ERROR_OCCURRED();
328 #endif
329  
330     // Local variable declarations.
331     PyObject *exception_type = NULL, *exception_value = NULL;
332     PyTracebackObject *exception_tb = NULL;
333     NUITKA_MAY_BE_UNUSED int exception_lineno = -1;
334     PyObject *tmp_return_value;
335     static struct Nuitka_FrameObject *cache_frame_cf4aeacd6df87e67139d4aee116146b2 = NULL;
336  
337     struct Nuitka_FrameObject *frame_cf4aeacd6df87e67139d4aee116146b2;
338  
339     char const *type_description;
340     tmp_return_value = NULL;
341  
342     // Actual function code.
343     MAKE_OR_REUSE_FRAME( cache_frame_cf4aeacd6df87e67139d4aee116146b2, codeobj_cf4aeacd6df87e67139d4aee116146b2, module___main__, sizeof(struct Nuitka_CellObject *) );
344     frame_cf4aeacd6df87e67139d4aee116146b2 = cache_frame_cf4aeacd6df87e67139d4aee116146b2;
345  
346     // Push the new frame as the currently active one.
347     pushFrameStack( frame_cf4aeacd6df87e67139d4aee116146b2 );
348  
349     // Mark the frame object as in use, ref count 1 will be up for reuse.
350     assert( Py_REFCNT( frame_cf4aeacd6df87e67139d4aee116146b2 ) == 2 ); // Frame stack
351  
352     // Framed code:
353     if ( self->m_closure[0] == NULL )
354     {
355         tmp_return_value = NULL;
356     }
357     else
358     {
359         tmp_return_value = PyCell_GET( self->m_closure[0] );
360     }
361  
362     if ( tmp_return_value == NULL )
363     {
364  
365         exception_type = PyExc_NameError;
366         Py_INCREF( exception_type );
367         exception_value = PyUnicode_FromFormat( "free variable '%s' referenced before assignment in enclosing scope", "closure_var" );
368         exception_tb = NULL;
369         NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb );
370         CHAIN_EXCEPTION( exception_value );
371  
372         exception_lineno = 29;
373         type_description = "c";
374         goto frame_exception_exit_1;
375     }
376  
377     Py_INCREF( tmp_return_value );
378     goto frame_return_exit_1;
379  
380 #if 0
381     RESTORE_FRAME_EXCEPTION( frame_cf4aeacd6df87e67139d4aee116146b2 );
382 #endif
383  
384     // Put the previous frame back on top.
385     popFrameStack();
386  
387     goto frame_no_exception_1;
388  
389     frame_return_exit_1:;
390 #if 0
391     RESTORE_FRAME_EXCEPTION( frame_cf4aeacd6df87e67139d4aee116146b2 );
392 #endif
393  
394     // Put the previous frame back on top.
395     popFrameStack();
396  
397     goto function_return_exit;
398  
399     frame_exception_exit_1:;
400  
401 #if 0
402     RESTORE_FRAME_EXCEPTION( frame_cf4aeacd6df87e67139d4aee116146b2 );
403 #endif
404  
405     if ( exception_tb == NULL )
406     {
407         exception_tb = MAKE_TRACEBACK( frame_cf4aeacd6df87e67139d4aee116146b2, exception_lineno );
408     }
409     else if ( exception_tb->tb_frame != &frame_cf4aeacd6df87e67139d4aee116146b2->m_frame )
410     {
411         exception_tb = ADD_TRACEBACK( exception_tb, frame_cf4aeacd6df87e67139d4aee116146b2, exception_lineno );
412     }
413  
414     Nuitka_Frame_AttachLocals( (struct Nuitka_FrameObject *)frame_cf4aeacd6df87e67139d4aee116146b2, type_description ,self->m_closure[0] );
415  
416     // Release cached frame.
417     if ( frame_cf4aeacd6df87e67139d4aee116146b2 == cache_frame_cf4aeacd6df87e67139d4aee116146b2 )
418     {
419         Py_DECREF( frame_cf4aeacd6df87e67139d4aee116146b2 );
420     }
421     cache_frame_cf4aeacd6df87e67139d4aee116146b2 = NULL;
422  
423     assertFrameObject( frame_cf4aeacd6df87e67139d4aee116146b2 );
424  
425  
426     // Put the previous frame back on top.
427     popFrameStack();
428  
429     // Return the error.
430     goto function_exception_exit;
431  
432     frame_no_exception_1:;
433  
434  
435     // Return statement must have exited already.
436     NUITKA_CANNOT_GET_HERE( __main__$$$function_1_calledRepeatedly$$$function_1_empty );
437     return NULL;
438  
439 function_exception_exit:
440     assert( exception_type );
441     RESTORE_ERROR_OCCURRED( exception_type, exception_value, exception_tb );
442  
443     return NULL;
444     function_return_exit:
445  
446     CHECK_OBJECT( tmp_return_value );
447     assert( had_error || !ERROR_OCCURRED() );
448     return tmp_return_value;
449  
450 }
451  
452  
453 278
454 static PyObject *MAKE_FUNCTION___main__$$$function_1_calledRepeatedly(  ) 279 static PyObject *MAKE_FUNCTION___main__$$$function_1_calledRepeatedly(  )
455 { 280 {
456     struct Nuitka_FunctionObject *result = Nuitka_Function_New( 281     struct Nuitka_FunctionObject *result = Nuitka_Function_New(
457         impl___main__$$$function_1_calledRepeatedly, 282         impl___main__$$$function_1_calledRepeatedly,
468         module___main__, 293         module___main__,
469         Py_None, 294         Py_None,
470         0 295         0
471     ); 296     );
472 297
t 473   t
474     return (PyObject *)result;
475 }
476  
477  
478  
479 static PyObject *MAKE_FUNCTION___main__$$$function_1_calledRepeatedly$$$function_1_empty( struct Nuitka_CellObject *closure_closure_var )
480 {
481     struct Nuitka_FunctionObject *result = Nuitka_Function_New(
482         impl___main__$$$function_1_calledRepeatedly$$$function_1_empty,
483         const_str_plain_empty,
484 #if PYTHON_VERSION >= 330
485         const_str_digest_30e4724e0d508bc0c811d26a46d4b6cd,
486 #endif
487         codeobj_cf4aeacd6df87e67139d4aee116146b2,
488         NULL,
489 #if PYTHON_VERSION >= 300
490         NULL,
491         const_dict_empty,
492 #endif
493         module___main__,
494         Py_None,
495         1
496     );
497  
498 result->m_closure[0] = closure_closure_var;
499 Py_INCREF( result->m_closure[0] );
500 298
501     return (PyObject *)result; 299     return (PyObject *)result;
502 } 300 }
503 301
504 302