Construct LoopSmallXrange

Performance Diagrams

Construct LoopSmallXrange 0010000000100000002000000020000000300000003000000040000000400000005000000050000000600000006000000070000000700000008000000080000000CPython 2.7Nuitka (master)Nuitka (develop)Nuitka (factory)8257863188.95192307692307257.0CPython 2.725609735242.31730769230768427.4786150566464Nuitka (master)25056003395.6826923076923429.1356502302356Nuitka (develop)25056003549.0480769230769429.1356502302356Nuitka (factory)Construct LoopSmallXrangeTicks Construct LoopSmallXrange 00100000001000000020000000200000003000000030000000400000004000000050000000500000006000000060000000700000007000000080000000800000009000000090000000100000000100000000CPython 3.8Nuitka (master)Nuitka (develop)Nuitka (factory)10398123588.11538461538461257.0CPython 3.863257071240.03846153846155353.78253436785974Nuitka (master)63257630391.96153846153845353.7812058829653Nuitka (develop)63257630543.8846153846154353.7812058829653Nuitka (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
31 31
32 PyObject *module___main__; 32 PyObject *module___main__;
33 PyDictObject *moduledict___main__; 33 PyDictObject *moduledict___main__;
34 34
35 /* The declarations of module constants used, if any. */ 35 /* The declarations of module constants used, if any. */
n 36 static PyObject *mod_consts[21]; n 36 static PyObject *mod_consts[20];
37 #ifndef __NUITKA_NO_ASSERT__ 37 #ifndef __NUITKA_NO_ASSERT__
n 38 static Py_hash_t mod_consts_hash[21]; n 38 static Py_hash_t mod_consts_hash[20];
39 #endif 39 #endif
40 40
41 static PyObject *module_filename_obj = NULL; 41 static PyObject *module_filename_obj = NULL;
42 42
43 /* Indicator if this modules private constants were created yet. */ 43 /* Indicator if this modules private constants were created yet. */
48     if (constants_created == false) { 48     if (constants_created == false) {
49         loadConstantsBlob(&mod_consts[0], UNTRANSLATE("__main__")); 49         loadConstantsBlob(&mod_consts[0], UNTRANSLATE("__main__"));
50         constants_created = true; 50         constants_created = true;
51 51
52 #ifndef __NUITKA_NO_ASSERT__ 52 #ifndef __NUITKA_NO_ASSERT__
n 53         for(int i = 0; i < 21; i++) { n 53         for(int i = 0; i < 20; i++) {
54             mod_consts_hash[i] = DEEP_HASH(mod_consts[i]); 54             mod_consts_hash[i] = DEEP_HASH(mod_consts[i]);
55         } 55         }
56 #endif 56 #endif
57     } 57     }
58 } 58 }
68 #ifndef __NUITKA_NO_ASSERT__ 68 #ifndef __NUITKA_NO_ASSERT__
69 void checkModuleConstants___main__(void) { 69 void checkModuleConstants___main__(void) {
70     // The module may not have been used at all, then ignore this. 70     // The module may not have been used at all, then ignore this.
71     if (constants_created == false) return; 71     if (constants_created == false) return;
72 72
n 73     for(int i = 0; i < 21; i++) { n 73     for(int i = 0; i < 20; i++) {
74         assert(mod_consts_hash[i] == DEEP_HASH(mod_consts[i])); 74         assert(mod_consts_hash[i] == DEEP_HASH(mod_consts[i]));
75         CHECK_OBJECT_DEEP(mod_consts[i]); 75         CHECK_OBJECT_DEEP(mod_consts[i]);
76     } 76     }
77 } 77 }
78 #endif 78 #endif
79 79
80 // The module code objects. 80 // The module code objects.
81 static PyCodeObject *codeobj_bd88014dfae7c2e4a94eb4ac0f71d5bb; 81 static PyCodeObject *codeobj_bd88014dfae7c2e4a94eb4ac0f71d5bb;
n 82 static PyCodeObject *codeobj_004a9b0c852205081f4d70f5bfe116d9; n 82 static PyCodeObject *codeobj_afa989e3084bfe047ba11092dc0ce8b5;
83 /* For use in "MainProgram.c". */ 83 /* For use in "MainProgram.c". */
84 PyCodeObject *codeobj_main = NULL; 84 PyCodeObject *codeobj_main = NULL;
85 85
86 static void createModuleCodeObjects(void) { 86 static void createModuleCodeObjects(void) {
n 87     module_filename_obj = mod_consts[4]; CHECK_OBJECT(module_filename_obj); n 87     module_filename_obj = mod_consts[3]; CHECK_OBJECT(module_filename_obj);
88     codeobj_bd88014dfae7c2e4a94eb4ac0f71d5bb = MAKE_CODEOBJECT(module_filename_obj, 1, CO_NOFREE, mod_consts[19], NULL, NULL, 0, 0, 0); 88     codeobj_bd88014dfae7c2e4a94eb4ac0f71d5bb = MAKE_CODEOBJECT(module_filename_obj, 1, CO_NOFREE, mod_consts[18], NULL, NULL, 0, 0, 0);
89     codeobj_004a9b0c852205081f4d70f5bfe116d9 = MAKE_CODEOBJECT(module_filename_obj, 25, CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE, mod_consts[11], mod_consts[20], NULL, 0, 0, 0); 89     codeobj_afa989e3084bfe047ba11092dc0ce8b5 = MAKE_CODEOBJECT(module_filename_obj, 24, CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE, mod_consts[10], mod_consts[19], NULL, 0, 0, 0);
90 } 90 }
91 91
92 // The module function declarations. 92 // The module function declarations.
93 static PyObject *MAKE_FUNCTION___main__$$$function__1_calledRepeatedly(); 93 static PyObject *MAKE_FUNCTION___main__$$$function__1_calledRepeatedly();
94 94
101 #endif 101 #endif
102 102
103     // Local variable declarations. 103     // Local variable declarations.
104     PyObject *var_x = NULL; 104     PyObject *var_x = NULL;
105     PyObject *var_local_value = NULL; 105     PyObject *var_local_value = NULL;
n 106     PyObject *tmp_for_loop_1__for_iterator = NULL; n 106     struct Nuitka_FrameObject *frame_afa989e3084bfe047ba11092dc0ce8b5;
107     PyObject *tmp_for_loop_1__iter_value = NULL;
108     struct Nuitka_FrameObject *frame_004a9b0c852205081f4d70f5bfe116d9;
109     NUITKA_MAY_BE_UNUSED char const *type_description_1 = NULL; 107     NUITKA_MAY_BE_UNUSED char const *type_description_1 = NULL;
110     NUITKA_MAY_BE_UNUSED nuitka_void tmp_unused; 108     NUITKA_MAY_BE_UNUSED nuitka_void tmp_unused;
111     PyObject *exception_type = NULL; 109     PyObject *exception_type = NULL;
112     PyObject *exception_value = NULL; 110     PyObject *exception_value = NULL;
113     PyTracebackObject *exception_tb = NULL; 111     PyTracebackObject *exception_tb = NULL;
114     NUITKA_MAY_BE_UNUSED int exception_lineno = 0; 112     NUITKA_MAY_BE_UNUSED int exception_lineno = 0;
n n 113     static struct Nuitka_FrameObject *cache_frame_afa989e3084bfe047ba11092dc0ce8b5 = NULL;
114     PyObject *tmp_return_value = NULL;
115     PyObject *exception_keeper_type_1; 115     PyObject *exception_keeper_type_1;
116     PyObject *exception_keeper_value_1; 116     PyObject *exception_keeper_value_1;
117     PyTracebackObject *exception_keeper_tb_1; 117     PyTracebackObject *exception_keeper_tb_1;
118     NUITKA_MAY_BE_UNUSED int exception_keeper_lineno_1; 118     NUITKA_MAY_BE_UNUSED int exception_keeper_lineno_1;
n 119     static struct Nuitka_FrameObject *cache_frame_004a9b0c852205081f4d70f5bfe116d9 = NULL; n
120     PyObject *tmp_return_value = NULL;
121     PyObject *exception_keeper_type_2;
122     PyObject *exception_keeper_value_2;
123     PyTracebackObject *exception_keeper_tb_2;
124     NUITKA_MAY_BE_UNUSED int exception_keeper_lineno_2;
125 119
126     // Actual function body. 120     // Actual function body.
127     // Tried code: 121     // Tried code:
n 128     if (isFrameUnusable(cache_frame_004a9b0c852205081f4d70f5bfe116d9)) { n 122     if (isFrameUnusable(cache_frame_afa989e3084bfe047ba11092dc0ce8b5)) {
129         Py_XDECREF(cache_frame_004a9b0c852205081f4d70f5bfe116d9); 123         Py_XDECREF(cache_frame_afa989e3084bfe047ba11092dc0ce8b5);
130 124
131 #if _DEBUG_REFCOUNTS 125 #if _DEBUG_REFCOUNTS
n 132         if (cache_frame_004a9b0c852205081f4d70f5bfe116d9 == NULL) { n 126         if (cache_frame_afa989e3084bfe047ba11092dc0ce8b5 == NULL) {
133             count_active_frame_cache_instances += 1; 127             count_active_frame_cache_instances += 1;
134         } else { 128         } else {
135             count_released_frame_cache_instances += 1; 129             count_released_frame_cache_instances += 1;
136         } 130         }
137         count_allocated_frame_cache_instances += 1; 131         count_allocated_frame_cache_instances += 1;
138 #endif 132 #endif
n 139         cache_frame_004a9b0c852205081f4d70f5bfe116d9 = MAKE_FUNCTION_FRAME(codeobj_004a9b0c852205081f4d70f5bfe116d9, module___main__, sizeof(void *)+sizeof(void *)); n 133         cache_frame_afa989e3084bfe047ba11092dc0ce8b5 = MAKE_FUNCTION_FRAME(codeobj_afa989e3084bfe047ba11092dc0ce8b5, module___main__, sizeof(void *)+sizeof(void *));
140 #if _DEBUG_REFCOUNTS 134 #if _DEBUG_REFCOUNTS
141     } else { 135     } else {
142         count_hit_frame_cache_instances += 1; 136         count_hit_frame_cache_instances += 1;
143 #endif 137 #endif
144     } 138     }
n 145     assert(cache_frame_004a9b0c852205081f4d70f5bfe116d9->m_type_description == NULL); n 139     assert(cache_frame_afa989e3084bfe047ba11092dc0ce8b5->m_type_description == NULL);
146     frame_004a9b0c852205081f4d70f5bfe116d9 = cache_frame_004a9b0c852205081f4d70f5bfe116d9; 140     frame_afa989e3084bfe047ba11092dc0ce8b5 = cache_frame_afa989e3084bfe047ba11092dc0ce8b5;
147 141
148     // Push the new frame as the currently active one. 142     // Push the new frame as the currently active one.
n 149     pushFrameStack(frame_004a9b0c852205081f4d70f5bfe116d9); n 143     pushFrameStack(frame_afa989e3084bfe047ba11092dc0ce8b5);
150 144
151     // Mark the frame object as in use, ref count 1 will be up for reuse. 145     // Mark the frame object as in use, ref count 1 will be up for reuse.
n 152     assert(Py_REFCNT(frame_004a9b0c852205081f4d70f5bfe116d9) == 2); // Frame stack n 146     assert(Py_REFCNT(frame_afa989e3084bfe047ba11092dc0ce8b5) == 2); // Frame stack
153 147
154     // Framed code: 148     // Framed code:
155     { 149     {
156         PyObject *tmp_mvar_value_1; 150         PyObject *tmp_mvar_value_1;
157         tmp_mvar_value_1 = GET_STRING_DICT_VALUE(moduledict___main__, (Nuitka_StringObject *)mod_consts[0]); 151         tmp_mvar_value_1 = GET_STRING_DICT_VALUE(moduledict___main__, (Nuitka_StringObject *)mod_consts[0]);
164             assert(ERROR_OCCURRED()); 158             assert(ERROR_OCCURRED());
165 159
166             FETCH_ERROR_OCCURRED(&exception_type, &exception_value, &exception_tb); 160             FETCH_ERROR_OCCURRED(&exception_type, &exception_value, &exception_tb);
167 161
168 162
n 169             exception_lineno = 27; n 163             exception_lineno = 26;
170             type_description_1 = "oo"; 164             type_description_1 = "oo";
171             goto frame_exception_exit_1; 165             goto frame_exception_exit_1;
172         } 166         }
173     } 167     }
174     { 168     {
190             assert(ERROR_OCCURRED()); 184             assert(ERROR_OCCURRED());
191 185
192             FETCH_ERROR_OCCURRED(&exception_type, &exception_value, &exception_tb); 186             FETCH_ERROR_OCCURRED(&exception_type, &exception_value, &exception_tb);
193 187
194 188
n 195             exception_lineno = 32; n 189             exception_lineno = 31;
196             type_description_1 = "oo"; 190             type_description_1 = "oo";
197             goto frame_exception_exit_1; 191             goto frame_exception_exit_1;
198         } 192         }
199         assert(var_local_value == NULL); 193         assert(var_local_value == NULL);
200         Py_INCREF(tmp_assign_source_2); 194         Py_INCREF(tmp_assign_source_2);
201         var_local_value = tmp_assign_source_2; 195         var_local_value = tmp_assign_source_2;
202     } 196     }
n n 197  
198 #if 0
199     RESTORE_FRAME_EXCEPTION(frame_afa989e3084bfe047ba11092dc0ce8b5);
200 #endif
201  
202     // Put the previous frame back on top.
203     popFrameStack();
204  
205     goto frame_no_exception_1;
206  
207     frame_exception_exit_1:;
208  
209 #if 0
210     RESTORE_FRAME_EXCEPTION(frame_afa989e3084bfe047ba11092dc0ce8b5);
211 #endif
212  
213     if (exception_tb == NULL) {
214         exception_tb = MAKE_TRACEBACK(frame_afa989e3084bfe047ba11092dc0ce8b5, exception_lineno);
215     } else if (exception_tb->tb_frame != &frame_afa989e3084bfe047ba11092dc0ce8b5->m_frame) {
216         exception_tb = ADD_TRACEBACK(exception_tb, frame_afa989e3084bfe047ba11092dc0ce8b5, exception_lineno);
203     { 217     }
204         PyObject *tmp_assign_source_3; 218  
205         PyObject *tmp_iter_arg_1; 219     // Attaches locals to frame if any.
206         PyObject *tmp_xrange_low_1; 220     Nuitka_Frame_AttachLocals(
207         PyObject *tmp_xrange_high_1; 221         frame_afa989e3084bfe047ba11092dc0ce8b5,
208         PyObject *tmp_left_name_1; 222         type_description_1,
209         PyObject *tmp_right_name_1; 223         var_x,
224         var_local_value
225     );
226  
227  
228     // Release cached frame if used for exception.
229     if (frame_afa989e3084bfe047ba11092dc0ce8b5 == cache_frame_afa989e3084bfe047ba11092dc0ce8b5) {
230 #if _DEBUG_REFCOUNTS
231         count_active_frame_cache_instances -= 1;
232         count_released_frame_cache_instances += 1;
233 #endif
234  
235         Py_DECREF(cache_frame_afa989e3084bfe047ba11092dc0ce8b5);
236         cache_frame_afa989e3084bfe047ba11092dc0ce8b5 = NULL;
237     }
238  
239     assertFrameObject(frame_afa989e3084bfe047ba11092dc0ce8b5);
240  
241     // Put the previous frame back on top.
242     popFrameStack();
243  
244     // Return the error.
245     goto try_except_handler_1;
246  
247     frame_no_exception_1:;
248     tmp_return_value = Py_None;
249     Py_INCREF(tmp_return_value);
250     goto try_return_handler_1;
251     NUITKA_CANNOT_GET_HERE("tried codes exits in all cases");
252     return NULL;
253     // Return handler code:
254     try_return_handler_1:;
255     CHECK_OBJECT(var_x);
256     Py_DECREF(var_x);
257     var_x = NULL;
210         CHECK_OBJECT(var_local_value); 258     CHECK_OBJECT(var_local_value);
211         tmp_xrange_low_1 = var_local_value; 259     Py_DECREF(var_local_value);
212         CHECK_OBJECT(var_local_value); 260     var_local_value = NULL;
213         tmp_left_name_1 = var_local_value; 261     goto function_return_exit;
214         tmp_right_name_1 = mod_consts[2];
215         tmp_xrange_high_1 = BINARY_OPERATION_ADD_OBJECT_OBJECT_LONG(tmp_left_name_1, tmp_right_name_1);
216         if (tmp_xrange_high_1 == NULL) {
217             assert(ERROR_OCCURRED());
218  
219             FETCH_ERROR_OCCURRED(&exception_type, &exception_value, &exception_tb);
220  
221  
222             exception_lineno = 35;
223             type_description_1 = "oo";
224             goto frame_exception_exit_1;
225         }
226         tmp_iter_arg_1 = BUILTIN_XRANGE2(tmp_xrange_low_1, tmp_xrange_high_1);
227         Py_DECREF(tmp_xrange_high_1);
228         if (tmp_iter_arg_1 == NULL) {
229             assert(ERROR_OCCURRED());
230  
231             FETCH_ERROR_OCCURRED(&exception_type, &exception_value, &exception_tb);
232  
233  
234             exception_lineno = 35;
235             type_description_1 = "oo";
236             goto frame_exception_exit_1;
237         }
238         tmp_assign_source_3 = MAKE_ITERATOR(tmp_iter_arg_1);
239         Py_DECREF(tmp_iter_arg_1);
240         if (tmp_assign_source_3 == NULL) {
241             assert(ERROR_OCCURRED());
242  
243             FETCH_ERROR_OCCURRED(&exception_type, &exception_value, &exception_tb);
244  
245  
246             exception_lineno = 35;
247             type_description_1 = "oo";
248             goto frame_exception_exit_1;
249         }
250         assert(tmp_for_loop_1__for_iterator == NULL);
251         tmp_for_loop_1__for_iterator = tmp_assign_source_3;
252     }
253     // Tried code:
254     loop_start_1:;
255     {
256         PyObject *tmp_next_source_1;
257         PyObject *tmp_assign_source_4;
258         CHECK_OBJECT(tmp_for_loop_1__for_iterator);
259         tmp_next_source_1 = tmp_for_loop_1__for_iterator;
260         tmp_assign_source_4 = ITERATOR_NEXT(tmp_next_source_1);
261         if (tmp_assign_source_4 == NULL) {
262             if (CHECK_AND_CLEAR_STOP_ITERATION_OCCURRED()) {
263  
264                 goto loop_end_1;
265             } else {
266  
267                 FETCH_ERROR_OCCURRED(&exception_type, &exception_value, &exception_tb);
268                 type_description_1 = "oo";
269                 exception_lineno = 35;
270                 goto try_except_handler_2;
271             }
272         }
273  
274         {
275             PyObject *old = tmp_for_loop_1__iter_value;
276             tmp_for_loop_1__iter_value = tmp_assign_source_4;
277             Py_XDECREF(old);
278         }
279  
280     }
281     {
282         PyObject *tmp_assign_source_5;
283         CHECK_OBJECT(tmp_for_loop_1__iter_value);
284         tmp_assign_source_5 = tmp_for_loop_1__iter_value;
285         {
286             PyObject *old = var_x;
287             var_x = tmp_assign_source_5;
288             Py_INCREF(var_x);
289             Py_XDECREF(old);
290         }
291  
292     }
293     if (CONSIDER_THREADING() == false) {
294         assert(ERROR_OCCURRED());
295  
296         FETCH_ERROR_OCCURRED(&exception_type, &exception_value, &exception_tb);
297  
298  
299         exception_lineno = 35;
300         type_description_1 = "oo";
301         goto try_except_handler_2;
302     }
303     goto loop_start_1;
304     loop_end_1:;
305     goto try_end_1;
306     // Exception handler code: 262     // Exception handler code:
n 307     try_except_handler_2:; n 263     try_except_handler_1:;
308     exception_keeper_type_1 = exception_type; 264     exception_keeper_type_1 = exception_type;
309     exception_keeper_value_1 = exception_value; 265     exception_keeper_value_1 = exception_value;
310     exception_keeper_tb_1 = exception_tb; 266     exception_keeper_tb_1 = exception_tb;
311     exception_keeper_lineno_1 = exception_lineno; 267     exception_keeper_lineno_1 = exception_lineno;
312     exception_type = NULL; 268     exception_type = NULL;
313     exception_value = NULL; 269     exception_value = NULL;
314     exception_tb = NULL; 270     exception_tb = NULL;
315     exception_lineno = 0; 271     exception_lineno = 0;
316 272
n 317     Py_XDECREF(tmp_for_loop_1__iter_value); n 273     Py_XDECREF(var_x);
318     tmp_for_loop_1__iter_value = NULL; 274     var_x = NULL;
319     CHECK_OBJECT(tmp_for_loop_1__for_iterator);
320     Py_DECREF(tmp_for_loop_1__for_iterator);
321     tmp_for_loop_1__for_iterator = NULL;
322     // Re-raise. 275     // Re-raise.
323     exception_type = exception_keeper_type_1; 276     exception_type = exception_keeper_type_1;
324     exception_value = exception_keeper_value_1; 277     exception_value = exception_keeper_value_1;
325     exception_tb = exception_keeper_tb_1; 278     exception_tb = exception_keeper_tb_1;
326     exception_lineno = exception_keeper_lineno_1; 279     exception_lineno = exception_keeper_lineno_1;
n 327   n
328     goto frame_exception_exit_1;
329     // End of try:
330     try_end_1:;
331  
332 #if 0
333     RESTORE_FRAME_EXCEPTION(frame_004a9b0c852205081f4d70f5bfe116d9);
334 #endif
335  
336     // Put the previous frame back on top.
337     popFrameStack();
338  
339     goto frame_no_exception_1;
340  
341     frame_exception_exit_1:;
342  
343 #if 0
344     RESTORE_FRAME_EXCEPTION(frame_004a9b0c852205081f4d70f5bfe116d9);
345 #endif
346  
347     if (exception_tb == NULL) {
348         exception_tb = MAKE_TRACEBACK(frame_004a9b0c852205081f4d70f5bfe116d9, exception_lineno);
349     } else if (exception_tb->tb_frame != &frame_004a9b0c852205081f4d70f5bfe116d9->m_frame) {
350         exception_tb = ADD_TRACEBACK(exception_tb, frame_004a9b0c852205081f4d70f5bfe116d9, exception_lineno);
351     }
352  
353     // Attaches locals to frame if any.
354     Nuitka_Frame_AttachLocals(
355         frame_004a9b0c852205081f4d70f5bfe116d9,
356         type_description_1,
357         var_x,
358         var_local_value
359     );
360  
361  
362     // Release cached frame if used for exception.
363     if (frame_004a9b0c852205081f4d70f5bfe116d9 == cache_frame_004a9b0c852205081f4d70f5bfe116d9) {
364 #if _DEBUG_REFCOUNTS
365         count_active_frame_cache_instances -= 1;
366         count_released_frame_cache_instances += 1;
367 #endif
368  
369         Py_DECREF(cache_frame_004a9b0c852205081f4d70f5bfe116d9);
370         cache_frame_004a9b0c852205081f4d70f5bfe116d9 = NULL;
371     }
372  
373     assertFrameObject(frame_004a9b0c852205081f4d70f5bfe116d9);
374  
375     // Put the previous frame back on top.
376     popFrameStack();
377  
378     // Return the error.
379     goto try_except_handler_1;
380  
381     frame_no_exception_1:;
382     Py_XDECREF(tmp_for_loop_1__iter_value);
383     tmp_for_loop_1__iter_value = NULL;
384     CHECK_OBJECT(tmp_for_loop_1__for_iterator);
385     Py_DECREF(tmp_for_loop_1__for_iterator);
386     tmp_for_loop_1__for_iterator = NULL;
387     tmp_return_value = Py_None;
388     Py_INCREF(tmp_return_value);
389     goto try_return_handler_1;
390     NUITKA_CANNOT_GET_HERE("tried codes exits in all cases");
391     return NULL;
392     // Return handler code:
393     try_return_handler_1:;
394     Py_XDECREF(var_x);
395     var_x = NULL;
396     CHECK_OBJECT(var_local_value);
397     Py_DECREF(var_local_value);
398     var_local_value = NULL;
399     goto function_return_exit;
400     // Exception handler code:
401     try_except_handler_1:;
402     exception_keeper_type_2 = exception_type;
403     exception_keeper_value_2 = exception_value;
404     exception_keeper_tb_2 = exception_tb;
405     exception_keeper_lineno_2 = exception_lineno;
406     exception_type = NULL;
407     exception_value = NULL;
408     exception_tb = NULL;
409     exception_lineno = 0;
410  
411     Py_XDECREF(var_x);
412     var_x = NULL;
413     Py_XDECREF(var_local_value);
414     var_local_value = NULL;
415     // Re-raise.
416     exception_type = exception_keeper_type_2;
417     exception_value = exception_keeper_value_2;
418     exception_tb = exception_keeper_tb_2;
419     exception_lineno = exception_keeper_lineno_2;
420 280
421     goto function_exception_exit; 281     goto function_exception_exit;
422     // End of try: 282     // End of try:
423 283
424     NUITKA_CANNOT_GET_HERE("Return statement must have exited already."); 284     NUITKA_CANNOT_GET_HERE("Return statement must have exited already.");
444 304
445 305
446 static PyObject *MAKE_FUNCTION___main__$$$function__1_calledRepeatedly() { 306 static PyObject *MAKE_FUNCTION___main__$$$function__1_calledRepeatedly() {
447     struct Nuitka_FunctionObject *result = Nuitka_Function_New( 307     struct Nuitka_FunctionObject *result = Nuitka_Function_New(
448         impl___main__$$$function__1_calledRepeatedly, 308         impl___main__$$$function__1_calledRepeatedly,
n 449         mod_consts[11], n 309         mod_consts[10],
450 #if PYTHON_VERSION >= 0x300 310 #if PYTHON_VERSION >= 0x300
451         NULL, 311         NULL,
452 #endif 312 #endif
n 453         codeobj_004a9b0c852205081f4d70f5bfe116d9, n 313         codeobj_afa989e3084bfe047ba11092dc0ce8b5,
454         NULL, 314         NULL,
455 #if PYTHON_VERSION >= 0x300 315 #if PYTHON_VERSION >= 0x300
456         NULL, 316         NULL,
457         NULL, 317         NULL,
458 #endif 318 #endif
824 684
825     // Module code. 685     // Module code.
826     { 686     {
827         PyObject *tmp_assign_source_1; 687         PyObject *tmp_assign_source_1;
828         tmp_assign_source_1 = Py_None; 688         tmp_assign_source_1 = Py_None;
n 829         UPDATE_STRING_DICT0(moduledict___main__, (Nuitka_StringObject *)mod_consts[3], tmp_assign_source_1); n 689         UPDATE_STRING_DICT0(moduledict___main__, (Nuitka_StringObject *)mod_consts[2], tmp_assign_source_1);
830     } 690     }
831     { 691     {
832         PyObject *tmp_assign_source_2; 692         PyObject *tmp_assign_source_2;
n 833         tmp_assign_source_2 = mod_consts[4]; n 693         tmp_assign_source_2 = mod_consts[3];
834         UPDATE_STRING_DICT0(moduledict___main__, (Nuitka_StringObject *)mod_consts[5], tmp_assign_source_2); 694         UPDATE_STRING_DICT0(moduledict___main__, (Nuitka_StringObject *)mod_consts[4], tmp_assign_source_2);
835     } 695     }
836     { 696     {
837         PyObject *tmp_assign_source_3; 697         PyObject *tmp_assign_source_3;
838         tmp_assign_source_3 = Py_None; 698         tmp_assign_source_3 = Py_None;
n 839         UPDATE_STRING_DICT0(moduledict___main__, (Nuitka_StringObject *)mod_consts[6], tmp_assign_source_3); n 699         UPDATE_STRING_DICT0(moduledict___main__, (Nuitka_StringObject *)mod_consts[5], tmp_assign_source_3);
840     } 700     }
841     { 701     {
842         PyObject *tmp_assign_source_4; 702         PyObject *tmp_assign_source_4;
843         tmp_assign_source_4 = PyDict_New(); 703         tmp_assign_source_4 = PyDict_New();
n 844         UPDATE_STRING_DICT1(moduledict___main__, (Nuitka_StringObject *)mod_consts[7], tmp_assign_source_4); n 704         UPDATE_STRING_DICT1(moduledict___main__, (Nuitka_StringObject *)mod_consts[6], tmp_assign_source_4);
845     } 705     }
846     { 706     {
847         PyObject *tmp_assign_source_5; 707         PyObject *tmp_assign_source_5;
n 848         tmp_assign_source_5 = mod_consts[8]; n 708         tmp_assign_source_5 = mod_consts[7];
849         UPDATE_STRING_DICT0(moduledict___main__, (Nuitka_StringObject *)mod_consts[5], tmp_assign_source_5); 709         UPDATE_STRING_DICT0(moduledict___main__, (Nuitka_StringObject *)mod_consts[0], tmp_assign_source_5);
850     } 710     }
851     { 711     {
852         PyObject *tmp_assign_source_6; 712         PyObject *tmp_assign_source_6;
n 853         tmp_assign_source_6 = mod_consts[9]; n 713         tmp_assign_source_6 = mod_consts[8];
854         UPDATE_STRING_DICT0(moduledict___main__, (Nuitka_StringObject *)mod_consts[0], tmp_assign_source_6); 714         UPDATE_STRING_DICT0(moduledict___main__, (Nuitka_StringObject *)mod_consts[9], tmp_assign_source_6);
855     } 715     }
856     { 716     {
857         PyObject *tmp_assign_source_7; 717         PyObject *tmp_assign_source_7;
n 858         tmp_assign_source_7 = mod_consts[2]; n 718  
719  
720         tmp_assign_source_7 = MAKE_FUNCTION___main__$$$function__1_calledRepeatedly();
721  
859         UPDATE_STRING_DICT0(moduledict___main__, (Nuitka_StringObject *)mod_consts[10], tmp_assign_source_7); 722         UPDATE_STRING_DICT1(moduledict___main__, (Nuitka_StringObject *)mod_consts[10], tmp_assign_source_7);
860     } 723     }
861     { 724     {
862         PyObject *tmp_assign_source_8; 725         PyObject *tmp_assign_source_8;
n 863   n
864  
865         tmp_assign_source_8 = MAKE_FUNCTION___main__$$$function__1_calledRepeatedly();
866  
867         UPDATE_STRING_DICT1(moduledict___main__, (Nuitka_StringObject *)mod_consts[11], tmp_assign_source_8);
868     }
869     {
870         PyObject *tmp_assign_source_9;
871         PyObject *tmp_name_name_1; 726         PyObject *tmp_name_name_1;
872         PyObject *tmp_globals_arg_name_1; 727         PyObject *tmp_globals_arg_name_1;
873         PyObject *tmp_locals_arg_name_1; 728         PyObject *tmp_locals_arg_name_1;
874         PyObject *tmp_fromlist_name_1; 729         PyObject *tmp_fromlist_name_1;
875         PyObject *tmp_level_name_1; 730         PyObject *tmp_level_name_1;
n 876         tmp_name_name_1 = mod_consts[12]; n 731         tmp_name_name_1 = mod_consts[11];
877         tmp_globals_arg_name_1 = (PyObject *)moduledict___main__; 732         tmp_globals_arg_name_1 = (PyObject *)moduledict___main__;
878         tmp_locals_arg_name_1 = Py_None; 733         tmp_locals_arg_name_1 = Py_None;
879         tmp_fromlist_name_1 = Py_None; 734         tmp_fromlist_name_1 = Py_None;
n 880         tmp_level_name_1 = mod_consts[13]; n 735         tmp_level_name_1 = mod_consts[12];
881         tmp_assign_source_9 = IMPORT_MODULE5(tmp_name_name_1, tmp_globals_arg_name_1, tmp_locals_arg_name_1, tmp_fromlist_name_1, tmp_level_name_1); 736         tmp_assign_source_8 = IMPORT_MODULE5(tmp_name_name_1, tmp_globals_arg_name_1, tmp_locals_arg_name_1, tmp_fromlist_name_1, tmp_level_name_1);
882         assert(!(tmp_assign_source_9 == NULL)); 737         assert(!(tmp_assign_source_8 == NULL));
883         UPDATE_STRING_DICT1(moduledict___main__, (Nuitka_StringObject *)mod_consts[12], tmp_assign_source_9); 738         UPDATE_STRING_DICT1(moduledict___main__, (Nuitka_StringObject *)mod_consts[11], tmp_assign_source_8);
884     } 739     }
885     // Frame without reuse. 740     // Frame without reuse.
886     frame_bd88014dfae7c2e4a94eb4ac0f71d5bb = MAKE_MODULE_FRAME(codeobj_bd88014dfae7c2e4a94eb4ac0f71d5bb, module___main__); 741     frame_bd88014dfae7c2e4a94eb4ac0f71d5bb = MAKE_MODULE_FRAME(codeobj_bd88014dfae7c2e4a94eb4ac0f71d5bb, module___main__);
887 742
888     // Push the new frame as the currently active one, and we should be exclusively 743     // Push the new frame as the currently active one, and we should be exclusively
890     pushFrameStack(frame_bd88014dfae7c2e4a94eb4ac0f71d5bb); 745     pushFrameStack(frame_bd88014dfae7c2e4a94eb4ac0f71d5bb);
891     assert(Py_REFCNT(frame_bd88014dfae7c2e4a94eb4ac0f71d5bb) == 2); 746     assert(Py_REFCNT(frame_bd88014dfae7c2e4a94eb4ac0f71d5bb) == 2);
892 747
893     // Framed code: 748     // Framed code:
894     { 749     {
n 895         PyObject *tmp_assign_source_10; n 750         PyObject *tmp_assign_source_9;
896         PyObject *tmp_iter_arg_1; 751         PyObject *tmp_iter_arg_1;
897         PyObject *tmp_called_instance_1; 752         PyObject *tmp_called_instance_1;
n 898         tmp_called_instance_1 = GET_STRING_DICT_VALUE(moduledict___main__, (Nuitka_StringObject *)mod_consts[12]); n 753         tmp_called_instance_1 = GET_STRING_DICT_VALUE(moduledict___main__, (Nuitka_StringObject *)mod_consts[11]);
899 754
900         if (unlikely(tmp_called_instance_1 == NULL)) { 755         if (unlikely(tmp_called_instance_1 == NULL)) {
n 901             tmp_called_instance_1 = GET_MODULE_VARIABLE_VALUE_FALLBACK(mod_consts[12]); n 756             tmp_called_instance_1 = GET_MODULE_VARIABLE_VALUE_FALLBACK(mod_consts[11]);
902         } 757         }
903 758
904         assert(!(tmp_called_instance_1 == NULL)); 759         assert(!(tmp_called_instance_1 == NULL));
n 905         frame_bd88014dfae7c2e4a94eb4ac0f71d5bb->m_frame.f_lineno = 40; n 760         frame_bd88014dfae7c2e4a94eb4ac0f71d5bb->m_frame.f_lineno = 39;
906         tmp_iter_arg_1 = CALL_METHOD_WITH_ARGS2( 761         tmp_iter_arg_1 = CALL_METHOD_WITH_ARGS2(
907             tmp_called_instance_1, 762             tmp_called_instance_1,
n 908             mod_consts[14], n 763             mod_consts[13],
909             &PyTuple_GET_ITEM(mod_consts[15], 0) 764             &PyTuple_GET_ITEM(mod_consts[14], 0)
910         ); 765         );
911 766
912         if (tmp_iter_arg_1 == NULL) { 767         if (tmp_iter_arg_1 == NULL) {
913             assert(ERROR_OCCURRED()); 768             assert(ERROR_OCCURRED());
914 769
915             FETCH_ERROR_OCCURRED(&exception_type, &exception_value, &exception_tb); 770             FETCH_ERROR_OCCURRED(&exception_type, &exception_value, &exception_tb);
916 771
917 772
n 918             exception_lineno = 40; n 773             exception_lineno = 39;
919 774
920             goto frame_exception_exit_1; 775             goto frame_exception_exit_1;
921         } 776         }
n 922         tmp_assign_source_10 = MAKE_ITERATOR(tmp_iter_arg_1); n 777         tmp_assign_source_9 = MAKE_ITERATOR(tmp_iter_arg_1);
923         Py_DECREF(tmp_iter_arg_1); 778         Py_DECREF(tmp_iter_arg_1);
n 924         if (tmp_assign_source_10 == NULL) { n 779         if (tmp_assign_source_9 == NULL) {
925             assert(ERROR_OCCURRED()); 780             assert(ERROR_OCCURRED());
926 781
927             FETCH_ERROR_OCCURRED(&exception_type, &exception_value, &exception_tb); 782             FETCH_ERROR_OCCURRED(&exception_type, &exception_value, &exception_tb);
928 783
929 784
n 930             exception_lineno = 40; n 785             exception_lineno = 39;
931 786
932             goto frame_exception_exit_1; 787             goto frame_exception_exit_1;
933         } 788         }
934         assert(tmp_for_loop_1__for_iterator == NULL); 789         assert(tmp_for_loop_1__for_iterator == NULL);
n 935         tmp_for_loop_1__for_iterator = tmp_assign_source_10; n 790         tmp_for_loop_1__for_iterator = tmp_assign_source_9;
936     } 791     }
937     // Tried code: 792     // Tried code:
938     loop_start_1:; 793     loop_start_1:;
939     { 794     {
940         PyObject *tmp_next_source_1; 795         PyObject *tmp_next_source_1;
n 941         PyObject *tmp_assign_source_11; n 796         PyObject *tmp_assign_source_10;
942         CHECK_OBJECT(tmp_for_loop_1__for_iterator); 797         CHECK_OBJECT(tmp_for_loop_1__for_iterator);
943         tmp_next_source_1 = tmp_for_loop_1__for_iterator; 798         tmp_next_source_1 = tmp_for_loop_1__for_iterator;
n 944         tmp_assign_source_11 = ITERATOR_NEXT(tmp_next_source_1); n 799         tmp_assign_source_10 = ITERATOR_NEXT(tmp_next_source_1);
945         if (tmp_assign_source_11 == NULL) { 800         if (tmp_assign_source_10 == NULL) {
946             if (CHECK_AND_CLEAR_STOP_ITERATION_OCCURRED()) { 801             if (CHECK_AND_CLEAR_STOP_ITERATION_OCCURRED()) {
947 802
948                 goto loop_end_1; 803                 goto loop_end_1;
949             } else { 804             } else {
950 805
951                 FETCH_ERROR_OCCURRED(&exception_type, &exception_value, &exception_tb); 806                 FETCH_ERROR_OCCURRED(&exception_type, &exception_value, &exception_tb);
952 807
n 953                 exception_lineno = 40; n 808                 exception_lineno = 39;
954                 goto try_except_handler_1; 809                 goto try_except_handler_1;
955             } 810             }
956         } 811         }
957 812
958         { 813         {
959             PyObject *old = tmp_for_loop_1__iter_value; 814             PyObject *old = tmp_for_loop_1__iter_value;
n 960             tmp_for_loop_1__iter_value = tmp_assign_source_11; n 815             tmp_for_loop_1__iter_value = tmp_assign_source_10;
961             Py_XDECREF(old); 816             Py_XDECREF(old);
962         } 817         }
963 818
964     } 819     }
965     { 820     {
n 966         PyObject *tmp_assign_source_12; n 821         PyObject *tmp_assign_source_11;
967         CHECK_OBJECT(tmp_for_loop_1__iter_value); 822         CHECK_OBJECT(tmp_for_loop_1__iter_value);
n 968         tmp_assign_source_12 = tmp_for_loop_1__iter_value; n 823         tmp_assign_source_11 = tmp_for_loop_1__iter_value;
969         UPDATE_STRING_DICT0(moduledict___main__, (Nuitka_StringObject *)mod_consts[16], tmp_assign_source_12); 824         UPDATE_STRING_DICT0(moduledict___main__, (Nuitka_StringObject *)mod_consts[15], tmp_assign_source_11);
970     } 825     }
971     { 826     {
972         PyObject *tmp_called_name_1; 827         PyObject *tmp_called_name_1;
973         PyObject *tmp_call_result_1; 828         PyObject *tmp_call_result_1;
n 974         tmp_called_name_1 = GET_STRING_DICT_VALUE(moduledict___main__, (Nuitka_StringObject *)mod_consts[11]); n 829         tmp_called_name_1 = GET_STRING_DICT_VALUE(moduledict___main__, (Nuitka_StringObject *)mod_consts[10]);
975 830
976         if (unlikely(tmp_called_name_1 == NULL)) { 831         if (unlikely(tmp_called_name_1 == NULL)) {
n 977             tmp_called_name_1 = GET_MODULE_VARIABLE_VALUE_FALLBACK(mod_consts[11]); n 832             tmp_called_name_1 = GET_MODULE_VARIABLE_VALUE_FALLBACK(mod_consts[10]);
978         } 833         }
979 834
980         if (tmp_called_name_1 == NULL) { 835         if (tmp_called_name_1 == NULL) {
981             assert(ERROR_OCCURRED()); 836             assert(ERROR_OCCURRED());
982 837
983             FETCH_ERROR_OCCURRED(&exception_type, &exception_value, &exception_tb); 838             FETCH_ERROR_OCCURRED(&exception_type, &exception_value, &exception_tb);
984 839
985 840
n 986             exception_lineno = 41; n 841             exception_lineno = 40;
987 842
988             goto try_except_handler_1; 843             goto try_except_handler_1;
989         } 844         }
n 990         frame_bd88014dfae7c2e4a94eb4ac0f71d5bb->m_frame.f_lineno = 41; n 845         frame_bd88014dfae7c2e4a94eb4ac0f71d5bb->m_frame.f_lineno = 40;
991         tmp_call_result_1 = CALL_FUNCTION_NO_ARGS(tmp_called_name_1); 846         tmp_call_result_1 = CALL_FUNCTION_NO_ARGS(tmp_called_name_1);
992         if (tmp_call_result_1 == NULL) { 847         if (tmp_call_result_1 == NULL) {
993             assert(ERROR_OCCURRED()); 848             assert(ERROR_OCCURRED());
994 849
995             FETCH_ERROR_OCCURRED(&exception_type, &exception_value, &exception_tb); 850             FETCH_ERROR_OCCURRED(&exception_type, &exception_value, &exception_tb);
996 851
997 852
n 998             exception_lineno = 41; n 853             exception_lineno = 40;
999 854
1000             goto try_except_handler_1; 855             goto try_except_handler_1;
1001         } 856         }
1002         Py_DECREF(tmp_call_result_1); 857         Py_DECREF(tmp_call_result_1);
1003     } 858     }
1005         assert(ERROR_OCCURRED()); 860         assert(ERROR_OCCURRED());
1006 861
1007         FETCH_ERROR_OCCURRED(&exception_type, &exception_value, &exception_tb); 862         FETCH_ERROR_OCCURRED(&exception_type, &exception_value, &exception_tb);
1008 863
1009 864
n 1010         exception_lineno = 40; n 865         exception_lineno = 39;
1011 866
1012         goto try_except_handler_1; 867         goto try_except_handler_1;
1013     } 868     }
1014     goto loop_start_1; 869     goto loop_start_1;
1015     loop_end_1:; 870     loop_end_1:;
1045     Py_DECREF(tmp_for_loop_1__for_iterator); 900     Py_DECREF(tmp_for_loop_1__for_iterator);
1046     tmp_for_loop_1__for_iterator = NULL; 901     tmp_for_loop_1__for_iterator = NULL;
1047     { 902     {
1048         PyObject *tmp_called_name_2; 903         PyObject *tmp_called_name_2;
1049         PyObject *tmp_call_result_2; 904         PyObject *tmp_call_result_2;
n 1050         tmp_called_name_2 = LOOKUP_BUILTIN(mod_consts[17]); n 905         tmp_called_name_2 = LOOKUP_BUILTIN(mod_consts[16]);
1051         assert(tmp_called_name_2 != NULL); 906         assert(tmp_called_name_2 != NULL);
n 1052         frame_bd88014dfae7c2e4a94eb4ac0f71d5bb->m_frame.f_lineno = 43; n 907         frame_bd88014dfae7c2e4a94eb4ac0f71d5bb->m_frame.f_lineno = 42;
1053         tmp_call_result_2 = CALL_FUNCTION_WITH_POSARGS1(tmp_called_name_2, mod_consts[18]); 908         tmp_call_result_2 = CALL_FUNCTION_WITH_POSARGS1(tmp_called_name_2, mod_consts[17]);
1054 909
1055         if (tmp_call_result_2 == NULL) { 910         if (tmp_call_result_2 == NULL) {
1056             assert(ERROR_OCCURRED()); 911             assert(ERROR_OCCURRED());
1057 912
1058             FETCH_ERROR_OCCURRED(&exception_type, &exception_value, &exception_tb); 913             FETCH_ERROR_OCCURRED(&exception_type, &exception_value, &exception_tb);
1059 914
1060 915
t 1061             exception_lineno = 43; t 916             exception_lineno = 42;
1062 917
1063             goto frame_exception_exit_1; 918             goto frame_exception_exit_1;
1064         } 919         }
1065         Py_DECREF(tmp_call_result_2); 920         Py_DECREF(tmp_call_result_2);
1066     } 921     }