Construct LoopSmallXrange

Performance Diagrams

Construct LoopSmallXrange 00100000001000000020000000200000003000000030000000400000004000000050000000500000006000000060000000700000007000000080000000800000009000000090000000100000000100000000CPython 2.7Nuitka (master)Nuitka (develop)Nuitka (factory)10663294788.11538461538461257.0CPython 2.730530902240.03846153846155433.36187172237027Nuitka (master)30530932391.96153846153845433.36180219919055Nuitka (develop)30531748543.8846153846154433.3599111687022Nuitka (factory)Construct LoopSmallXrangeTicks Construct LoopSmallXrange 00100000001000000020000000200000003000000030000000400000004000000050000000500000006000000060000000700000007000000080000000800000009000000090000000100000000100000000110000000110000000120000000120000000130000000130000000CPython 3.5Nuitka (master)Nuitka (develop)Nuitka (factory)13898423288.11538461538461257.0CPython 3.588645829240.03846153846155346.5021948840156Nuitka (master)88644309391.96153846153845346.50489745954667Nuitka (develop)88646457543.8846153846154346.50107829359877Nuitka (factory)Construct LoopSmallXrangeTicks

Source Code with Construct

module_value1 = 5
module_value2 = 3

def calledRepeatedly():
    # Force frame and eliminate forward propagation (currently).
    module_value1

    # Make sure we have a local variable x anyway
    x = 2

    local_value = module_value1

# construct_begin
    for x in xrange(local_value, local_value+3):
        pass
# construct_end

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

print("OK.")

Source Code without Construct

module_value1 = 5
module_value2 = 3

def calledRepeatedly():
    # Force frame and eliminate forward propagation (currently).
    module_value1

    # Make sure we have a local variable x anyway
    x = 2

    local_value = module_value1

# construct_begin




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

print("OK.")

Context Diff of Source Code


Construct
Baseline
29     x = 2 29     x = 2
30 30
31     local_value = module_value1 31     local_value = module_value1
32 32
33 # construct_begin 33 # construct_begin
t 34     for x in xrange(local_value, local_value+3): t 34  
35         pass 35  
36 # construct_end 36  
37 37
38 import itertools 38 import itertools
39 for x in itertools.repeat(None, 50000): 39 for x in itertools.repeat(None, 50000):
40     calledRepeatedly() 40     calledRepeatedly()
41 41

Context Diff of Generated Code


