Construct FunctionEmpty
Source Code with Construct
def empty(): pass module_var = None def calledRepeatedly(called): # Force a frame for now module_var # construct_begin called() # construct_end return called import itertools for x in itertools.repeat(None, 50000): calledRepeatedly(empty) print("OK.")
Source Code without Construct
def empty(): pass module_var = None def calledRepeatedly(called): # Force a frame for now module_var # construct_begin return called import itertools for x in itertools.repeat(None, 50000): calledRepeatedly(empty) print("OK.")
Context Diff of Source Code
Construct | Baseline | ||||
---|---|---|---|---|---|
27 | def calledRepeatedly(called): | 27 | def calledRepeatedly(called): | ||
28 | # Force a frame for now | 28 | # Force a frame for now | ||
29 | module_var | 29 | module_var | ||
30 | 30 | ||||
31 | # construct_begin | 31 | # construct_begin | ||
t | 32 | called() | t | 32 | |
33 | # construct_end | 33 | |||
34 | 34 | ||||
35 | return called | 35 | return called | ||
36 | 36 | ||||
37 | import itertools | 37 | import itertools | ||
38 | for x in itertools.repeat(None, 50000): | 38 | for x in itertools.repeat(None, 50000): |
Context Diff of Generated Code
Construct | Baseline | ||||
---|---|---|---|---|---|
153 | 153 | ||||
154 | exception_lineno = 29; | 154 | exception_lineno = 29; | ||
155 | type_description_1 = "o"; | 155 | type_description_1 = "o"; | ||
156 | goto frame_exception_exit_1; | 156 | goto frame_exception_exit_1; | ||
157 | } | 157 | } | ||
t | 158 | } | t | ||
159 | { | ||||
160 | PyObject *tmp_called_name_1; | ||||
161 | PyObject *tmp_call_result_1; | ||||
162 | CHECK_OBJECT(par_called); | ||||
163 | tmp_called_name_1 = par_called; | ||||
164 | frame_a064e3544c4d829f3f5edb3355b0e7d4->m_frame.f_lineno = 32; | ||||
165 | tmp_call_result_1 = CALL_FUNCTION_NO_ARGS(tmp_called_name_1); | ||||
166 | if (tmp_call_result_1 == NULL) { | ||||
167 | assert(ERROR_OCCURRED()); | ||||
168 | |||||
169 | FETCH_ERROR_OCCURRED(&exception_type, &exception_value, &exception_tb); | ||||
170 | |||||
171 | |||||
172 | exception_lineno = 32; | ||||
173 | type_description_1 = "o"; | ||||
174 | goto frame_exception_exit_1; | ||||
175 | } | ||||
176 | Py_DECREF(tmp_call_result_1); | ||||
177 | } | 158 | } | ||
178 | 159 | ||||
179 | #if 0 | 160 | #if 0 | ||
180 | RESTORE_FRAME_EXCEPTION(frame_a064e3544c4d829f3f5edb3355b0e7d4); | 161 | RESTORE_FRAME_EXCEPTION(frame_a064e3544c4d829f3f5edb3355b0e7d4); | ||
181 | #endif | 162 | #endif |