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[15]; | 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[15]; | 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 < 15; 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 < 15; 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_886c97ecf838344124b077b0f8517d1f; | 81 | static PyCodeObject *codeobj_886c97ecf838344124b077b0f8517d1f; | ||
82 | static PyCodeObject *codeobj_f0147ad0e4af28af5a9185bd34db7b79; | 82 | static PyCodeObject *codeobj_f0147ad0e4af28af5a9185bd34db7b79; | ||
n | 83 | static PyCodeObject *codeobj_26c8c4677279ec4dd904cd044562a844; | 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_886c97ecf838344124b077b0f8517d1f = MAKE_CODE_OBJECT(module_filename_obj, 1, CO_NOFREE, mod_consts[12], mod_consts[12], NULL, NULL, 0, 0, 0); | 88 | codeobj_886c97ecf838344124b077b0f8517d1f = MAKE_CODE_OBJECT(module_filename_obj, 1, CO_NOFREE, mod_consts[11], mod_consts[11], NULL, NULL, 0, 0, 0); | ||
90 | codeobj_main = codeobj_886c97ecf838344124b077b0f8517d1f; | 89 | codeobj_main = codeobj_886c97ecf838344124b077b0f8517d1f; | ||
n | 91 | codeobj_f0147ad0e4af28af5a9185bd34db7b79 = 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_f0147ad0e4af28af5a9185bd34db7b79 = 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_26c8c4677279ec4dd904cd044562a844 = MAKE_CODE_OBJECT(module_filename_obj, 12, CO_GENERATOR | CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE, mod_consts[0], mod_consts[14], 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_26c8c4677279ec4dd904cd044562a844, 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_26c8c4677279ec4dd904cd044562a844, | ||||
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_f0147ad0e4af28af5a9185bd34db7b79, | 106 | codeobj_f0147ad0e4af28af5a9185bd34db7b79, | ||
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_26c8c4677279ec4dd904cd044562a844, | ||||
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; | ||
775 | 487 | ||||
776 | // Module code. | 488 | // Module code. | ||
777 | { | 489 | { | ||
778 | PyObject *tmp_assign_source_1; | 490 | PyObject *tmp_assign_source_1; | ||
779 | tmp_assign_source_1 = Py_None; | 491 | tmp_assign_source_1 = Py_None; | ||
n | 780 | UPDATE_STRING_DICT0(moduledict___main__, (Nuitka_StringObject *)mod_consts[2], tmp_assign_source_1); | n | 492 | UPDATE_STRING_DICT0(moduledict___main__, (Nuitka_StringObject *)mod_consts[0], tmp_assign_source_1); |
781 | } | 493 | } | ||
782 | { | 494 | { | ||
783 | PyObject *tmp_assign_source_2; | 495 | PyObject *tmp_assign_source_2; | ||
n | 784 | tmp_assign_source_2 = mod_consts[3]; | n | 496 | tmp_assign_source_2 = mod_consts[1]; |
785 | UPDATE_STRING_DICT0(moduledict___main__, (Nuitka_StringObject *)mod_consts[4], tmp_assign_source_2); | 497 | UPDATE_STRING_DICT0(moduledict___main__, (Nuitka_StringObject *)mod_consts[2], tmp_assign_source_2); | ||
786 | } | 498 | } | ||
787 | frame_886c97ecf838344124b077b0f8517d1f = MAKE_MODULE_FRAME(codeobj_886c97ecf838344124b077b0f8517d1f, module___main__); | 499 | frame_886c97ecf838344124b077b0f8517d1f = MAKE_MODULE_FRAME(codeobj_886c97ecf838344124b077b0f8517d1f, module___main__); | ||
788 | 500 | ||||
789 | // Push the new frame as the currently active one, and we should be exclusively | 501 | // Push the new frame as the currently active one, and we should be exclusively | ||
790 | // owning it. | 502 | // owning it. | ||
796 | PyObject *tmp_assign_source_3; | 508 | PyObject *tmp_assign_source_3; | ||
797 | PyObject *tmp_name_value_1; | 509 | PyObject *tmp_name_value_1; | ||
798 | PyObject *tmp_globals_arg_value_1; | 510 | PyObject *tmp_globals_arg_value_1; | ||
799 | PyObject *tmp_locals_arg_value_1; | 511 | PyObject *tmp_locals_arg_value_1; | ||
800 | PyObject *tmp_fromlist_value_1; | 512 | PyObject *tmp_fromlist_value_1; | ||
n | 801 | tmp_name_value_1 = mod_consts[5]; | n | 513 | tmp_name_value_1 = mod_consts[3]; |
802 | tmp_globals_arg_value_1 = (PyObject *)moduledict___main__; | 514 | tmp_globals_arg_value_1 = (PyObject *)moduledict___main__; | ||
803 | tmp_locals_arg_value_1 = Py_None; | 515 | tmp_locals_arg_value_1 = Py_None; | ||
804 | tmp_fromlist_value_1 = Py_None; | 516 | tmp_fromlist_value_1 = Py_None; | ||
805 | frame_886c97ecf838344124b077b0f8517d1f->m_frame.f_lineno = 4; | 517 | frame_886c97ecf838344124b077b0f8517d1f->m_frame.f_lineno = 4; | ||
806 | 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); | 518 | 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); | ||
812 | 524 | ||||
813 | exception_lineno = 4; | 525 | exception_lineno = 4; | ||
814 | 526 | ||||
815 | goto frame_exception_exit_1; | 527 | goto frame_exception_exit_1; | ||
816 | } | 528 | } | ||
n | 817 | UPDATE_STRING_DICT1(moduledict___main__, (Nuitka_StringObject *)mod_consts[5], tmp_assign_source_3); | n | 529 | UPDATE_STRING_DICT1(moduledict___main__, (Nuitka_StringObject *)mod_consts[3], tmp_assign_source_3); |
818 | } | 530 | } | ||
819 | { | 531 | { | ||
820 | PyObject *tmp_assign_source_4; | 532 | PyObject *tmp_assign_source_4; | ||
821 | tmp_assign_source_4 = Py_None; | 533 | tmp_assign_source_4 = Py_None; | ||
n | 822 | UPDATE_STRING_DICT0(moduledict___main__, (Nuitka_StringObject *)mod_consts[6], tmp_assign_source_4); | n | 534 | UPDATE_STRING_DICT0(moduledict___main__, (Nuitka_StringObject *)mod_consts[4], tmp_assign_source_4); |
823 | } | 535 | } | ||
824 | { | 536 | { | ||
825 | PyObject *tmp_assign_source_5; | 537 | PyObject *tmp_assign_source_5; | ||
826 | 538 | ||||
827 | 539 | ||||
828 | tmp_assign_source_5 = MAKE_FUNCTION___main__$$$function__1_calledRepeatedly(); | 540 | tmp_assign_source_5 = MAKE_FUNCTION___main__$$$function__1_calledRepeatedly(); | ||
829 | 541 | ||||
n | 830 | UPDATE_STRING_DICT1(moduledict___main__, (Nuitka_StringObject *)mod_consts[7], tmp_assign_source_5); | n | 542 | UPDATE_STRING_DICT1(moduledict___main__, (Nuitka_StringObject *)mod_consts[6], tmp_assign_source_5); |
831 | } | 543 | } | ||
832 | { | 544 | { | ||
833 | PyObject *tmp_assign_source_6; | 545 | PyObject *tmp_assign_source_6; | ||
834 | PyObject *tmp_iter_arg_1; | 546 | PyObject *tmp_iter_arg_1; | ||
835 | PyObject *tmp_called_instance_1; | 547 | PyObject *tmp_called_instance_1; | ||
n | 836 | tmp_called_instance_1 = GET_STRING_DICT_VALUE(moduledict___main__, (Nuitka_StringObject *)mod_consts[5]); | n | 548 | tmp_called_instance_1 = GET_STRING_DICT_VALUE(moduledict___main__, (Nuitka_StringObject *)mod_consts[3]); |
837 | 549 | ||||
838 | if (unlikely(tmp_called_instance_1 == NULL)) { | 550 | if (unlikely(tmp_called_instance_1 == NULL)) { | ||
n | 839 | tmp_called_instance_1 = GET_MODULE_VARIABLE_VALUE_FALLBACK(tstate, mod_consts[5]); | n | 551 | tmp_called_instance_1 = GET_MODULE_VARIABLE_VALUE_FALLBACK(tstate, mod_consts[3]); |
840 | } | 552 | } | ||
841 | 553 | ||||
842 | assert(!(tmp_called_instance_1 == NULL)); | 554 | assert(!(tmp_called_instance_1 == NULL)); | ||
843 | frame_886c97ecf838344124b077b0f8517d1f->m_frame.f_lineno = 22; | 555 | frame_886c97ecf838344124b077b0f8517d1f->m_frame.f_lineno = 22; | ||
844 | tmp_iter_arg_1 = CALL_METHOD_WITH_ARGS2( | 556 | tmp_iter_arg_1 = CALL_METHOD_WITH_ARGS2( | ||
845 | tstate, | 557 | tstate, | ||
846 | tmp_called_instance_1, | 558 | tmp_called_instance_1, | ||
n | 847 | mod_consts[8], | n | 559 | mod_consts[7], |
848 | &PyTuple_GET_ITEM(mod_consts[9], 0) | 560 | &PyTuple_GET_ITEM(mod_consts[8], 0) | ||
849 | ); | 561 | ); | ||
850 | 562 | ||||
851 | if (tmp_iter_arg_1 == NULL) { | 563 | if (tmp_iter_arg_1 == NULL) { | ||
852 | assert(HAS_ERROR_OCCURRED(tstate)); | 564 | assert(HAS_ERROR_OCCURRED(tstate)); | ||
853 | 565 | ||||
903 | } | 615 | } | ||
904 | { | 616 | { | ||
905 | PyObject *tmp_assign_source_8; | 617 | PyObject *tmp_assign_source_8; | ||
906 | CHECK_OBJECT(tmp_for_loop_1__iter_value); | 618 | CHECK_OBJECT(tmp_for_loop_1__iter_value); | ||
907 | tmp_assign_source_8 = tmp_for_loop_1__iter_value; | 619 | tmp_assign_source_8 = tmp_for_loop_1__iter_value; | ||
n | 908 | UPDATE_STRING_DICT0(moduledict___main__, (Nuitka_StringObject *)mod_consts[10], tmp_assign_source_8); | n | 620 | UPDATE_STRING_DICT0(moduledict___main__, (Nuitka_StringObject *)mod_consts[9], tmp_assign_source_8); |
909 | } | 621 | } | ||
910 | { | 622 | { | ||
911 | PyObject *tmp_called_value_1; | 623 | PyObject *tmp_called_value_1; | ||
912 | PyObject *tmp_call_result_1; | 624 | PyObject *tmp_call_result_1; | ||
n | 913 | tmp_called_value_1 = GET_STRING_DICT_VALUE(moduledict___main__, (Nuitka_StringObject *)mod_consts[7]); | n | 625 | tmp_called_value_1 = GET_STRING_DICT_VALUE(moduledict___main__, (Nuitka_StringObject *)mod_consts[6]); |
914 | 626 | ||||
915 | if (unlikely(tmp_called_value_1 == NULL)) { | 627 | if (unlikely(tmp_called_value_1 == NULL)) { | ||
n | 916 | tmp_called_value_1 = GET_MODULE_VARIABLE_VALUE_FALLBACK(tstate, mod_consts[7]); | n | 628 | tmp_called_value_1 = GET_MODULE_VARIABLE_VALUE_FALLBACK(tstate, mod_consts[6]); |
917 | } | 629 | } | ||
918 | 630 | ||||
919 | if (tmp_called_value_1 == NULL) { | 631 | if (tmp_called_value_1 == NULL) { | ||
920 | assert(HAS_ERROR_OCCURRED(tstate)); | 632 | assert(HAS_ERROR_OCCURRED(tstate)); | ||
921 | 633 | ||||
981 | Py_XDECREF(tmp_for_loop_1__iter_value); | 693 | Py_XDECREF(tmp_for_loop_1__iter_value); | ||
982 | tmp_for_loop_1__iter_value = NULL; | 694 | tmp_for_loop_1__iter_value = NULL; | ||
983 | CHECK_OBJECT(tmp_for_loop_1__for_iterator); | 695 | CHECK_OBJECT(tmp_for_loop_1__for_iterator); | ||
984 | Py_DECREF(tmp_for_loop_1__for_iterator); | 696 | Py_DECREF(tmp_for_loop_1__for_iterator); | ||
985 | tmp_for_loop_1__for_iterator = NULL; | 697 | tmp_for_loop_1__for_iterator = NULL; | ||
t | 986 | tmp_print_value = mod_consts[11]; | t | 698 | tmp_print_value = mod_consts[10]; |
987 | tmp_result = PRINT_ITEM(tmp_print_value); | 699 | tmp_result = PRINT_ITEM(tmp_print_value); | ||
988 | if (tmp_result == false) { | 700 | if (tmp_result == false) { | ||
989 | assert(HAS_ERROR_OCCURRED(tstate)); | 701 | assert(HAS_ERROR_OCCURRED(tstate)); | ||
990 | 702 | ||||
991 | FETCH_ERROR_OCCURRED(tstate, &exception_type, &exception_value, &exception_tb); | 703 | FETCH_ERROR_OCCURRED(tstate, &exception_type, &exception_value, &exception_tb); |