Construct
Baseline
48 static PyObject *const_str_plain_x; 48 static PyObject *const_str_plain_x;
49 extern PyObject *const_tuple_empty; 49 extern PyObject *const_tuple_empty;
50 static PyObject *const_str_digest_5ed1392909ad16e6227b8230f4582352; 50 static PyObject *const_str_digest_5ed1392909ad16e6227b8230f4582352;
51 static PyObject *const_int_pos_5; 51 static PyObject *const_int_pos_5;
52 static PyObject *const_str_plain_repeat; 52 static PyObject *const_str_plain_repeat;
n 53 static PyObject *const_int_pos_2; n
54 static PyObject *const_tuple_none_int_pos_50000_tuple; 53 static PyObject *const_tuple_none_int_pos_50000_tuple;
55 static PyObject *const_tuple_str_plain_x_str_plain_local_value_tuple; 54 static PyObject *const_tuple_str_plain_x_str_plain_local_value_tuple;
n 56 static PyObject *const_str_digest_7a454677c638097f888dacd4edc8ecce; n
57 extern PyObject *const_str_plain___main__; 55 extern PyObject *const_str_plain___main__;
58 extern PyObject *const_str_plain___doc__; 56 extern PyObject *const_str_plain___doc__;
59 extern PyObject *const_str_plain___cached__; 57 extern PyObject *const_str_plain___cached__;
60 static PyObject *module_filename_obj; 58 static PyObject *module_filename_obj;
61 59
77     const_str_angle_module = UNSTREAM_STRING_ASCII( &constant_bin[ 131 ], 8, 0 ); 75     const_str_angle_module = UNSTREAM_STRING_ASCII( &constant_bin[ 131 ], 8, 0 );
78     const_str_plain_None = UNSTREAM_STRING_ASCII( &constant_bin[ 139 ], 4, 1 ); 76     const_str_plain_None = UNSTREAM_STRING_ASCII( &constant_bin[ 139 ], 4, 1 );
79     const_str_plain_x = UNSTREAM_STRING_ASCII( &constant_bin[ 34 ], 1, 1 ); 77     const_str_plain_x = UNSTREAM_STRING_ASCII( &constant_bin[ 34 ], 1, 1 );
80     const_int_pos_5 = PyLong_FromUnsignedLong( 5ul ); 78     const_int_pos_5 = PyLong_FromUnsignedLong( 5ul );
81     const_str_plain_repeat = UNSTREAM_STRING_ASCII( &constant_bin[ 143 ], 6, 1 ); 79     const_str_plain_repeat = UNSTREAM_STRING_ASCII( &constant_bin[ 143 ], 6, 1 );
n 82     const_int_pos_2 = PyLong_FromUnsignedLong( 2ul ); n
83     const_tuple_none_int_pos_50000_tuple = PyTuple_New( 2 ); 80     const_tuple_none_int_pos_50000_tuple = PyTuple_New( 2 );
84     PyTuple_SET_ITEM( const_tuple_none_int_pos_50000_tuple, 0, Py_None ); Py_INCREF( Py_None ); 81     PyTuple_SET_ITEM( const_tuple_none_int_pos_50000_tuple, 0, Py_None ); Py_INCREF( Py_None );
85     PyTuple_SET_ITEM( const_tuple_none_int_pos_50000_tuple, 1, const_int_pos_50000 ); Py_INCREF( const_int_pos_50000 ); 82     PyTuple_SET_ITEM( const_tuple_none_int_pos_50000_tuple, 1, const_int_pos_50000 ); Py_INCREF( const_int_pos_50000 );
86     const_tuple_str_plain_x_str_plain_local_value_tuple = PyTuple_New( 2 ); 83     const_tuple_str_plain_x_str_plain_local_value_tuple = PyTuple_New( 2 );
87     PyTuple_SET_ITEM( const_tuple_str_plain_x_str_plain_local_value_tuple, 0, const_str_plain_x ); Py_INCREF( const_str_plain_x ); 84     PyTuple_SET_ITEM( const_tuple_str_plain_x_str_plain_local_value_tuple, 0, const_str_plain_x ); Py_INCREF( const_str_plain_x );
88     PyTuple_SET_ITEM( const_tuple_str_plain_x_str_plain_local_value_tuple, 1, const_str_plain_local_value ); Py_INCREF( const_str_plain_local_value ); 85     PyTuple_SET_ITEM( const_tuple_str_plain_x_str_plain_local_value_tuple, 1, const_str_plain_local_value ); Py_INCREF( const_str_plain_local_value );
n 89     const_str_digest_7a454677c638097f888dacd4edc8ecce = UNSTREAM_STRING_ASCII( &constant_bin[ 149 ], 49, 0 ); n
90 86
91     constants_created = true; 87     constants_created = true;
92 } 88 }
93 89
94 #ifndef __NUITKA_NO_ASSERT__ 90 #ifndef __NUITKA_NO_ASSERT__
101 } 97 }
102 #endif 98 #endif
103 99
104 // The module code objects. 100 // The module code objects.
105 static PyCodeObject *codeobj_5c463d9ba3cf831427781e794452a340; 101 static PyCodeObject *codeobj_5c463d9ba3cf831427781e794452a340;
n 106 static PyCodeObject *codeobj_d0829e2ea0fbfe8444128bfb67f51351; n 102 static PyCodeObject *codeobj_792d5af78f97490fdfebbc22bdfc6d02;
107 /* For use in "MainProgram.c". */ 103 /* For use in "MainProgram.c". */
108 PyCodeObject *codeobj_main = NULL; 104 PyCodeObject *codeobj_main = NULL;
109 105
110 static void createModuleCodeObjects(void) 106 static void createModuleCodeObjects(void)
111 { 107 {
112     module_filename_obj = const_str_digest_fb422d5bcde326f02b6a2913edd34c13; 108     module_filename_obj = const_str_digest_fb422d5bcde326f02b6a2913edd34c13;
113     codeobj_5c463d9ba3cf831427781e794452a340 = MAKE_CODEOBJ( module_filename_obj, const_str_angle_module, 1, const_tuple_empty, 0, 0, CO_NOFREE ); 109     codeobj_5c463d9ba3cf831427781e794452a340 = MAKE_CODEOBJ( module_filename_obj, const_str_angle_module, 1, const_tuple_empty, 0, 0, CO_NOFREE );
114     codeobj_main = codeobj_5c463d9ba3cf831427781e794452a340; 110     codeobj_main = codeobj_5c463d9ba3cf831427781e794452a340;
n 115     codeobj_d0829e2ea0fbfe8444128bfb67f51351 = MAKE_CODEOBJ( module_filename_obj, const_str_plain_calledRepeatedly, 25, const_tuple_str_plain_x_str_plain_local_value_tuple, 0, 0, CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE ); n 111     codeobj_792d5af78f97490fdfebbc22bdfc6d02 = MAKE_CODEOBJ( module_filename_obj, const_str_plain_calledRepeatedly, 24, const_tuple_str_plain_x_str_plain_local_value_tuple, 0, 0, CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE );
116 } 112 }
117 113
118 // The module function declarations. 114 // The module function declarations.
119 static PyObject *MAKE_FUNCTION___main__$$$function_1_calledRepeatedly(  ); 115 static PyObject *MAKE_FUNCTION___main__$$$function_1_calledRepeatedly(  );
120 116
126 #ifndef __NUITKA_NO_ASSERT__ 122 #ifndef __NUITKA_NO_ASSERT__
127     NUITKA_MAY_BE_UNUSED bool had_error = ERROR_OCCURRED(); 123     NUITKA_MAY_BE_UNUSED bool had_error = ERROR_OCCURRED();
128 #endif 124 #endif
129 125
130     // Local variable declarations. 126     // Local variable declarations.
n 131     PyObject *var_x = NULL; n
132     PyObject *var_local_value = NULL; 127     PyObject *var_local_value = NULL;
n 133     PyObject *tmp_for_loop_1__for_iterator = NULL; n 128     struct Nuitka_FrameObject *frame_792d5af78f97490fdfebbc22bdfc6d02;
134     PyObject *tmp_for_loop_1__iter_value = NULL;
135     struct Nuitka_FrameObject *frame_d0829e2ea0fbfe8444128bfb67f51351;
136     NUITKA_MAY_BE_UNUSED char const *type_description_1 = NULL; 129     NUITKA_MAY_BE_UNUSED char const *type_description_1 = NULL;
137     PyObject *exception_type = NULL; 130     PyObject *exception_type = NULL;
138     PyObject *exception_value = NULL; 131     PyObject *exception_value = NULL;
139     PyTracebackObject *exception_tb = NULL; 132     PyTracebackObject *exception_tb = NULL;
140     NUITKA_MAY_BE_UNUSED int exception_lineno = 0; 133     NUITKA_MAY_BE_UNUSED int exception_lineno = 0;
n n 134     static struct Nuitka_FrameObject *cache_frame_792d5af78f97490fdfebbc22bdfc6d02 = NULL;
135     PyObject *tmp_return_value = NULL;
141     PyObject *exception_keeper_type_1; 136     PyObject *exception_keeper_type_1;
142     PyObject *exception_keeper_value_1; 137     PyObject *exception_keeper_value_1;
143     PyTracebackObject *exception_keeper_tb_1; 138     PyTracebackObject *exception_keeper_tb_1;
144     NUITKA_MAY_BE_UNUSED int exception_keeper_lineno_1; 139     NUITKA_MAY_BE_UNUSED int exception_keeper_lineno_1;
n 145     static struct Nuitka_FrameObject *cache_frame_d0829e2ea0fbfe8444128bfb67f51351 = NULL; n
146     PyObject *tmp_return_value = NULL;
147     PyObject *exception_keeper_type_2;
148     PyObject *exception_keeper_value_2;
149     PyTracebackObject *exception_keeper_tb_2;
150     NUITKA_MAY_BE_UNUSED int exception_keeper_lineno_2;
151 140
152     // Actual function code. 141     // Actual function code.
153     { 142     {
154     // Tried code: 143     // Tried code:
n 155     MAKE_OR_REUSE_FRAME( cache_frame_d0829e2ea0fbfe8444128bfb67f51351, codeobj_d0829e2ea0fbfe8444128bfb67f51351, module___main__, sizeof(void *)+sizeof(void *) ); n 144     MAKE_OR_REUSE_FRAME( cache_frame_792d5af78f97490fdfebbc22bdfc6d02, codeobj_792d5af78f97490fdfebbc22bdfc6d02, module___main__, sizeof(void *)+sizeof(void *) );
156     frame_d0829e2ea0fbfe8444128bfb67f51351 = cache_frame_d0829e2ea0fbfe8444128bfb67f51351; 145     frame_792d5af78f97490fdfebbc22bdfc6d02 = cache_frame_792d5af78f97490fdfebbc22bdfc6d02;
157 146
158     // Push the new frame as the currently active one. 147     // Push the new frame as the currently active one.
n 159     pushFrameStack( frame_d0829e2ea0fbfe8444128bfb67f51351 ); n 148     pushFrameStack( frame_792d5af78f97490fdfebbc22bdfc6d02 );
160 149
161     // Mark the frame object as in use, ref count 1 will be up for reuse. 150     // Mark the frame object as in use, ref count 1 will be up for reuse.
n 162     assert( Py_REFCNT( frame_d0829e2ea0fbfe8444128bfb67f51351 ) == 2 ); // Frame stack n 151     assert( Py_REFCNT( frame_792d5af78f97490fdfebbc22bdfc6d02 ) == 2 ); // Frame stack
163 152
164     // Framed code: 153     // Framed code:
165     { 154     {
166     PyObject *tmp_mvar_value_1; 155     PyObject *tmp_mvar_value_1;
167     tmp_mvar_value_1 = GET_STRING_DICT_VALUE( moduledict___main__, (Nuitka_StringObject *)const_str_plain_module_value1 ); 156     tmp_mvar_value_1 = GET_STRING_DICT_VALUE( moduledict___main__, (Nuitka_StringObject *)const_str_plain_module_value1 );
179         exception_value = PyUnicode_FromFormat( "name '%s' is not defined", "module_value1" ); 168         exception_value = PyUnicode_FromFormat( "name '%s' is not defined", "module_value1" );
180         exception_tb = NULL; 169         exception_tb = NULL;
181         NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); 170         NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb );
182         CHAIN_EXCEPTION( exception_value ); 171         CHAIN_EXCEPTION( exception_value );
183 172
n 184         exception_lineno = 27; n 173         exception_lineno = 26;
185         type_description_1 = "oo"; 174         type_description_1 = "No";
186         goto frame_exception_exit_1; 175         goto frame_exception_exit_1;
187     } 176     }
188 177
189     } 178     }
190     { 179     {
191     PyObject *tmp_assign_source_1; 180     PyObject *tmp_assign_source_1;
n 192     tmp_assign_source_1 = const_int_pos_2; n
193     assert( var_x == NULL );
194     Py_INCREF( tmp_assign_source_1 );
195     var_x = tmp_assign_source_1;
196  
197     }
198     {
199     PyObject *tmp_assign_source_2;
200     PyObject *tmp_mvar_value_2; 181     PyObject *tmp_mvar_value_2;
201     tmp_mvar_value_2 = GET_STRING_DICT_VALUE( moduledict___main__, (Nuitka_StringObject *)const_str_plain_module_value1 ); 182     tmp_mvar_value_2 = GET_STRING_DICT_VALUE( moduledict___main__, (Nuitka_StringObject *)const_str_plain_module_value1 );
202 183
203     if (unlikely( tmp_mvar_value_2 == NULL )) 184     if (unlikely( tmp_mvar_value_2 == NULL ))
204     { 185     {
213         exception_value = PyUnicode_FromFormat( "name '%s' is not defined", "module_value1" ); 194         exception_value = PyUnicode_FromFormat( "name '%s' is not defined", "module_value1" );
214         exception_tb = NULL; 195         exception_tb = NULL;
215         NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); 196         NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb );
216         CHAIN_EXCEPTION( exception_value ); 197         CHAIN_EXCEPTION( exception_value );
217 198
n 218         exception_lineno = 32; n 199         exception_lineno = 31;
219         type_description_1 = "oo"; 200         type_description_1 = "No";
220         goto frame_exception_exit_1; 201         goto frame_exception_exit_1;
221     } 202     }
222 203
n 223     tmp_assign_source_2 = tmp_mvar_value_2; n 204     tmp_assign_source_1 = tmp_mvar_value_2;
224     assert( var_local_value == NULL ); 205     assert( var_local_value == NULL );
n 225     Py_INCREF( tmp_assign_source_2 ); n 206     Py_INCREF( tmp_assign_source_1 );
226     var_local_value = tmp_assign_source_2; 207     var_local_value = tmp_assign_source_1;
227 208
n 228     } n
229     { 209     }
230     PyObject *tmp_assign_source_3; 210  
231     PyObject *tmp_iter_arg_1; 211 #if 0
232     PyObject *tmp_xrange_low_1; 212     RESTORE_FRAME_EXCEPTION( frame_792d5af78f97490fdfebbc22bdfc6d02 );
233     PyObject *tmp_xrange_high_1; 213 #endif
234     PyObject *tmp_left_name_1; 214  
235     PyObject *tmp_right_name_1; 215     // Put the previous frame back on top.
236     CHECK_OBJECT( var_local_value ); 216     popFrameStack();
237     tmp_xrange_low_1 = var_local_value; 217  
238     CHECK_OBJECT( var_local_value ); 218     goto frame_no_exception_1;
239     tmp_left_name_1 = var_local_value; 219  
240     tmp_right_name_1 = const_int_pos_3; 220     frame_exception_exit_1:;
241     tmp_xrange_high_1 = BINARY_OPERATION_ADD_OBJECT_OBJECT( tmp_left_name_1, tmp_right_name_1 ); 221  
242     if ( tmp_xrange_high_1 == NULL ) 222 #if 0
223     RESTORE_FRAME_EXCEPTION( frame_792d5af78f97490fdfebbc22bdfc6d02 );
224 #endif
225  
226     if ( exception_tb == NULL )
227     {
228         exception_tb = MAKE_TRACEBACK( frame_792d5af78f97490fdfebbc22bdfc6d02, exception_lineno );
243     { 229     }
244         assert( ERROR_OCCURRED() ); 230     else if ( exception_tb->tb_frame != &frame_792d5af78f97490fdfebbc22bdfc6d02->m_frame )
231     {
232         exception_tb = ADD_TRACEBACK( exception_tb, frame_792d5af78f97490fdfebbc22bdfc6d02, exception_lineno );
233     }
245 234
n 246         FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); n 235     // Attachs locals to frame if any.
247   236     Nuitka_Frame_AttachLocals(
248   237         (struct Nuitka_FrameObject *)frame_792d5af78f97490fdfebbc22bdfc6d02,
249         exception_lineno = 35;
250         type_description_1 = "oo"; 238         type_description_1,
251         goto frame_exception_exit_1; 239         NULL,
240         var_local_value
241     );
242  
243  
244     // Release cached frame.
245     if ( frame_792d5af78f97490fdfebbc22bdfc6d02 == cache_frame_792d5af78f97490fdfebbc22bdfc6d02 )
252     } 246     {
253     tmp_iter_arg_1 = BUILTIN_XRANGE2( tmp_xrange_low_1, tmp_xrange_high_1 ); 247         Py_DECREF( frame_792d5af78f97490fdfebbc22bdfc6d02 );
254     Py_DECREF( tmp_xrange_high_1 );
255     if ( tmp_iter_arg_1 == NULL )
256     { 248     }
257         assert( ERROR_OCCURRED() ); 249     cache_frame_792d5af78f97490fdfebbc22bdfc6d02 = NULL;
258 250
n 259         FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); n 251     assertFrameObject( frame_792d5af78f97490fdfebbc22bdfc6d02 );
260 252
n n 253     // Put the previous frame back on top.
254     popFrameStack();
261 255
n 262         exception_lineno = 35; n 256     // Return the error.
263         type_description_1 = "oo";
264         goto frame_exception_exit_1;
265     }
266     tmp_assign_source_3 = MAKE_ITERATOR( tmp_iter_arg_1 );
267     Py_DECREF( tmp_iter_arg_1 );
268     if ( tmp_assign_source_3 == NULL )
269     {
270         assert( ERROR_OCCURRED() );
271  
272         FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb );
273  
274  
275         exception_lineno = 35;
276         type_description_1 = "oo";
277         goto frame_exception_exit_1;
278     }
279     assert( tmp_for_loop_1__for_iterator == NULL );
280     tmp_for_loop_1__for_iterator = tmp_assign_source_3;
281  
282     }
283     {
284     // Tried code:
285     {
286     loop_start_1:;
287     {
288     PyObject *tmp_next_source_1;
289     PyObject *tmp_assign_source_4;
290     CHECK_OBJECT( tmp_for_loop_1__for_iterator );
291     tmp_next_source_1 = tmp_for_loop_1__for_iterator;
292     tmp_assign_source_4 = ITERATOR_NEXT( tmp_next_source_1 );
293     if ( tmp_assign_source_4 == NULL )
294     {
295         if ( CHECK_AND_CLEAR_STOP_ITERATION_OCCURRED() )
296         {
297  
298             goto loop_end_1;
299         }
300         else
301         {
302  
303             FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb );
304             type_description_1 = "oo";
305             exception_lineno = 35;
306             goto try_except_handler_2;
307         }
308     }
309  
310     {
311         PyObject *old = tmp_for_loop_1__iter_value;
312         tmp_for_loop_1__iter_value = tmp_assign_source_4;
313         Py_XDECREF( old );
314     }
315  
316     }
317     {
318     PyObject *tmp_assign_source_5;
319     CHECK_OBJECT( tmp_for_loop_1__iter_value );
320     tmp_assign_source_5 = tmp_for_loop_1__iter_value;
321     {
322         PyObject *old = var_x;
323         var_x = tmp_assign_source_5;
324         Py_INCREF( var_x );
325         Py_XDECREF( old );
326     }
327  
328     }
329     if ( CONSIDER_THREADING() == false )
330     {
331         assert( ERROR_OCCURRED() );
332  
333         FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb );
334  
335  
336         exception_lineno = 35;
337         type_description_1 = "oo";
338         goto try_except_handler_2; 257     goto try_except_handler_1;
258  
259     frame_no_exception_1:;
339     } 260     {
340     goto loop_start_1; 261     tmp_return_value = Py_None;
341     loop_end_1:; 262     Py_INCREF( tmp_return_value );
263     goto try_return_handler_1;
264     }
265     // tried codes exits in all cases
266     NUITKA_CANNOT_GET_HERE( __main__$$$function_1_calledRepeatedly );
267     return NULL;
268     // Return handler code:
269     try_return_handler_1:;
342     } 270     {
343     goto try_end_1; 271     CHECK_OBJECT( (PyObject *)var_local_value );
272     Py_DECREF( var_local_value );
273     var_local_value = NULL;
274  
275     }
276     {
277     goto function_return_exit;
278     }
344     // Exception handler code: 279     // Exception handler code:
n 345     try_except_handler_2:; n 280     try_except_handler_1:;
346     exception_keeper_type_1 = exception_type; 281     exception_keeper_type_1 = exception_type;
347     exception_keeper_value_1 = exception_value; 282     exception_keeper_value_1 = exception_value;
348     exception_keeper_tb_1 = exception_tb; 283     exception_keeper_tb_1 = exception_tb;
349     exception_keeper_lineno_1 = exception_lineno; 284     exception_keeper_lineno_1 = exception_lineno;
350     exception_type = NULL; 285     exception_type = NULL;
351     exception_value = NULL; 286     exception_value = NULL;
352     exception_tb = NULL; 287     exception_tb = NULL;
353     exception_lineno = 0; 288     exception_lineno = 0;
354 289
355     { 290     {
n 356     Py_XDECREF( tmp_for_loop_1__iter_value ); n
357     tmp_for_loop_1__iter_value = NULL;
358  
359     }
360     {
361     CHECK_OBJECT( (PyObject *)tmp_for_loop_1__for_iterator );
362     Py_DECREF( tmp_for_loop_1__for_iterator );
363     tmp_for_loop_1__for_iterator = NULL;
364  
365     }
366     {
367     // Re-raise. 291     // Re-raise.
368     exception_type = exception_keeper_type_1; 292     exception_type = exception_keeper_type_1;
369     exception_value = exception_keeper_value_1; 293     exception_value = exception_keeper_value_1;
370     exception_tb = exception_keeper_tb_1; 294     exception_tb = exception_keeper_tb_1;
371     exception_lineno = exception_keeper_lineno_1; 295     exception_lineno = exception_keeper_lineno_1;
n 372   n
373     goto frame_exception_exit_1;
374     }
375     // End of try:
376     try_end_1:;
377     }
378  
379 #if 0
380     RESTORE_FRAME_EXCEPTION( frame_d0829e2ea0fbfe8444128bfb67f51351 );
381 #endif
382  
383     // Put the previous frame back on top.
384     popFrameStack();
385  
386     goto frame_no_exception_1;
387  
388     frame_exception_exit_1:;
389  
390 #if 0
391     RESTORE_FRAME_EXCEPTION( frame_d0829e2ea0fbfe8444128bfb67f51351 );
392 #endif
393  
394     if ( exception_tb == NULL )
395     {
396         exception_tb = MAKE_TRACEBACK( frame_d0829e2ea0fbfe8444128bfb67f51351, exception_lineno );
397     }
398     else if ( exception_tb->tb_frame != &frame_d0829e2ea0fbfe8444128bfb67f51351->m_frame )
399     {
400         exception_tb = ADD_TRACEBACK( exception_tb, frame_d0829e2ea0fbfe8444128bfb67f51351, exception_lineno );
401     }
402  
403     // Attachs locals to frame if any.
404     Nuitka_Frame_AttachLocals(
405         (struct Nuitka_FrameObject *)frame_d0829e2ea0fbfe8444128bfb67f51351,
406         type_description_1,
407         var_x,
408         var_local_value
409     );
410  
411  
412     // Release cached frame.
413     if ( frame_d0829e2ea0fbfe8444128bfb67f51351 == cache_frame_d0829e2ea0fbfe8444128bfb67f51351 )
414     {
415         Py_DECREF( frame_d0829e2ea0fbfe8444128bfb67f51351 );
416     }
417     cache_frame_d0829e2ea0fbfe8444128bfb67f51351 = NULL;
418  
419     assertFrameObject( frame_d0829e2ea0fbfe8444128bfb67f51351 );
420  
421     // Put the previous frame back on top.
422     popFrameStack();
423  
424     // Return the error.
425     goto try_except_handler_1;
426  
427     frame_no_exception_1:;
428     {
429     Py_XDECREF( tmp_for_loop_1__iter_value );
430     tmp_for_loop_1__iter_value = NULL;
431  
432     }
433     {
434     CHECK_OBJECT( (PyObject *)tmp_for_loop_1__for_iterator );
435     Py_DECREF( tmp_for_loop_1__for_iterator );
436     tmp_for_loop_1__for_iterator = NULL;
437  
438     }
439     {
440     tmp_return_value = Py_None;
441     Py_INCREF( tmp_return_value );
442     goto try_return_handler_1;
443     }
444     // tried codes exits in all cases
445     NUITKA_CANNOT_GET_HERE( __main__$$$function_1_calledRepeatedly );
446     return NULL;
447     // Return handler code:
448     try_return_handler_1:;
449     {
450     Py_XDECREF( var_x );
451     var_x = NULL;
452  
453     }
454     {
455     Py_XDECREF( var_local_value );
456     var_local_value = NULL;
457  
458     }
459     {
460     goto function_return_exit;
461     }
462     // Exception handler code:
463     try_except_handler_1:;
464     exception_keeper_type_2 = exception_type;
465     exception_keeper_value_2 = exception_value;
466     exception_keeper_tb_2 = exception_tb;
467     exception_keeper_lineno_2 = exception_lineno;
468     exception_type = NULL;
469     exception_value = NULL;
470     exception_tb = NULL;
471     exception_lineno = 0;
472  
473     {
474     Py_XDECREF( var_x );
475     var_x = NULL;
476  
477     }
478     {
479     Py_XDECREF( var_local_value );
480     var_local_value = NULL;
481  
482     }
483     {
484     // Re-raise.
485     exception_type = exception_keeper_type_2;
486     exception_value = exception_keeper_value_2;
487     exception_tb = exception_keeper_tb_2;
488     exception_lineno = exception_keeper_lineno_2;
489 296
490     goto function_exception_exit; 297     goto function_exception_exit;
491     } 298     }
492     // End of try: 299     // End of try:
493     } 300     }
517         impl___main__$$$function_1_calledRepeatedly, 324         impl___main__$$$function_1_calledRepeatedly,
518         const_str_plain_calledRepeatedly, 325         const_str_plain_calledRepeatedly,
519 #if PYTHON_VERSION >= 300 326 #if PYTHON_VERSION >= 300
520         NULL, 327         NULL,
521 #endif 328 #endif
n 522         codeobj_d0829e2ea0fbfe8444128bfb67f51351, n 329         codeobj_792d5af78f97490fdfebbc22bdfc6d02,
523         NULL, 330         NULL,
524 #if PYTHON_VERSION >= 300 331 #if PYTHON_VERSION >= 300
525         NULL, 332         NULL,
526         NULL, 333         NULL,
527 #endif 334 #endif
812     tmp_assign_source_3 = Py_None; 619     tmp_assign_source_3 = Py_None;
813     UPDATE_STRING_DICT0( moduledict___main__, (Nuitka_StringObject *)const_str_plain___cached__, tmp_assign_source_3 ); 620     UPDATE_STRING_DICT0( moduledict___main__, (Nuitka_StringObject *)const_str_plain___cached__, tmp_assign_source_3 );
814     } 621     }
815     { 622     {
816     PyObject *tmp_assign_source_4; 623     PyObject *tmp_assign_source_4;
n 817     tmp_assign_source_4 = const_str_digest_7a454677c638097f888dacd4edc8ecce; n 624     tmp_assign_source_4 = const_int_pos_5;
818     UPDATE_STRING_DICT0( moduledict___main__, (Nuitka_StringObject *)const_str_plain___file__, tmp_assign_source_4 ); 625     UPDATE_STRING_DICT0( moduledict___main__, (Nuitka_StringObject *)const_str_plain_module_value1, tmp_assign_source_4 );
819     } 626     }
820     { 627     {
821     PyObject *tmp_assign_source_5; 628     PyObject *tmp_assign_source_5;
n 822     tmp_assign_source_5 = const_int_pos_5; n 629     tmp_assign_source_5 = const_int_pos_3;
823     UPDATE_STRING_DICT0( moduledict___main__, (Nuitka_StringObject *)const_str_plain_module_value1, tmp_assign_source_5 ); 630     UPDATE_STRING_DICT0( moduledict___main__, (Nuitka_StringObject *)const_str_plain_module_value2, tmp_assign_source_5 );
824     } 631     }
825     { 632     {
826     PyObject *tmp_assign_source_6; 633     PyObject *tmp_assign_source_6;
n 827     tmp_assign_source_6 = const_int_pos_3; n 634     tmp_assign_source_6 = MAKE_FUNCTION___main__$$$function_1_calledRepeatedly(  );
635  
636  
637  
828     UPDATE_STRING_DICT0( moduledict___main__, (Nuitka_StringObject *)const_str_plain_module_value2, tmp_assign_source_6 ); 638     UPDATE_STRING_DICT1( moduledict___main__, (Nuitka_StringObject *)const_str_plain_calledRepeatedly, tmp_assign_source_6 );
829     } 639     }
830     { 640     {
831     PyObject *tmp_assign_source_7; 641     PyObject *tmp_assign_source_7;
n 832     tmp_assign_source_7 = MAKE_FUNCTION___main__$$$function_1_calledRepeatedly(  ); n
833  
834  
835  
836     UPDATE_STRING_DICT1( moduledict___main__, (Nuitka_StringObject *)const_str_plain_calledRepeatedly, tmp_assign_source_7 );
837     }
838     {
839     PyObject *tmp_assign_source_8;
840     PyObject *tmp_name_name_1; 642     PyObject *tmp_name_name_1;
841     PyObject *tmp_globals_name_1; 643     PyObject *tmp_globals_name_1;
842     PyObject *tmp_locals_name_1; 644     PyObject *tmp_locals_name_1;
843     PyObject *tmp_fromlist_name_1; 645     PyObject *tmp_fromlist_name_1;
844     PyObject *tmp_level_name_1; 646     PyObject *tmp_level_name_1;
845     tmp_name_name_1 = const_str_plain_itertools; 647     tmp_name_name_1 = const_str_plain_itertools;
846     tmp_globals_name_1 = (PyObject *)moduledict___main__; 648     tmp_globals_name_1 = (PyObject *)moduledict___main__;
847     tmp_locals_name_1 = Py_None; 649     tmp_locals_name_1 = Py_None;
848     tmp_fromlist_name_1 = Py_None; 650     tmp_fromlist_name_1 = Py_None;
849     tmp_level_name_1 = const_int_0; 651     tmp_level_name_1 = const_int_0;
n 850     tmp_assign_source_8 = IMPORT_MODULE5( tmp_name_name_1, tmp_globals_name_1, tmp_locals_name_1, tmp_fromlist_name_1, tmp_level_name_1 ); n 652     tmp_assign_source_7 = IMPORT_MODULE5( tmp_name_name_1, tmp_globals_name_1, tmp_locals_name_1, tmp_fromlist_name_1, tmp_level_name_1 );
851     assert( !(tmp_assign_source_8 == NULL) ); 653     assert( !(tmp_assign_source_7 == NULL) );
852     UPDATE_STRING_DICT1( moduledict___main__, (Nuitka_StringObject *)const_str_plain_itertools, tmp_assign_source_8 ); 654     UPDATE_STRING_DICT1( moduledict___main__, (Nuitka_StringObject *)const_str_plain_itertools, tmp_assign_source_7 );
853     } 655     }
854     // Frame without reuse. 656     // Frame without reuse.
855     frame_5c463d9ba3cf831427781e794452a340 = MAKE_MODULE_FRAME( codeobj_5c463d9ba3cf831427781e794452a340, module___main__ ); 657     frame_5c463d9ba3cf831427781e794452a340 = MAKE_MODULE_FRAME( codeobj_5c463d9ba3cf831427781e794452a340, module___main__ );
856 658
857     // Push the new frame as the currently active one, and we should be exclusively 659     // Push the new frame as the currently active one, and we should be exclusively
859     pushFrameStack( frame_5c463d9ba3cf831427781e794452a340 ); 661     pushFrameStack( frame_5c463d9ba3cf831427781e794452a340 );
860     assert( Py_REFCNT( frame_5c463d9ba3cf831427781e794452a340 ) == 2 ); 662     assert( Py_REFCNT( frame_5c463d9ba3cf831427781e794452a340 ) == 2 );
861 663
862     // Framed code: 664     // Framed code:
863     { 665     {
n 864     PyObject *tmp_assign_source_9; n 666     PyObject *tmp_assign_source_8;
865     PyObject *tmp_iter_arg_1; 667     PyObject *tmp_iter_arg_1;
866     PyObject *tmp_called_instance_1; 668     PyObject *tmp_called_instance_1;
867     PyObject *tmp_mvar_value_1; 669     PyObject *tmp_mvar_value_1;
868     tmp_mvar_value_1 = GET_STRING_DICT_VALUE( moduledict___main__, (Nuitka_StringObject *)const_str_plain_itertools ); 670     tmp_mvar_value_1 = GET_STRING_DICT_VALUE( moduledict___main__, (Nuitka_StringObject *)const_str_plain_itertools );
869 671
872         tmp_mvar_value_1 = GET_STRING_DICT_VALUE( dict_builtin, (Nuitka_StringObject *)const_str_plain_itertools ); 674         tmp_mvar_value_1 = GET_STRING_DICT_VALUE( dict_builtin, (Nuitka_StringObject *)const_str_plain_itertools );
873     } 675     }
874 676
875     CHECK_OBJECT( tmp_mvar_value_1 ); 677     CHECK_OBJECT( tmp_mvar_value_1 );
876     tmp_called_instance_1 = tmp_mvar_value_1; 678     tmp_called_instance_1 = tmp_mvar_value_1;
n 877     frame_5c463d9ba3cf831427781e794452a340->m_frame.f_lineno = 40; n 679     frame_5c463d9ba3cf831427781e794452a340->m_frame.f_lineno = 39;
878     tmp_iter_arg_1 = CALL_METHOD_WITH_ARGS2( tmp_called_instance_1, const_str_plain_repeat, &PyTuple_GET_ITEM( const_tuple_none_int_pos_50000_tuple, 0 ) ); 680     tmp_iter_arg_1 = CALL_METHOD_WITH_ARGS2( tmp_called_instance_1, const_str_plain_repeat, &PyTuple_GET_ITEM( const_tuple_none_int_pos_50000_tuple, 0 ) );
879 681
880     if ( tmp_iter_arg_1 == NULL ) 682     if ( tmp_iter_arg_1 == NULL )
881     { 683     {
882         assert( ERROR_OCCURRED() ); 684         assert( ERROR_OCCURRED() );
883 685
884         FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); 686         FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb );
885 687
886 688
n 887         exception_lineno = 40; n 689         exception_lineno = 39;
888 690
889         goto frame_exception_exit_1; 691         goto frame_exception_exit_1;
890     } 692     }
n 891     tmp_assign_source_9 = MAKE_ITERATOR( tmp_iter_arg_1 ); n 693     tmp_assign_source_8 = MAKE_ITERATOR( tmp_iter_arg_1 );
892     Py_DECREF( tmp_iter_arg_1 ); 694     Py_DECREF( tmp_iter_arg_1 );
n 893     if ( tmp_assign_source_9 == NULL ) n 695     if ( tmp_assign_source_8 == NULL )
894     { 696     {
895         assert( ERROR_OCCURRED() ); 697         assert( ERROR_OCCURRED() );
896 698
897         FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); 699         FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb );
898 700
899 701
n 900         exception_lineno = 40; n 702         exception_lineno = 39;
901 703
902         goto frame_exception_exit_1; 704         goto frame_exception_exit_1;
903     } 705     }
904     assert( tmp_for_loop_1__for_iterator == NULL ); 706     assert( tmp_for_loop_1__for_iterator == NULL );
n 905     tmp_for_loop_1__for_iterator = tmp_assign_source_9; n 707     tmp_for_loop_1__for_iterator = tmp_assign_source_8;
906 708
907     } 709     }
908     { 710     {
909     // Tried code: 711     // Tried code:
910     { 712     {
911     loop_start_1:; 713     loop_start_1:;
912     { 714     {
913     PyObject *tmp_next_source_1; 715     PyObject *tmp_next_source_1;
n 914     PyObject *tmp_assign_source_10; n 716     PyObject *tmp_assign_source_9;
915     CHECK_OBJECT( tmp_for_loop_1__for_iterator ); 717     CHECK_OBJECT( tmp_for_loop_1__for_iterator );
916     tmp_next_source_1 = tmp_for_loop_1__for_iterator; 718     tmp_next_source_1 = tmp_for_loop_1__for_iterator;
n 917     tmp_assign_source_10 = ITERATOR_NEXT( tmp_next_source_1 ); n 719     tmp_assign_source_9 = ITERATOR_NEXT( tmp_next_source_1 );
918     if ( tmp_assign_source_10 == NULL ) 720     if ( tmp_assign_source_9 == NULL )
919     { 721     {
920         if ( CHECK_AND_CLEAR_STOP_ITERATION_OCCURRED() ) 722         if ( CHECK_AND_CLEAR_STOP_ITERATION_OCCURRED() )
921         { 723         {
922 724
923             goto loop_end_1; 725             goto loop_end_1;
925         else 727         else
926         { 728         {
927 729
928             FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); 730             FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb );
929 731
n 930             exception_lineno = 40; n 732             exception_lineno = 39;
931             goto try_except_handler_1; 733             goto try_except_handler_1;
932         } 734         }
933     } 735     }
934 736
935     { 737     {
936         PyObject *old = tmp_for_loop_1__iter_value; 738         PyObject *old = tmp_for_loop_1__iter_value;
n 937         tmp_for_loop_1__iter_value = tmp_assign_source_10; n 739         tmp_for_loop_1__iter_value = tmp_assign_source_9;
938         Py_XDECREF( old ); 740         Py_XDECREF( old );
939     } 741     }
940 742
941     } 743     }
942     { 744     {
n 943     PyObject *tmp_assign_source_11; n 745     PyObject *tmp_assign_source_10;
944     CHECK_OBJECT( tmp_for_loop_1__iter_value ); 746     CHECK_OBJECT( tmp_for_loop_1__iter_value );
n 945     tmp_assign_source_11 = tmp_for_loop_1__iter_value; n 747     tmp_assign_source_10 = tmp_for_loop_1__iter_value;
946     UPDATE_STRING_DICT0( moduledict___main__, (Nuitka_StringObject *)const_str_plain_x, tmp_assign_source_11 ); 748     UPDATE_STRING_DICT0( moduledict___main__, (Nuitka_StringObject *)const_str_plain_x, tmp_assign_source_10 );
947     } 749     }
948     { 750     {
949     PyObject *tmp_called_name_1; 751     PyObject *tmp_called_name_1;
950     PyObject *tmp_mvar_value_2; 752     PyObject *tmp_mvar_value_2;
951     PyObject *tmp_call_result_1; 753     PyObject *tmp_call_result_1;
964         exception_value = PyUnicode_FromFormat( "name '%s' is not defined", "calledRepeatedly" ); 766         exception_value = PyUnicode_FromFormat( "name '%s' is not defined", "calledRepeatedly" );
965         exception_tb = NULL; 767         exception_tb = NULL;
966         NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); 768         NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb );
967         CHAIN_EXCEPTION( exception_value ); 769         CHAIN_EXCEPTION( exception_value );
968 770
n 969         exception_lineno = 41; n 771         exception_lineno = 40;
970 772
971         goto try_except_handler_1; 773         goto try_except_handler_1;
972     } 774     }
973 775
974     tmp_called_name_1 = tmp_mvar_value_2; 776     tmp_called_name_1 = tmp_mvar_value_2;
n 975     frame_5c463d9ba3cf831427781e794452a340->m_frame.f_lineno = 41; n 777     frame_5c463d9ba3cf831427781e794452a340->m_frame.f_lineno = 40;
976     tmp_call_result_1 = CALL_FUNCTION_NO_ARGS( tmp_called_name_1 ); 778     tmp_call_result_1 = CALL_FUNCTION_NO_ARGS( tmp_called_name_1 );
977     if ( tmp_call_result_1 == NULL ) 779     if ( tmp_call_result_1 == NULL )
978     { 780     {
979         assert( ERROR_OCCURRED() ); 781         assert( ERROR_OCCURRED() );
980 782
981         FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); 783         FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb );
982 784
983 785
n 984         exception_lineno = 41; n 786         exception_lineno = 40;
985 787
986         goto try_except_handler_1; 788         goto try_except_handler_1;
987     } 789     }
988     Py_DECREF( tmp_call_result_1 ); 790     Py_DECREF( tmp_call_result_1 );
989     } 791     }
992         assert( ERROR_OCCURRED() ); 794         assert( ERROR_OCCURRED() );
993 795
994         FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); 796         FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb );
995 797
996 798
n 997         exception_lineno = 40; n 799         exception_lineno = 39;
998 800
999         goto try_except_handler_1; 801         goto try_except_handler_1;
1000     } 802     }
1001     goto loop_start_1; 803     goto loop_start_1;
1002     loop_end_1:; 804     loop_end_1:;
1050     { 852     {
1051     PyObject *tmp_called_name_2; 853     PyObject *tmp_called_name_2;
1052     PyObject *tmp_call_result_2; 854     PyObject *tmp_call_result_2;
1053     tmp_called_name_2 = LOOKUP_BUILTIN( const_str_plain_print ); 855     tmp_called_name_2 = LOOKUP_BUILTIN( const_str_plain_print );
1054     assert( tmp_called_name_2 != NULL ); 856     assert( tmp_called_name_2 != NULL );
n 1055     frame_5c463d9ba3cf831427781e794452a340->m_frame.f_lineno = 43; n 857     frame_5c463d9ba3cf831427781e794452a340->m_frame.f_lineno = 42;
1056     tmp_call_result_2 = CALL_FUNCTION_WITH_ARGS1( tmp_called_name_2, &PyTuple_GET_ITEM( const_tuple_str_digest_5ed1392909ad16e6227b8230f4582352_tuple, 0 ) ); 858     tmp_call_result_2 = CALL_FUNCTION_WITH_ARGS1( tmp_called_name_2, &PyTuple_GET_ITEM( const_tuple_str_digest_5ed1392909ad16e6227b8230f4582352_tuple, 0 ) );
1057 859
1058     if ( tmp_call_result_2 == NULL ) 860     if ( tmp_call_result_2 == NULL )
1059     { 861     {
1060         assert( ERROR_OCCURRED() ); 862         assert( ERROR_OCCURRED() );
1061 863
1062         FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); 864         FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb );
1063 865
1064 866
t 1065         exception_lineno = 43; t 867         exception_lineno = 42;
1066 868
1067         goto frame_exception_exit_1; 869         goto frame_exception_exit_1;
1068     } 870     }
1069     Py_DECREF( tmp_call_result_2 ); 871     Py_DECREF( tmp_call_result_2 );
1070     } 872     }