Construct FunctionCreationGeneratorLocal
Performance Diagrams
Source Code with Construct
for x in itertools.repeat(None, 50000): calledRepeatedly() print("OK.") # Python test originally created or extracted from other peoples work. The # parts from me are licensed as below. It is at least Free Software where # it's copied from other people. In these cases, that will normally be # indicated. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License.
Source Code without Construct
for x in itertools.repeat(None, 50000): calledRepeatedly() print("OK.") # Python test originally created or extracted from other peoples work. The # parts from me are licensed as below. It is at least Free Software where # it's copied from other people. In these cases, that will normally be # indicated. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License.
Context Diff of Source Code
Construct | Baseline | ||||
---|---|---|---|---|---|
7 | 7 | ||||
8 | 8 | ||||
9 | def calledRepeatedly(): | 9 | def calledRepeatedly(): | ||
10 | # We measure making a local function that will remain unused. | 10 | # We measure making a local function that will remain unused. | ||
11 | # construct_begin | 11 | # construct_begin | ||
n | 12 | def empty(): | n | 12 | |
13 | yield 1 | 13 | |||
14 | 14 | ||||
15 | # construct_alternative | 15 | # construct_alternative | ||
t | 16 | t | 16 | empty = 1 | |
17 | 17 | # construct_end | |||
18 | 18 | ||||
19 | return empty | 19 | return empty | ||
20 | 20 | ||||
21 | 21 | ||||
22 | for x in itertools.repeat(None, 50000): | 22 | for x in itertools.repeat(None, 50000): |
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[14]; | n | 36 | static PyObject *mod_consts[13]; |
37 | #ifndef __NUITKA_NO_ASSERT__ | 37 | #ifndef __NUITKA_NO_ASSERT__ | ||
n | 38 | static Py_hash_t mod_consts_hash[14]; | n | 38 | static Py_hash_t mod_consts_hash[13]; |
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(tstate, &mod_consts[0], UNTRANSLATE("__main__")); | 49 | loadConstantsBlob(tstate, &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 < 14; i++) { | n | 53 | for (int i = 0; i < 13; i++) { |
54 | mod_consts_hash[i] = DEEP_HASH(tstate, mod_consts[i]); | 54 | mod_consts_hash[i] = DEEP_HASH(tstate, 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__(PyThreadState *tstate) { | 69 | void checkModuleConstants___main__(PyThreadState *tstate) { | ||
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 < 14; i++) { | n | 73 | for (int i = 0; i < 13; i++) { |
74 | assert(mod_consts_hash[i] == DEEP_HASH(tstate, mod_consts[i])); | 74 | assert(mod_consts_hash[i] == DEEP_HASH(tstate, 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_9ef36c9887d89545de361a09ab309719; | 81 | static PyCodeObject *codeobj_9ef36c9887d89545de361a09ab309719; | ||
82 | static PyCodeObject *codeobj_a4be106de002b3f8c9b882761d777cfc; | 82 | static PyCodeObject *codeobj_a4be106de002b3f8c9b882761d777cfc; | ||
n | 83 | static PyCodeObject *codeobj_a832fa0bf2ebcc864c703e0e444a0682; | n | ||
84 | /* For use in "MainProgram.c". */ | 83 | /* For use in "MainProgram.c". */ | ||
85 | PyCodeObject *codeobj_main = NULL; | 84 | PyCodeObject *codeobj_main = NULL; | ||
86 | 85 | ||||
87 | static void createModuleCodeObjects(void) { | 86 | static void createModuleCodeObjects(void) { | ||
n | 88 | module_filename_obj = mod_consts[3]; CHECK_OBJECT(module_filename_obj); | n | 87 | module_filename_obj = mod_consts[1]; CHECK_OBJECT(module_filename_obj); |
89 | codeobj_9ef36c9887d89545de361a09ab309719 = MAKE_CODE_OBJECT(module_filename_obj, 1, CO_NOFREE, mod_consts[12], mod_consts[12], NULL, NULL, 0, 0, 0); | 88 | codeobj_9ef36c9887d89545de361a09ab309719 = MAKE_CODE_OBJECT(module_filename_obj, 1, CO_NOFREE, mod_consts[11], mod_consts[11], NULL, NULL, 0, 0, 0); | ||
90 | codeobj_main = codeobj_9ef36c9887d89545de361a09ab309719; | 89 | codeobj_main = codeobj_9ef36c9887d89545de361a09ab309719; | ||
n | 91 | codeobj_a4be106de002b3f8c9b882761d777cfc = MAKE_CODE_OBJECT(module_filename_obj, 9, CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE, mod_consts[7], mod_consts[7], mod_consts[13], NULL, 0, 0, 0); | n | 90 | codeobj_a4be106de002b3f8c9b882761d777cfc = MAKE_CODE_OBJECT(module_filename_obj, 9, CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE, mod_consts[6], mod_consts[6], mod_consts[12], NULL, 0, 0, 0); |
92 | codeobj_a832fa0bf2ebcc864c703e0e444a0682 = MAKE_CODE_OBJECT(module_filename_obj, 12, CO_GENERATOR | CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE, mod_consts[0], mod_consts[0], NULL, NULL, 0, 0, 0); | ||||
93 | } | 91 | } | ||
94 | 92 | ||||
95 | // The module function declarations. | 93 | // The module function declarations. | ||
n | 96 | static PyObject *MAKE_GENERATOR___main__$$$function__1_calledRepeatedly$$$function__1_empty$$$genobj__1_empty(); | n | ||
97 | |||||
98 | |||||
99 | static PyObject *MAKE_FUNCTION___main__$$$function__1_calledRepeatedly(); | 94 | static PyObject *MAKE_FUNCTION___main__$$$function__1_calledRepeatedly(); | ||
100 | 95 | ||||
101 | 96 | ||||
n | 102 | static PyObject *MAKE_FUNCTION___main__$$$function__1_calledRepeatedly$$$function__1_empty(); | n | ||
103 | |||||
104 | |||||
105 | // The module function definitions. | 97 | // The module function definitions. | ||
n | 106 | static PyObject *impl___main__$$$function__1_calledRepeatedly(PyThreadState *tstate, struct Nuitka_FunctionObject const *self, PyObject **python_pars) { | n | ||
107 | // Preserve error status for checks | ||||
108 | #ifndef __NUITKA_NO_ASSERT__ | ||||
109 | NUITKA_MAY_BE_UNUSED bool had_error = HAS_ERROR_OCCURRED(tstate); | ||||
110 | #endif | ||||
111 | |||||
112 | // Local variable declarations. | ||||
113 | PyObject *var_empty = NULL; | ||||
114 | PyObject *tmp_return_value = NULL; | ||||
115 | |||||
116 | // Actual function body. | ||||
117 | { | ||||
118 | PyObject *tmp_assign_source_1; | ||||
119 | |||||
120 | |||||
121 | tmp_assign_source_1 = MAKE_FUNCTION___main__$$$function__1_calledRepeatedly$$$function__1_empty(); | ||||
122 | |||||
123 | assert(var_empty == NULL); | ||||
124 | var_empty = tmp_assign_source_1; | ||||
125 | } | ||||
126 | // Tried code: | ||||
127 | CHECK_OBJECT(var_empty); | ||||
128 | tmp_return_value = var_empty; | ||||
129 | Py_INCREF(tmp_return_value); | ||||
130 | goto try_return_handler_1; | ||||
131 | NUITKA_CANNOT_GET_HERE("tried codes exits in all cases"); | ||||
132 | return NULL; | ||||
133 | // Return handler code: | ||||
134 | try_return_handler_1:; | ||||
135 | CHECK_OBJECT(var_empty); | ||||
136 | Py_DECREF(var_empty); | ||||
137 | var_empty = NULL; | ||||
138 | goto function_return_exit; | ||||
139 | // End of try: | ||||
140 | |||||
141 | NUITKA_CANNOT_GET_HERE("Return statement must have exited already."); | ||||
142 | return NULL; | ||||
143 | |||||
144 | |||||
145 | function_return_exit: | ||||
146 | // Function cleanup code if any. | ||||
147 | |||||
148 | |||||
149 | // Actual function exit with return value, making sure we did not make | ||||
150 | // the error status worse despite non-NULL return. | ||||
151 | CHECK_OBJECT(tmp_return_value); | ||||
152 | assert(had_error || !HAS_ERROR_OCCURRED(tstate)); | ||||
153 | return tmp_return_value; | ||||
154 | } | ||||
155 | |||||
156 | |||||
157 | static PyObject *impl___main__$$$function__1_calledRepeatedly$$$function__1_empty(PyThreadState *tstate, struct Nuitka_FunctionObject const *self, PyObject **python_pars) { | ||||
158 | // Preserve error status for checks | ||||
159 | #ifndef __NUITKA_NO_ASSERT__ | ||||
160 | NUITKA_MAY_BE_UNUSED bool had_error = HAS_ERROR_OCCURRED(tstate); | ||||
161 | #endif | ||||
162 | |||||
163 | // Local variable declarations. | ||||
164 | PyObject *tmp_return_value = NULL; | ||||
165 | |||||
166 | // Actual function body. | ||||
167 | |||||
168 | |||||
169 | tmp_return_value = MAKE_GENERATOR___main__$$$function__1_calledRepeatedly$$$function__1_empty$$$genobj__1_empty(); | ||||
170 | |||||
171 | goto function_return_exit; | ||||
172 | |||||
173 | NUITKA_CANNOT_GET_HERE("Return statement must have exited already."); | ||||
174 | return NULL; | ||||
175 | |||||
176 | |||||
177 | function_return_exit: | ||||
178 | // Function cleanup code if any. | ||||
179 | |||||
180 | |||||
181 | // Actual function exit with return value, making sure we did not make | ||||
182 | // the error status worse despite non-NULL return. | ||||
183 | CHECK_OBJECT(tmp_return_value); | ||||
184 | assert(had_error || !HAS_ERROR_OCCURRED(tstate)); | ||||
185 | return tmp_return_value; | ||||
186 | } | ||||
187 | |||||
188 | |||||
189 | |||||
190 | #if 1 | ||||
191 | struct __main__$$$function__1_calledRepeatedly$$$function__1_empty$$$genobj__1_empty_locals { | ||||
192 | char const *type_description_1; | ||||
193 | PyObject *exception_type; | ||||
194 | PyObject *exception_value; | ||||
195 | PyTracebackObject *exception_tb; | ||||
196 | int exception_lineno; | ||||
197 | }; | ||||
198 | #endif | ||||
199 | |||||
200 | static PyObject *__main__$$$function__1_calledRepeatedly$$$function__1_empty$$$genobj__1_empty_context(PyThreadState *tstate, struct Nuitka_GeneratorObject *generator, PyObject *yield_return_value) { | ||||
201 | CHECK_OBJECT(generator); | ||||
202 | assert(Nuitka_Generator_Check((PyObject *)generator)); | ||||
203 | CHECK_OBJECT_X(yield_return_value); | ||||
204 | |||||
205 | #if 1 | ||||
206 | // Heap access. | ||||
207 | struct __main__$$$function__1_calledRepeatedly$$$function__1_empty$$$genobj__1_empty_locals *generator_heap = (struct __main__$$$function__1_calledRepeatedly$$$function__1_empty$$$genobj__1_empty_locals *)generator->m_heap_storage; | ||||
208 | #endif | ||||
209 | |||||
210 | // Dispatch to yield based on return label index: | ||||
211 | switch(generator->m_yield_return_index) { | ||||
212 | case 1: goto yield_return_1; | ||||
213 | } | ||||
214 | |||||
215 | // Local variable initialization | ||||
216 | NUITKA_MAY_BE_UNUSED nuitka_void tmp_unused; | ||||
217 | static struct Nuitka_FrameObject *cache_m_frame = NULL; | ||||
218 | generator_heap->type_description_1 = NULL; | ||||
219 | generator_heap->exception_type = NULL; | ||||
220 | generator_heap->exception_value = NULL; | ||||
221 | generator_heap->exception_tb = NULL; | ||||
222 | generator_heap->exception_lineno = 0; | ||||
223 | |||||
224 | // Actual generator function body. | ||||
225 | if (isFrameUnusable(cache_m_frame)) { | ||||
226 | Py_XDECREF(cache_m_frame); | ||||
227 | |||||
228 | #if _DEBUG_REFCOUNTS | ||||
229 | if (cache_m_frame == NULL) { | ||||
230 | count_active_frame_cache_instances += 1; | ||||
231 | } else { | ||||
232 | count_released_frame_cache_instances += 1; | ||||
233 | } | ||||
234 | count_allocated_frame_cache_instances += 1; | ||||
235 | #endif | ||||
236 | cache_m_frame = MAKE_FUNCTION_FRAME(tstate, codeobj_a832fa0bf2ebcc864c703e0e444a0682, module___main__, 0); | ||||
237 | #if _DEBUG_REFCOUNTS | ||||
238 | } else { | ||||
239 | count_hit_frame_cache_instances += 1; | ||||
240 | #endif | ||||
241 | } | ||||
242 | |||||
243 | assert(cache_m_frame->m_type_description == NULL); | ||||
244 | generator->m_frame = cache_m_frame; | ||||
245 | // Mark the frame object as in use, ref count 1 will be up for reuse. | ||||
246 | Py_INCREF(generator->m_frame); | ||||
247 | assert(Py_REFCNT(generator->m_frame) == 2); // Frame stack | ||||
248 | |||||
249 | |||||
250 | assert(generator->m_frame->m_frame.f_back == NULL); | ||||
251 | |||||
252 | // Push the new frame as the currently active one, and we should be exclusively | ||||
253 | // owning it. | ||||
254 | pushFrameStackGeneratorCompiledFrame(tstate, generator->m_frame); | ||||
255 | assert(Py_REFCNT(generator->m_frame) == 2); | ||||
256 | |||||
257 | // Framed code: | ||||
258 | { | ||||
259 | PyObject *tmp_expression_value_1; | ||||
260 | NUITKA_MAY_BE_UNUSED PyObject *tmp_yield_result_1; | ||||
261 | tmp_expression_value_1 = mod_consts[1]; | ||||
262 | Py_INCREF(tmp_expression_value_1); | ||||
263 | generator->m_yield_return_index = 1; | ||||
264 | return tmp_expression_value_1; | ||||
265 | yield_return_1: | ||||
266 | if (yield_return_value == NULL) { | ||||
267 | assert(HAS_ERROR_OCCURRED(tstate)); | ||||
268 | |||||
269 | FETCH_ERROR_OCCURRED(tstate, &generator_heap->exception_type, &generator_heap->exception_value, &generator_heap->exception_tb); | ||||
270 | |||||
271 | |||||
272 | generator_heap->exception_lineno = 13; | ||||
273 | |||||
274 | goto frame_exception_exit_1; | ||||
275 | } | ||||
276 | tmp_yield_result_1 = yield_return_value; | ||||
277 | Py_DECREF(tmp_yield_result_1); | ||||
278 | } | ||||
279 | |||||
280 | |||||
281 | |||||
282 | goto frame_no_exception_1; | ||||
283 | frame_exception_exit_1:; | ||||
284 | |||||
285 | // If it's not an exit exception, consider and create a traceback for it. | ||||
286 | if (!EXCEPTION_MATCH_GENERATOR(tstate, generator_heap->exception_type)) { | ||||
287 | if (generator_heap->exception_tb == NULL) { | ||||
288 | generator_heap->exception_tb = MAKE_TRACEBACK(generator->m_frame, generator_heap->exception_lineno); | ||||
289 | } else if (generator_heap->exception_tb->tb_frame != &generator->m_frame->m_frame) { | ||||
290 | generator_heap->exception_tb = ADD_TRACEBACK(generator_heap->exception_tb, generator->m_frame, generator_heap->exception_lineno); | ||||
291 | } | ||||
292 | |||||
293 | Nuitka_Frame_AttachLocals( | ||||
294 | generator->m_frame, | ||||
295 | generator_heap->type_description_1 | ||||
296 | ); | ||||
297 | |||||
298 | |||||
299 | // Release cached frame if used for exception. | ||||
300 | if (generator->m_frame == cache_m_frame) { | ||||
301 | #if _DEBUG_REFCOUNTS | ||||
302 | count_active_frame_cache_instances -= 1; | ||||
303 | count_released_frame_cache_instances += 1; | ||||
304 | #endif | ||||
305 | |||||
306 | Py_DECREF(cache_m_frame); | ||||
307 | cache_m_frame = NULL; | ||||
308 | } | ||||
309 | |||||
310 | assertFrameObject(generator->m_frame); | ||||
311 | } | ||||
312 | |||||
313 | #if PYTHON_VERSION >= 0x300 | ||||
314 | #if PYTHON_VERSION < 0x3b0 | ||||
315 | Py_CLEAR(EXC_TYPE_F(generator)); | ||||
316 | #endif | ||||
317 | Py_CLEAR(EXC_VALUE_F(generator)); | ||||
318 | #if PYTHON_VERSION < 0x3b0 | ||||
319 | Py_CLEAR(EXC_TRACEBACK_F(generator)); | ||||
320 | #endif | ||||
321 | #endif | ||||
322 | |||||
323 | // Return the error. | ||||
324 | goto function_exception_exit; | ||||
325 | |||||
326 | frame_no_exception_1:; | ||||
327 | |||||
328 | |||||
329 | return NULL; | ||||
330 | |||||
331 | function_exception_exit: | ||||
332 | |||||
333 | assert(generator_heap->exception_type); | ||||
334 | RESTORE_ERROR_OCCURRED(tstate, generator_heap->exception_type, generator_heap->exception_value, generator_heap->exception_tb); | ||||
335 | |||||
336 | return NULL; | ||||
337 | |||||
338 | } | ||||
339 | |||||
340 | static PyObject *MAKE_GENERATOR___main__$$$function__1_calledRepeatedly$$$function__1_empty$$$genobj__1_empty() { | ||||
341 | return Nuitka_Generator_New( | ||||
342 | __main__$$$function__1_calledRepeatedly$$$function__1_empty$$$genobj__1_empty_context, | ||||
343 | module___main__, | ||||
344 | mod_consts[0], | ||||
345 | #if PYTHON_VERSION >= 0x350 | ||||
346 | NULL, | ||||
347 | #endif | ||||
348 | codeobj_a832fa0bf2ebcc864c703e0e444a0682, | ||||
349 | NULL, | ||||
350 | 0, | ||||
351 | #if 1 | ||||
352 | sizeof(struct __main__$$$function__1_calledRepeatedly$$$function__1_empty$$$genobj__1_empty_locals) | ||||
353 | #else | ||||
354 | 0 | ||||
355 | #endif | ||||
356 | ); | ||||
357 | } | ||||
358 | |||||
359 | |||||
360 | 98 | ||||
361 | static PyObject *MAKE_FUNCTION___main__$$$function__1_calledRepeatedly() { | 99 | static PyObject *MAKE_FUNCTION___main__$$$function__1_calledRepeatedly() { | ||
362 | struct Nuitka_FunctionObject *result = Nuitka_Function_New( | 100 | struct Nuitka_FunctionObject *result = Nuitka_Function_New( | ||
n | 363 | impl___main__$$$function__1_calledRepeatedly, | n | 101 | NULL, |
364 | mod_consts[7], | 102 | mod_consts[6], | ||
365 | #if PYTHON_VERSION >= 0x300 | 103 | #if PYTHON_VERSION >= 0x300 | ||
366 | NULL, | 104 | NULL, | ||
367 | #endif | 105 | #endif | ||
368 | codeobj_a4be106de002b3f8c9b882761d777cfc, | 106 | codeobj_a4be106de002b3f8c9b882761d777cfc, | ||
369 | NULL, | 107 | NULL, | ||
374 | module___main__, | 112 | module___main__, | ||
375 | NULL, | 113 | NULL, | ||
376 | NULL, | 114 | NULL, | ||
377 | 0 | 115 | 0 | ||
378 | ); | 116 | ); | ||
n | 379 | n | 117 | Nuitka_Function_EnableConstReturnGeneric(result, mod_consts[5]); | |
380 | |||||
381 | return (PyObject *)result; | ||||
382 | } | ||||
383 | |||||
384 | |||||
385 | |||||
386 | static PyObject *MAKE_FUNCTION___main__$$$function__1_calledRepeatedly$$$function__1_empty() { | ||||
387 | struct Nuitka_FunctionObject *result = Nuitka_Function_New( | ||||
388 | impl___main__$$$function__1_calledRepeatedly$$$function__1_empty, | ||||
389 | mod_consts[0], | ||||
390 | #if PYTHON_VERSION >= 0x300 | ||||
391 | NULL, | ||||
392 | #endif | ||||
393 | codeobj_a832fa0bf2ebcc864c703e0e444a0682, | ||||
394 | NULL, | ||||
395 | #if PYTHON_VERSION >= 0x300 | ||||
396 | NULL, | ||||
397 | NULL, | ||||
398 | #endif | ||||
399 | module___main__, | ||||
400 | NULL, | ||||
401 | NULL, | ||||
402 | 0 | ||||
403 | ); | ||||
404 | |||||
405 | 118 | ||||
406 | return (PyObject *)result; | 119 | return (PyObject *)result; | ||
407 | } | 120 | } | ||
408 | 121 | ||||
409 | 122 | ||||
419 | // Provide a way to create find a function via its C code and create it back | 132 | // Provide a way to create find a function via its C code and create it back | ||
420 | // in another process, useful for multiprocessing extensions like dill | 133 | // in another process, useful for multiprocessing extensions like dill | ||
421 | extern void registerDillPluginTables(PyThreadState *tstate, char const *module_name, PyMethodDef *reduce_compiled_function, PyMethodDef *create_compiled_function); | 134 | extern void registerDillPluginTables(PyThreadState *tstate, char const *module_name, PyMethodDef *reduce_compiled_function, PyMethodDef *create_compiled_function); | ||
422 | 135 | ||||
423 | static function_impl_code const function_table___main__[] = { | 136 | static function_impl_code const function_table___main__[] = { | ||
n | 424 | impl___main__$$$function__1_calledRepeatedly$$$function__1_empty, | n | 137 | |
425 | impl___main__$$$function__1_calledRepeatedly, | ||||
426 | NULL | 138 | NULL | ||
427 | }; | 139 | }; | ||
428 | 140 | ||||
429 | static PyObject *_reduce_compiled_function(PyObject *self, PyObject *args, PyObject *kwds) { | 141 | static PyObject *_reduce_compiled_function(PyObject *self, PyObject *args, PyObject *kwds) { | ||
430 | PyObject *func; | 142 | PyObject *func; | ||
772 | 484 | ||||
773 | // Module code. | 485 | // Module code. | ||
774 | { | 486 | { | ||
775 | PyObject *tmp_assign_source_1; | 487 | PyObject *tmp_assign_source_1; | ||
776 | tmp_assign_source_1 = Py_None; | 488 | tmp_assign_source_1 = Py_None; | ||
n | 777 | UPDATE_STRING_DICT0(moduledict___main__, (Nuitka_StringObject *)mod_consts[2], tmp_assign_source_1); | n | 489 | UPDATE_STRING_DICT0(moduledict___main__, (Nuitka_StringObject *)mod_consts[0], tmp_assign_source_1); |
778 | } | 490 | } | ||
779 | { | 491 | { | ||
780 | PyObject *tmp_assign_source_2; | 492 | PyObject *tmp_assign_source_2; | ||
n | 781 | tmp_assign_source_2 = mod_consts[3]; | n | 493 | tmp_assign_source_2 = mod_consts[1]; |
782 | UPDATE_STRING_DICT0(moduledict___main__, (Nuitka_StringObject *)mod_consts[4], tmp_assign_source_2); | 494 | UPDATE_STRING_DICT0(moduledict___main__, (Nuitka_StringObject *)mod_consts[2], tmp_assign_source_2); | ||
783 | } | 495 | } | ||
784 | frame_9ef36c9887d89545de361a09ab309719 = MAKE_MODULE_FRAME(codeobj_9ef36c9887d89545de361a09ab309719, module___main__); | 496 | frame_9ef36c9887d89545de361a09ab309719 = MAKE_MODULE_FRAME(codeobj_9ef36c9887d89545de361a09ab309719, module___main__); | ||
785 | 497 | ||||
786 | // Push the new frame as the currently active one, and we should be exclusively | 498 | // Push the new frame as the currently active one, and we should be exclusively | ||
787 | // owning it. | 499 | // owning it. | ||
793 | PyObject *tmp_assign_source_3; | 505 | PyObject *tmp_assign_source_3; | ||
794 | PyObject *tmp_name_value_1; | 506 | PyObject *tmp_name_value_1; | ||
795 | PyObject *tmp_globals_arg_value_1; | 507 | PyObject *tmp_globals_arg_value_1; | ||
796 | PyObject *tmp_locals_arg_value_1; | 508 | PyObject *tmp_locals_arg_value_1; | ||
797 | PyObject *tmp_fromlist_value_1; | 509 | PyObject *tmp_fromlist_value_1; | ||
n | 798 | tmp_name_value_1 = mod_consts[5]; | n | 510 | tmp_name_value_1 = mod_consts[3]; |
799 | tmp_globals_arg_value_1 = (PyObject *)moduledict___main__; | 511 | tmp_globals_arg_value_1 = (PyObject *)moduledict___main__; | ||
800 | tmp_locals_arg_value_1 = Py_None; | 512 | tmp_locals_arg_value_1 = Py_None; | ||
801 | tmp_fromlist_value_1 = Py_None; | 513 | tmp_fromlist_value_1 = Py_None; | ||
802 | frame_9ef36c9887d89545de361a09ab309719->m_frame.f_lineno = 4; | 514 | frame_9ef36c9887d89545de361a09ab309719->m_frame.f_lineno = 4; | ||
803 | tmp_assign_source_3 = IMPORT_MODULE4(tstate, tmp_name_value_1, tmp_globals_arg_value_1, tmp_locals_arg_value_1, tmp_fromlist_value_1); | 515 | tmp_assign_source_3 = IMPORT_MODULE4(tstate, tmp_name_value_1, tmp_globals_arg_value_1, tmp_locals_arg_value_1, tmp_fromlist_value_1); | ||
809 | 521 | ||||
810 | exception_lineno = 4; | 522 | exception_lineno = 4; | ||
811 | 523 | ||||
812 | goto frame_exception_exit_1; | 524 | goto frame_exception_exit_1; | ||
813 | } | 525 | } | ||
n | 814 | UPDATE_STRING_DICT1(moduledict___main__, (Nuitka_StringObject *)mod_consts[5], tmp_assign_source_3); | n | 526 | UPDATE_STRING_DICT1(moduledict___main__, (Nuitka_StringObject *)mod_consts[3], tmp_assign_source_3); |
815 | } | 527 | } | ||
816 | { | 528 | { | ||
817 | PyObject *tmp_assign_source_4; | 529 | PyObject *tmp_assign_source_4; | ||
818 | tmp_assign_source_4 = Py_None; | 530 | tmp_assign_source_4 = Py_None; | ||
n | 819 | UPDATE_STRING_DICT0(moduledict___main__, (Nuitka_StringObject *)mod_consts[6], tmp_assign_source_4); | n | 531 | UPDATE_STRING_DICT0(moduledict___main__, (Nuitka_StringObject *)mod_consts[4], tmp_assign_source_4); |
820 | } | 532 | } | ||
821 | { | 533 | { | ||
822 | PyObject *tmp_assign_source_5; | 534 | PyObject *tmp_assign_source_5; | ||
823 | 535 | ||||
824 | 536 | ||||
825 | tmp_assign_source_5 = MAKE_FUNCTION___main__$$$function__1_calledRepeatedly(); | 537 | tmp_assign_source_5 = MAKE_FUNCTION___main__$$$function__1_calledRepeatedly(); | ||
826 | 538 | ||||
n | 827 | UPDATE_STRING_DICT1(moduledict___main__, (Nuitka_StringObject *)mod_consts[7], tmp_assign_source_5); | n | 539 | UPDATE_STRING_DICT1(moduledict___main__, (Nuitka_StringObject *)mod_consts[6], tmp_assign_source_5); |
828 | } | 540 | } | ||
829 | { | 541 | { | ||
830 | PyObject *tmp_assign_source_6; | 542 | PyObject *tmp_assign_source_6; | ||
831 | PyObject *tmp_iter_arg_1; | 543 | PyObject *tmp_iter_arg_1; | ||
832 | PyObject *tmp_called_instance_1; | 544 | PyObject *tmp_called_instance_1; | ||
n | 833 | tmp_called_instance_1 = GET_STRING_DICT_VALUE(moduledict___main__, (Nuitka_StringObject *)mod_consts[5]); | n | 545 | tmp_called_instance_1 = GET_STRING_DICT_VALUE(moduledict___main__, (Nuitka_StringObject *)mod_consts[3]); |
834 | 546 | ||||
835 | if (unlikely(tmp_called_instance_1 == NULL)) { | 547 | if (unlikely(tmp_called_instance_1 == NULL)) { | ||
n | 836 | tmp_called_instance_1 = GET_MODULE_VARIABLE_VALUE_FALLBACK(tstate, mod_consts[5]); | n | 548 | tmp_called_instance_1 = GET_MODULE_VARIABLE_VALUE_FALLBACK(tstate, mod_consts[3]); |
837 | } | 549 | } | ||
838 | 550 | ||||
839 | assert(!(tmp_called_instance_1 == NULL)); | 551 | assert(!(tmp_called_instance_1 == NULL)); | ||
840 | frame_9ef36c9887d89545de361a09ab309719->m_frame.f_lineno = 22; | 552 | frame_9ef36c9887d89545de361a09ab309719->m_frame.f_lineno = 22; | ||
841 | tmp_iter_arg_1 = CALL_METHOD_WITH_ARGS2( | 553 | tmp_iter_arg_1 = CALL_METHOD_WITH_ARGS2( | ||
842 | tstate, | 554 | tstate, | ||
843 | tmp_called_instance_1, | 555 | tmp_called_instance_1, | ||
n | 844 | mod_consts[8], | n | 556 | mod_consts[7], |
845 | &PyTuple_GET_ITEM(mod_consts[9], 0) | 557 | &PyTuple_GET_ITEM(mod_consts[8], 0) | ||
846 | ); | 558 | ); | ||
847 | 559 | ||||
848 | if (tmp_iter_arg_1 == NULL) { | 560 | if (tmp_iter_arg_1 == NULL) { | ||
849 | assert(HAS_ERROR_OCCURRED(tstate)); | 561 | assert(HAS_ERROR_OCCURRED(tstate)); | ||
850 | 562 | ||||
900 | } | 612 | } | ||
901 | { | 613 | { | ||
902 | PyObject *tmp_assign_source_8; | 614 | PyObject *tmp_assign_source_8; | ||
903 | CHECK_OBJECT(tmp_for_loop_1__iter_value); | 615 | CHECK_OBJECT(tmp_for_loop_1__iter_value); | ||
904 | tmp_assign_source_8 = tmp_for_loop_1__iter_value; | 616 | tmp_assign_source_8 = tmp_for_loop_1__iter_value; | ||
n | 905 | UPDATE_STRING_DICT0(moduledict___main__, (Nuitka_StringObject *)mod_consts[10], tmp_assign_source_8); | n | 617 | UPDATE_STRING_DICT0(moduledict___main__, (Nuitka_StringObject *)mod_consts[9], tmp_assign_source_8); |
906 | } | 618 | } | ||
907 | { | 619 | { | ||
908 | PyObject *tmp_called_value_1; | 620 | PyObject *tmp_called_value_1; | ||
909 | PyObject *tmp_call_result_1; | 621 | PyObject *tmp_call_result_1; | ||
n | 910 | tmp_called_value_1 = GET_STRING_DICT_VALUE(moduledict___main__, (Nuitka_StringObject *)mod_consts[7]); | n | 622 | tmp_called_value_1 = GET_STRING_DICT_VALUE(moduledict___main__, (Nuitka_StringObject *)mod_consts[6]); |
911 | 623 | ||||
912 | if (unlikely(tmp_called_value_1 == NULL)) { | 624 | if (unlikely(tmp_called_value_1 == NULL)) { | ||
n | 913 | tmp_called_value_1 = GET_MODULE_VARIABLE_VALUE_FALLBACK(tstate, mod_consts[7]); | n | 625 | tmp_called_value_1 = GET_MODULE_VARIABLE_VALUE_FALLBACK(tstate, mod_consts[6]); |
914 | } | 626 | } | ||
915 | 627 | ||||
916 | if (tmp_called_value_1 == NULL) { | 628 | if (tmp_called_value_1 == NULL) { | ||
917 | assert(HAS_ERROR_OCCURRED(tstate)); | 629 | assert(HAS_ERROR_OCCURRED(tstate)); | ||
918 | 630 | ||||
978 | Py_XDECREF(tmp_for_loop_1__iter_value); | 690 | Py_XDECREF(tmp_for_loop_1__iter_value); | ||
979 | tmp_for_loop_1__iter_value = NULL; | 691 | tmp_for_loop_1__iter_value = NULL; | ||
980 | CHECK_OBJECT(tmp_for_loop_1__for_iterator); | 692 | CHECK_OBJECT(tmp_for_loop_1__for_iterator); | ||
981 | Py_DECREF(tmp_for_loop_1__for_iterator); | 693 | Py_DECREF(tmp_for_loop_1__for_iterator); | ||
982 | tmp_for_loop_1__for_iterator = NULL; | 694 | tmp_for_loop_1__for_iterator = NULL; | ||
t | 983 | tmp_print_value = mod_consts[11]; | t | 695 | tmp_print_value = mod_consts[10]; |
984 | tmp_result = PRINT_ITEM(tmp_print_value); | 696 | tmp_result = PRINT_ITEM(tmp_print_value); | ||
985 | if (tmp_result == false) { | 697 | if (tmp_result == false) { | ||
986 | assert(HAS_ERROR_OCCURRED(tstate)); | 698 | assert(HAS_ERROR_OCCURRED(tstate)); | ||
987 | 699 | ||||
988 | FETCH_ERROR_OCCURRED(tstate, &exception_type, &exception_value, &exception_tb); | 700 | FETCH_ERROR_OCCURRED(tstate, &exception_type, &exception_value, &exception_tb); |