Construct LoopSmallXrange

Performance Diagrams

Construct LoopSmallXrange 00100000001000000020000000200000003000000030000000400000004000000050000000500000006000000060000000700000007000000080000000800000009000000090000000100000000100000000CPython 2.7Nuitka (master)Nuitka (develop)Nuitka (factory)10663294788.11538461538461257.0CPython 2.730531772240.03846153846155433.3598555501584Nuitka (master)30631325391.96153846153845433.12914751313286Nuitka (develop)30631201543.8846153846154433.12943487560904Nuitka (factory)Construct LoopSmallXrangeTicks Construct LoopSmallXrange 00100000001000000020000000200000003000000030000000400000004000000050000000500000006000000060000000700000007000000080000000800000009000000090000000100000000100000000110000000110000000120000000120000000130000000130000000CPython 3.5Nuitka (master)Nuitka (develop)Nuitka (factory)13898423288.11538461538461257.0CPython 3.588646648240.03846153846155346.5007386936471Nuitka (master)88947499391.96153846153845345.96582254159813Nuitka (develop)88947173543.8846153846154345.9664021729292Nuitka (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;
56 extern PyObject *const_str_plain___main__; 55 extern PyObject *const_str_plain___main__;
57 extern PyObject *const_str_plain___doc__; 56 extern PyObject *const_str_plain___doc__;
58 extern PyObject *const_str_plain___cached__; 57 extern PyObject *const_str_plain___cached__;
n 59 static PyObject *const_str_digest_119ded1fc76d5c9d08cde4412da95cff; n
60 static PyObject *module_filename_obj; 58 static PyObject *module_filename_obj;
61 59
62 static bool constants_created = false; 60 static bool constants_created = false;
63 61
64 static void createModuleConstants( void ) 62 static void createModuleConstants( void )
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_119ded1fc76d5c9d08cde4412da95cff = 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_bb8ad3690a87d22acbeabf27f1900840; 101 static PyCodeObject *codeobj_bb8ad3690a87d22acbeabf27f1900840;
n 106 static PyCodeObject *codeobj_4a5f66e83d56299ef5f532d34d3910c9; n 102 static PyCodeObject *codeobj_3cba7043bd7f90e6523660dc3df07e3c;
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_b2409810518cbb60119c43de0e218b62; 108     module_filename_obj = const_str_digest_b2409810518cbb60119c43de0e218b62;
113     codeobj_bb8ad3690a87d22acbeabf27f1900840 = MAKE_CODEOBJ( module_filename_obj, const_str_angle_module, 1, const_tuple_empty, 0, 0, CO_NOFREE ); 109     codeobj_bb8ad3690a87d22acbeabf27f1900840 = MAKE_CODEOBJ( module_filename_obj, const_str_angle_module, 1, const_tuple_empty, 0, 0, CO_NOFREE );
114     codeobj_main = codeobj_bb8ad3690a87d22acbeabf27f1900840; 110     codeobj_main = codeobj_bb8ad3690a87d22acbeabf27f1900840;
n 115     codeobj_4a5f66e83d56299ef5f532d34d3910c9 = 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_3cba7043bd7f90e6523660dc3df07e3c = 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_3cba7043bd7f90e6523660dc3df07e3c;
134     PyObject *tmp_for_loop_1__iter_value = NULL;
135     struct Nuitka_FrameObject *frame_4a5f66e83d56299ef5f532d34d3910c9;
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_3cba7043bd7f90e6523660dc3df07e3c = 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_4a5f66e83d56299ef5f532d34d3910c9 = 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_4a5f66e83d56299ef5f532d34d3910c9, codeobj_4a5f66e83d56299ef5f532d34d3910c9, module___main__, sizeof(void *)+sizeof(void *) ); n 144     MAKE_OR_REUSE_FRAME( cache_frame_3cba7043bd7f90e6523660dc3df07e3c, codeobj_3cba7043bd7f90e6523660dc3df07e3c, module___main__, sizeof(void *)+sizeof(void *) );
156     frame_4a5f66e83d56299ef5f532d34d3910c9 = cache_frame_4a5f66e83d56299ef5f532d34d3910c9; 145     frame_3cba7043bd7f90e6523660dc3df07e3c = cache_frame_3cba7043bd7f90e6523660dc3df07e3c;
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_4a5f66e83d56299ef5f532d34d3910c9 ); n 148     pushFrameStack( frame_3cba7043bd7f90e6523660dc3df07e3c );
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_4a5f66e83d56299ef5f532d34d3910c9 ) == 2 ); // Frame stack n 151     assert( Py_REFCNT( frame_3cba7043bd7f90e6523660dc3df07e3c ) == 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_3cba7043bd7f90e6523660dc3df07e3c );
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_LONG( tmp_left_name_1, tmp_right_name_1 ); 221  
242     if ( tmp_xrange_high_1 == NULL ) 222 #if 0
223     RESTORE_FRAME_EXCEPTION( frame_3cba7043bd7f90e6523660dc3df07e3c );
224 #endif
225  
226     if ( exception_tb == NULL )
227     {
228         exception_tb = MAKE_TRACEBACK( frame_3cba7043bd7f90e6523660dc3df07e3c, exception_lineno );
243     { 229     }
244         assert( ERROR_OCCURRED() ); 230     else if ( exception_tb->tb_frame != &frame_3cba7043bd7f90e6523660dc3df07e3c->m_frame )
231     {
232         exception_tb = ADD_TRACEBACK( exception_tb, frame_3cba7043bd7f90e6523660dc3df07e3c, 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_3cba7043bd7f90e6523660dc3df07e3c,
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_3cba7043bd7f90e6523660dc3df07e3c == cache_frame_3cba7043bd7f90e6523660dc3df07e3c )
252     } 246     {
253     tmp_iter_arg_1 = BUILTIN_XRANGE2( tmp_xrange_low_1, tmp_xrange_high_1 ); 247         Py_DECREF( frame_3cba7043bd7f90e6523660dc3df07e3c );
254     Py_DECREF( tmp_xrange_high_1 );
255     if ( tmp_iter_arg_1 == NULL )
256     { 248     }
257         assert( ERROR_OCCURRED() ); 249     cache_frame_3cba7043bd7f90e6523660dc3df07e3c = NULL;
258 250
n 259         FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); n 251     assertFrameObject( frame_3cba7043bd7f90e6523660dc3df07e3c );
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_4a5f66e83d56299ef5f532d34d3910c9 );
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_4a5f66e83d56299ef5f532d34d3910c9 );
392 #endif
393  
394     if ( exception_tb == NULL )
395     {
396         exception_tb = MAKE_TRACEBACK( frame_4a5f66e83d56299ef5f532d34d3910c9, exception_lineno );
397     }
398     else if ( exception_tb->tb_frame != &frame_4a5f66e83d56299ef5f532d34d3910c9->m_frame )
399     {
400         exception_tb = ADD_TRACEBACK( exception_tb, frame_4a5f66e83d56299ef5f532d34d3910c9, exception_lineno );
401     }
402  
403     // Attachs locals to frame if any.
404     Nuitka_Frame_AttachLocals(
405         (struct Nuitka_FrameObject *)frame_4a5f66e83d56299ef5f532d34d3910c9,
406         type_description_1,
407         var_x,
408         var_local_value
409     );
410  
411  
412     // Release cached frame.
413     if ( frame_4a5f66e83d56299ef5f532d34d3910c9 == cache_frame_4a5f66e83d56299ef5f532d34d3910c9 )
414     {
415         Py_DECREF( frame_4a5f66e83d56299ef5f532d34d3910c9 );
416     }
417     cache_frame_4a5f66e83d56299ef5f532d34d3910c9 = NULL;
418  
419     assertFrameObject( frame_4a5f66e83d56299ef5f532d34d3910c9 );
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     CHECK_OBJECT( (PyObject *)var_local_value );
456     Py_DECREF( var_local_value );
457     var_local_value = NULL;
458  
459     }
460     {
461     goto function_return_exit;
462     }
463     // Exception handler code:
464     try_except_handler_1:;
465     exception_keeper_type_2 = exception_type;
466     exception_keeper_value_2 = exception_value;
467     exception_keeper_tb_2 = exception_tb;
468     exception_keeper_lineno_2 = exception_lineno;
469     exception_type = NULL;
470     exception_value = NULL;
471     exception_tb = NULL;
472     exception_lineno = 0;
473  
474     {
475     Py_XDECREF( var_x );
476     var_x = NULL;
477  
478     }
479     {
480     Py_XDECREF( var_local_value );
481     var_local_value = NULL;
482  
483     }
484     {
485     // Re-raise.
486     exception_type = exception_keeper_type_2;
487     exception_value = exception_keeper_value_2;
488     exception_tb = exception_keeper_tb_2;
489     exception_lineno = exception_keeper_lineno_2;
490 296
491     goto function_exception_exit; 297     goto function_exception_exit;
492     } 298     }
493     // End of try: 299     // End of try:
494     } 300     }
518         impl___main__$$$function_1_calledRepeatedly, 324         impl___main__$$$function_1_calledRepeatedly,
519         const_str_plain_calledRepeatedly, 325         const_str_plain_calledRepeatedly,
520 #if PYTHON_VERSION >= 300 326 #if PYTHON_VERSION >= 300
521         NULL, 327         NULL,
522 #endif 328 #endif
n 523         codeobj_4a5f66e83d56299ef5f532d34d3910c9, n 329         codeobj_3cba7043bd7f90e6523660dc3df07e3c,
524         NULL, 330         NULL,
525 #if PYTHON_VERSION >= 300 331 #if PYTHON_VERSION >= 300
526         NULL, 332         NULL,
527         NULL, 333         NULL,
528 #endif 334 #endif
814     tmp_assign_source_3 = Py_None; 620     tmp_assign_source_3 = Py_None;
815     UPDATE_STRING_DICT0( moduledict___main__, (Nuitka_StringObject *)const_str_plain___cached__, tmp_assign_source_3 ); 621     UPDATE_STRING_DICT0( moduledict___main__, (Nuitka_StringObject *)const_str_plain___cached__, tmp_assign_source_3 );
816     } 622     }
817     { 623     {
818     PyObject *tmp_assign_source_4; 624     PyObject *tmp_assign_source_4;
n 819     tmp_assign_source_4 = const_str_digest_119ded1fc76d5c9d08cde4412da95cff; n 625     tmp_assign_source_4 = const_int_pos_5;
820     UPDATE_STRING_DICT0( moduledict___main__, (Nuitka_StringObject *)const_str_plain___file__, tmp_assign_source_4 ); 626     UPDATE_STRING_DICT0( moduledict___main__, (Nuitka_StringObject *)const_str_plain_module_value1, tmp_assign_source_4 );
821     } 627     }
822     { 628     {
823     PyObject *tmp_assign_source_5; 629     PyObject *tmp_assign_source_5;
n 824     tmp_assign_source_5 = const_int_pos_5; n 630     tmp_assign_source_5 = const_int_pos_3;
825     UPDATE_STRING_DICT0( moduledict___main__, (Nuitka_StringObject *)const_str_plain_module_value1, tmp_assign_source_5 ); 631     UPDATE_STRING_DICT0( moduledict___main__, (Nuitka_StringObject *)const_str_plain_module_value2, tmp_assign_source_5 );
826     } 632     }
827     { 633     {
828     PyObject *tmp_assign_source_6; 634     PyObject *tmp_assign_source_6;
n 829     tmp_assign_source_6 = const_int_pos_3; n 635     tmp_assign_source_6 = MAKE_FUNCTION___main__$$$function_1_calledRepeatedly(  );
636  
637  
638  
830     UPDATE_STRING_DICT0( moduledict___main__, (Nuitka_StringObject *)const_str_plain_module_value2, tmp_assign_source_6 ); 639     UPDATE_STRING_DICT1( moduledict___main__, (Nuitka_StringObject *)const_str_plain_calledRepeatedly, tmp_assign_source_6 );
831     } 640     }
832     { 641     {
833     PyObject *tmp_assign_source_7; 642     PyObject *tmp_assign_source_7;
n 834     tmp_assign_source_7 = MAKE_FUNCTION___main__$$$function_1_calledRepeatedly(  ); n
835  
836  
837  
838     UPDATE_STRING_DICT1( moduledict___main__, (Nuitka_StringObject *)const_str_plain_calledRepeatedly, tmp_assign_source_7 );
839     }
840     {
841     PyObject *tmp_assign_source_8;
842     PyObject *tmp_name_name_1; 643     PyObject *tmp_name_name_1;
843     PyObject *tmp_globals_name_1; 644     PyObject *tmp_globals_name_1;
844     PyObject *tmp_locals_name_1; 645     PyObject *tmp_locals_name_1;
845     PyObject *tmp_fromlist_name_1; 646     PyObject *tmp_fromlist_name_1;
846     PyObject *tmp_level_name_1; 647     PyObject *tmp_level_name_1;
847     tmp_name_name_1 = const_str_plain_itertools; 648     tmp_name_name_1 = const_str_plain_itertools;
848     tmp_globals_name_1 = (PyObject *)moduledict___main__; 649     tmp_globals_name_1 = (PyObject *)moduledict___main__;
849     tmp_locals_name_1 = Py_None; 650     tmp_locals_name_1 = Py_None;
850     tmp_fromlist_name_1 = Py_None; 651     tmp_fromlist_name_1 = Py_None;
851     tmp_level_name_1 = const_int_0; 652     tmp_level_name_1 = const_int_0;
n 852     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 653     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 );
853     assert( !(tmp_assign_source_8 == NULL) ); 654     assert( !(tmp_assign_source_7 == NULL) );
854     UPDATE_STRING_DICT1( moduledict___main__, (Nuitka_StringObject *)const_str_plain_itertools, tmp_assign_source_8 ); 655     UPDATE_STRING_DICT1( moduledict___main__, (Nuitka_StringObject *)const_str_plain_itertools, tmp_assign_source_7 );
855     } 656     }
856     // Frame without reuse. 657     // Frame without reuse.
857     frame_bb8ad3690a87d22acbeabf27f1900840 = MAKE_MODULE_FRAME( codeobj_bb8ad3690a87d22acbeabf27f1900840, module___main__ ); 658     frame_bb8ad3690a87d22acbeabf27f1900840 = MAKE_MODULE_FRAME( codeobj_bb8ad3690a87d22acbeabf27f1900840, module___main__ );
858 659
859     // Push the new frame as the currently active one, and we should be exclusively 660     // Push the new frame as the currently active one, and we should be exclusively
861     pushFrameStack( frame_bb8ad3690a87d22acbeabf27f1900840 ); 662     pushFrameStack( frame_bb8ad3690a87d22acbeabf27f1900840 );
862     assert( Py_REFCNT( frame_bb8ad3690a87d22acbeabf27f1900840 ) == 2 ); 663     assert( Py_REFCNT( frame_bb8ad3690a87d22acbeabf27f1900840 ) == 2 );
863 664
864     // Framed code: 665     // Framed code:
865     { 666     {
n 866     PyObject *tmp_assign_source_9; n 667     PyObject *tmp_assign_source_8;
867     PyObject *tmp_iter_arg_1; 668     PyObject *tmp_iter_arg_1;
868     PyObject *tmp_called_instance_1; 669     PyObject *tmp_called_instance_1;
869     PyObject *tmp_mvar_value_1; 670     PyObject *tmp_mvar_value_1;
870     tmp_mvar_value_1 = GET_STRING_DICT_VALUE( moduledict___main__, (Nuitka_StringObject *)const_str_plain_itertools ); 671     tmp_mvar_value_1 = GET_STRING_DICT_VALUE( moduledict___main__, (Nuitka_StringObject *)const_str_plain_itertools );
871 672
874         tmp_mvar_value_1 = GET_STRING_DICT_VALUE( dict_builtin, (Nuitka_StringObject *)const_str_plain_itertools ); 675         tmp_mvar_value_1 = GET_STRING_DICT_VALUE( dict_builtin, (Nuitka_StringObject *)const_str_plain_itertools );
875     } 676     }
876 677
877     CHECK_OBJECT( tmp_mvar_value_1 ); 678     CHECK_OBJECT( tmp_mvar_value_1 );
878     tmp_called_instance_1 = tmp_mvar_value_1; 679     tmp_called_instance_1 = tmp_mvar_value_1;
n 879     frame_bb8ad3690a87d22acbeabf27f1900840->m_frame.f_lineno = 40; n 680     frame_bb8ad3690a87d22acbeabf27f1900840->m_frame.f_lineno = 39;
880     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 ) ); 681     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 ) );
881 682
882     if ( tmp_iter_arg_1 == NULL ) 683     if ( tmp_iter_arg_1 == NULL )
883     { 684     {
884         assert( ERROR_OCCURRED() ); 685         assert( ERROR_OCCURRED() );
885 686
886         FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); 687         FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb );
887 688
888 689
n 889         exception_lineno = 40; n 690         exception_lineno = 39;
890 691
891         goto frame_exception_exit_1; 692         goto frame_exception_exit_1;
892     } 693     }
n 893     tmp_assign_source_9 = MAKE_ITERATOR( tmp_iter_arg_1 ); n 694     tmp_assign_source_8 = MAKE_ITERATOR( tmp_iter_arg_1 );
894     Py_DECREF( tmp_iter_arg_1 ); 695     Py_DECREF( tmp_iter_arg_1 );
n 895     if ( tmp_assign_source_9 == NULL ) n 696     if ( tmp_assign_source_8 == NULL )
896     { 697     {
897         assert( ERROR_OCCURRED() ); 698         assert( ERROR_OCCURRED() );
898 699
899         FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); 700         FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb );
900 701
901 702
n 902         exception_lineno = 40; n 703         exception_lineno = 39;
903 704
904         goto frame_exception_exit_1; 705         goto frame_exception_exit_1;
905     } 706     }
906     assert( tmp_for_loop_1__for_iterator == NULL ); 707     assert( tmp_for_loop_1__for_iterator == NULL );
n 907     tmp_for_loop_1__for_iterator = tmp_assign_source_9; n 708     tmp_for_loop_1__for_iterator = tmp_assign_source_8;
908 709
909     } 710     }
910     { 711     {
911     // Tried code: 712     // Tried code:
912     { 713     {
913     loop_start_1:; 714     loop_start_1:;
914     { 715     {
915     PyObject *tmp_next_source_1; 716     PyObject *tmp_next_source_1;
n 916     PyObject *tmp_assign_source_10; n 717     PyObject *tmp_assign_source_9;
917     CHECK_OBJECT( tmp_for_loop_1__for_iterator ); 718     CHECK_OBJECT( tmp_for_loop_1__for_iterator );
918     tmp_next_source_1 = tmp_for_loop_1__for_iterator; 719     tmp_next_source_1 = tmp_for_loop_1__for_iterator;
n 919     tmp_assign_source_10 = ITERATOR_NEXT( tmp_next_source_1 ); n 720     tmp_assign_source_9 = ITERATOR_NEXT( tmp_next_source_1 );
920     if ( tmp_assign_source_10 == NULL ) 721     if ( tmp_assign_source_9 == NULL )
921     { 722     {
922         if ( CHECK_AND_CLEAR_STOP_ITERATION_OCCURRED() ) 723         if ( CHECK_AND_CLEAR_STOP_ITERATION_OCCURRED() )
923         { 724         {
924 725
925             goto loop_end_1; 726             goto loop_end_1;
927         else 728         else
928         { 729         {
929 730
930             FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); 731             FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb );
931 732
n 932             exception_lineno = 40; n 733             exception_lineno = 39;
933             goto try_except_handler_1; 734             goto try_except_handler_1;
934         } 735         }
935     } 736     }
936 737
937     { 738     {
938         PyObject *old = tmp_for_loop_1__iter_value; 739         PyObject *old = tmp_for_loop_1__iter_value;
n 939         tmp_for_loop_1__iter_value = tmp_assign_source_10; n 740         tmp_for_loop_1__iter_value = tmp_assign_source_9;
940         Py_XDECREF( old ); 741         Py_XDECREF( old );
941     } 742     }
942 743
943     } 744     }
944     { 745     {
n 945     PyObject *tmp_assign_source_11; n 746     PyObject *tmp_assign_source_10;
946     CHECK_OBJECT( tmp_for_loop_1__iter_value ); 747     CHECK_OBJECT( tmp_for_loop_1__iter_value );
n 947     tmp_assign_source_11 = tmp_for_loop_1__iter_value; n 748     tmp_assign_source_10 = tmp_for_loop_1__iter_value;
948     UPDATE_STRING_DICT0( moduledict___main__, (Nuitka_StringObject *)const_str_plain_x, tmp_assign_source_11 ); 749     UPDATE_STRING_DICT0( moduledict___main__, (Nuitka_StringObject *)const_str_plain_x, tmp_assign_source_10 );
949     } 750     }
950     { 751     {
951     PyObject *tmp_called_name_1; 752     PyObject *tmp_called_name_1;
952     PyObject *tmp_mvar_value_2; 753     PyObject *tmp_mvar_value_2;
953     PyObject *tmp_call_result_1; 754     PyObject *tmp_call_result_1;
966         exception_value = PyUnicode_FromFormat( "name '%s' is not defined", "calledRepeatedly" ); 767         exception_value = PyUnicode_FromFormat( "name '%s' is not defined", "calledRepeatedly" );
967         exception_tb = NULL; 768         exception_tb = NULL;
968         NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); 769         NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb );
969         CHAIN_EXCEPTION( exception_value ); 770         CHAIN_EXCEPTION( exception_value );
970 771
n 971         exception_lineno = 41; n 772         exception_lineno = 40;
972 773
973         goto try_except_handler_1; 774         goto try_except_handler_1;
974     } 775     }
975 776
976     tmp_called_name_1 = tmp_mvar_value_2; 777     tmp_called_name_1 = tmp_mvar_value_2;
n 977     frame_bb8ad3690a87d22acbeabf27f1900840->m_frame.f_lineno = 41; n 778     frame_bb8ad3690a87d22acbeabf27f1900840->m_frame.f_lineno = 40;
978     tmp_call_result_1 = CALL_FUNCTION_NO_ARGS( tmp_called_name_1 ); 779     tmp_call_result_1 = CALL_FUNCTION_NO_ARGS( tmp_called_name_1 );
979     if ( tmp_call_result_1 == NULL ) 780     if ( tmp_call_result_1 == NULL )
980     { 781     {
981         assert( ERROR_OCCURRED() ); 782         assert( ERROR_OCCURRED() );
982 783
983         FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); 784         FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb );
984 785
985 786
n 986         exception_lineno = 41; n 787         exception_lineno = 40;
987 788
988         goto try_except_handler_1; 789         goto try_except_handler_1;
989     } 790     }
990     Py_DECREF( tmp_call_result_1 ); 791     Py_DECREF( tmp_call_result_1 );
991     } 792     }
994         assert( ERROR_OCCURRED() ); 795         assert( ERROR_OCCURRED() );
995 796
996         FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); 797         FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb );
997 798
998 799
n 999         exception_lineno = 40; n 800         exception_lineno = 39;
1000 801
1001         goto try_except_handler_1; 802         goto try_except_handler_1;
1002     } 803     }
1003     goto loop_start_1; 804     goto loop_start_1;
1004     loop_end_1:; 805     loop_end_1:;
1052     { 853     {
1053     PyObject *tmp_called_name_2; 854     PyObject *tmp_called_name_2;
1054     PyObject *tmp_call_result_2; 855     PyObject *tmp_call_result_2;
1055     tmp_called_name_2 = LOOKUP_BUILTIN( const_str_plain_print ); 856     tmp_called_name_2 = LOOKUP_BUILTIN( const_str_plain_print );
1056     assert( tmp_called_name_2 != NULL ); 857     assert( tmp_called_name_2 != NULL );
n 1057     frame_bb8ad3690a87d22acbeabf27f1900840->m_frame.f_lineno = 43; n 858     frame_bb8ad3690a87d22acbeabf27f1900840->m_frame.f_lineno = 42;
1058     tmp_call_result_2 = CALL_FUNCTION_WITH_ARGS1( tmp_called_name_2, &PyTuple_GET_ITEM( const_tuple_str_digest_5ed1392909ad16e6227b8230f4582352_tuple, 0 ) ); 859     tmp_call_result_2 = CALL_FUNCTION_WITH_ARGS1( tmp_called_name_2, &PyTuple_GET_ITEM( const_tuple_str_digest_5ed1392909ad16e6227b8230f4582352_tuple, 0 ) );
1059 860
1060     if ( tmp_call_result_2 == NULL ) 861     if ( tmp_call_result_2 == NULL )
1061     { 862     {
1062         assert( ERROR_OCCURRED() ); 863         assert( ERROR_OCCURRED() );
1063 864
1064         FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); 865         FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb );
1065 866
1066 867
t 1067         exception_lineno = 43; t 868         exception_lineno = 42;
1068 869
1069         goto frame_exception_exit_1; 870         goto frame_exception_exit_1;
1070     } 871     }
1071     Py_DECREF( tmp_call_result_2 ); 872     Py_DECREF( tmp_call_result_2 );
1072     } 873     }