Branch data Line data Source code
1 : : // This file is generated by Tools/cases_generator/generate_cases.py
2 : : // from:
3 : : // Python/bytecodes.c
4 : : // Do not edit!
5 : :
6 : 383992 : TARGET(NOP) {
7 : 383992 : DISPATCH();
8 : : }
9 : :
10 [ + + ]: 4035495 : TARGET(RESUME) {
11 : : #line 89 "Python/bytecodes.c"
12 : : assert(tstate->cframe == &cframe);
13 : : assert(frame == cframe.current_frame);
14 : : if (_Py_atomic_load_relaxed_int32(eval_breaker) && oparg < 2) {
15 : : goto handle_eval_breaker;
16 : : }
17 : : #line 18 "Python/generated_cases.c.h"
18 : 4035436 : DISPATCH();
19 : : }
20 : :
21 [ - + ]: 46173 : TARGET(LOAD_CLOSURE) {
22 : : PyObject *value;
23 : : #line 97 "Python/bytecodes.c"
24 : : /* We keep LOAD_CLOSURE so that the bytecode stays more readable. */
25 : : value = GETLOCAL(oparg);
26 : : if (value == NULL) goto unbound_local_error;
27 : : Py_INCREF(value);
28 : : #line 29 "Python/generated_cases.c.h"
29 : 46173 : STACK_GROW(1);
30 : 46173 : stack_pointer[-1] = value;
31 : 46173 : DISPATCH();
32 : : }
33 : :
34 [ - + ]: 3012 : TARGET(LOAD_FAST_CHECK) {
35 : : PyObject *value;
36 : : #line 104 "Python/bytecodes.c"
37 : : value = GETLOCAL(oparg);
38 : : if (value == NULL) goto unbound_local_error;
39 : : Py_INCREF(value);
40 : : #line 41 "Python/generated_cases.c.h"
41 : 3012 : STACK_GROW(1);
42 : 3012 : stack_pointer[-1] = value;
43 : 3012 : DISPATCH();
44 : : }
45 : :
46 : 17197868 : TARGET(LOAD_FAST) {
47 : : PyObject *value;
48 : : #line 110 "Python/bytecodes.c"
49 : : value = GETLOCAL(oparg);
50 : : assert(value != NULL);
51 : : Py_INCREF(value);
52 : : #line 53 "Python/generated_cases.c.h"
53 : 17197868 : STACK_GROW(1);
54 : 17197868 : stack_pointer[-1] = value;
55 : 17197868 : DISPATCH();
56 : : }
57 : :
58 : 3477988 : TARGET(LOAD_CONST) {
59 : 3477988 : PREDICTED(LOAD_CONST);
60 : : PyObject *value;
61 : : #line 116 "Python/bytecodes.c"
62 : : value = GETITEM(frame->f_code->co_consts, oparg);
63 : : Py_INCREF(value);
64 : : #line 65 "Python/generated_cases.c.h"
65 : 3477988 : STACK_GROW(1);
66 : 3477988 : stack_pointer[-1] = value;
67 : 3477988 : DISPATCH();
68 : : }
69 : :
70 : 3795677 : TARGET(STORE_FAST) {
71 [ + + ]: 3795677 : PyObject *value = stack_pointer[-1];
72 : : #line 121 "Python/bytecodes.c"
73 : : SETLOCAL(oparg, value);
74 : : #line 75 "Python/generated_cases.c.h"
75 : 3795677 : STACK_SHRINK(1);
76 : 3795677 : DISPATCH();
77 : : }
78 : :
79 : 6611510 : TARGET(LOAD_FAST__LOAD_FAST) {
80 : : PyObject *_tmp_1;
81 : : PyObject *_tmp_2;
82 : : {
83 : : PyObject *value;
84 : : #line 110 "Python/bytecodes.c"
85 : : value = GETLOCAL(oparg);
86 : : assert(value != NULL);
87 : : Py_INCREF(value);
88 : : #line 89 "Python/generated_cases.c.h"
89 : 6611510 : _tmp_2 = value;
90 : : }
91 : 6611510 : oparg = (next_instr++)->op.arg;
92 : : {
93 : : PyObject *value;
94 : : #line 110 "Python/bytecodes.c"
95 : : value = GETLOCAL(oparg);
96 : : assert(value != NULL);
97 : : Py_INCREF(value);
98 : : #line 99 "Python/generated_cases.c.h"
99 : 6611510 : _tmp_1 = value;
100 : : }
101 : 6611510 : STACK_GROW(2);
102 : 6611510 : stack_pointer[-1] = _tmp_1;
103 : 6611510 : stack_pointer[-2] = _tmp_2;
104 : 6611510 : DISPATCH();
105 : : }
106 : :
107 : 1272619 : TARGET(LOAD_FAST__LOAD_CONST) {
108 : : PyObject *_tmp_1;
109 : : PyObject *_tmp_2;
110 : : {
111 : : PyObject *value;
112 : : #line 110 "Python/bytecodes.c"
113 : : value = GETLOCAL(oparg);
114 : : assert(value != NULL);
115 : : Py_INCREF(value);
116 : : #line 117 "Python/generated_cases.c.h"
117 : 1272619 : _tmp_2 = value;
118 : : }
119 : 1272619 : oparg = (next_instr++)->op.arg;
120 : : {
121 : : PyObject *value;
122 : : #line 116 "Python/bytecodes.c"
123 : : value = GETITEM(frame->f_code->co_consts, oparg);
124 : : Py_INCREF(value);
125 : : #line 126 "Python/generated_cases.c.h"
126 : 1272619 : _tmp_1 = value;
127 : : }
128 : 1272619 : STACK_GROW(2);
129 : 1272619 : stack_pointer[-1] = _tmp_1;
130 : 1272619 : stack_pointer[-2] = _tmp_2;
131 : 1272619 : DISPATCH();
132 : : }
133 : :
134 : 3895432 : TARGET(STORE_FAST__LOAD_FAST) {
135 : 3895432 : PyObject *_tmp_1 = stack_pointer[-1];
136 : : {
137 [ + + ]: 3895432 : PyObject *value = _tmp_1;
138 : : #line 121 "Python/bytecodes.c"
139 : : SETLOCAL(oparg, value);
140 : : #line 141 "Python/generated_cases.c.h"
141 : : }
142 : 3895432 : oparg = (next_instr++)->op.arg;
143 : : {
144 : : PyObject *value;
145 : : #line 110 "Python/bytecodes.c"
146 : : value = GETLOCAL(oparg);
147 : : assert(value != NULL);
148 : : Py_INCREF(value);
149 : : #line 150 "Python/generated_cases.c.h"
150 : 3895432 : _tmp_1 = value;
151 : : }
152 : 3895432 : stack_pointer[-1] = _tmp_1;
153 : 3895432 : DISPATCH();
154 : : }
155 : :
156 : 2334263 : TARGET(STORE_FAST__STORE_FAST) {
157 : 2334263 : PyObject *_tmp_1 = stack_pointer[-1];
158 : 2334263 : PyObject *_tmp_2 = stack_pointer[-2];
159 : : {
160 [ + + ]: 2334263 : PyObject *value = _tmp_1;
161 : : #line 121 "Python/bytecodes.c"
162 : : SETLOCAL(oparg, value);
163 : : #line 164 "Python/generated_cases.c.h"
164 : : }
165 : 2334263 : oparg = (next_instr++)->op.arg;
166 : : {
167 [ + + ]: 2334263 : PyObject *value = _tmp_2;
168 : : #line 121 "Python/bytecodes.c"
169 : : SETLOCAL(oparg, value);
170 : : #line 171 "Python/generated_cases.c.h"
171 : : }
172 : 2334263 : STACK_SHRINK(2);
173 : 2334263 : DISPATCH();
174 : : }
175 : :
176 : 936610 : TARGET(LOAD_CONST__LOAD_FAST) {
177 : : PyObject *_tmp_1;
178 : : PyObject *_tmp_2;
179 : : {
180 : : PyObject *value;
181 : : #line 116 "Python/bytecodes.c"
182 : : value = GETITEM(frame->f_code->co_consts, oparg);
183 : : Py_INCREF(value);
184 : : #line 185 "Python/generated_cases.c.h"
185 : 936610 : _tmp_2 = value;
186 : : }
187 : 936610 : oparg = (next_instr++)->op.arg;
188 : : {
189 : : PyObject *value;
190 : : #line 110 "Python/bytecodes.c"
191 : : value = GETLOCAL(oparg);
192 : : assert(value != NULL);
193 : : Py_INCREF(value);
194 : : #line 195 "Python/generated_cases.c.h"
195 : 936610 : _tmp_1 = value;
196 : : }
197 : 936610 : STACK_GROW(2);
198 : 936610 : stack_pointer[-1] = _tmp_1;
199 : 936610 : stack_pointer[-2] = _tmp_2;
200 : 936610 : DISPATCH();
201 : : }
202 : :
203 : 1797369 : TARGET(POP_TOP) {
204 : 1797369 : PyObject *value = stack_pointer[-1];
205 : : #line 131 "Python/bytecodes.c"
206 : : #line 207 "Python/generated_cases.c.h"
207 [ + + ]: 1797369 : Py_DECREF(value);
208 : 1797369 : STACK_SHRINK(1);
209 : 1797369 : DISPATCH();
210 : : }
211 : :
212 : 1841863 : TARGET(PUSH_NULL) {
213 : : PyObject *res;
214 : : #line 135 "Python/bytecodes.c"
215 : : res = NULL;
216 : : #line 217 "Python/generated_cases.c.h"
217 : 1841863 : STACK_GROW(1);
218 : 1841863 : stack_pointer[-1] = res;
219 : 1841863 : DISPATCH();
220 : : }
221 : :
222 : 69 : TARGET(END_FOR) {
223 : 69 : PyObject *_tmp_1 = stack_pointer[-1];
224 : 69 : PyObject *_tmp_2 = stack_pointer[-2];
225 : : {
226 : 69 : PyObject *value = _tmp_1;
227 : : #line 131 "Python/bytecodes.c"
228 : : #line 229 "Python/generated_cases.c.h"
229 [ - + ]: 69 : Py_DECREF(value);
230 : : }
231 : : {
232 : 69 : PyObject *value = _tmp_2;
233 : : #line 131 "Python/bytecodes.c"
234 : : #line 235 "Python/generated_cases.c.h"
235 [ + + ]: 69 : Py_DECREF(value);
236 : : }
237 : 69 : STACK_SHRINK(2);
238 : 69 : DISPATCH();
239 : : }
240 : :
241 : 45079 : TARGET(UNARY_NEGATIVE) {
242 : 45079 : PyObject *value = stack_pointer[-1];
243 : : PyObject *res;
244 : : #line 141 "Python/bytecodes.c"
245 : : res = PyNumber_Negative(value);
246 : : #line 247 "Python/generated_cases.c.h"
247 [ + + ]: 45079 : Py_DECREF(value);
248 : : #line 143 "Python/bytecodes.c"
249 : : if (res == NULL) goto pop_1_error;
250 : : #line 251 "Python/generated_cases.c.h"
251 : 45079 : stack_pointer[-1] = res;
252 : 45079 : DISPATCH();
253 : : }
254 : :
255 : 636 : TARGET(UNARY_NOT) {
256 : 636 : PyObject *value = stack_pointer[-1];
257 : : PyObject *res;
258 : : #line 147 "Python/bytecodes.c"
259 : : int err = PyObject_IsTrue(value);
260 : : #line 261 "Python/generated_cases.c.h"
261 [ - + ]: 636 : Py_DECREF(value);
262 : : #line 149 "Python/bytecodes.c"
263 : : if (err < 0) goto pop_1_error;
264 : : if (err == 0) {
265 : : res = Py_True;
266 : : }
267 : : else {
268 : : res = Py_False;
269 : : }
270 : : Py_INCREF(res);
271 : : #line 272 "Python/generated_cases.c.h"
272 : 636 : stack_pointer[-1] = res;
273 : 636 : DISPATCH();
274 : : }
275 : :
276 : 18211 : TARGET(UNARY_INVERT) {
277 : 18211 : PyObject *value = stack_pointer[-1];
278 : : PyObject *res;
279 : : #line 160 "Python/bytecodes.c"
280 : : res = PyNumber_Invert(value);
281 : : #line 282 "Python/generated_cases.c.h"
282 [ + + ]: 18211 : Py_DECREF(value);
283 : : #line 162 "Python/bytecodes.c"
284 : : if (res == NULL) goto pop_1_error;
285 : : #line 286 "Python/generated_cases.c.h"
286 : 18211 : stack_pointer[-1] = res;
287 : 18211 : DISPATCH();
288 : : }
289 : :
290 : 439353 : TARGET(BINARY_OP_MULTIPLY_INT) {
291 : 439353 : PyObject *right = stack_pointer[-1];
292 [ + + ]: 439353 : PyObject *left = stack_pointer[-2];
293 : : PyObject *prod;
294 : : #line 179 "Python/bytecodes.c"
295 : : assert(cframe.use_tracing == 0);
296 : : DEOPT_IF(!PyLong_CheckExact(left), BINARY_OP);
297 : : DEOPT_IF(!PyLong_CheckExact(right), BINARY_OP);
298 : : STAT_INC(BINARY_OP, hit);
299 : : prod = _PyLong_Multiply((PyLongObject *)left, (PyLongObject *)right);
300 : : _Py_DECREF_SPECIALIZED(right, (destructor)PyObject_Free);
301 : : _Py_DECREF_SPECIALIZED(left, (destructor)PyObject_Free);
302 : : if (prod == NULL) goto pop_2_error;
303 : : #line 304 "Python/generated_cases.c.h"
304 : 439275 : STACK_SHRINK(1);
305 : 439275 : stack_pointer[-1] = prod;
306 : 439275 : next_instr += 1;
307 : 439275 : DISPATCH();
308 : : }
309 : :
310 : 602046 : TARGET(BINARY_OP_MULTIPLY_FLOAT) {
311 : 602046 : PyObject *right = stack_pointer[-1];
312 [ + + ]: 602046 : PyObject *left = stack_pointer[-2];
313 : : PyObject *prod;
314 : : #line 190 "Python/bytecodes.c"
315 : : assert(cframe.use_tracing == 0);
316 : : DEOPT_IF(!PyFloat_CheckExact(left), BINARY_OP);
317 : : DEOPT_IF(!PyFloat_CheckExact(right), BINARY_OP);
318 : : STAT_INC(BINARY_OP, hit);
319 : : double dprod = ((PyFloatObject *)left)->ob_fval *
320 : : ((PyFloatObject *)right)->ob_fval;
321 : : DECREF_INPUTS_AND_REUSE_FLOAT(left, right, dprod, prod);
322 : : #line 323 "Python/generated_cases.c.h"
323 : 602045 : STACK_SHRINK(1);
324 : 602045 : stack_pointer[-1] = prod;
325 : 602045 : next_instr += 1;
326 : 602045 : DISPATCH();
327 : : }
328 : :
329 : 1662277 : TARGET(BINARY_OP_SUBTRACT_INT) {
330 : 1662277 : PyObject *right = stack_pointer[-1];
331 [ - + ]: 1662277 : PyObject *left = stack_pointer[-2];
332 : : PyObject *sub;
333 : : #line 200 "Python/bytecodes.c"
334 : : assert(cframe.use_tracing == 0);
335 : : DEOPT_IF(!PyLong_CheckExact(left), BINARY_OP);
336 : : DEOPT_IF(!PyLong_CheckExact(right), BINARY_OP);
337 : : STAT_INC(BINARY_OP, hit);
338 : : sub = _PyLong_Subtract((PyLongObject *)left, (PyLongObject *)right);
339 : : _Py_DECREF_SPECIALIZED(right, (destructor)PyObject_Free);
340 : : _Py_DECREF_SPECIALIZED(left, (destructor)PyObject_Free);
341 : : if (sub == NULL) goto pop_2_error;
342 : : #line 343 "Python/generated_cases.c.h"
343 : 1662277 : STACK_SHRINK(1);
344 : 1662277 : stack_pointer[-1] = sub;
345 : 1662277 : next_instr += 1;
346 : 1662277 : DISPATCH();
347 : : }
348 : :
349 : 655270 : TARGET(BINARY_OP_SUBTRACT_FLOAT) {
350 : 655270 : PyObject *right = stack_pointer[-1];
351 [ - + ]: 655270 : PyObject *left = stack_pointer[-2];
352 : : PyObject *sub;
353 : : #line 211 "Python/bytecodes.c"
354 : : assert(cframe.use_tracing == 0);
355 : : DEOPT_IF(!PyFloat_CheckExact(left), BINARY_OP);
356 : : DEOPT_IF(!PyFloat_CheckExact(right), BINARY_OP);
357 : : STAT_INC(BINARY_OP, hit);
358 : : double dsub = ((PyFloatObject *)left)->ob_fval - ((PyFloatObject *)right)->ob_fval;
359 : : DECREF_INPUTS_AND_REUSE_FLOAT(left, right, dsub, sub);
360 : : #line 361 "Python/generated_cases.c.h"
361 : 654271 : STACK_SHRINK(1);
362 : 654271 : stack_pointer[-1] = sub;
363 : 654271 : next_instr += 1;
364 : 654271 : DISPATCH();
365 : : }
366 : :
367 : 92351 : TARGET(BINARY_OP_ADD_UNICODE) {
368 : 92351 : PyObject *right = stack_pointer[-1];
369 [ - + ]: 92351 : PyObject *left = stack_pointer[-2];
370 : : PyObject *res;
371 : : #line 220 "Python/bytecodes.c"
372 : : assert(cframe.use_tracing == 0);
373 : : DEOPT_IF(!PyUnicode_CheckExact(left), BINARY_OP);
374 : : DEOPT_IF(Py_TYPE(right) != Py_TYPE(left), BINARY_OP);
375 : : STAT_INC(BINARY_OP, hit);
376 : : res = PyUnicode_Concat(left, right);
377 : : _Py_DECREF_SPECIALIZED(left, _PyUnicode_ExactDealloc);
378 : : _Py_DECREF_SPECIALIZED(right, _PyUnicode_ExactDealloc);
379 : : if (res == NULL) goto pop_2_error;
380 : : #line 381 "Python/generated_cases.c.h"
381 : 92351 : STACK_SHRINK(1);
382 : 92351 : stack_pointer[-1] = res;
383 : 92351 : next_instr += 1;
384 : 92351 : DISPATCH();
385 : : }
386 : :
387 : 2240 : TARGET(BINARY_OP_INPLACE_ADD_UNICODE) {
388 : 2240 : PyObject *right = stack_pointer[-1];
389 [ - + ]: 2240 : PyObject *left = stack_pointer[-2];
390 : : #line 237 "Python/bytecodes.c"
391 : : assert(cframe.use_tracing == 0);
392 : : DEOPT_IF(!PyUnicode_CheckExact(left), BINARY_OP);
393 : : DEOPT_IF(Py_TYPE(right) != Py_TYPE(left), BINARY_OP);
394 : : _Py_CODEUNIT true_next = next_instr[INLINE_CACHE_ENTRIES_BINARY_OP];
395 : : assert(true_next.op.code == STORE_FAST ||
396 : : true_next.op.code == STORE_FAST__LOAD_FAST);
397 : : PyObject **target_local = &GETLOCAL(true_next.op.arg);
398 : : DEOPT_IF(*target_local != left, BINARY_OP);
399 : : STAT_INC(BINARY_OP, hit);
400 : : /* Handle `left = left + right` or `left += right` for str.
401 : : *
402 : : * When possible, extend `left` in place rather than
403 : : * allocating a new PyUnicodeObject. This attempts to avoid
404 : : * quadratic behavior when one neglects to use str.join().
405 : : *
406 : : * If `left` has only two references remaining (one from
407 : : * the stack, one in the locals), DECREFing `left` leaves
408 : : * only the locals reference, so PyUnicode_Append knows
409 : : * that the string is safe to mutate.
410 : : */
411 : : assert(Py_REFCNT(left) >= 2);
412 : : _Py_DECREF_NO_DEALLOC(left);
413 : : PyUnicode_Append(target_local, right);
414 : : _Py_DECREF_SPECIALIZED(right, _PyUnicode_ExactDealloc);
415 : : if (*target_local == NULL) goto pop_2_error;
416 : : // The STORE_FAST is already done.
417 : : JUMPBY(INLINE_CACHE_ENTRIES_BINARY_OP + 1);
418 : : #line 419 "Python/generated_cases.c.h"
419 : 2187 : STACK_SHRINK(2);
420 : 2187 : DISPATCH();
421 : : }
422 : :
423 : 201021 : TARGET(BINARY_OP_ADD_FLOAT) {
424 : 201021 : PyObject *right = stack_pointer[-1];
425 [ + + ]: 201021 : PyObject *left = stack_pointer[-2];
426 : : PyObject *sum;
427 : : #line 267 "Python/bytecodes.c"
428 : : assert(cframe.use_tracing == 0);
429 : : DEOPT_IF(!PyFloat_CheckExact(left), BINARY_OP);
430 : : DEOPT_IF(Py_TYPE(right) != Py_TYPE(left), BINARY_OP);
431 : : STAT_INC(BINARY_OP, hit);
432 : : double dsum = ((PyFloatObject *)left)->ob_fval +
433 : : ((PyFloatObject *)right)->ob_fval;
434 : : DECREF_INPUTS_AND_REUSE_FLOAT(left, right, dsum, sum);
435 : : #line 436 "Python/generated_cases.c.h"
436 : 200022 : STACK_SHRINK(1);
437 : 200022 : stack_pointer[-1] = sum;
438 : 200022 : next_instr += 1;
439 : 200022 : DISPATCH();
440 : : }
441 : :
442 : 1310070 : TARGET(BINARY_OP_ADD_INT) {
443 : 1310070 : PyObject *right = stack_pointer[-1];
444 [ - + ]: 1310070 : PyObject *left = stack_pointer[-2];
445 : : PyObject *sum;
446 : : #line 277 "Python/bytecodes.c"
447 : : assert(cframe.use_tracing == 0);
448 : : DEOPT_IF(!PyLong_CheckExact(left), BINARY_OP);
449 : : DEOPT_IF(Py_TYPE(right) != Py_TYPE(left), BINARY_OP);
450 : : STAT_INC(BINARY_OP, hit);
451 : : sum = _PyLong_Add((PyLongObject *)left, (PyLongObject *)right);
452 : : _Py_DECREF_SPECIALIZED(right, (destructor)PyObject_Free);
453 : : _Py_DECREF_SPECIALIZED(left, (destructor)PyObject_Free);
454 : : if (sum == NULL) goto pop_2_error;
455 : : #line 456 "Python/generated_cases.c.h"
456 : 1310038 : STACK_SHRINK(1);
457 : 1310038 : stack_pointer[-1] = sum;
458 : 1310038 : next_instr += 1;
459 : 1310038 : DISPATCH();
460 : : }
461 : :
462 : 113713 : TARGET(BINARY_SUBSCR) {
463 : 114248 : PREDICTED(BINARY_SUBSCR);
464 : : static_assert(INLINE_CACHE_ENTRIES_BINARY_SUBSCR == 4, "incorrect cache size");
465 : 114248 : PyObject *sub = stack_pointer[-1];
466 [ + + ]: 114248 : PyObject *container = stack_pointer[-2];
467 : : PyObject *res;
468 : : #line 296 "Python/bytecodes.c"
469 : : #if ENABLE_SPECIALIZATION
470 : : _PyBinarySubscrCache *cache = (_PyBinarySubscrCache *)next_instr;
471 : : if (ADAPTIVE_COUNTER_IS_ZERO(cache->counter)) {
472 : : assert(cframe.use_tracing == 0);
473 : : next_instr--;
474 : : _Py_Specialize_BinarySubscr(container, sub, next_instr);
475 : : DISPATCH_SAME_OPARG();
476 : : }
477 : : STAT_INC(BINARY_SUBSCR, deferred);
478 : : DECREMENT_ADAPTIVE_COUNTER(cache->counter);
479 : : #endif /* ENABLE_SPECIALIZATION */
480 : : res = PyObject_GetItem(container, sub);
481 : : #line 482 "Python/generated_cases.c.h"
482 [ + + ]: 112805 : Py_DECREF(container);
483 [ + + ]: 112805 : Py_DECREF(sub);
484 : : #line 309 "Python/bytecodes.c"
485 : : if (res == NULL) goto pop_2_error;
486 : : #line 487 "Python/generated_cases.c.h"
487 : 112051 : STACK_SHRINK(1);
488 : 112051 : stack_pointer[-1] = res;
489 : 112051 : next_instr += 4;
490 : 112051 : DISPATCH();
491 : : }
492 : :
493 : 81347 : TARGET(BINARY_SLICE) {
494 : 81347 : PyObject *stop = stack_pointer[-1];
495 : 81347 : PyObject *start = stack_pointer[-2];
496 : 81347 : PyObject *container = stack_pointer[-3];
497 : : PyObject *res;
498 : : #line 313 "Python/bytecodes.c"
499 : : PyObject *slice = _PyBuildSlice_ConsumeRefs(start, stop);
500 : : // Can't use ERROR_IF() here, because we haven't
501 : : // DECREF'ed container yet, and we still own slice.
502 : : if (slice == NULL) {
503 : : res = NULL;
504 : : }
505 : : else {
506 : : res = PyObject_GetItem(container, slice);
507 : : Py_DECREF(slice);
508 : : }
509 : : Py_DECREF(container);
510 : : if (res == NULL) goto pop_3_error;
511 : : #line 512 "Python/generated_cases.c.h"
512 : 81347 : STACK_SHRINK(2);
513 : 81347 : stack_pointer[-1] = res;
514 : 81347 : DISPATCH();
515 : : }
516 : :
517 : 46 : TARGET(STORE_SLICE) {
518 : 46 : PyObject *stop = stack_pointer[-1];
519 : 46 : PyObject *start = stack_pointer[-2];
520 : 46 : PyObject *container = stack_pointer[-3];
521 : 46 : PyObject *v = stack_pointer[-4];
522 : : #line 328 "Python/bytecodes.c"
523 : : PyObject *slice = _PyBuildSlice_ConsumeRefs(start, stop);
524 : : int err;
525 : : if (slice == NULL) {
526 : : err = 1;
527 : : }
528 : : else {
529 : : err = PyObject_SetItem(container, slice, v);
530 : : Py_DECREF(slice);
531 : : }
532 : : Py_DECREF(v);
533 : : Py_DECREF(container);
534 : : if (err) goto pop_4_error;
535 : : #line 536 "Python/generated_cases.c.h"
536 : 46 : STACK_SHRINK(4);
537 : 46 : DISPATCH();
538 : : }
539 : :
540 : 538690 : TARGET(BINARY_SUBSCR_LIST_INT) {
541 : 538690 : PyObject *sub = stack_pointer[-1];
542 [ - + ]: 538690 : PyObject *list = stack_pointer[-2];
543 : : PyObject *res;
544 : : #line 343 "Python/bytecodes.c"
545 : : assert(cframe.use_tracing == 0);
546 : : DEOPT_IF(!PyLong_CheckExact(sub), BINARY_SUBSCR);
547 : : DEOPT_IF(!PyList_CheckExact(list), BINARY_SUBSCR);
548 : :
549 : : // Deopt unless 0 <= sub < PyList_Size(list)
550 : : DEOPT_IF(!_PyLong_IsPositiveSingleDigit(sub), BINARY_SUBSCR);
551 : : assert(((PyLongObject *)_PyLong_GetZero())->long_value.ob_digit[0] == 0);
552 : : Py_ssize_t index = ((PyLongObject*)sub)->long_value.ob_digit[0];
553 : : DEOPT_IF(index >= PyList_GET_SIZE(list), BINARY_SUBSCR);
554 : : STAT_INC(BINARY_SUBSCR, hit);
555 : : res = PyList_GET_ITEM(list, index);
556 : : assert(res != NULL);
557 : : Py_INCREF(res);
558 : : _Py_DECREF_SPECIALIZED(sub, (destructor)PyObject_Free);
559 : : Py_DECREF(list);
560 : : #line 561 "Python/generated_cases.c.h"
561 : 538155 : STACK_SHRINK(1);
562 : 538155 : stack_pointer[-1] = res;
563 : 538155 : next_instr += 4;
564 : 538155 : DISPATCH();
565 : : }
566 : :
567 : 12648 : TARGET(BINARY_SUBSCR_TUPLE_INT) {
568 : 12648 : PyObject *sub = stack_pointer[-1];
569 [ - + ]: 12648 : PyObject *tuple = stack_pointer[-2];
570 : : PyObject *res;
571 : : #line 361 "Python/bytecodes.c"
572 : : assert(cframe.use_tracing == 0);
573 : : DEOPT_IF(!PyLong_CheckExact(sub), BINARY_SUBSCR);
574 : : DEOPT_IF(!PyTuple_CheckExact(tuple), BINARY_SUBSCR);
575 : :
576 : : // Deopt unless 0 <= sub < PyTuple_Size(list)
577 : : DEOPT_IF(!_PyLong_IsPositiveSingleDigit(sub), BINARY_SUBSCR);
578 : : assert(((PyLongObject *)_PyLong_GetZero())->long_value.ob_digit[0] == 0);
579 : : Py_ssize_t index = ((PyLongObject*)sub)->long_value.ob_digit[0];
580 : : DEOPT_IF(index >= PyTuple_GET_SIZE(tuple), BINARY_SUBSCR);
581 : : STAT_INC(BINARY_SUBSCR, hit);
582 : : res = PyTuple_GET_ITEM(tuple, index);
583 : : assert(res != NULL);
584 : : Py_INCREF(res);
585 : : _Py_DECREF_SPECIALIZED(sub, (destructor)PyObject_Free);
586 : : Py_DECREF(tuple);
587 : : #line 588 "Python/generated_cases.c.h"
588 : 12648 : STACK_SHRINK(1);
589 : 12648 : stack_pointer[-1] = res;
590 : 12648 : next_instr += 4;
591 : 12648 : DISPATCH();
592 : : }
593 : :
594 : 24503 : TARGET(BINARY_SUBSCR_DICT) {
595 : 24503 : PyObject *sub = stack_pointer[-1];
596 [ - + ]: 24503 : PyObject *dict = stack_pointer[-2];
597 : : PyObject *res;
598 : : #line 379 "Python/bytecodes.c"
599 : : assert(cframe.use_tracing == 0);
600 : : DEOPT_IF(!PyDict_CheckExact(dict), BINARY_SUBSCR);
601 : : STAT_INC(BINARY_SUBSCR, hit);
602 : : res = PyDict_GetItemWithError(dict, sub);
603 : : if (res == NULL) {
604 : : if (!_PyErr_Occurred(tstate)) {
605 : : _PyErr_SetKeyError(sub);
606 : : }
607 : : #line 608 "Python/generated_cases.c.h"
608 [ - + ]: 1336 : Py_DECREF(dict);
609 [ - + ]: 1336 : Py_DECREF(sub);
610 : : #line 388 "Python/bytecodes.c"
611 : : if (true) goto pop_2_error;
612 : : }
613 : : Py_INCREF(res); // Do this before DECREF'ing dict, sub
614 : : #line 615 "Python/generated_cases.c.h"
615 [ + + ]: 23167 : Py_DECREF(dict);
616 [ + + ]: 23167 : Py_DECREF(sub);
617 : 23167 : STACK_SHRINK(1);
618 : 23167 : stack_pointer[-1] = res;
619 : 23167 : next_instr += 4;
620 : 23167 : DISPATCH();
621 : : }
622 : :
623 : 2025 : TARGET(BINARY_SUBSCR_GETITEM) {
624 : 2025 : PyObject *sub = stack_pointer[-1];
625 : 2025 : PyObject *container = stack_pointer[-2];
626 : 2025 : uint32_t type_version = read_u32(&next_instr[1].cache);
627 : 2025 : uint16_t func_version = read_u16(&next_instr[3].cache);
628 : : #line 395 "Python/bytecodes.c"
629 : : PyTypeObject *tp = Py_TYPE(container);
630 : : DEOPT_IF(tp->tp_version_tag != type_version, BINARY_SUBSCR);
631 : : assert(tp->tp_flags & Py_TPFLAGS_HEAPTYPE);
632 : : PyObject *cached = ((PyHeapTypeObject *)tp)->_spec_cache.getitem;
633 : : assert(PyFunction_Check(cached));
634 : : PyFunctionObject *getitem = (PyFunctionObject *)cached;
635 : : DEOPT_IF(getitem->func_version != func_version, BINARY_SUBSCR);
636 : : PyCodeObject *code = (PyCodeObject *)getitem->func_code;
637 : : assert(code->co_argcount == 2);
638 : : DEOPT_IF(!_PyThreadState_HasStackSpace(tstate, code->co_framesize), BINARY_SUBSCR);
639 : : STAT_INC(BINARY_SUBSCR, hit);
640 : : Py_INCREF(getitem);
641 : : _PyInterpreterFrame *new_frame = _PyFrame_PushUnchecked(tstate, getitem, 2);
642 : : STACK_SHRINK(2);
643 : : new_frame->localsplus[0] = container;
644 : : new_frame->localsplus[1] = sub;
645 : : JUMPBY(INLINE_CACHE_ENTRIES_BINARY_SUBSCR);
646 : : DISPATCH_INLINED(new_frame);
647 : : #line 648 "Python/generated_cases.c.h"
648 : : }
649 : :
650 : 411909 : TARGET(LIST_APPEND) {
651 : 411909 : PyObject *v = stack_pointer[-1];
652 : 411909 : PyObject *list = stack_pointer[-(2 + (oparg-1))];
653 : : #line 416 "Python/bytecodes.c"
654 : : if (_PyList_AppendTakeRef((PyListObject *)list, v) < 0) goto pop_1_error;
655 : : #line 656 "Python/generated_cases.c.h"
656 : 411909 : STACK_SHRINK(1);
657 : : PREDICT(JUMP_BACKWARD);
658 : 411909 : DISPATCH();
659 : : }
660 : :
661 : 51 : TARGET(SET_ADD) {
662 : 51 : PyObject *v = stack_pointer[-1];
663 : 51 : PyObject *set = stack_pointer[-(2 + (oparg-1))];
664 : : #line 421 "Python/bytecodes.c"
665 : : int err = PySet_Add(set, v);
666 : : #line 667 "Python/generated_cases.c.h"
667 [ - + ]: 51 : Py_DECREF(v);
668 : : #line 423 "Python/bytecodes.c"
669 : : if (err) goto pop_1_error;
670 : : #line 671 "Python/generated_cases.c.h"
671 : 51 : STACK_SHRINK(1);
672 : : PREDICT(JUMP_BACKWARD);
673 : 51 : DISPATCH();
674 : : }
675 : :
676 : 6909 : TARGET(STORE_SUBSCR) {
677 : 6909 : PREDICTED(STORE_SUBSCR);
678 : : static_assert(INLINE_CACHE_ENTRIES_STORE_SUBSCR == 1, "incorrect cache size");
679 : 6909 : PyObject *sub = stack_pointer[-1];
680 : 6909 : PyObject *container = stack_pointer[-2];
681 : 6909 : PyObject *v = stack_pointer[-3];
682 : 6909 : uint16_t counter = read_u16(&next_instr[0].cache);
683 : : #line 434 "Python/bytecodes.c"
684 : : #if ENABLE_SPECIALIZATION
685 : : if (ADAPTIVE_COUNTER_IS_ZERO(counter)) {
686 : : assert(cframe.use_tracing == 0);
687 : : next_instr--;
688 : : _Py_Specialize_StoreSubscr(container, sub, next_instr);
689 : : DISPATCH_SAME_OPARG();
690 : : }
691 : : STAT_INC(STORE_SUBSCR, deferred);
692 : : _PyStoreSubscrCache *cache = (_PyStoreSubscrCache *)next_instr;
693 : : DECREMENT_ADAPTIVE_COUNTER(cache->counter);
694 : : #else
695 : : (void)counter; // Unused.
696 : : #endif /* ENABLE_SPECIALIZATION */
697 : : /* container[sub] = v */
698 : : int err = PyObject_SetItem(container, sub, v);
699 : : #line 700 "Python/generated_cases.c.h"
700 [ - + ]: 6344 : Py_DECREF(v);
701 [ - + ]: 6344 : Py_DECREF(container);
702 [ - + ]: 6344 : Py_DECREF(sub);
703 : : #line 450 "Python/bytecodes.c"
704 : : if (err) goto pop_3_error;
705 : : #line 706 "Python/generated_cases.c.h"
706 : 6341 : STACK_SHRINK(3);
707 : 6341 : next_instr += 1;
708 : 6341 : DISPATCH();
709 : : }
710 : :
711 : 519769 : TARGET(STORE_SUBSCR_LIST_INT) {
712 : 519769 : PyObject *sub = stack_pointer[-1];
713 : 519769 : PyObject *list = stack_pointer[-2];
714 [ - + ]: 519769 : PyObject *value = stack_pointer[-3];
715 : : #line 454 "Python/bytecodes.c"
716 : : assert(cframe.use_tracing == 0);
717 : : DEOPT_IF(!PyLong_CheckExact(sub), STORE_SUBSCR);
718 : : DEOPT_IF(!PyList_CheckExact(list), STORE_SUBSCR);
719 : :
720 : : // Ensure nonnegative, zero-or-one-digit ints.
721 : : DEOPT_IF(!_PyLong_IsPositiveSingleDigit(sub), STORE_SUBSCR);
722 : : Py_ssize_t index = ((PyLongObject*)sub)->long_value.ob_digit[0];
723 : : // Ensure index < len(list)
724 : : DEOPT_IF(index >= PyList_GET_SIZE(list), STORE_SUBSCR);
725 : : STAT_INC(STORE_SUBSCR, hit);
726 : :
727 : : PyObject *old_value = PyList_GET_ITEM(list, index);
728 : : PyList_SET_ITEM(list, index, value);
729 : : assert(old_value != NULL);
730 : : Py_DECREF(old_value);
731 : : _Py_DECREF_SPECIALIZED(sub, (destructor)PyObject_Free);
732 : : Py_DECREF(list);
733 : : #line 734 "Python/generated_cases.c.h"
734 : 519769 : STACK_SHRINK(3);
735 : 519769 : next_instr += 1;
736 : 519769 : DISPATCH();
737 : : }
738 : :
739 : 101571 : TARGET(STORE_SUBSCR_DICT) {
740 : 101571 : PyObject *sub = stack_pointer[-1];
741 : 101571 : PyObject *dict = stack_pointer[-2];
742 [ - + ]: 101571 : PyObject *value = stack_pointer[-3];
743 : : #line 474 "Python/bytecodes.c"
744 : : assert(cframe.use_tracing == 0);
745 : : DEOPT_IF(!PyDict_CheckExact(dict), STORE_SUBSCR);
746 : : STAT_INC(STORE_SUBSCR, hit);
747 : : int err = _PyDict_SetItem_Take2((PyDictObject *)dict, sub, value);
748 : : Py_DECREF(dict);
749 : : if (err) goto pop_3_error;
750 : : #line 751 "Python/generated_cases.c.h"
751 : 101571 : STACK_SHRINK(3);
752 : 101571 : next_instr += 1;
753 : 101571 : DISPATCH();
754 : : }
755 : :
756 : 1235 : TARGET(DELETE_SUBSCR) {
757 : 1235 : PyObject *sub = stack_pointer[-1];
758 : 1235 : PyObject *container = stack_pointer[-2];
759 : : #line 483 "Python/bytecodes.c"
760 : : /* del container[sub] */
761 : : int err = PyObject_DelItem(container, sub);
762 : : #line 763 "Python/generated_cases.c.h"
763 [ - + ]: 1235 : Py_DECREF(container);
764 [ + + ]: 1235 : Py_DECREF(sub);
765 : : #line 486 "Python/bytecodes.c"
766 : : if (err) goto pop_2_error;
767 : : #line 768 "Python/generated_cases.c.h"
768 : 1234 : STACK_SHRINK(2);
769 : 1234 : DISPATCH();
770 : : }
771 : :
772 : 3351 : TARGET(CALL_INTRINSIC_1) {
773 : 3351 : PyObject *value = stack_pointer[-1];
774 : : PyObject *res;
775 : : #line 490 "Python/bytecodes.c"
776 : : assert(oparg <= MAX_INTRINSIC_1);
777 : : res = _PyIntrinsics_UnaryFunctions[oparg](tstate, value);
778 : : #line 779 "Python/generated_cases.c.h"
779 [ + + ]: 3351 : Py_DECREF(value);
780 : : #line 493 "Python/bytecodes.c"
781 : : if (res == NULL) goto pop_1_error;
782 : : #line 783 "Python/generated_cases.c.h"
783 : 3351 : stack_pointer[-1] = res;
784 : 3351 : DISPATCH();
785 : : }
786 : :
787 : 0 : TARGET(CALL_INTRINSIC_2) {
788 : 0 : PyObject *value1 = stack_pointer[-1];
789 : 0 : PyObject *value2 = stack_pointer[-2];
790 : : PyObject *res;
791 : : #line 497 "Python/bytecodes.c"
792 : : assert(oparg <= MAX_INTRINSIC_2);
793 : : res = _PyIntrinsics_BinaryFunctions[oparg](tstate, value2, value1);
794 : : #line 795 "Python/generated_cases.c.h"
795 [ # # ]: 0 : Py_DECREF(value2);
796 [ # # ]: 0 : Py_DECREF(value1);
797 : : #line 500 "Python/bytecodes.c"
798 : : if (res == NULL) goto pop_2_error;
799 : : #line 800 "Python/generated_cases.c.h"
800 : 0 : STACK_SHRINK(1);
801 : 0 : stack_pointer[-1] = res;
802 : 0 : DISPATCH();
803 : : }
804 : :
805 : 413 : TARGET(RAISE_VARARGS) {
806 [ + + + - ]: 413 : PyObject **args = (stack_pointer - oparg);
807 : : #line 504 "Python/bytecodes.c"
808 : : PyObject *cause = NULL, *exc = NULL;
809 : : switch (oparg) {
810 : : case 2:
811 : : cause = args[1];
812 : : /* fall through */
813 : : case 1:
814 : : exc = args[0];
815 : : /* fall through */
816 : : case 0:
817 : : if (do_raise(tstate, exc, cause)) { STACK_SHRINK(oparg); goto exception_unwind; }
818 : : break;
819 : : default:
820 : : _PyErr_SetString(tstate, PyExc_SystemError,
821 : : "bad RAISE_VARARGS oparg");
822 : : break;
823 : : }
824 : : if (true) { STACK_SHRINK(oparg); goto error; }
825 : : #line 826 "Python/generated_cases.c.h"
826 : : }
827 : :
828 : 1673510 : TARGET(INTERPRETER_EXIT) {
829 : 1673510 : PyObject *retval = stack_pointer[-1];
830 : : #line 524 "Python/bytecodes.c"
831 : : assert(frame == &entry_frame);
832 : : assert(_PyFrame_IsIncomplete(frame));
833 : : STACK_SHRINK(1); // Since we're not going to DISPATCH()
834 : : assert(EMPTY());
835 : : /* Restore previous cframe and return. */
836 : : tstate->cframe = cframe.previous;
837 : : tstate->cframe->use_tracing = cframe.use_tracing;
838 : : assert(tstate->cframe->current_frame == frame->previous);
839 : : assert(!_PyErr_Occurred(tstate));
840 : : _Py_LeaveRecursiveCallTstate(tstate);
841 : : return retval;
842 : : #line 843 "Python/generated_cases.c.h"
843 : : }
844 : :
845 : 2531207 : TARGET(RETURN_VALUE) {
846 : 2531207 : PyObject *retval = stack_pointer[-1];
847 : : #line 538 "Python/bytecodes.c"
848 : : STACK_SHRINK(1);
849 : : assert(EMPTY());
850 : : _PyFrame_SetStackPointer(frame, stack_pointer);
851 : : TRACE_FUNCTION_EXIT();
852 : : DTRACE_FUNCTION_EXIT();
853 : : _Py_LeaveRecursiveCallPy(tstate);
854 : : assert(frame != &entry_frame);
855 : : // GH-99729: We need to unlink the frame *before* clearing it:
856 : : _PyInterpreterFrame *dying = frame;
857 : : frame = cframe.current_frame = dying->previous;
858 : : _PyEvalFrameClearAndPop(tstate, dying);
859 : : _PyFrame_StackPush(frame, retval);
860 : : goto resume_frame;
861 : : #line 862 "Python/generated_cases.c.h"
862 : : }
863 : :
864 : 1073392 : TARGET(RETURN_CONST) {
865 : : #line 554 "Python/bytecodes.c"
866 : : PyObject *retval = GETITEM(frame->f_code->co_consts, oparg);
867 : : Py_INCREF(retval);
868 : : assert(EMPTY());
869 : : _PyFrame_SetStackPointer(frame, stack_pointer);
870 : : TRACE_FUNCTION_EXIT();
871 : : DTRACE_FUNCTION_EXIT();
872 : : _Py_LeaveRecursiveCallPy(tstate);
873 : : assert(frame != &entry_frame);
874 : : // GH-99729: We need to unlink the frame *before* clearing it:
875 : : _PyInterpreterFrame *dying = frame;
876 : : frame = cframe.current_frame = dying->previous;
877 : : _PyEvalFrameClearAndPop(tstate, dying);
878 : : _PyFrame_StackPush(frame, retval);
879 : : goto resume_frame;
880 : : #line 881 "Python/generated_cases.c.h"
881 : : }
882 : :
883 : 0 : TARGET(GET_AITER) {
884 : 0 : PyObject *obj = stack_pointer[-1];
885 : : PyObject *iter;
886 : : #line 571 "Python/bytecodes.c"
887 : : unaryfunc getter = NULL;
888 : : PyTypeObject *type = Py_TYPE(obj);
889 : :
890 : : if (type->tp_as_async != NULL) {
891 : : getter = type->tp_as_async->am_aiter;
892 : : }
893 : :
894 : : if (getter == NULL) {
895 : : _PyErr_Format(tstate, PyExc_TypeError,
896 : : "'async for' requires an object with "
897 : : "__aiter__ method, got %.100s",
898 : : type->tp_name);
899 : : #line 900 "Python/generated_cases.c.h"
900 [ # # ]: 0 : Py_DECREF(obj);
901 : : #line 584 "Python/bytecodes.c"
902 : : if (true) goto pop_1_error;
903 : : }
904 : :
905 : : iter = (*getter)(obj);
906 : : #line 907 "Python/generated_cases.c.h"
907 [ # # ]: 0 : Py_DECREF(obj);
908 : : #line 589 "Python/bytecodes.c"
909 : : if (iter == NULL) goto pop_1_error;
910 : :
911 : : if (Py_TYPE(iter)->tp_as_async == NULL ||
912 : : Py_TYPE(iter)->tp_as_async->am_anext == NULL) {
913 : :
914 : : _PyErr_Format(tstate, PyExc_TypeError,
915 : : "'async for' received an object from __aiter__ "
916 : : "that does not implement __anext__: %.100s",
917 : : Py_TYPE(iter)->tp_name);
918 : : Py_DECREF(iter);
919 : : if (true) goto pop_1_error;
920 : : }
921 : : #line 922 "Python/generated_cases.c.h"
922 : 0 : stack_pointer[-1] = iter;
923 : 0 : DISPATCH();
924 : : }
925 : :
926 : 0 : TARGET(GET_ANEXT) {
927 : 0 : PyObject *aiter = stack_pointer[-1];
928 : : PyObject *awaitable;
929 : : #line 604 "Python/bytecodes.c"
930 : : unaryfunc getter = NULL;
931 : : PyObject *next_iter = NULL;
932 : : PyTypeObject *type = Py_TYPE(aiter);
933 : :
934 : : if (PyAsyncGen_CheckExact(aiter)) {
935 : : awaitable = type->tp_as_async->am_anext(aiter);
936 : : if (awaitable == NULL) {
937 : : goto error;
938 : : }
939 : : } else {
940 : : if (type->tp_as_async != NULL){
941 : : getter = type->tp_as_async->am_anext;
942 : : }
943 : :
944 : : if (getter != NULL) {
945 : : next_iter = (*getter)(aiter);
946 : : if (next_iter == NULL) {
947 : : goto error;
948 : : }
949 : : }
950 : : else {
951 : : _PyErr_Format(tstate, PyExc_TypeError,
952 : : "'async for' requires an iterator with "
953 : : "__anext__ method, got %.100s",
954 : : type->tp_name);
955 : : goto error;
956 : : }
957 : :
958 : : awaitable = _PyCoro_GetAwaitableIter(next_iter);
959 : : if (awaitable == NULL) {
960 : : _PyErr_FormatFromCause(
961 : : PyExc_TypeError,
962 : : "'async for' received an invalid object "
963 : : "from __anext__: %.100s",
964 : : Py_TYPE(next_iter)->tp_name);
965 : :
966 : : Py_DECREF(next_iter);
967 : : goto error;
968 : : } else {
969 : : Py_DECREF(next_iter);
970 : : }
971 : : }
972 : :
973 : : #line 974 "Python/generated_cases.c.h"
974 : 0 : STACK_GROW(1);
975 : 0 : stack_pointer[-1] = awaitable;
976 : : PREDICT(LOAD_CONST);
977 : 0 : DISPATCH();
978 : : }
979 : :
980 : 0 : TARGET(GET_AWAITABLE) {
981 : 0 : PREDICTED(GET_AWAITABLE);
982 : 0 : PyObject *iterable = stack_pointer[-1];
983 : : PyObject *iter;
984 : : #line 651 "Python/bytecodes.c"
985 : : iter = _PyCoro_GetAwaitableIter(iterable);
986 : :
987 : : if (iter == NULL) {
988 : : format_awaitable_error(tstate, Py_TYPE(iterable), oparg);
989 : : }
990 : :
991 : : #line 992 "Python/generated_cases.c.h"
992 [ # # ]: 0 : Py_DECREF(iterable);
993 : : #line 658 "Python/bytecodes.c"
994 : :
995 : : if (iter != NULL && PyCoro_CheckExact(iter)) {
996 : : PyObject *yf = _PyGen_yf((PyGenObject*)iter);
997 : : if (yf != NULL) {
998 : : /* `iter` is a coroutine object that is being
999 : : awaited, `yf` is a pointer to the current awaitable
1000 : : being awaited on. */
1001 : : Py_DECREF(yf);
1002 : : Py_CLEAR(iter);
1003 : : _PyErr_SetString(tstate, PyExc_RuntimeError,
1004 : : "coroutine is being awaited already");
1005 : : /* The code below jumps to `error` if `iter` is NULL. */
1006 : : }
1007 : : }
1008 : :
1009 : : if (iter == NULL) goto pop_1_error;
1010 : :
1011 : : #line 1012 "Python/generated_cases.c.h"
1012 : 0 : stack_pointer[-1] = iter;
1013 : : PREDICT(LOAD_CONST);
1014 : 0 : DISPATCH();
1015 : : }
1016 : :
1017 : 36 : TARGET(SEND) {
1018 : 36 : PREDICTED(SEND);
1019 : 36 : PyObject *v = stack_pointer[-1];
1020 [ + + ]: 36 : PyObject *receiver = stack_pointer[-2];
1021 : : PyObject *retval;
1022 : : #line 684 "Python/bytecodes.c"
1023 : : #if ENABLE_SPECIALIZATION
1024 : : _PySendCache *cache = (_PySendCache *)next_instr;
1025 : : if (ADAPTIVE_COUNTER_IS_ZERO(cache->counter)) {
1026 : : assert(cframe.use_tracing == 0);
1027 : : next_instr--;
1028 : : _Py_Specialize_Send(receiver, next_instr);
1029 : : DISPATCH_SAME_OPARG();
1030 : : }
1031 : : STAT_INC(SEND, deferred);
1032 : : DECREMENT_ADAPTIVE_COUNTER(cache->counter);
1033 : : #endif /* ENABLE_SPECIALIZATION */
1034 : : assert(frame != &entry_frame);
1035 : : if (Py_IsNone(v) && PyIter_Check(receiver)) {
1036 : : retval = Py_TYPE(receiver)->tp_iternext(receiver);
1037 : : }
1038 : : else {
1039 : : retval = PyObject_CallMethodOneArg(receiver, &_Py_ID(send), v);
1040 : : }
1041 : : if (retval == NULL) {
1042 : : if (tstate->c_tracefunc != NULL
1043 : : && _PyErr_ExceptionMatches(tstate, PyExc_StopIteration))
1044 : : call_exc_trace(tstate->c_tracefunc, tstate->c_traceobj, tstate, frame);
1045 : : if (_PyGen_FetchStopIterationValue(&retval) == 0) {
1046 : : assert(retval != NULL);
1047 : : JUMPBY(oparg);
1048 : : }
1049 : : else {
1050 : : assert(retval == NULL);
1051 : : goto error;
1052 : : }
1053 : : }
1054 : : else {
1055 : : assert(retval != NULL);
1056 : : }
1057 : : Py_DECREF(v);
1058 : : #line 1059 "Python/generated_cases.c.h"
1059 : 26 : stack_pointer[-1] = retval;
1060 : 26 : next_instr += 1;
1061 : 26 : DISPATCH();
1062 : : }
1063 : :
1064 : 351 : TARGET(SEND_GEN) {
1065 : 351 : PyObject *v = stack_pointer[-1];
1066 : 351 : PyObject *receiver = stack_pointer[-2];
1067 : : #line 722 "Python/bytecodes.c"
1068 : : assert(cframe.use_tracing == 0);
1069 : : PyGenObject *gen = (PyGenObject *)receiver;
1070 : : DEOPT_IF(Py_TYPE(gen) != &PyGen_Type &&
1071 : : Py_TYPE(gen) != &PyCoro_Type, SEND);
1072 : : DEOPT_IF(gen->gi_frame_state >= FRAME_EXECUTING, SEND);
1073 : : STAT_INC(SEND, hit);
1074 : : _PyInterpreterFrame *gen_frame = (_PyInterpreterFrame *)gen->gi_iframe;
1075 : : frame->yield_offset = oparg;
1076 : : STACK_SHRINK(1);
1077 : : _PyFrame_StackPush(gen_frame, v);
1078 : : gen->gi_frame_state = FRAME_EXECUTING;
1079 : : gen->gi_exc_state.previous_item = tstate->exc_info;
1080 : : tstate->exc_info = &gen->gi_exc_state;
1081 : : JUMPBY(INLINE_CACHE_ENTRIES_SEND + oparg);
1082 : : DISPATCH_INLINED(gen_frame);
1083 : : #line 1084 "Python/generated_cases.c.h"
1084 : : }
1085 : :
1086 : 429374 : TARGET(YIELD_VALUE) {
1087 : 429374 : PyObject *retval = stack_pointer[-1];
1088 : : #line 740 "Python/bytecodes.c"
1089 : : // NOTE: It's important that YIELD_VALUE never raises an exception!
1090 : : // The compiler treats any exception raised here as a failed close()
1091 : : // or throw() call.
1092 : : assert(frame != &entry_frame);
1093 : : PyGenObject *gen = _PyFrame_GetGenerator(frame);
1094 : : gen->gi_frame_state = FRAME_SUSPENDED;
1095 : : _PyFrame_SetStackPointer(frame, stack_pointer - 1);
1096 : : TRACE_FUNCTION_EXIT();
1097 : : DTRACE_FUNCTION_EXIT();
1098 : : tstate->exc_info = gen->gi_exc_state.previous_item;
1099 : : gen->gi_exc_state.previous_item = NULL;
1100 : : _Py_LeaveRecursiveCallPy(tstate);
1101 : : _PyInterpreterFrame *gen_frame = frame;
1102 : : frame = cframe.current_frame = frame->previous;
1103 : : gen_frame->previous = NULL;
1104 : : frame->prev_instr -= frame->yield_offset;
1105 : : _PyFrame_StackPush(frame, retval);
1106 : : goto resume_frame;
1107 : : #line 1108 "Python/generated_cases.c.h"
1108 : : }
1109 : :
1110 : 101972 : TARGET(POP_EXCEPT) {
1111 [ + - ]: 101972 : PyObject *exc_value = stack_pointer[-1];
1112 : : #line 761 "Python/bytecodes.c"
1113 : : _PyErr_StackItem *exc_info = tstate->exc_info;
1114 : : Py_XSETREF(exc_info->exc_value, exc_value);
1115 : : #line 1116 "Python/generated_cases.c.h"
1116 : 101972 : STACK_SHRINK(1);
1117 : 101972 : DISPATCH();
1118 : : }
1119 : :
1120 : 2415 : TARGET(RERAISE) {
1121 : 2415 : PyObject *exc = stack_pointer[-1];
1122 [ + + ]: 2415 : PyObject **values = (stack_pointer - (1 + oparg));
1123 : : #line 766 "Python/bytecodes.c"
1124 : : assert(oparg >= 0 && oparg <= 2);
1125 : : if (oparg) {
1126 : : PyObject *lasti = values[0];
1127 : : if (PyLong_Check(lasti)) {
1128 : : frame->prev_instr = _PyCode_CODE(frame->f_code) + PyLong_AsLong(lasti);
1129 : : assert(!_PyErr_Occurred(tstate));
1130 : : }
1131 : : else {
1132 : : assert(PyLong_Check(lasti));
1133 : : _PyErr_SetString(tstate, PyExc_SystemError, "lasti is not an int");
1134 : : goto error;
1135 : : }
1136 : : }
1137 : : assert(exc && PyExceptionInstance_Check(exc));
1138 : : Py_INCREF(exc);
1139 : : _PyErr_SetRaisedException(tstate, exc);
1140 : : goto exception_unwind;
1141 : : #line 1142 "Python/generated_cases.c.h"
1142 : : }
1143 : :
1144 : 0 : TARGET(END_ASYNC_FOR) {
1145 : 0 : PyObject *exc = stack_pointer[-1];
1146 : 0 : PyObject *awaitable = stack_pointer[-2];
1147 : : #line 786 "Python/bytecodes.c"
1148 : : assert(exc && PyExceptionInstance_Check(exc));
1149 : : if (PyErr_GivenExceptionMatches(exc, PyExc_StopAsyncIteration)) {
1150 : : #line 1151 "Python/generated_cases.c.h"
1151 [ # # ]: 0 : Py_DECREF(awaitable);
1152 [ # # ]: 0 : Py_DECREF(exc);
1153 : : #line 789 "Python/bytecodes.c"
1154 : : }
1155 : : else {
1156 : : Py_INCREF(exc);
1157 : : _PyErr_SetRaisedException(tstate, exc);
1158 : : goto exception_unwind;
1159 : : }
1160 : : #line 1161 "Python/generated_cases.c.h"
1161 : 0 : STACK_SHRINK(2);
1162 : 0 : DISPATCH();
1163 : : }
1164 : :
1165 : 0 : TARGET(CLEANUP_THROW) {
1166 : 0 : PyObject *exc_value = stack_pointer[-1];
1167 : 0 : PyObject *last_sent_val = stack_pointer[-2];
1168 : 0 : PyObject *sub_iter = stack_pointer[-3];
1169 : : PyObject *none;
1170 : : PyObject *value;
1171 : : #line 798 "Python/bytecodes.c"
1172 : : assert(throwflag);
1173 : : assert(exc_value && PyExceptionInstance_Check(exc_value));
1174 : : if (PyErr_GivenExceptionMatches(exc_value, PyExc_StopIteration)) {
1175 : : value = Py_NewRef(((PyStopIterationObject *)exc_value)->value);
1176 : : #line 1177 "Python/generated_cases.c.h"
1177 [ # # ]: 0 : Py_DECREF(sub_iter);
1178 [ # # ]: 0 : Py_DECREF(last_sent_val);
1179 [ # # ]: 0 : Py_DECREF(exc_value);
1180 : : #line 803 "Python/bytecodes.c"
1181 : : none = Py_NewRef(Py_None);
1182 : : }
1183 : : else {
1184 : : _PyErr_SetRaisedException(tstate, Py_NewRef(exc_value));
1185 : : goto exception_unwind;
1186 : : }
1187 : : #line 1188 "Python/generated_cases.c.h"
1188 : 0 : STACK_SHRINK(1);
1189 : 0 : stack_pointer[-1] = value;
1190 : 0 : stack_pointer[-2] = none;
1191 : 0 : DISPATCH();
1192 : : }
1193 : :
1194 : 0 : TARGET(LOAD_ASSERTION_ERROR) {
1195 : : PyObject *value;
1196 : : #line 812 "Python/bytecodes.c"
1197 : : value = Py_NewRef(PyExc_AssertionError);
1198 : : #line 1199 "Python/generated_cases.c.h"
1199 : 0 : STACK_GROW(1);
1200 : 0 : stack_pointer[-1] = value;
1201 : 0 : DISPATCH();
1202 : : }
1203 : :
1204 [ + - ]: 3141 : TARGET(LOAD_BUILD_CLASS) {
1205 : : PyObject *bc;
1206 : : #line 816 "Python/bytecodes.c"
1207 : : if (PyDict_CheckExact(BUILTINS())) {
1208 : : bc = _PyDict_GetItemWithError(BUILTINS(),
1209 : : &_Py_ID(__build_class__));
1210 : : if (bc == NULL) {
1211 : : if (!_PyErr_Occurred(tstate)) {
1212 : : _PyErr_SetString(tstate, PyExc_NameError,
1213 : : "__build_class__ not found");
1214 : : }
1215 : : if (true) goto error;
1216 : : }
1217 : : Py_INCREF(bc);
1218 : : }
1219 : : else {
1220 : : bc = PyObject_GetItem(BUILTINS(), &_Py_ID(__build_class__));
1221 : : if (bc == NULL) {
1222 : : if (_PyErr_ExceptionMatches(tstate, PyExc_KeyError))
1223 : : _PyErr_SetString(tstate, PyExc_NameError,
1224 : : "__build_class__ not found");
1225 : : if (true) goto error;
1226 : : }
1227 : : }
1228 : : #line 1229 "Python/generated_cases.c.h"
1229 : 3141 : STACK_GROW(1);
1230 : 3141 : stack_pointer[-1] = bc;
1231 : 3141 : DISPATCH();
1232 : : }
1233 : :
1234 : 54214 : TARGET(STORE_NAME) {
1235 [ - + ]: 54214 : PyObject *v = stack_pointer[-1];
1236 : : #line 840 "Python/bytecodes.c"
1237 : : PyObject *name = GETITEM(frame->f_code->co_names, oparg);
1238 : : PyObject *ns = LOCALS();
1239 : : int err;
1240 : : if (ns == NULL) {
1241 : : _PyErr_Format(tstate, PyExc_SystemError,
1242 : : "no locals found when storing %R", name);
1243 : : #line 1244 "Python/generated_cases.c.h"
1244 [ # # ]: 0 : Py_DECREF(v);
1245 : : #line 847 "Python/bytecodes.c"
1246 : : if (true) goto pop_1_error;
1247 : : }
1248 : : if (PyDict_CheckExact(ns))
1249 : : err = PyDict_SetItem(ns, name, v);
1250 : : else
1251 : : err = PyObject_SetItem(ns, name, v);
1252 : : #line 1253 "Python/generated_cases.c.h"
1253 [ + + ]: 54214 : Py_DECREF(v);
1254 : : #line 854 "Python/bytecodes.c"
1255 : : if (err) goto pop_1_error;
1256 : : #line 1257 "Python/generated_cases.c.h"
1257 : 54214 : STACK_SHRINK(1);
1258 : 54214 : DISPATCH();
1259 : : }
1260 : :
1261 [ - + ]: 514 : TARGET(DELETE_NAME) {
1262 : : #line 858 "Python/bytecodes.c"
1263 : : PyObject *name = GETITEM(frame->f_code->co_names, oparg);
1264 : : PyObject *ns = LOCALS();
1265 : : int err;
1266 : : if (ns == NULL) {
1267 : : _PyErr_Format(tstate, PyExc_SystemError,
1268 : : "no locals when deleting %R", name);
1269 : : goto error;
1270 : : }
1271 : : err = PyObject_DelItem(ns, name);
1272 : : // Can't use ERROR_IF here.
1273 : : if (err != 0) {
1274 : : format_exc_check_arg(tstate, PyExc_NameError,
1275 : : NAME_ERROR_MSG,
1276 : : name);
1277 : : goto error;
1278 : : }
1279 : : #line 1280 "Python/generated_cases.c.h"
1280 : 514 : DISPATCH();
1281 : : }
1282 : :
1283 : 1203 : TARGET(UNPACK_SEQUENCE) {
1284 : 1203 : PREDICTED(UNPACK_SEQUENCE);
1285 : : static_assert(INLINE_CACHE_ENTRIES_UNPACK_SEQUENCE == 1, "incorrect cache size");
1286 [ + + ]: 1203 : PyObject *seq = stack_pointer[-1];
1287 : : #line 884 "Python/bytecodes.c"
1288 : : #if ENABLE_SPECIALIZATION
1289 : : _PyUnpackSequenceCache *cache = (_PyUnpackSequenceCache *)next_instr;
1290 : : if (ADAPTIVE_COUNTER_IS_ZERO(cache->counter)) {
1291 : : assert(cframe.use_tracing == 0);
1292 : : next_instr--;
1293 : : _Py_Specialize_UnpackSequence(seq, next_instr, oparg);
1294 : : DISPATCH_SAME_OPARG();
1295 : : }
1296 : : STAT_INC(UNPACK_SEQUENCE, deferred);
1297 : : DECREMENT_ADAPTIVE_COUNTER(cache->counter);
1298 : : #endif /* ENABLE_SPECIALIZATION */
1299 : : PyObject **top = stack_pointer + oparg - 1;
1300 : : int res = unpack_iterable(tstate, seq, oparg, -1, top);
1301 : : #line 1302 "Python/generated_cases.c.h"
1302 [ + + ]: 671 : Py_DECREF(seq);
1303 : : #line 898 "Python/bytecodes.c"
1304 : : if (res == 0) goto pop_1_error;
1305 : : #line 1306 "Python/generated_cases.c.h"
1306 : 671 : STACK_SHRINK(1);
1307 : 671 : STACK_GROW(oparg);
1308 : 671 : next_instr += 1;
1309 : 671 : DISPATCH();
1310 : : }
1311 : :
1312 : 1690349 : TARGET(UNPACK_SEQUENCE_TWO_TUPLE) {
1313 : 1690349 : PyObject *seq = stack_pointer[-1];
1314 [ - + ]: 1690349 : PyObject **values = stack_pointer - (1);
1315 : : #line 902 "Python/bytecodes.c"
1316 : : DEOPT_IF(!PyTuple_CheckExact(seq), UNPACK_SEQUENCE);
1317 : : DEOPT_IF(PyTuple_GET_SIZE(seq) != 2, UNPACK_SEQUENCE);
1318 : : assert(oparg == 2);
1319 : : STAT_INC(UNPACK_SEQUENCE, hit);
1320 : : values[0] = Py_NewRef(PyTuple_GET_ITEM(seq, 1));
1321 : : values[1] = Py_NewRef(PyTuple_GET_ITEM(seq, 0));
1322 : : #line 1323 "Python/generated_cases.c.h"
1323 [ + + ]: 1690349 : Py_DECREF(seq);
1324 : 1690349 : STACK_SHRINK(1);
1325 : 1690349 : STACK_GROW(oparg);
1326 : 1690349 : next_instr += 1;
1327 : 1690349 : DISPATCH();
1328 : : }
1329 : :
1330 : 11126 : TARGET(UNPACK_SEQUENCE_TUPLE) {
1331 : 11126 : PyObject *seq = stack_pointer[-1];
1332 [ - + ]: 11126 : PyObject **values = stack_pointer - (1);
1333 : : #line 912 "Python/bytecodes.c"
1334 : : DEOPT_IF(!PyTuple_CheckExact(seq), UNPACK_SEQUENCE);
1335 : : DEOPT_IF(PyTuple_GET_SIZE(seq) != oparg, UNPACK_SEQUENCE);
1336 : : STAT_INC(UNPACK_SEQUENCE, hit);
1337 : : PyObject **items = _PyTuple_ITEMS(seq);
1338 : : for (int i = oparg; --i >= 0; ) {
1339 : : *values++ = Py_NewRef(items[i]);
1340 : : }
1341 : : #line 1342 "Python/generated_cases.c.h"
1342 [ + + ]: 11126 : Py_DECREF(seq);
1343 : 11126 : STACK_SHRINK(1);
1344 : 11126 : STACK_GROW(oparg);
1345 : 11126 : next_instr += 1;
1346 : 11126 : DISPATCH();
1347 : : }
1348 : :
1349 : 5127 : TARGET(UNPACK_SEQUENCE_LIST) {
1350 : 5127 : PyObject *seq = stack_pointer[-1];
1351 [ - + ]: 5127 : PyObject **values = stack_pointer - (1);
1352 : : #line 923 "Python/bytecodes.c"
1353 : : DEOPT_IF(!PyList_CheckExact(seq), UNPACK_SEQUENCE);
1354 : : DEOPT_IF(PyList_GET_SIZE(seq) != oparg, UNPACK_SEQUENCE);
1355 : : STAT_INC(UNPACK_SEQUENCE, hit);
1356 : : PyObject **items = _PyList_ITEMS(seq);
1357 : : for (int i = oparg; --i >= 0; ) {
1358 : : *values++ = Py_NewRef(items[i]);
1359 : : }
1360 : : #line 1361 "Python/generated_cases.c.h"
1361 [ + + ]: 5127 : Py_DECREF(seq);
1362 : 5127 : STACK_SHRINK(1);
1363 : 5127 : STACK_GROW(oparg);
1364 : 5127 : next_instr += 1;
1365 : 5127 : DISPATCH();
1366 : : }
1367 : :
1368 : 1994 : TARGET(UNPACK_EX) {
1369 : 1994 : PyObject *seq = stack_pointer[-1];
1370 : : #line 934 "Python/bytecodes.c"
1371 : : int totalargs = 1 + (oparg & 0xFF) + (oparg >> 8);
1372 : : PyObject **top = stack_pointer + totalargs - 1;
1373 : : int res = unpack_iterable(tstate, seq, oparg & 0xFF, oparg >> 8, top);
1374 : : #line 1375 "Python/generated_cases.c.h"
1375 [ + + ]: 1994 : Py_DECREF(seq);
1376 : : #line 938 "Python/bytecodes.c"
1377 : : if (res == 0) goto pop_1_error;
1378 : : #line 1379 "Python/generated_cases.c.h"
1379 : 1994 : STACK_GROW((oparg & 0xFF) + (oparg >> 8));
1380 : 1994 : DISPATCH();
1381 : : }
1382 : :
1383 : 129025 : TARGET(STORE_ATTR) {
1384 : 450233 : PREDICTED(STORE_ATTR);
1385 : : static_assert(INLINE_CACHE_ENTRIES_STORE_ATTR == 4, "incorrect cache size");
1386 : 450233 : PyObject *owner = stack_pointer[-1];
1387 : 450233 : PyObject *v = stack_pointer[-2];
1388 : 450233 : uint16_t counter = read_u16(&next_instr[0].cache);
1389 : : #line 949 "Python/bytecodes.c"
1390 : : #if ENABLE_SPECIALIZATION
1391 : : if (ADAPTIVE_COUNTER_IS_ZERO(counter)) {
1392 : : assert(cframe.use_tracing == 0);
1393 : : PyObject *name = GETITEM(frame->f_code->co_names, oparg);
1394 : : next_instr--;
1395 : : _Py_Specialize_StoreAttr(owner, next_instr, name);
1396 : : DISPATCH_SAME_OPARG();
1397 : : }
1398 : : STAT_INC(STORE_ATTR, deferred);
1399 : : _PyAttrCache *cache = (_PyAttrCache *)next_instr;
1400 : : DECREMENT_ADAPTIVE_COUNTER(cache->counter);
1401 : : #else
1402 : : (void)counter; // Unused.
1403 : : #endif /* ENABLE_SPECIALIZATION */
1404 : : PyObject *name = GETITEM(frame->f_code->co_names, oparg);
1405 : : int err = PyObject_SetAttr(owner, name, v);
1406 : : #line 1407 "Python/generated_cases.c.h"
1407 [ - + ]: 440926 : Py_DECREF(v);
1408 [ - + ]: 440926 : Py_DECREF(owner);
1409 : : #line 966 "Python/bytecodes.c"
1410 : : if (err) goto pop_2_error;
1411 : : #line 1412 "Python/generated_cases.c.h"
1412 : 440926 : STACK_SHRINK(2);
1413 : 440926 : next_instr += 4;
1414 : 440926 : DISPATCH();
1415 : : }
1416 : :
1417 : 292839 : TARGET(DELETE_ATTR) {
1418 : 292839 : PyObject *owner = stack_pointer[-1];
1419 : : #line 970 "Python/bytecodes.c"
1420 : : PyObject *name = GETITEM(frame->f_code->co_names, oparg);
1421 : : int err = PyObject_SetAttr(owner, name, (PyObject *)NULL);
1422 : : #line 1423 "Python/generated_cases.c.h"
1423 [ - + ]: 292839 : Py_DECREF(owner);
1424 : : #line 973 "Python/bytecodes.c"
1425 : : if (err) goto pop_1_error;
1426 : : #line 1427 "Python/generated_cases.c.h"
1427 : 292839 : STACK_SHRINK(1);
1428 : 292839 : DISPATCH();
1429 : : }
1430 : :
1431 : 1270 : TARGET(STORE_GLOBAL) {
1432 : 1270 : PyObject *v = stack_pointer[-1];
1433 : : #line 977 "Python/bytecodes.c"
1434 : : PyObject *name = GETITEM(frame->f_code->co_names, oparg);
1435 : : int err = PyDict_SetItem(GLOBALS(), name, v);
1436 : : #line 1437 "Python/generated_cases.c.h"
1437 [ - + ]: 1270 : Py_DECREF(v);
1438 : : #line 980 "Python/bytecodes.c"
1439 : : if (err) goto pop_1_error;
1440 : : #line 1441 "Python/generated_cases.c.h"
1441 : 1270 : STACK_SHRINK(1);
1442 : 1270 : DISPATCH();
1443 : : }
1444 : :
1445 : 0 : TARGET(DELETE_GLOBAL) {
1446 : : #line 984 "Python/bytecodes.c"
1447 : : PyObject *name = GETITEM(frame->f_code->co_names, oparg);
1448 : : int err;
1449 : : err = PyDict_DelItem(GLOBALS(), name);
1450 : : // Can't use ERROR_IF here.
1451 : : if (err != 0) {
1452 : : if (_PyErr_ExceptionMatches(tstate, PyExc_KeyError)) {
1453 : : format_exc_check_arg(tstate, PyExc_NameError,
1454 : : NAME_ERROR_MSG, name);
1455 : : }
1456 : : goto error;
1457 : : }
1458 : : #line 1459 "Python/generated_cases.c.h"
1459 : 0 : DISPATCH();
1460 : : }
1461 : :
1462 [ - + ]: 35562 : TARGET(LOAD_NAME) {
1463 : : PyObject *v;
1464 : : #line 998 "Python/bytecodes.c"
1465 : : PyObject *name = GETITEM(frame->f_code->co_names, oparg);
1466 : : PyObject *locals = LOCALS();
1467 : : if (locals == NULL) {
1468 : : _PyErr_Format(tstate, PyExc_SystemError,
1469 : : "no locals when loading %R", name);
1470 : : goto error;
1471 : : }
1472 : : if (PyDict_CheckExact(locals)) {
1473 : : v = PyDict_GetItemWithError(locals, name);
1474 : : if (v != NULL) {
1475 : : Py_INCREF(v);
1476 : : }
1477 : : else if (_PyErr_Occurred(tstate)) {
1478 : : goto error;
1479 : : }
1480 : : }
1481 : : else {
1482 : : v = PyObject_GetItem(locals, name);
1483 : : if (v == NULL) {
1484 : : if (!_PyErr_ExceptionMatches(tstate, PyExc_KeyError))
1485 : : goto error;
1486 : : _PyErr_Clear(tstate);
1487 : : }
1488 : : }
1489 : : if (v == NULL) {
1490 : : v = PyDict_GetItemWithError(GLOBALS(), name);
1491 : : if (v != NULL) {
1492 : : Py_INCREF(v);
1493 : : }
1494 : : else if (_PyErr_Occurred(tstate)) {
1495 : : goto error;
1496 : : }
1497 : : else {
1498 : : if (PyDict_CheckExact(BUILTINS())) {
1499 : : v = PyDict_GetItemWithError(BUILTINS(), name);
1500 : : if (v == NULL) {
1501 : : if (!_PyErr_Occurred(tstate)) {
1502 : : format_exc_check_arg(
1503 : : tstate, PyExc_NameError,
1504 : : NAME_ERROR_MSG, name);
1505 : : }
1506 : : goto error;
1507 : : }
1508 : : Py_INCREF(v);
1509 : : }
1510 : : else {
1511 : : v = PyObject_GetItem(BUILTINS(), name);
1512 : : if (v == NULL) {
1513 : : if (_PyErr_ExceptionMatches(tstate, PyExc_KeyError)) {
1514 : : format_exc_check_arg(
1515 : : tstate, PyExc_NameError,
1516 : : NAME_ERROR_MSG, name);
1517 : : }
1518 : : goto error;
1519 : : }
1520 : : }
1521 : : }
1522 : : }
1523 : : #line 1524 "Python/generated_cases.c.h"
1524 : 35561 : STACK_GROW(1);
1525 : 35561 : stack_pointer[-1] = v;
1526 : 35561 : DISPATCH();
1527 : : }
1528 : :
1529 : 28880 : TARGET(LOAD_GLOBAL) {
1530 : 74883 : PREDICTED(LOAD_GLOBAL);
1531 : : static_assert(INLINE_CACHE_ENTRIES_LOAD_GLOBAL == 4, "incorrect cache size");
1532 [ + + ]: 74883 : PyObject *null = NULL;
1533 : : PyObject *v;
1534 : : #line 1065 "Python/bytecodes.c"
1535 : : #if ENABLE_SPECIALIZATION
1536 : : _PyLoadGlobalCache *cache = (_PyLoadGlobalCache *)next_instr;
1537 : : if (ADAPTIVE_COUNTER_IS_ZERO(cache->counter)) {
1538 : : assert(cframe.use_tracing == 0);
1539 : : PyObject *name = GETITEM(frame->f_code->co_names, oparg>>1);
1540 : : next_instr--;
1541 : : _Py_Specialize_LoadGlobal(GLOBALS(), BUILTINS(), next_instr, name);
1542 : : DISPATCH_SAME_OPARG();
1543 : : }
1544 : : STAT_INC(LOAD_GLOBAL, deferred);
1545 : : DECREMENT_ADAPTIVE_COUNTER(cache->counter);
1546 : : #endif /* ENABLE_SPECIALIZATION */
1547 : : PyObject *name = GETITEM(frame->f_code->co_names, oparg>>1);
1548 : : if (PyDict_CheckExact(GLOBALS())
1549 : : && PyDict_CheckExact(BUILTINS()))
1550 : : {
1551 : : v = _PyDict_LoadGlobal((PyDictObject *)GLOBALS(),
1552 : : (PyDictObject *)BUILTINS(),
1553 : : name);
1554 : : if (v == NULL) {
1555 : : if (!_PyErr_Occurred(tstate)) {
1556 : : /* _PyDict_LoadGlobal() returns NULL without raising
1557 : : * an exception if the key doesn't exist */
1558 : : format_exc_check_arg(tstate, PyExc_NameError,
1559 : : NAME_ERROR_MSG, name);
1560 : : }
1561 : : if (true) goto error;
1562 : : }
1563 : : Py_INCREF(v);
1564 : : }
1565 : : else {
1566 : : /* Slow-path if globals or builtins is not a dict */
1567 : :
1568 : : /* namespace 1: globals */
1569 : : v = PyObject_GetItem(GLOBALS(), name);
1570 : : if (v == NULL) {
1571 : : if (!_PyErr_ExceptionMatches(tstate, PyExc_KeyError)) goto error;
1572 : : _PyErr_Clear(tstate);
1573 : :
1574 : : /* namespace 2: builtins */
1575 : : v = PyObject_GetItem(BUILTINS(), name);
1576 : : if (v == NULL) {
1577 : : if (_PyErr_ExceptionMatches(tstate, PyExc_KeyError)) {
1578 : : format_exc_check_arg(
1579 : : tstate, PyExc_NameError,
1580 : : NAME_ERROR_MSG, name);
1581 : : }
1582 : : if (true) goto error;
1583 : : }
1584 : : }
1585 : : }
1586 : : null = NULL;
1587 : : #line 1588 "Python/generated_cases.c.h"
1588 : 63803 : STACK_GROW(1);
1589 : 63803 : STACK_GROW(((oparg & 1) ? 1 : 0));
1590 : 63803 : stack_pointer[-1] = v;
1591 [ + + ]: 63803 : if (oparg & 1) { stack_pointer[-(1 + ((oparg & 1) ? 1 : 0))] = null; }
1592 : 63803 : next_instr += 4;
1593 : 63803 : DISPATCH();
1594 : : }
1595 : :
1596 : 4127977 : TARGET(LOAD_GLOBAL_MODULE) {
1597 : 4127977 : PyObject *null = NULL;
1598 : : PyObject *res;
1599 : 4127977 : uint16_t index = read_u16(&next_instr[1].cache);
1600 : 4127977 : uint16_t version = read_u16(&next_instr[2].cache);
1601 : : #line 1120 "Python/bytecodes.c"
1602 : : assert(cframe.use_tracing == 0);
1603 : : DEOPT_IF(!PyDict_CheckExact(GLOBALS()), LOAD_GLOBAL);
1604 : : PyDictObject *dict = (PyDictObject *)GLOBALS();
1605 : : DEOPT_IF(dict->ma_keys->dk_version != version, LOAD_GLOBAL);
1606 : : assert(DK_IS_UNICODE(dict->ma_keys));
1607 : : PyDictUnicodeEntry *entries = DK_UNICODE_ENTRIES(dict->ma_keys);
1608 : : res = entries[index].me_value;
1609 : : DEOPT_IF(res == NULL, LOAD_GLOBAL);
1610 : : Py_INCREF(res);
1611 : : STAT_INC(LOAD_GLOBAL, hit);
1612 : : null = NULL;
1613 : : #line 1614 "Python/generated_cases.c.h"
1614 : 4109990 : STACK_GROW(1);
1615 : 4109990 : STACK_GROW(((oparg & 1) ? 1 : 0));
1616 : 4109990 : stack_pointer[-1] = res;
1617 [ + + ]: 4109990 : if (oparg & 1) { stack_pointer[-(1 + ((oparg & 1) ? 1 : 0))] = null; }
1618 : 4109990 : next_instr += 4;
1619 : 4109990 : DISPATCH();
1620 : : }
1621 : :
1622 : 3589529 : TARGET(LOAD_GLOBAL_BUILTIN) {
1623 : 3589529 : PyObject *null = NULL;
1624 : : PyObject *res;
1625 : 3589529 : uint16_t index = read_u16(&next_instr[1].cache);
1626 : 3589529 : uint16_t mod_version = read_u16(&next_instr[2].cache);
1627 : 3589529 : uint16_t bltn_version = read_u16(&next_instr[3].cache);
1628 : : #line 1134 "Python/bytecodes.c"
1629 : : assert(cframe.use_tracing == 0);
1630 : : DEOPT_IF(!PyDict_CheckExact(GLOBALS()), LOAD_GLOBAL);
1631 : : DEOPT_IF(!PyDict_CheckExact(BUILTINS()), LOAD_GLOBAL);
1632 : : PyDictObject *mdict = (PyDictObject *)GLOBALS();
1633 : : PyDictObject *bdict = (PyDictObject *)BUILTINS();
1634 : : DEOPT_IF(mdict->ma_keys->dk_version != mod_version, LOAD_GLOBAL);
1635 : : DEOPT_IF(bdict->ma_keys->dk_version != bltn_version, LOAD_GLOBAL);
1636 : : assert(DK_IS_UNICODE(bdict->ma_keys));
1637 : : PyDictUnicodeEntry *entries = DK_UNICODE_ENTRIES(bdict->ma_keys);
1638 : : res = entries[index].me_value;
1639 : : DEOPT_IF(res == NULL, LOAD_GLOBAL);
1640 : : Py_INCREF(res);
1641 : : STAT_INC(LOAD_GLOBAL, hit);
1642 : : null = NULL;
1643 : : #line 1644 "Python/generated_cases.c.h"
1644 : 3561513 : STACK_GROW(1);
1645 : 3561513 : STACK_GROW(((oparg & 1) ? 1 : 0));
1646 : 3561513 : stack_pointer[-1] = res;
1647 [ + + ]: 3561513 : if (oparg & 1) { stack_pointer[-(1 + ((oparg & 1) ? 1 : 0))] = null; }
1648 : 3561513 : next_instr += 4;
1649 : 3561513 : DISPATCH();
1650 : : }
1651 : :
1652 [ - + ]: 85 : TARGET(DELETE_FAST) {
1653 : : #line 1151 "Python/bytecodes.c"
1654 : : PyObject *v = GETLOCAL(oparg);
1655 : : if (v == NULL) goto unbound_local_error;
1656 : : SETLOCAL(oparg, NULL);
1657 : : #line 1658 "Python/generated_cases.c.h"
1658 : 85 : DISPATCH();
1659 : : }
1660 : :
1661 : 43879 : TARGET(MAKE_CELL) {
1662 : : #line 1157 "Python/bytecodes.c"
1663 : : // "initial" is probably NULL but not if it's an arg (or set
1664 : : // via PyFrame_LocalsToFast() before MAKE_CELL has run).
1665 : : PyObject *initial = GETLOCAL(oparg);
1666 : : PyObject *cell = PyCell_New(initial);
1667 : : if (cell == NULL) {
1668 : : goto resume_with_error;
1669 : : }
1670 : : SETLOCAL(oparg, cell);
1671 : : #line 1672 "Python/generated_cases.c.h"
1672 : 43879 : DISPATCH();
1673 : : }
1674 : :
1675 : 0 : TARGET(DELETE_DEREF) {
1676 : : #line 1168 "Python/bytecodes.c"
1677 : : PyObject *cell = GETLOCAL(oparg);
1678 : : PyObject *oldobj = PyCell_GET(cell);
1679 : : // Can't use ERROR_IF here.
1680 : : // Fortunately we don't need its superpower.
1681 : : if (oldobj == NULL) {
1682 : : format_exc_unbound(tstate, frame->f_code, oparg);
1683 : : goto error;
1684 : : }
1685 : : PyCell_SET(cell, NULL);
1686 : : Py_DECREF(oldobj);
1687 : : #line 1688 "Python/generated_cases.c.h"
1688 : 0 : DISPATCH();
1689 : : }
1690 : :
1691 [ + - ]: 14 : TARGET(LOAD_CLASSDEREF) {
1692 : : PyObject *value;
1693 : : #line 1181 "Python/bytecodes.c"
1694 : : PyObject *name, *locals = LOCALS();
1695 : : assert(locals);
1696 : : assert(oparg >= 0 && oparg < frame->f_code->co_nlocalsplus);
1697 : : name = PyTuple_GET_ITEM(frame->f_code->co_localsplusnames, oparg);
1698 : : if (PyDict_CheckExact(locals)) {
1699 : : value = PyDict_GetItemWithError(locals, name);
1700 : : if (value != NULL) {
1701 : : Py_INCREF(value);
1702 : : }
1703 : : else if (_PyErr_Occurred(tstate)) {
1704 : : goto error;
1705 : : }
1706 : : }
1707 : : else {
1708 : : value = PyObject_GetItem(locals, name);
1709 : : if (value == NULL) {
1710 : : if (!_PyErr_ExceptionMatches(tstate, PyExc_KeyError)) {
1711 : : goto error;
1712 : : }
1713 : : _PyErr_Clear(tstate);
1714 : : }
1715 : : }
1716 : : if (!value) {
1717 : : PyObject *cell = GETLOCAL(oparg);
1718 : : value = PyCell_GET(cell);
1719 : : if (value == NULL) {
1720 : : format_exc_unbound(tstate, frame->f_code, oparg);
1721 : : goto error;
1722 : : }
1723 : : Py_INCREF(value);
1724 : : }
1725 : : #line 1726 "Python/generated_cases.c.h"
1726 : 14 : STACK_GROW(1);
1727 : 14 : stack_pointer[-1] = value;
1728 : 14 : DISPATCH();
1729 : : }
1730 : :
1731 : 1415494 : TARGET(LOAD_DEREF) {
1732 : : PyObject *value;
1733 : : #line 1215 "Python/bytecodes.c"
1734 : : PyObject *cell = GETLOCAL(oparg);
1735 : : value = PyCell_GET(cell);
1736 : : if (value == NULL) {
1737 : : format_exc_unbound(tstate, frame->f_code, oparg);
1738 : : if (true) goto error;
1739 : : }
1740 : : Py_INCREF(value);
1741 : : #line 1742 "Python/generated_cases.c.h"
1742 : 1415494 : STACK_GROW(1);
1743 : 1415494 : stack_pointer[-1] = value;
1744 : 1415494 : DISPATCH();
1745 : : }
1746 : :
1747 : 19694 : TARGET(STORE_DEREF) {
1748 : 19694 : PyObject *v = stack_pointer[-1];
1749 : : #line 1225 "Python/bytecodes.c"
1750 : : PyObject *cell = GETLOCAL(oparg);
1751 : : PyObject *oldobj = PyCell_GET(cell);
1752 : : PyCell_SET(cell, v);
1753 : : Py_XDECREF(oldobj);
1754 : : #line 1755 "Python/generated_cases.c.h"
1755 : 19694 : STACK_SHRINK(1);
1756 : 19694 : DISPATCH();
1757 : : }
1758 : :
1759 : 736039 : TARGET(COPY_FREE_VARS) {
1760 : : #line 1232 "Python/bytecodes.c"
1761 : : /* Copy closure variables to free variables */
1762 : : PyCodeObject *co = frame->f_code;
1763 : : assert(PyFunction_Check(frame->f_funcobj));
1764 : : PyObject *closure = ((PyFunctionObject *)frame->f_funcobj)->func_closure;
1765 : : assert(oparg == co->co_nfreevars);
1766 : : int offset = co->co_nlocalsplus - oparg;
1767 : : for (int i = 0; i < oparg; ++i) {
1768 : : PyObject *o = PyTuple_GET_ITEM(closure, i);
1769 : : frame->localsplus[offset + i] = Py_NewRef(o);
1770 : : }
1771 : : #line 1772 "Python/generated_cases.c.h"
1772 : 736039 : DISPATCH();
1773 : : }
1774 : :
1775 : 342034 : TARGET(BUILD_STRING) {
1776 : 342034 : PyObject **pieces = (stack_pointer - oparg);
1777 : : PyObject *str;
1778 : : #line 1245 "Python/bytecodes.c"
1779 : : str = _PyUnicode_JoinArray(&_Py_STR(empty), pieces, oparg);
1780 : : #line 1781 "Python/generated_cases.c.h"
1781 [ + + ]: 1104955 : for (int _i = oparg; --_i >= 0;) {
1782 [ + + ]: 762921 : Py_DECREF(pieces[_i]);
1783 : : }
1784 : : #line 1247 "Python/bytecodes.c"
1785 : : if (str == NULL) { STACK_SHRINK(oparg); goto error; }
1786 : : #line 1787 "Python/generated_cases.c.h"
1787 : 342034 : STACK_SHRINK(oparg);
1788 : 342034 : STACK_GROW(1);
1789 : 342034 : stack_pointer[-1] = str;
1790 : 342034 : DISPATCH();
1791 : : }
1792 : :
1793 : 278852 : TARGET(BUILD_TUPLE) {
1794 : 278852 : PyObject **values = (stack_pointer - oparg);
1795 : : PyObject *tup;
1796 : : #line 1251 "Python/bytecodes.c"
1797 : : tup = _PyTuple_FromArraySteal(values, oparg);
1798 : : if (tup == NULL) { STACK_SHRINK(oparg); goto error; }
1799 : : #line 1800 "Python/generated_cases.c.h"
1800 : 278852 : STACK_SHRINK(oparg);
1801 : 278852 : STACK_GROW(1);
1802 : 278852 : stack_pointer[-1] = tup;
1803 : 278852 : DISPATCH();
1804 : : }
1805 : :
1806 : 165891 : TARGET(BUILD_LIST) {
1807 : 165891 : PyObject **values = (stack_pointer - oparg);
1808 : : PyObject *list;
1809 : : #line 1256 "Python/bytecodes.c"
1810 : : list = _PyList_FromArraySteal(values, oparg);
1811 : : if (list == NULL) { STACK_SHRINK(oparg); goto error; }
1812 : : #line 1813 "Python/generated_cases.c.h"
1813 : 165891 : STACK_SHRINK(oparg);
1814 : 165891 : STACK_GROW(1);
1815 : 165891 : stack_pointer[-1] = list;
1816 : 165891 : DISPATCH();
1817 : : }
1818 : :
1819 : 2739 : TARGET(LIST_EXTEND) {
1820 : 2739 : PyObject *iterable = stack_pointer[-1];
1821 : 2739 : PyObject *list = stack_pointer[-(2 + (oparg-1))];
1822 : : #line 1261 "Python/bytecodes.c"
1823 : : PyObject *none_val = _PyList_Extend((PyListObject *)list, iterable);
1824 : : if (none_val == NULL) {
1825 : : if (_PyErr_ExceptionMatches(tstate, PyExc_TypeError) &&
1826 : : (Py_TYPE(iterable)->tp_iter == NULL && !PySequence_Check(iterable)))
1827 : : {
1828 : : _PyErr_Clear(tstate);
1829 : : _PyErr_Format(tstate, PyExc_TypeError,
1830 : : "Value after * must be an iterable, not %.200s",
1831 : : Py_TYPE(iterable)->tp_name);
1832 : : }
1833 : : #line 1834 "Python/generated_cases.c.h"
1834 [ # # ]: 0 : Py_DECREF(iterable);
1835 : : #line 1272 "Python/bytecodes.c"
1836 : : if (true) goto pop_1_error;
1837 : : }
1838 : : Py_DECREF(none_val);
1839 : : #line 1840 "Python/generated_cases.c.h"
1840 [ + + ]: 2739 : Py_DECREF(iterable);
1841 : 2739 : STACK_SHRINK(1);
1842 : 2739 : DISPATCH();
1843 : : }
1844 : :
1845 : 10 : TARGET(SET_UPDATE) {
1846 : 10 : PyObject *iterable = stack_pointer[-1];
1847 : 10 : PyObject *set = stack_pointer[-(2 + (oparg-1))];
1848 : : #line 1279 "Python/bytecodes.c"
1849 : : int err = _PySet_Update(set, iterable);
1850 : : #line 1851 "Python/generated_cases.c.h"
1851 [ - + ]: 10 : Py_DECREF(iterable);
1852 : : #line 1281 "Python/bytecodes.c"
1853 : : if (err < 0) goto pop_1_error;
1854 : : #line 1855 "Python/generated_cases.c.h"
1855 : 10 : STACK_SHRINK(1);
1856 : 10 : DISPATCH();
1857 : : }
1858 : :
1859 : 374 : TARGET(BUILD_SET) {
1860 : 374 : PyObject **values = (stack_pointer - oparg);
1861 : : PyObject *set;
1862 : : #line 1285 "Python/bytecodes.c"
1863 : : set = PySet_New(NULL);
1864 : : if (set == NULL)
1865 : : goto error;
1866 : : int err = 0;
1867 : : for (int i = 0; i < oparg; i++) {
1868 : : PyObject *item = values[i];
1869 : : if (err == 0)
1870 : : err = PySet_Add(set, item);
1871 : : Py_DECREF(item);
1872 : : }
1873 : : if (err != 0) {
1874 : : Py_DECREF(set);
1875 : : if (true) { STACK_SHRINK(oparg); goto error; }
1876 : : }
1877 : : #line 1878 "Python/generated_cases.c.h"
1878 : 374 : STACK_SHRINK(oparg);
1879 : 374 : STACK_GROW(1);
1880 : 374 : stack_pointer[-1] = set;
1881 : 374 : DISPATCH();
1882 : : }
1883 : :
1884 : 120365 : TARGET(BUILD_MAP) {
1885 : 120365 : PyObject **values = (stack_pointer - oparg*2);
1886 : : PyObject *map;
1887 : : #line 1302 "Python/bytecodes.c"
1888 : : map = _PyDict_FromItems(
1889 : : values, 2,
1890 : : values+1, 2,
1891 : : oparg);
1892 : : if (map == NULL)
1893 : : goto error;
1894 : :
1895 : : #line 1896 "Python/generated_cases.c.h"
1896 [ + + ]: 120831 : for (int _i = oparg*2; --_i >= 0;) {
1897 [ - + ]: 466 : Py_DECREF(values[_i]);
1898 : : }
1899 : : #line 1310 "Python/bytecodes.c"
1900 : : if (map == NULL) { STACK_SHRINK(oparg*2); goto error; }
1901 : : #line 1902 "Python/generated_cases.c.h"
1902 : 120365 : STACK_SHRINK(oparg*2);
1903 : 120365 : STACK_GROW(1);
1904 : 120365 : stack_pointer[-1] = map;
1905 : 120365 : DISPATCH();
1906 : : }
1907 : :
1908 [ - + ]: 1 : TARGET(SETUP_ANNOTATIONS) {
1909 : : #line 1314 "Python/bytecodes.c"
1910 : : int err;
1911 : : PyObject *ann_dict;
1912 : : if (LOCALS() == NULL) {
1913 : : _PyErr_Format(tstate, PyExc_SystemError,
1914 : : "no locals found when setting up annotations");
1915 : : if (true) goto error;
1916 : : }
1917 : : /* check if __annotations__ in locals()... */
1918 : : if (PyDict_CheckExact(LOCALS())) {
1919 : : ann_dict = _PyDict_GetItemWithError(LOCALS(),
1920 : : &_Py_ID(__annotations__));
1921 : : if (ann_dict == NULL) {
1922 : : if (_PyErr_Occurred(tstate)) goto error;
1923 : : /* ...if not, create a new one */
1924 : : ann_dict = PyDict_New();
1925 : : if (ann_dict == NULL) goto error;
1926 : : err = PyDict_SetItem(LOCALS(), &_Py_ID(__annotations__),
1927 : : ann_dict);
1928 : : Py_DECREF(ann_dict);
1929 : : if (err) goto error;
1930 : : }
1931 : : }
1932 : : else {
1933 : : /* do the same if locals() is not a dict */
1934 : : ann_dict = PyObject_GetItem(LOCALS(), &_Py_ID(__annotations__));
1935 : : if (ann_dict == NULL) {
1936 : : if (!_PyErr_ExceptionMatches(tstate, PyExc_KeyError)) goto error;
1937 : : _PyErr_Clear(tstate);
1938 : : ann_dict = PyDict_New();
1939 : : if (ann_dict == NULL) goto error;
1940 : : err = PyObject_SetItem(LOCALS(), &_Py_ID(__annotations__),
1941 : : ann_dict);
1942 : : Py_DECREF(ann_dict);
1943 : : if (err) goto error;
1944 : : }
1945 : : else {
1946 : : Py_DECREF(ann_dict);
1947 : : }
1948 : : }
1949 : : #line 1950 "Python/generated_cases.c.h"
1950 : 1 : DISPATCH();
1951 : : }
1952 : :
1953 : 1911 : TARGET(BUILD_CONST_KEY_MAP) {
1954 : 1911 : PyObject *keys = stack_pointer[-1];
1955 [ + - ]: 1911 : PyObject **values = (stack_pointer - (1 + oparg));
1956 : : PyObject *map;
1957 : : #line 1356 "Python/bytecodes.c"
1958 : : if (!PyTuple_CheckExact(keys) ||
1959 : : PyTuple_GET_SIZE(keys) != (Py_ssize_t)oparg) {
1960 : : _PyErr_SetString(tstate, PyExc_SystemError,
1961 : : "bad BUILD_CONST_KEY_MAP keys argument");
1962 : : goto error; // Pop the keys and values.
1963 : : }
1964 : : map = _PyDict_FromItems(
1965 : : &PyTuple_GET_ITEM(keys, 0), 1,
1966 : : values, 1, oparg);
1967 : : #line 1968 "Python/generated_cases.c.h"
1968 [ + + ]: 7081 : for (int _i = oparg; --_i >= 0;) {
1969 [ - + ]: 5170 : Py_DECREF(values[_i]);
1970 : : }
1971 [ - + ]: 1911 : Py_DECREF(keys);
1972 : : #line 1366 "Python/bytecodes.c"
1973 : : if (map == NULL) { STACK_SHRINK(oparg); goto pop_1_error; }
1974 : : #line 1975 "Python/generated_cases.c.h"
1975 : 1911 : STACK_SHRINK(oparg);
1976 : 1911 : stack_pointer[-1] = map;
1977 : 1911 : DISPATCH();
1978 : : }
1979 : :
1980 : 750 : TARGET(DICT_UPDATE) {
1981 : 750 : PyObject *update = stack_pointer[-1];
1982 : : #line 1370 "Python/bytecodes.c"
1983 : : PyObject *dict = PEEK(oparg + 1); // update is still on the stack
1984 : : if (PyDict_Update(dict, update) < 0) {
1985 : : if (_PyErr_ExceptionMatches(tstate, PyExc_AttributeError)) {
1986 : : _PyErr_Format(tstate, PyExc_TypeError,
1987 : : "'%.200s' object is not a mapping",
1988 : : Py_TYPE(update)->tp_name);
1989 : : }
1990 : : #line 1991 "Python/generated_cases.c.h"
1991 [ # # ]: 0 : Py_DECREF(update);
1992 : : #line 1378 "Python/bytecodes.c"
1993 : : if (true) goto pop_1_error;
1994 : : }
1995 : : #line 1996 "Python/generated_cases.c.h"
1996 [ + - ]: 750 : Py_DECREF(update);
1997 : 750 : STACK_SHRINK(1);
1998 : 750 : DISPATCH();
1999 : : }
2000 : :
2001 : 102304 : TARGET(DICT_MERGE) {
2002 : 102304 : PyObject *update = stack_pointer[-1];
2003 : : #line 1384 "Python/bytecodes.c"
2004 : : PyObject *dict = PEEK(oparg + 1); // update is still on the stack
2005 : :
2006 : : if (_PyDict_MergeEx(dict, update, 2) < 0) {
2007 : : format_kwargs_error(tstate, PEEK(3 + oparg), update);
2008 : : #line 2009 "Python/generated_cases.c.h"
2009 [ # # ]: 0 : Py_DECREF(update);
2010 : : #line 1389 "Python/bytecodes.c"
2011 : : if (true) goto pop_1_error;
2012 : : }
2013 : : #line 2014 "Python/generated_cases.c.h"
2014 [ - + ]: 102304 : Py_DECREF(update);
2015 : 102304 : STACK_SHRINK(1);
2016 : : PREDICT(CALL_FUNCTION_EX);
2017 : 102304 : DISPATCH();
2018 : : }
2019 : :
2020 : 13896 : TARGET(MAP_ADD) {
2021 : 13896 : PyObject *value = stack_pointer[-1];
2022 : 13896 : PyObject *key = stack_pointer[-2];
2023 : : #line 1396 "Python/bytecodes.c"
2024 : : PyObject *dict = PEEK(oparg + 2); // key, value are still on the stack
2025 : : assert(PyDict_CheckExact(dict));
2026 : : /* dict[key] = value */
2027 : : // Do not DECREF INPUTS because the function steals the references
2028 : : if (_PyDict_SetItem_Take2((PyDictObject *)dict, key, value) != 0) goto pop_2_error;
2029 : : #line 2030 "Python/generated_cases.c.h"
2030 : 13896 : STACK_SHRINK(2);
2031 : : PREDICT(JUMP_BACKWARD);
2032 : 13896 : DISPATCH();
2033 : : }
2034 : :
2035 : 1650808 : TARGET(LOAD_ATTR) {
2036 : 1891903 : PREDICTED(LOAD_ATTR);
2037 : : static_assert(INLINE_CACHE_ENTRIES_LOAD_ATTR == 9, "incorrect cache size");
2038 : 1891903 : PyObject *owner = stack_pointer[-1];
2039 [ + + ]: 1891903 : PyObject *res2 = NULL;
2040 : : PyObject *res;
2041 : : #line 1419 "Python/bytecodes.c"
2042 : : #if ENABLE_SPECIALIZATION
2043 : : _PyAttrCache *cache = (_PyAttrCache *)next_instr;
2044 : : if (ADAPTIVE_COUNTER_IS_ZERO(cache->counter)) {
2045 : : assert(cframe.use_tracing == 0);
2046 : : PyObject *name = GETITEM(frame->f_code->co_names, oparg>>1);
2047 : : next_instr--;
2048 : : _Py_Specialize_LoadAttr(owner, next_instr, name);
2049 : : DISPATCH_SAME_OPARG();
2050 : : }
2051 : : STAT_INC(LOAD_ATTR, deferred);
2052 : : DECREMENT_ADAPTIVE_COUNTER(cache->counter);
2053 : : #endif /* ENABLE_SPECIALIZATION */
2054 : : PyObject *name = GETITEM(frame->f_code->co_names, oparg >> 1);
2055 : : if (oparg & 1) {
2056 : : /* Designed to work in tandem with CALL, pushes two values. */
2057 : : PyObject* meth = NULL;
2058 : : if (_PyObject_GetMethod(owner, name, &meth)) {
2059 : : /* We can bypass temporary bound method object.
2060 : : meth is unbound method and obj is self.
2061 : :
2062 : : meth | self | arg1 | ... | argN
2063 : : */
2064 : : assert(meth != NULL); // No errors on this branch
2065 : : res2 = meth;
2066 : : res = owner; // Transfer ownership
2067 : : }
2068 : : else {
2069 : : /* meth is not an unbound method (but a regular attr, or
2070 : : something was returned by a descriptor protocol). Set
2071 : : the second element of the stack to NULL, to signal
2072 : : CALL that it's not a method call.
2073 : :
2074 : : NULL | meth | arg1 | ... | argN
2075 : : */
2076 : : #line 2077 "Python/generated_cases.c.h"
2077 [ + + ]: 256938 : Py_DECREF(owner);
2078 : : #line 1454 "Python/bytecodes.c"
2079 : : if (meth == NULL) goto pop_1_error;
2080 : : res2 = NULL;
2081 : : res = meth;
2082 : : }
2083 : : }
2084 : : else {
2085 : : /* Classic, pushes one value. */
2086 : : res = PyObject_GetAttr(owner, name);
2087 : : #line 2088 "Python/generated_cases.c.h"
2088 [ + + ]: 1403529 : Py_DECREF(owner);
2089 : : #line 1463 "Python/bytecodes.c"
2090 : : if (res == NULL) goto pop_1_error;
2091 : : }
2092 : : #line 2093 "Python/generated_cases.c.h"
2093 : 1873557 : STACK_GROW(((oparg & 1) ? 1 : 0));
2094 : 1873557 : stack_pointer[-1] = res;
2095 [ + + ]: 1873557 : if (oparg & 1) { stack_pointer[-(1 + ((oparg & 1) ? 1 : 0))] = res2; }
2096 : 1873557 : next_instr += 9;
2097 : 1873557 : DISPATCH();
2098 : : }
2099 : :
2100 : 1481398 : TARGET(LOAD_ATTR_INSTANCE_VALUE) {
2101 : 1481398 : PyObject *owner = stack_pointer[-1];
2102 : 1481398 : PyObject *res2 = NULL;
2103 : : PyObject *res;
2104 : 1481398 : uint32_t type_version = read_u32(&next_instr[1].cache);
2105 : 1481398 : uint16_t index = read_u16(&next_instr[3].cache);
2106 : : #line 1468 "Python/bytecodes.c"
2107 : : assert(cframe.use_tracing == 0);
2108 : : PyTypeObject *tp = Py_TYPE(owner);
2109 : : assert(type_version != 0);
2110 : : DEOPT_IF(tp->tp_version_tag != type_version, LOAD_ATTR);
2111 : : assert(tp->tp_dictoffset < 0);
2112 : : assert(tp->tp_flags & Py_TPFLAGS_MANAGED_DICT);
2113 : : PyDictOrValues dorv = *_PyObject_DictOrValuesPointer(owner);
2114 : : DEOPT_IF(!_PyDictOrValues_IsValues(dorv), LOAD_ATTR);
2115 : : res = _PyDictOrValues_GetValues(dorv)->values[index];
2116 : : DEOPT_IF(res == NULL, LOAD_ATTR);
2117 : : STAT_INC(LOAD_ATTR, hit);
2118 : : Py_INCREF(res);
2119 : : res2 = NULL;
2120 : : #line 2121 "Python/generated_cases.c.h"
2121 [ - + ]: 1480649 : Py_DECREF(owner);
2122 : 1480649 : STACK_GROW(((oparg & 1) ? 1 : 0));
2123 : 1480649 : stack_pointer[-1] = res;
2124 [ + + ]: 1480649 : if (oparg & 1) { stack_pointer[-(1 + ((oparg & 1) ? 1 : 0))] = res2; }
2125 : 1480649 : next_instr += 9;
2126 : 1480649 : DISPATCH();
2127 : : }
2128 : :
2129 : 1473626 : TARGET(LOAD_ATTR_MODULE) {
2130 : 1473626 : PyObject *owner = stack_pointer[-1];
2131 : 1473626 : PyObject *res2 = NULL;
2132 : : PyObject *res;
2133 : 1473626 : uint32_t type_version = read_u32(&next_instr[1].cache);
2134 : 1473626 : uint16_t index = read_u16(&next_instr[3].cache);
2135 : : #line 1485 "Python/bytecodes.c"
2136 : : assert(cframe.use_tracing == 0);
2137 : : DEOPT_IF(!PyModule_CheckExact(owner), LOAD_ATTR);
2138 : : PyDictObject *dict = (PyDictObject *)((PyModuleObject *)owner)->md_dict;
2139 : : assert(dict != NULL);
2140 : : DEOPT_IF(dict->ma_keys->dk_version != type_version, LOAD_ATTR);
2141 : : assert(dict->ma_keys->dk_kind == DICT_KEYS_UNICODE);
2142 : : assert(index < dict->ma_keys->dk_nentries);
2143 : : PyDictUnicodeEntry *ep = DK_UNICODE_ENTRIES(dict->ma_keys) + index;
2144 : : res = ep->me_value;
2145 : : DEOPT_IF(res == NULL, LOAD_ATTR);
2146 : : STAT_INC(LOAD_ATTR, hit);
2147 : : Py_INCREF(res);
2148 : : res2 = NULL;
2149 : : #line 2150 "Python/generated_cases.c.h"
2150 [ - + ]: 1462832 : Py_DECREF(owner);
2151 : 1462832 : STACK_GROW(((oparg & 1) ? 1 : 0));
2152 : 1462832 : stack_pointer[-1] = res;
2153 [ + + ]: 1462832 : if (oparg & 1) { stack_pointer[-(1 + ((oparg & 1) ? 1 : 0))] = res2; }
2154 : 1462832 : next_instr += 9;
2155 : 1462832 : DISPATCH();
2156 : : }
2157 : :
2158 : 227690 : TARGET(LOAD_ATTR_WITH_HINT) {
2159 : 227690 : PyObject *owner = stack_pointer[-1];
2160 : 227690 : PyObject *res2 = NULL;
2161 : : PyObject *res;
2162 : 227690 : uint32_t type_version = read_u32(&next_instr[1].cache);
2163 : 227690 : uint16_t index = read_u16(&next_instr[3].cache);
2164 : : #line 1502 "Python/bytecodes.c"
2165 : : assert(cframe.use_tracing == 0);
2166 : : PyTypeObject *tp = Py_TYPE(owner);
2167 : : assert(type_version != 0);
2168 : : DEOPT_IF(tp->tp_version_tag != type_version, LOAD_ATTR);
2169 : : assert(tp->tp_flags & Py_TPFLAGS_MANAGED_DICT);
2170 : : PyDictOrValues dorv = *_PyObject_DictOrValuesPointer(owner);
2171 : : DEOPT_IF(_PyDictOrValues_IsValues(dorv), LOAD_ATTR);
2172 : : PyDictObject *dict = (PyDictObject *)_PyDictOrValues_GetDict(dorv);
2173 : : DEOPT_IF(dict == NULL, LOAD_ATTR);
2174 : : assert(PyDict_CheckExact((PyObject *)dict));
2175 : : PyObject *name = GETITEM(frame->f_code->co_names, oparg>>1);
2176 : : uint16_t hint = index;
2177 : : DEOPT_IF(hint >= (size_t)dict->ma_keys->dk_nentries, LOAD_ATTR);
2178 : : if (DK_IS_UNICODE(dict->ma_keys)) {
2179 : : PyDictUnicodeEntry *ep = DK_UNICODE_ENTRIES(dict->ma_keys) + hint;
2180 : : DEOPT_IF(ep->me_key != name, LOAD_ATTR);
2181 : : res = ep->me_value;
2182 : : }
2183 : : else {
2184 : : PyDictKeyEntry *ep = DK_ENTRIES(dict->ma_keys) + hint;
2185 : : DEOPT_IF(ep->me_key != name, LOAD_ATTR);
2186 : : res = ep->me_value;
2187 : : }
2188 : : DEOPT_IF(res == NULL, LOAD_ATTR);
2189 : : STAT_INC(LOAD_ATTR, hit);
2190 : : Py_INCREF(res);
2191 : : res2 = NULL;
2192 : : #line 2193 "Python/generated_cases.c.h"
2193 [ - + ]: 59 : Py_DECREF(owner);
2194 : 59 : STACK_GROW(((oparg & 1) ? 1 : 0));
2195 : 59 : stack_pointer[-1] = res;
2196 [ - + ]: 59 : if (oparg & 1) { stack_pointer[-(1 + ((oparg & 1) ? 1 : 0))] = res2; }
2197 : 59 : next_instr += 9;
2198 : 59 : DISPATCH();
2199 : : }
2200 : :
2201 : 375316 : TARGET(LOAD_ATTR_SLOT) {
2202 : 375316 : PyObject *owner = stack_pointer[-1];
2203 : 375316 : PyObject *res2 = NULL;
2204 : : PyObject *res;
2205 : 375316 : uint32_t type_version = read_u32(&next_instr[1].cache);
2206 : 375316 : uint16_t index = read_u16(&next_instr[3].cache);
2207 : : #line 1533 "Python/bytecodes.c"
2208 : : assert(cframe.use_tracing == 0);
2209 : : PyTypeObject *tp = Py_TYPE(owner);
2210 : : assert(type_version != 0);
2211 : : DEOPT_IF(tp->tp_version_tag != type_version, LOAD_ATTR);
2212 : : char *addr = (char *)owner + index;
2213 : : res = *(PyObject **)addr;
2214 : : DEOPT_IF(res == NULL, LOAD_ATTR);
2215 : : STAT_INC(LOAD_ATTR, hit);
2216 : : Py_INCREF(res);
2217 : : res2 = NULL;
2218 : : #line 2219 "Python/generated_cases.c.h"
2219 [ - + ]: 374910 : Py_DECREF(owner);
2220 : 374910 : STACK_GROW(((oparg & 1) ? 1 : 0));
2221 : 374910 : stack_pointer[-1] = res;
2222 [ + + ]: 374910 : if (oparg & 1) { stack_pointer[-(1 + ((oparg & 1) ? 1 : 0))] = res2; }
2223 : 374910 : next_instr += 9;
2224 : 374910 : DISPATCH();
2225 : : }
2226 : :
2227 : 376321 : TARGET(LOAD_ATTR_CLASS) {
2228 : 376321 : PyObject *cls = stack_pointer[-1];
2229 : 376321 : PyObject *res2 = NULL;
2230 : : PyObject *res;
2231 : 376321 : uint32_t type_version = read_u32(&next_instr[1].cache);
2232 : 376321 : PyObject *descr = read_obj(&next_instr[5].cache);
2233 : : #line 1547 "Python/bytecodes.c"
2234 : : assert(cframe.use_tracing == 0);
2235 : :
2236 : : DEOPT_IF(!PyType_Check(cls), LOAD_ATTR);
2237 : : DEOPT_IF(((PyTypeObject *)cls)->tp_version_tag != type_version,
2238 : : LOAD_ATTR);
2239 : : assert(type_version != 0);
2240 : :
2241 : : STAT_INC(LOAD_ATTR, hit);
2242 : : res2 = NULL;
2243 : : res = descr;
2244 : : assert(res != NULL);
2245 : : Py_INCREF(res);
2246 : : #line 2247 "Python/generated_cases.c.h"
2247 [ - + ]: 376319 : Py_DECREF(cls);
2248 : 376319 : STACK_GROW(((oparg & 1) ? 1 : 0));
2249 : 376319 : stack_pointer[-1] = res;
2250 [ - + ]: 376319 : if (oparg & 1) { stack_pointer[-(1 + ((oparg & 1) ? 1 : 0))] = res2; }
2251 : 376319 : next_instr += 9;
2252 : 376319 : DISPATCH();
2253 : : }
2254 : :
2255 : 41965 : TARGET(LOAD_ATTR_PROPERTY) {
2256 : 41965 : PyObject *owner = stack_pointer[-1];
2257 : 41965 : uint32_t type_version = read_u32(&next_instr[1].cache);
2258 : 41965 : uint32_t func_version = read_u32(&next_instr[3].cache);
2259 : 41965 : PyObject *fget = read_obj(&next_instr[5].cache);
2260 : : #line 1563 "Python/bytecodes.c"
2261 : : assert(cframe.use_tracing == 0);
2262 : : DEOPT_IF(tstate->interp->eval_frame, LOAD_ATTR);
2263 : :
2264 : : PyTypeObject *cls = Py_TYPE(owner);
2265 : : DEOPT_IF(cls->tp_version_tag != type_version, LOAD_ATTR);
2266 : : assert(type_version != 0);
2267 : : assert(Py_IS_TYPE(fget, &PyFunction_Type));
2268 : : PyFunctionObject *f = (PyFunctionObject *)fget;
2269 : : assert(func_version != 0);
2270 : : DEOPT_IF(f->func_version != func_version, LOAD_ATTR);
2271 : : PyCodeObject *code = (PyCodeObject *)f->func_code;
2272 : : assert(code->co_argcount == 1);
2273 : : DEOPT_IF(!_PyThreadState_HasStackSpace(tstate, code->co_framesize), LOAD_ATTR);
2274 : : STAT_INC(LOAD_ATTR, hit);
2275 : : Py_INCREF(fget);
2276 : : _PyInterpreterFrame *new_frame = _PyFrame_PushUnchecked(tstate, f, 1);
2277 : : // Manipulate stack directly because we exit with DISPATCH_INLINED().
2278 : : SET_TOP(NULL);
2279 : : int shrink_stack = !(oparg & 1);
2280 : : STACK_SHRINK(shrink_stack);
2281 : : new_frame->localsplus[0] = owner;
2282 : : JUMPBY(INLINE_CACHE_ENTRIES_LOAD_ATTR);
2283 : : DISPATCH_INLINED(new_frame);
2284 : : #line 2285 "Python/generated_cases.c.h"
2285 : : }
2286 : :
2287 : 0 : TARGET(LOAD_ATTR_GETATTRIBUTE_OVERRIDDEN) {
2288 : 0 : PyObject *owner = stack_pointer[-1];
2289 : 0 : uint32_t type_version = read_u32(&next_instr[1].cache);
2290 : 0 : uint32_t func_version = read_u32(&next_instr[3].cache);
2291 : 0 : PyObject *getattribute = read_obj(&next_instr[5].cache);
2292 : : #line 1589 "Python/bytecodes.c"
2293 : : assert(cframe.use_tracing == 0);
2294 : : DEOPT_IF(tstate->interp->eval_frame, LOAD_ATTR);
2295 : : PyTypeObject *cls = Py_TYPE(owner);
2296 : : DEOPT_IF(cls->tp_version_tag != type_version, LOAD_ATTR);
2297 : : assert(type_version != 0);
2298 : : assert(Py_IS_TYPE(getattribute, &PyFunction_Type));
2299 : : PyFunctionObject *f = (PyFunctionObject *)getattribute;
2300 : : assert(func_version != 0);
2301 : : DEOPT_IF(f->func_version != func_version, LOAD_ATTR);
2302 : : PyCodeObject *code = (PyCodeObject *)f->func_code;
2303 : : assert(code->co_argcount == 2);
2304 : : DEOPT_IF(!_PyThreadState_HasStackSpace(tstate, code->co_framesize), LOAD_ATTR);
2305 : : STAT_INC(LOAD_ATTR, hit);
2306 : :
2307 : : PyObject *name = GETITEM(frame->f_code->co_names, oparg >> 1);
2308 : : Py_INCREF(f);
2309 : : _PyInterpreterFrame *new_frame = _PyFrame_PushUnchecked(tstate, f, 2);
2310 : : // Manipulate stack directly because we exit with DISPATCH_INLINED().
2311 : : SET_TOP(NULL);
2312 : : int shrink_stack = !(oparg & 1);
2313 : : STACK_SHRINK(shrink_stack);
2314 : : new_frame->localsplus[0] = owner;
2315 : : new_frame->localsplus[1] = Py_NewRef(name);
2316 : : JUMPBY(INLINE_CACHE_ENTRIES_LOAD_ATTR);
2317 : : DISPATCH_INLINED(new_frame);
2318 : : #line 2319 "Python/generated_cases.c.h"
2319 : : }
2320 : :
2321 : 842732 : TARGET(STORE_ATTR_INSTANCE_VALUE) {
2322 : 842732 : PyObject *owner = stack_pointer[-1];
2323 : 842732 : PyObject *value = stack_pointer[-2];
2324 : 842732 : uint32_t type_version = read_u32(&next_instr[1].cache);
2325 : 842732 : uint16_t index = read_u16(&next_instr[3].cache);
2326 : : #line 1617 "Python/bytecodes.c"
2327 : : assert(cframe.use_tracing == 0);
2328 : : PyTypeObject *tp = Py_TYPE(owner);
2329 : : assert(type_version != 0);
2330 : : DEOPT_IF(tp->tp_version_tag != type_version, STORE_ATTR);
2331 : : assert(tp->tp_flags & Py_TPFLAGS_MANAGED_DICT);
2332 : : PyDictOrValues dorv = *_PyObject_DictOrValuesPointer(owner);
2333 : : DEOPT_IF(!_PyDictOrValues_IsValues(dorv), STORE_ATTR);
2334 : : STAT_INC(STORE_ATTR, hit);
2335 : : PyDictValues *values = _PyDictOrValues_GetValues(dorv);
2336 : : PyObject *old_value = values->values[index];
2337 : : values->values[index] = value;
2338 : : if (old_value == NULL) {
2339 : : _PyDictValues_AddToInsertionOrder(values, index);
2340 : : }
2341 : : else {
2342 : : Py_DECREF(old_value);
2343 : : }
2344 : : Py_DECREF(owner);
2345 : : #line 2346 "Python/generated_cases.c.h"
2346 : 841574 : STACK_SHRINK(2);
2347 : 841574 : next_instr += 4;
2348 : 841574 : DISPATCH();
2349 : : }
2350 : :
2351 : 319989 : TARGET(STORE_ATTR_WITH_HINT) {
2352 : 319989 : PyObject *owner = stack_pointer[-1];
2353 : 319989 : PyObject *value = stack_pointer[-2];
2354 : 319989 : uint32_t type_version = read_u32(&next_instr[1].cache);
2355 : 319989 : uint16_t hint = read_u16(&next_instr[3].cache);
2356 : : #line 1638 "Python/bytecodes.c"
2357 : : assert(cframe.use_tracing == 0);
2358 : : PyTypeObject *tp = Py_TYPE(owner);
2359 : : assert(type_version != 0);
2360 : : DEOPT_IF(tp->tp_version_tag != type_version, STORE_ATTR);
2361 : : assert(tp->tp_flags & Py_TPFLAGS_MANAGED_DICT);
2362 : : PyDictOrValues dorv = *_PyObject_DictOrValuesPointer(owner);
2363 : : DEOPT_IF(_PyDictOrValues_IsValues(dorv), STORE_ATTR);
2364 : : PyDictObject *dict = (PyDictObject *)_PyDictOrValues_GetDict(dorv);
2365 : : DEOPT_IF(dict == NULL, STORE_ATTR);
2366 : : assert(PyDict_CheckExact((PyObject *)dict));
2367 : : PyObject *name = GETITEM(frame->f_code->co_names, oparg);
2368 : : DEOPT_IF(hint >= (size_t)dict->ma_keys->dk_nentries, STORE_ATTR);
2369 : : PyObject *old_value;
2370 : : uint64_t new_version;
2371 : : if (DK_IS_UNICODE(dict->ma_keys)) {
2372 : : PyDictUnicodeEntry *ep = DK_UNICODE_ENTRIES(dict->ma_keys) + hint;
2373 : : DEOPT_IF(ep->me_key != name, STORE_ATTR);
2374 : : old_value = ep->me_value;
2375 : : DEOPT_IF(old_value == NULL, STORE_ATTR);
2376 : : new_version = _PyDict_NotifyEvent(tstate->interp, PyDict_EVENT_MODIFIED, dict, name, value);
2377 : : ep->me_value = value;
2378 : : }
2379 : : else {
2380 : : PyDictKeyEntry *ep = DK_ENTRIES(dict->ma_keys) + hint;
2381 : : DEOPT_IF(ep->me_key != name, STORE_ATTR);
2382 : : old_value = ep->me_value;
2383 : : DEOPT_IF(old_value == NULL, STORE_ATTR);
2384 : : new_version = _PyDict_NotifyEvent(tstate->interp, PyDict_EVENT_MODIFIED, dict, name, value);
2385 : : ep->me_value = value;
2386 : : }
2387 : : Py_DECREF(old_value);
2388 : : STAT_INC(STORE_ATTR, hit);
2389 : : /* Ensure dict is GC tracked if it needs to be */
2390 : : if (!_PyObject_GC_IS_TRACKED(dict) && _PyObject_GC_MAY_BE_TRACKED(value)) {
2391 : : _PyObject_GC_TRACK(dict);
2392 : : }
2393 : : /* PEP 509 */
2394 : : dict->ma_version_tag = new_version;
2395 : : Py_DECREF(owner);
2396 : : #line 2397 "Python/generated_cases.c.h"
2397 : 0 : STACK_SHRINK(2);
2398 : 0 : next_instr += 4;
2399 : 0 : DISPATCH();
2400 : : }
2401 : :
2402 : 266076 : TARGET(STORE_ATTR_SLOT) {
2403 : 266076 : PyObject *owner = stack_pointer[-1];
2404 : 266076 : PyObject *value = stack_pointer[-2];
2405 : 266076 : uint32_t type_version = read_u32(&next_instr[1].cache);
2406 : 266076 : uint16_t index = read_u16(&next_instr[3].cache);
2407 : : #line 1680 "Python/bytecodes.c"
2408 : : assert(cframe.use_tracing == 0);
2409 : : PyTypeObject *tp = Py_TYPE(owner);
2410 : : assert(type_version != 0);
2411 : : DEOPT_IF(tp->tp_version_tag != type_version, STORE_ATTR);
2412 : : char *addr = (char *)owner + index;
2413 : : STAT_INC(STORE_ATTR, hit);
2414 : : PyObject *old_value = *(PyObject **)addr;
2415 : : *(PyObject **)addr = value;
2416 : : Py_XDECREF(old_value);
2417 : : Py_DECREF(owner);
2418 : : #line 2419 "Python/generated_cases.c.h"
2419 : 266015 : STACK_SHRINK(2);
2420 : 266015 : next_instr += 4;
2421 : 266015 : DISPATCH();
2422 : : }
2423 : :
2424 : 163293 : TARGET(COMPARE_OP) {
2425 : 163293 : PyObject *right = stack_pointer[-1];
2426 : 163293 : PyObject *left = stack_pointer[-2];
2427 : : PyObject *res;
2428 : : #line 1693 "Python/bytecodes.c"
2429 : : STAT_INC(COMPARE_OP, deferred);
2430 : : assert((oparg >> 4) <= Py_GE);
2431 : : res = PyObject_RichCompare(left, right, oparg>>4);
2432 : : #line 2433 "Python/generated_cases.c.h"
2433 [ + + ]: 163293 : Py_DECREF(left);
2434 [ + + ]: 163293 : Py_DECREF(right);
2435 : : #line 1697 "Python/bytecodes.c"
2436 : : if (res == NULL) goto pop_2_error;
2437 : : #line 2438 "Python/generated_cases.c.h"
2438 : 163293 : STACK_SHRINK(1);
2439 : 163293 : stack_pointer[-1] = res;
2440 : 163293 : next_instr += 1;
2441 : 163293 : DISPATCH();
2442 : : }
2443 : :
2444 : 110231 : TARGET(COMPARE_AND_BRANCH) {
2445 : 143382 : PREDICTED(COMPARE_AND_BRANCH);
2446 : 143382 : PyObject *right = stack_pointer[-1];
2447 [ + + ]: 143382 : PyObject *left = stack_pointer[-2];
2448 : : #line 1709 "Python/bytecodes.c"
2449 : : #if ENABLE_SPECIALIZATION
2450 : : _PyCompareOpCache *cache = (_PyCompareOpCache *)next_instr;
2451 : : if (ADAPTIVE_COUNTER_IS_ZERO(cache->counter)) {
2452 : : assert(cframe.use_tracing == 0);
2453 : : next_instr--;
2454 : : _Py_Specialize_CompareAndBranch(left, right, next_instr, oparg);
2455 : : DISPATCH_SAME_OPARG();
2456 : : }
2457 : : STAT_INC(COMPARE_AND_BRANCH, deferred);
2458 : : DECREMENT_ADAPTIVE_COUNTER(cache->counter);
2459 : : #endif /* ENABLE_SPECIALIZATION */
2460 : : assert((oparg >> 4) <= Py_GE);
2461 : : PyObject *cond = PyObject_RichCompare(left, right, oparg>>4);
2462 : : #line 2463 "Python/generated_cases.c.h"
2463 [ + + ]: 139548 : Py_DECREF(left);
2464 [ + + ]: 139548 : Py_DECREF(right);
2465 : : #line 1723 "Python/bytecodes.c"
2466 : : if (cond == NULL) goto pop_2_error;
2467 : : assert(next_instr[1].op.code == POP_JUMP_IF_FALSE ||
2468 : : next_instr[1].op.code == POP_JUMP_IF_TRUE);
2469 : : bool jump_on_true = next_instr[1].op.code == POP_JUMP_IF_TRUE;
2470 : : int offset = next_instr[1].op.arg;
2471 : : int err = PyObject_IsTrue(cond);
2472 : : Py_DECREF(cond);
2473 : : if (err < 0) goto pop_2_error;
2474 : : if (jump_on_true == (err != 0)) {
2475 : : JUMPBY(offset);
2476 : : }
2477 : : #line 2478 "Python/generated_cases.c.h"
2478 : 139548 : STACK_SHRINK(2);
2479 : 139548 : next_instr += 2;
2480 : 139548 : DISPATCH();
2481 : : }
2482 : :
2483 : 92283 : TARGET(COMPARE_AND_BRANCH_FLOAT) {
2484 : 92283 : PyObject *right = stack_pointer[-1];
2485 [ + + ]: 92283 : PyObject *left = stack_pointer[-2];
2486 : : #line 1737 "Python/bytecodes.c"
2487 : : assert(cframe.use_tracing == 0);
2488 : : DEOPT_IF(!PyFloat_CheckExact(left), COMPARE_AND_BRANCH);
2489 : : DEOPT_IF(!PyFloat_CheckExact(right), COMPARE_AND_BRANCH);
2490 : : STAT_INC(COMPARE_AND_BRANCH, hit);
2491 : : double dleft = PyFloat_AS_DOUBLE(left);
2492 : : double dright = PyFloat_AS_DOUBLE(right);
2493 : : // 1 if NaN, 2 if <, 4 if >, 8 if ==; this matches low four bits of the oparg
2494 : : int sign_ish = COMPARISON_BIT(dleft, dright);
2495 : : _Py_DECREF_SPECIALIZED(left, _PyFloat_ExactDealloc);
2496 : : _Py_DECREF_SPECIALIZED(right, _PyFloat_ExactDealloc);
2497 : : if (sign_ish & oparg) {
2498 : : int offset = next_instr[1].op.arg;
2499 : : JUMPBY(offset);
2500 : : }
2501 : : #line 2502 "Python/generated_cases.c.h"
2502 : 91957 : STACK_SHRINK(2);
2503 : 91957 : next_instr += 2;
2504 : 91957 : DISPATCH();
2505 : : }
2506 : :
2507 : 2025806 : TARGET(COMPARE_AND_BRANCH_INT) {
2508 : 2025806 : PyObject *right = stack_pointer[-1];
2509 [ - + ]: 2025806 : PyObject *left = stack_pointer[-2];
2510 : : #line 1755 "Python/bytecodes.c"
2511 : : assert(cframe.use_tracing == 0);
2512 : : DEOPT_IF(!PyLong_CheckExact(left), COMPARE_AND_BRANCH);
2513 : : DEOPT_IF(!PyLong_CheckExact(right), COMPARE_AND_BRANCH);
2514 : : DEOPT_IF((size_t)(Py_SIZE(left) + 1) > 2, COMPARE_AND_BRANCH);
2515 : : DEOPT_IF((size_t)(Py_SIZE(right) + 1) > 2, COMPARE_AND_BRANCH);
2516 : : STAT_INC(COMPARE_AND_BRANCH, hit);
2517 : : assert(Py_ABS(Py_SIZE(left)) <= 1 && Py_ABS(Py_SIZE(right)) <= 1);
2518 : : Py_ssize_t ileft = Py_SIZE(left) * ((PyLongObject *)left)->long_value.ob_digit[0];
2519 : : Py_ssize_t iright = Py_SIZE(right) * ((PyLongObject *)right)->long_value.ob_digit[0];
2520 : : // 2 if <, 4 if >, 8 if ==; this matches the low 4 bits of the oparg
2521 : : int sign_ish = COMPARISON_BIT(ileft, iright);
2522 : : _Py_DECREF_SPECIALIZED(left, (destructor)PyObject_Free);
2523 : : _Py_DECREF_SPECIALIZED(right, (destructor)PyObject_Free);
2524 : : if (sign_ish & oparg) {
2525 : : int offset = next_instr[1].op.arg;
2526 : : JUMPBY(offset);
2527 : : }
2528 : : #line 2529 "Python/generated_cases.c.h"
2529 : 1993163 : STACK_SHRINK(2);
2530 : 1993163 : next_instr += 2;
2531 : 1993163 : DISPATCH();
2532 : : }
2533 : :
2534 : 34573 : TARGET(COMPARE_AND_BRANCH_STR) {
2535 : 34573 : PyObject *right = stack_pointer[-1];
2536 [ + + ]: 34573 : PyObject *left = stack_pointer[-2];
2537 : : #line 1776 "Python/bytecodes.c"
2538 : : assert(cframe.use_tracing == 0);
2539 : : DEOPT_IF(!PyUnicode_CheckExact(left), COMPARE_AND_BRANCH);
2540 : : DEOPT_IF(!PyUnicode_CheckExact(right), COMPARE_AND_BRANCH);
2541 : : STAT_INC(COMPARE_AND_BRANCH, hit);
2542 : : int res = _PyUnicode_Equal(left, right);
2543 : : assert((oparg >>4) == Py_EQ || (oparg >>4) == Py_NE);
2544 : : _Py_DECREF_SPECIALIZED(left, _PyUnicode_ExactDealloc);
2545 : : _Py_DECREF_SPECIALIZED(right, _PyUnicode_ExactDealloc);
2546 : : assert(res == 0 || res == 1);
2547 : : assert((oparg & 0xf) == COMPARISON_NOT_EQUALS || (oparg & 0xf) == COMPARISON_EQUALS);
2548 : : assert(COMPARISON_NOT_EQUALS + 1 == COMPARISON_EQUALS);
2549 : : if ((res + COMPARISON_NOT_EQUALS) & oparg) {
2550 : : int offset = next_instr[1].op.arg;
2551 : : JUMPBY(offset);
2552 : : }
2553 : : #line 2554 "Python/generated_cases.c.h"
2554 : 34391 : STACK_SHRINK(2);
2555 : 34391 : next_instr += 2;
2556 : 34391 : DISPATCH();
2557 : : }
2558 : :
2559 : 242056 : TARGET(IS_OP) {
2560 : 242056 : PyObject *right = stack_pointer[-1];
2561 [ + + ]: 242056 : PyObject *left = stack_pointer[-2];
2562 : : PyObject *b;
2563 : : #line 1794 "Python/bytecodes.c"
2564 : : int res = Py_Is(left, right) ^ oparg;
2565 : : #line 2566 "Python/generated_cases.c.h"
2566 [ + + ]: 242056 : Py_DECREF(left);
2567 [ - + ]: 242056 : Py_DECREF(right);
2568 : : #line 1796 "Python/bytecodes.c"
2569 : : b = Py_NewRef(res ? Py_True : Py_False);
2570 : : #line 2571 "Python/generated_cases.c.h"
2571 : 242056 : STACK_SHRINK(1);
2572 : 242056 : stack_pointer[-1] = b;
2573 : 242056 : DISPATCH();
2574 : : }
2575 : :
2576 : 66972 : TARGET(CONTAINS_OP) {
2577 : 66972 : PyObject *right = stack_pointer[-1];
2578 : 66972 : PyObject *left = stack_pointer[-2];
2579 : : PyObject *b;
2580 : : #line 1800 "Python/bytecodes.c"
2581 : : int res = PySequence_Contains(right, left);
2582 : : #line 2583 "Python/generated_cases.c.h"
2583 [ + + ]: 66972 : Py_DECREF(left);
2584 [ + + ]: 66972 : Py_DECREF(right);
2585 : : #line 1802 "Python/bytecodes.c"
2586 : : if (res < 0) goto pop_2_error;
2587 : : b = Py_NewRef((res^oparg) ? Py_True : Py_False);
2588 : : #line 2589 "Python/generated_cases.c.h"
2589 : 66972 : STACK_SHRINK(1);
2590 : 66972 : stack_pointer[-1] = b;
2591 : 66972 : DISPATCH();
2592 : : }
2593 : :
2594 : 0 : TARGET(CHECK_EG_MATCH) {
2595 : 0 : PyObject *match_type = stack_pointer[-1];
2596 : 0 : PyObject *exc_value = stack_pointer[-2];
2597 : : PyObject *rest;
2598 : : PyObject *match;
2599 : : #line 1807 "Python/bytecodes.c"
2600 : : if (check_except_star_type_valid(tstate, match_type) < 0) {
2601 : : #line 2602 "Python/generated_cases.c.h"
2602 [ # # ]: 0 : Py_DECREF(exc_value);
2603 [ # # ]: 0 : Py_DECREF(match_type);
2604 : : #line 1809 "Python/bytecodes.c"
2605 : : if (true) goto pop_2_error;
2606 : : }
2607 : :
2608 : : match = NULL;
2609 : : rest = NULL;
2610 : : int res = exception_group_match(exc_value, match_type,
2611 : : &match, &rest);
2612 : : #line 2613 "Python/generated_cases.c.h"
2613 [ # # ]: 0 : Py_DECREF(exc_value);
2614 [ # # ]: 0 : Py_DECREF(match_type);
2615 : : #line 1817 "Python/bytecodes.c"
2616 : : if (res < 0) goto pop_2_error;
2617 : :
2618 : : assert((match == NULL) == (rest == NULL));
2619 : : if (match == NULL) goto pop_2_error;
2620 : :
2621 : : if (!Py_IsNone(match)) {
2622 : : PyErr_SetExcInfo(NULL, Py_NewRef(match), NULL);
2623 : : }
2624 : : #line 2625 "Python/generated_cases.c.h"
2625 : 0 : stack_pointer[-1] = match;
2626 : 0 : stack_pointer[-2] = rest;
2627 : 0 : DISPATCH();
2628 : : }
2629 : :
2630 : 101696 : TARGET(CHECK_EXC_MATCH) {
2631 : 101696 : PyObject *right = stack_pointer[-1];
2632 : 101696 : PyObject *left = stack_pointer[-2];
2633 : : PyObject *b;
2634 : : #line 1828 "Python/bytecodes.c"
2635 : : assert(PyExceptionInstance_Check(left));
2636 : : if (check_except_type_valid(tstate, right) < 0) {
2637 : : #line 2638 "Python/generated_cases.c.h"
2638 [ # # ]: 0 : Py_DECREF(right);
2639 : : #line 1831 "Python/bytecodes.c"
2640 : : if (true) goto pop_1_error;
2641 : : }
2642 : :
2643 : : int res = PyErr_GivenExceptionMatches(left, right);
2644 : : #line 2645 "Python/generated_cases.c.h"
2645 [ + + ]: 101696 : Py_DECREF(right);
2646 : : #line 1836 "Python/bytecodes.c"
2647 : : b = Py_NewRef(res ? Py_True : Py_False);
2648 : : #line 2649 "Python/generated_cases.c.h"
2649 : 101696 : stack_pointer[-1] = b;
2650 : 101696 : DISPATCH();
2651 : : }
2652 : :
2653 : 3157 : TARGET(IMPORT_NAME) {
2654 : 3157 : PyObject *fromlist = stack_pointer[-1];
2655 : 3157 : PyObject *level = stack_pointer[-2];
2656 : : PyObject *res;
2657 : : #line 1840 "Python/bytecodes.c"
2658 : : PyObject *name = GETITEM(frame->f_code->co_names, oparg);
2659 : : res = import_name(tstate, frame, name, fromlist, level);
2660 : : #line 2661 "Python/generated_cases.c.h"
2661 [ - + ]: 3157 : Py_DECREF(level);
2662 [ - + ]: 3157 : Py_DECREF(fromlist);
2663 : : #line 1843 "Python/bytecodes.c"
2664 : : if (res == NULL) goto pop_2_error;
2665 : : #line 2666 "Python/generated_cases.c.h"
2666 : 3113 : STACK_SHRINK(1);
2667 : 3113 : stack_pointer[-1] = res;
2668 : 3113 : DISPATCH();
2669 : : }
2670 : :
2671 : 2022 : TARGET(IMPORT_FROM) {
2672 : 2022 : PyObject *from = stack_pointer[-1];
2673 : : PyObject *res;
2674 : : #line 1847 "Python/bytecodes.c"
2675 : : PyObject *name = GETITEM(frame->f_code->co_names, oparg);
2676 : : res = import_from(tstate, from, name);
2677 : : if (res == NULL) goto error;
2678 : : #line 2679 "Python/generated_cases.c.h"
2679 : 1994 : STACK_GROW(1);
2680 : 1994 : stack_pointer[-1] = res;
2681 : 1994 : DISPATCH();
2682 : : }
2683 : :
2684 : 101239 : TARGET(JUMP_FORWARD) {
2685 : : #line 1853 "Python/bytecodes.c"
2686 : : JUMPBY(oparg);
2687 : : #line 2688 "Python/generated_cases.c.h"
2688 : 101239 : DISPATCH();
2689 : : }
2690 : :
2691 : 3172588 : TARGET(JUMP_BACKWARD) {
2692 [ + + ]: 3172588 : PREDICTED(JUMP_BACKWARD);
2693 : : #line 1857 "Python/bytecodes.c"
2694 : : assert(oparg < INSTR_OFFSET());
2695 : : JUMPBY(-oparg);
2696 : : #line 2697 "Python/generated_cases.c.h"
2697 [ + + ]: 3172588 : CHECK_EVAL_BREAKER();
2698 : 3172587 : DISPATCH();
2699 : : }
2700 : :
2701 : 1257996 : TARGET(POP_JUMP_IF_FALSE) {
2702 : 1257996 : PREDICTED(POP_JUMP_IF_FALSE);
2703 [ + + ]: 1257996 : PyObject *cond = stack_pointer[-1];
2704 : : #line 1863 "Python/bytecodes.c"
2705 : : if (Py_IsTrue(cond)) {
2706 : : _Py_DECREF_NO_DEALLOC(cond);
2707 : : }
2708 : : else if (Py_IsFalse(cond)) {
2709 : : _Py_DECREF_NO_DEALLOC(cond);
2710 : : JUMPBY(oparg);
2711 : : }
2712 : : else {
2713 : : int err = PyObject_IsTrue(cond);
2714 : : #line 2715 "Python/generated_cases.c.h"
2715 [ + + ]: 77359 : Py_DECREF(cond);
2716 : : #line 1873 "Python/bytecodes.c"
2717 : : if (err == 0) {
2718 : : JUMPBY(oparg);
2719 : : }
2720 : : else {
2721 : : if (err < 0) goto pop_1_error;
2722 : : }
2723 : : }
2724 : : #line 2725 "Python/generated_cases.c.h"
2725 : 1257996 : STACK_SHRINK(1);
2726 : 1257996 : DISPATCH();
2727 : : }
2728 : :
2729 : 667438 : TARGET(POP_JUMP_IF_TRUE) {
2730 [ + + ]: 667438 : PyObject *cond = stack_pointer[-1];
2731 : : #line 1883 "Python/bytecodes.c"
2732 : : if (Py_IsFalse(cond)) {
2733 : : _Py_DECREF_NO_DEALLOC(cond);
2734 : : }
2735 : : else if (Py_IsTrue(cond)) {
2736 : : _Py_DECREF_NO_DEALLOC(cond);
2737 : : JUMPBY(oparg);
2738 : : }
2739 : : else {
2740 : : int err = PyObject_IsTrue(cond);
2741 : : #line 2742 "Python/generated_cases.c.h"
2742 [ + + ]: 532230 : Py_DECREF(cond);
2743 : : #line 1893 "Python/bytecodes.c"
2744 : : if (err > 0) {
2745 : : JUMPBY(oparg);
2746 : : }
2747 : : else {
2748 : : if (err < 0) goto pop_1_error;
2749 : : }
2750 : : }
2751 : : #line 2752 "Python/generated_cases.c.h"
2752 : 667438 : STACK_SHRINK(1);
2753 : 667438 : DISPATCH();
2754 : : }
2755 : :
2756 : 513172 : TARGET(POP_JUMP_IF_NOT_NONE) {
2757 [ + + ]: 513172 : PyObject *value = stack_pointer[-1];
2758 : : #line 1903 "Python/bytecodes.c"
2759 : : if (!Py_IsNone(value)) {
2760 : : #line 2761 "Python/generated_cases.c.h"
2761 [ + + ]: 146583 : Py_DECREF(value);
2762 : : #line 1905 "Python/bytecodes.c"
2763 : : JUMPBY(oparg);
2764 : : }
2765 : : else {
2766 : : _Py_DECREF_NO_DEALLOC(value);
2767 : : }
2768 : : #line 2769 "Python/generated_cases.c.h"
2769 : 513172 : STACK_SHRINK(1);
2770 : 513172 : DISPATCH();
2771 : : }
2772 : :
2773 : 186654 : TARGET(POP_JUMP_IF_NONE) {
2774 [ + + ]: 186654 : PyObject *value = stack_pointer[-1];
2775 : : #line 1913 "Python/bytecodes.c"
2776 : : if (Py_IsNone(value)) {
2777 : : _Py_DECREF_NO_DEALLOC(value);
2778 : : JUMPBY(oparg);
2779 : : }
2780 : : else {
2781 : : #line 2782 "Python/generated_cases.c.h"
2782 [ - + ]: 23894 : Py_DECREF(value);
2783 : : #line 1919 "Python/bytecodes.c"
2784 : : }
2785 : : #line 2786 "Python/generated_cases.c.h"
2786 : 186654 : STACK_SHRINK(1);
2787 : 186654 : DISPATCH();
2788 : : }
2789 : :
2790 : 99575 : TARGET(JUMP_IF_FALSE_OR_POP) {
2791 [ + + ]: 99575 : PyObject *cond = stack_pointer[-1];
2792 : : #line 1923 "Python/bytecodes.c"
2793 : : bool jump = false;
2794 : : int err;
2795 : : if (Py_IsTrue(cond)) {
2796 : : _Py_DECREF_NO_DEALLOC(cond);
2797 : : }
2798 : : else if (Py_IsFalse(cond)) {
2799 : : JUMPBY(oparg);
2800 : : jump = true;
2801 : : }
2802 : : else {
2803 : : err = PyObject_IsTrue(cond);
2804 : : if (err > 0) {
2805 : : Py_DECREF(cond);
2806 : : }
2807 : : else if (err == 0) {
2808 : : JUMPBY(oparg);
2809 : : jump = true;
2810 : : }
2811 : : else {
2812 : : goto error;
2813 : : }
2814 : : }
2815 : : #line 2816 "Python/generated_cases.c.h"
2816 : 99575 : STACK_SHRINK(1);
2817 [ + + ]: 99575 : STACK_GROW((jump ? 1 : 0));
2818 : 99575 : DISPATCH();
2819 : : }
2820 : :
2821 : 18928 : TARGET(JUMP_IF_TRUE_OR_POP) {
2822 [ + + ]: 18928 : PyObject *cond = stack_pointer[-1];
2823 : : #line 1948 "Python/bytecodes.c"
2824 : : bool jump = false;
2825 : : int err;
2826 : : if (Py_IsFalse(cond)) {
2827 : : _Py_DECREF_NO_DEALLOC(cond);
2828 : : }
2829 : : else if (Py_IsTrue(cond)) {
2830 : : JUMPBY(oparg);
2831 : : jump = true;
2832 : : }
2833 : : else {
2834 : : err = PyObject_IsTrue(cond);
2835 : : if (err > 0) {
2836 : : JUMPBY(oparg);
2837 : : jump = true;
2838 : : }
2839 : : else if (err == 0) {
2840 : : Py_DECREF(cond);
2841 : : }
2842 : : else {
2843 : : goto error;
2844 : : }
2845 : : }
2846 : : #line 2847 "Python/generated_cases.c.h"
2847 : 18928 : STACK_SHRINK(1);
2848 [ + + ]: 18928 : STACK_GROW((jump ? 1 : 0));
2849 : 18928 : DISPATCH();
2850 : : }
2851 : :
2852 : 339 : TARGET(JUMP_BACKWARD_NO_INTERRUPT) {
2853 : : #line 1973 "Python/bytecodes.c"
2854 : : /* This bytecode is used in the `yield from` or `await` loop.
2855 : : * If there is an interrupt, we want it handled in the innermost
2856 : : * generator or coroutine, so we deliberately do not check it here.
2857 : : * (see bpo-30039).
2858 : : */
2859 : : JUMPBY(-oparg);
2860 : : #line 2861 "Python/generated_cases.c.h"
2861 : 339 : DISPATCH();
2862 : : }
2863 : :
2864 : 408 : TARGET(GET_LEN) {
2865 : 408 : PyObject *obj = stack_pointer[-1];
2866 : : PyObject *len_o;
2867 : : #line 1982 "Python/bytecodes.c"
2868 : : // PUSH(len(TOS))
2869 : : Py_ssize_t len_i = PyObject_Length(obj);
2870 : : if (len_i < 0) goto error;
2871 : : len_o = PyLong_FromSsize_t(len_i);
2872 : : if (len_o == NULL) goto error;
2873 : : #line 2874 "Python/generated_cases.c.h"
2874 : 408 : STACK_GROW(1);
2875 : 408 : stack_pointer[-1] = len_o;
2876 : 408 : DISPATCH();
2877 : : }
2878 : :
2879 : 26 : TARGET(MATCH_CLASS) {
2880 : 26 : PyObject *names = stack_pointer[-1];
2881 : 26 : PyObject *type = stack_pointer[-2];
2882 : 26 : PyObject *subject = stack_pointer[-3];
2883 : : PyObject *attrs;
2884 : : #line 1990 "Python/bytecodes.c"
2885 : : // Pop TOS and TOS1. Set TOS to a tuple of attributes on success, or
2886 : : // None on failure.
2887 : : assert(PyTuple_CheckExact(names));
2888 : : attrs = match_class(tstate, subject, type, oparg, names);
2889 : : #line 2890 "Python/generated_cases.c.h"
2890 [ - + ]: 26 : Py_DECREF(subject);
2891 [ - + ]: 26 : Py_DECREF(type);
2892 [ - + ]: 26 : Py_DECREF(names);
2893 : : #line 1995 "Python/bytecodes.c"
2894 : : if (attrs) {
2895 : : assert(PyTuple_CheckExact(attrs)); // Success!
2896 : : }
2897 : : else {
2898 : : if (_PyErr_Occurred(tstate)) goto pop_3_error;
2899 : : attrs = Py_NewRef(Py_None); // Failure!
2900 : : }
2901 : : #line 2902 "Python/generated_cases.c.h"
2902 : 26 : STACK_SHRINK(2);
2903 : 26 : stack_pointer[-1] = attrs;
2904 : 26 : DISPATCH();
2905 : : }
2906 : :
2907 : 0 : TARGET(MATCH_MAPPING) {
2908 : 0 : PyObject *subject = stack_pointer[-1];
2909 : : PyObject *res;
2910 : : #line 2005 "Python/bytecodes.c"
2911 : : int match = Py_TYPE(subject)->tp_flags & Py_TPFLAGS_MAPPING;
2912 : : res = Py_NewRef(match ? Py_True : Py_False);
2913 : : #line 2914 "Python/generated_cases.c.h"
2914 : 0 : STACK_GROW(1);
2915 : 0 : stack_pointer[-1] = res;
2916 : : PREDICT(POP_JUMP_IF_FALSE);
2917 : 0 : DISPATCH();
2918 : : }
2919 : :
2920 : 509 : TARGET(MATCH_SEQUENCE) {
2921 : 509 : PyObject *subject = stack_pointer[-1];
2922 : : PyObject *res;
2923 : : #line 2011 "Python/bytecodes.c"
2924 : : int match = Py_TYPE(subject)->tp_flags & Py_TPFLAGS_SEQUENCE;
2925 : : res = Py_NewRef(match ? Py_True : Py_False);
2926 : : #line 2927 "Python/generated_cases.c.h"
2927 : 509 : STACK_GROW(1);
2928 : 509 : stack_pointer[-1] = res;
2929 : : PREDICT(POP_JUMP_IF_FALSE);
2930 : 509 : DISPATCH();
2931 : : }
2932 : :
2933 : 0 : TARGET(MATCH_KEYS) {
2934 : 0 : PyObject *keys = stack_pointer[-1];
2935 : 0 : PyObject *subject = stack_pointer[-2];
2936 : : PyObject *values_or_none;
2937 : : #line 2017 "Python/bytecodes.c"
2938 : : // On successful match, PUSH(values). Otherwise, PUSH(None).
2939 : : values_or_none = match_keys(tstate, subject, keys);
2940 : : if (values_or_none == NULL) goto error;
2941 : : #line 2942 "Python/generated_cases.c.h"
2942 : 0 : STACK_GROW(1);
2943 : 0 : stack_pointer[-1] = values_or_none;
2944 : 0 : DISPATCH();
2945 : : }
2946 : :
2947 : 1629120 : TARGET(GET_ITER) {
2948 : 1629120 : PyObject *iterable = stack_pointer[-1];
2949 : : PyObject *iter;
2950 : : #line 2023 "Python/bytecodes.c"
2951 : : /* before: [obj]; after [getiter(obj)] */
2952 : : iter = PyObject_GetIter(iterable);
2953 : : #line 2954 "Python/generated_cases.c.h"
2954 [ + + ]: 1629120 : Py_DECREF(iterable);
2955 : : #line 2026 "Python/bytecodes.c"
2956 : : if (iter == NULL) goto pop_1_error;
2957 : : #line 2958 "Python/generated_cases.c.h"
2958 : 1629120 : stack_pointer[-1] = iter;
2959 : 1629120 : DISPATCH();
2960 : : }
2961 : :
2962 : 38 : TARGET(GET_YIELD_FROM_ITER) {
2963 [ - + ]: 38 : PyObject *iterable = stack_pointer[-1];
2964 : : PyObject *iter;
2965 : : #line 2030 "Python/bytecodes.c"
2966 : : /* before: [obj]; after [getiter(obj)] */
2967 : : if (PyCoro_CheckExact(iterable)) {
2968 : : /* `iterable` is a coroutine */
2969 : : if (!(frame->f_code->co_flags & (CO_COROUTINE | CO_ITERABLE_COROUTINE))) {
2970 : : /* and it is used in a 'yield from' expression of a
2971 : : regular generator. */
2972 : : _PyErr_SetString(tstate, PyExc_TypeError,
2973 : : "cannot 'yield from' a coroutine object "
2974 : : "in a non-coroutine generator");
2975 : : goto error;
2976 : : }
2977 : : iter = iterable;
2978 : : }
2979 : : else if (PyGen_CheckExact(iterable)) {
2980 : : iter = iterable;
2981 : : }
2982 : : else {
2983 : : /* `iterable` is not a generator. */
2984 : : iter = PyObject_GetIter(iterable);
2985 : : if (iter == NULL) {
2986 : : goto error;
2987 : : }
2988 : : #line 2989 "Python/generated_cases.c.h"
2989 [ - + ]: 11 : Py_DECREF(iterable);
2990 : : #line 2053 "Python/bytecodes.c"
2991 : : }
2992 : : #line 2993 "Python/generated_cases.c.h"
2993 : 38 : stack_pointer[-1] = iter;
2994 : : PREDICT(LOAD_CONST);
2995 : 38 : DISPATCH();
2996 : : }
2997 : :
2998 : 3536529 : TARGET(FOR_ITER) {
2999 : 3537147 : PREDICTED(FOR_ITER);
3000 : : static_assert(INLINE_CACHE_ENTRIES_FOR_ITER == 1, "incorrect cache size");
3001 [ + + ]: 3537147 : PyObject *iter = stack_pointer[-1];
3002 : : PyObject *next;
3003 : : #line 2072 "Python/bytecodes.c"
3004 : : #if ENABLE_SPECIALIZATION
3005 : : _PyForIterCache *cache = (_PyForIterCache *)next_instr;
3006 : : if (ADAPTIVE_COUNTER_IS_ZERO(cache->counter)) {
3007 : : assert(cframe.use_tracing == 0);
3008 : : next_instr--;
3009 : : _Py_Specialize_ForIter(iter, next_instr, oparg);
3010 : : DISPATCH_SAME_OPARG();
3011 : : }
3012 : : STAT_INC(FOR_ITER, deferred);
3013 : : DECREMENT_ADAPTIVE_COUNTER(cache->counter);
3014 : : #endif /* ENABLE_SPECIALIZATION */
3015 : : /* before: [iter]; after: [iter, iter()] *or* [] (and jump over END_FOR.) */
3016 : : next = (*Py_TYPE(iter)->tp_iternext)(iter);
3017 : : if (next == NULL) {
3018 : : if (_PyErr_Occurred(tstate)) {
3019 : : if (!_PyErr_ExceptionMatches(tstate, PyExc_StopIteration)) {
3020 : : goto error;
3021 : : }
3022 : : else if (tstate->c_tracefunc != NULL) {
3023 : : call_exc_trace(tstate->c_tracefunc, tstate->c_traceobj, tstate, frame);
3024 : : }
3025 : : _PyErr_Clear(tstate);
3026 : : }
3027 : : /* iterator ended normally */
3028 : : assert(next_instr[INLINE_CACHE_ENTRIES_FOR_ITER + oparg].op.code == END_FOR);
3029 : : Py_DECREF(iter);
3030 : : STACK_SHRINK(1);
3031 : : /* Jump forward oparg, then skip following END_FOR instruction */
3032 : : JUMPBY(INLINE_CACHE_ENTRIES_FOR_ITER + oparg + 1);
3033 : : DISPATCH();
3034 : : }
3035 : : // Common case: no jump, leave it to the code generator
3036 : : #line 3037 "Python/generated_cases.c.h"
3037 : 1935227 : STACK_GROW(1);
3038 : 1935227 : stack_pointer[-1] = next;
3039 : 1935227 : next_instr += 1;
3040 : 1935227 : DISPATCH();
3041 : : }
3042 : :
3043 : 586273 : TARGET(FOR_ITER_LIST) {
3044 : 586273 : PyObject *iter = stack_pointer[-1];
3045 : : PyObject *next;
3046 : : #line 2107 "Python/bytecodes.c"
3047 : : assert(cframe.use_tracing == 0);
3048 : : DEOPT_IF(Py_TYPE(iter) != &PyListIter_Type, FOR_ITER);
3049 : : _PyListIterObject *it = (_PyListIterObject *)iter;
3050 : : STAT_INC(FOR_ITER, hit);
3051 : : PyListObject *seq = it->it_seq;
3052 : : if (seq) {
3053 : : if (it->it_index < PyList_GET_SIZE(seq)) {
3054 : : next = Py_NewRef(PyList_GET_ITEM(seq, it->it_index++));
3055 : : goto end_for_iter_list; // End of this instruction
3056 : : }
3057 : : it->it_seq = NULL;
3058 : : Py_DECREF(seq);
3059 : : }
3060 : : Py_DECREF(iter);
3061 : : STACK_SHRINK(1);
3062 : : /* Jump forward oparg, then skip following END_FOR instruction */
3063 : : JUMPBY(INLINE_CACHE_ENTRIES_FOR_ITER + oparg + 1);
3064 : : DISPATCH();
3065 : : end_for_iter_list:
3066 : : // Common case: no jump, leave it to the code generator
3067 : : #line 3068 "Python/generated_cases.c.h"
3068 : 578555 : STACK_GROW(1);
3069 : 578555 : stack_pointer[-1] = next;
3070 : 578555 : next_instr += 1;
3071 : 578555 : DISPATCH();
3072 : : }
3073 : :
3074 : 31091 : TARGET(FOR_ITER_TUPLE) {
3075 : 31091 : PyObject *iter = stack_pointer[-1];
3076 : : PyObject *next;
3077 : : #line 2130 "Python/bytecodes.c"
3078 : : assert(cframe.use_tracing == 0);
3079 : : _PyTupleIterObject *it = (_PyTupleIterObject *)iter;
3080 : : DEOPT_IF(Py_TYPE(it) != &PyTupleIter_Type, FOR_ITER);
3081 : : STAT_INC(FOR_ITER, hit);
3082 : : PyTupleObject *seq = it->it_seq;
3083 : : if (seq) {
3084 : : if (it->it_index < PyTuple_GET_SIZE(seq)) {
3085 : : next = Py_NewRef(PyTuple_GET_ITEM(seq, it->it_index++));
3086 : : goto end_for_iter_tuple; // End of this instruction
3087 : : }
3088 : : it->it_seq = NULL;
3089 : : Py_DECREF(seq);
3090 : : }
3091 : : Py_DECREF(iter);
3092 : : STACK_SHRINK(1);
3093 : : /* Jump forward oparg, then skip following END_FOR instruction */
3094 : : JUMPBY(INLINE_CACHE_ENTRIES_FOR_ITER + oparg + 1);
3095 : : DISPATCH();
3096 : : end_for_iter_tuple:
3097 : : // Common case: no jump, leave it to the code generator
3098 : : #line 3099 "Python/generated_cases.c.h"
3099 : 21063 : STACK_GROW(1);
3100 : 21063 : stack_pointer[-1] = next;
3101 : 21063 : next_instr += 1;
3102 : 21063 : DISPATCH();
3103 : : }
3104 : :
3105 : 594262 : TARGET(FOR_ITER_RANGE) {
3106 : 594262 : PyObject *iter = stack_pointer[-1];
3107 : : PyObject *next;
3108 : : #line 2153 "Python/bytecodes.c"
3109 : : assert(cframe.use_tracing == 0);
3110 : : _PyRangeIterObject *r = (_PyRangeIterObject *)iter;
3111 : : DEOPT_IF(Py_TYPE(r) != &PyRangeIter_Type, FOR_ITER);
3112 : : STAT_INC(FOR_ITER, hit);
3113 : : if (r->len <= 0) {
3114 : : STACK_SHRINK(1);
3115 : : Py_DECREF(r);
3116 : : // Jump over END_FOR instruction.
3117 : : JUMPBY(INLINE_CACHE_ENTRIES_FOR_ITER + oparg + 1);
3118 : : DISPATCH();
3119 : : }
3120 : : long value = r->start;
3121 : : r->start = value + r->step;
3122 : : r->len--;
3123 : : next = PyLong_FromLong(value);
3124 : : if (next == NULL) {
3125 : : goto error;
3126 : : }
3127 : : #line 3128 "Python/generated_cases.c.h"
3128 : 587220 : STACK_GROW(1);
3129 : 587220 : stack_pointer[-1] = next;
3130 : 587220 : next_instr += 1;
3131 : 587220 : DISPATCH();
3132 : : }
3133 : :
3134 : 5388 : TARGET(FOR_ITER_GEN) {
3135 : 5388 : PyObject *iter = stack_pointer[-1];
3136 : : #line 2174 "Python/bytecodes.c"
3137 : : assert(cframe.use_tracing == 0);
3138 : : PyGenObject *gen = (PyGenObject *)iter;
3139 : : DEOPT_IF(Py_TYPE(gen) != &PyGen_Type, FOR_ITER);
3140 : : DEOPT_IF(gen->gi_frame_state >= FRAME_EXECUTING, FOR_ITER);
3141 : : STAT_INC(FOR_ITER, hit);
3142 : : _PyInterpreterFrame *gen_frame = (_PyInterpreterFrame *)gen->gi_iframe;
3143 : : frame->yield_offset = oparg;
3144 : : _PyFrame_StackPush(gen_frame, Py_NewRef(Py_None));
3145 : : gen->gi_frame_state = FRAME_EXECUTING;
3146 : : gen->gi_exc_state.previous_item = tstate->exc_info;
3147 : : tstate->exc_info = &gen->gi_exc_state;
3148 : : JUMPBY(INLINE_CACHE_ENTRIES_FOR_ITER + oparg);
3149 : : assert(next_instr->op.code == END_FOR);
3150 : : DISPATCH_INLINED(gen_frame);
3151 : : #line 3152 "Python/generated_cases.c.h"
3152 : : }
3153 : :
3154 : 0 : TARGET(BEFORE_ASYNC_WITH) {
3155 : 0 : PyObject *mgr = stack_pointer[-1];
3156 : : PyObject *exit;
3157 : : PyObject *res;
3158 : : #line 2191 "Python/bytecodes.c"
3159 : : PyObject *enter = _PyObject_LookupSpecial(mgr, &_Py_ID(__aenter__));
3160 : : if (enter == NULL) {
3161 : : if (!_PyErr_Occurred(tstate)) {
3162 : : _PyErr_Format(tstate, PyExc_TypeError,
3163 : : "'%.200s' object does not support the "
3164 : : "asynchronous context manager protocol",
3165 : : Py_TYPE(mgr)->tp_name);
3166 : : }
3167 : : goto error;
3168 : : }
3169 : : exit = _PyObject_LookupSpecial(mgr, &_Py_ID(__aexit__));
3170 : : if (exit == NULL) {
3171 : : if (!_PyErr_Occurred(tstate)) {
3172 : : _PyErr_Format(tstate, PyExc_TypeError,
3173 : : "'%.200s' object does not support the "
3174 : : "asynchronous context manager protocol "
3175 : : "(missed __aexit__ method)",
3176 : : Py_TYPE(mgr)->tp_name);
3177 : : }
3178 : : Py_DECREF(enter);
3179 : : goto error;
3180 : : }
3181 : : #line 3182 "Python/generated_cases.c.h"
3182 [ # # ]: 0 : Py_DECREF(mgr);
3183 : : #line 2214 "Python/bytecodes.c"
3184 : : res = _PyObject_CallNoArgs(enter);
3185 : : Py_DECREF(enter);
3186 : : if (res == NULL) {
3187 : : Py_DECREF(exit);
3188 : : if (true) goto pop_1_error;
3189 : : }
3190 : : #line 3191 "Python/generated_cases.c.h"
3191 : 0 : STACK_GROW(1);
3192 : 0 : stack_pointer[-1] = res;
3193 : 0 : stack_pointer[-2] = exit;
3194 : : PREDICT(GET_AWAITABLE);
3195 : 0 : DISPATCH();
3196 : : }
3197 : :
3198 : 106669 : TARGET(BEFORE_WITH) {
3199 : 106669 : PyObject *mgr = stack_pointer[-1];
3200 : : PyObject *exit;
3201 : : PyObject *res;
3202 : : #line 2224 "Python/bytecodes.c"
3203 : : /* pop the context manager, push its __exit__ and the
3204 : : * value returned from calling its __enter__
3205 : : */
3206 : : PyObject *enter = _PyObject_LookupSpecial(mgr, &_Py_ID(__enter__));
3207 : : if (enter == NULL) {
3208 : : if (!_PyErr_Occurred(tstate)) {
3209 : : _PyErr_Format(tstate, PyExc_TypeError,
3210 : : "'%.200s' object does not support the "
3211 : : "context manager protocol",
3212 : : Py_TYPE(mgr)->tp_name);
3213 : : }
3214 : : goto error;
3215 : : }
3216 : : exit = _PyObject_LookupSpecial(mgr, &_Py_ID(__exit__));
3217 : : if (exit == NULL) {
3218 : : if (!_PyErr_Occurred(tstate)) {
3219 : : _PyErr_Format(tstate, PyExc_TypeError,
3220 : : "'%.200s' object does not support the "
3221 : : "context manager protocol "
3222 : : "(missed __exit__ method)",
3223 : : Py_TYPE(mgr)->tp_name);
3224 : : }
3225 : : Py_DECREF(enter);
3226 : : goto error;
3227 : : }
3228 : : #line 3229 "Python/generated_cases.c.h"
3229 [ - + ]: 106669 : Py_DECREF(mgr);
3230 : : #line 2250 "Python/bytecodes.c"
3231 : : res = _PyObject_CallNoArgs(enter);
3232 : : Py_DECREF(enter);
3233 : : if (res == NULL) {
3234 : : Py_DECREF(exit);
3235 : : if (true) goto pop_1_error;
3236 : : }
3237 : : #line 3238 "Python/generated_cases.c.h"
3238 : 106669 : STACK_GROW(1);
3239 : 106669 : stack_pointer[-1] = res;
3240 : 106669 : stack_pointer[-2] = exit;
3241 : 106669 : DISPATCH();
3242 : : }
3243 : :
3244 : 293 : TARGET(WITH_EXCEPT_START) {
3245 : 293 : PyObject *val = stack_pointer[-1];
3246 : 293 : PyObject *lasti = stack_pointer[-3];
3247 : 293 : PyObject *exit_func = stack_pointer[-4];
3248 : : PyObject *res;
3249 : : #line 2259 "Python/bytecodes.c"
3250 : : /* At the top of the stack are 4 values:
3251 : : - val: TOP = exc_info()
3252 : : - unused: SECOND = previous exception
3253 : : - lasti: THIRD = lasti of exception in exc_info()
3254 : : - exit_func: FOURTH = the context.__exit__ bound method
3255 : : We call FOURTH(type(TOP), TOP, GetTraceback(TOP)).
3256 : : Then we push the __exit__ return value.
3257 : : */
3258 : : PyObject *exc, *tb;
3259 : :
3260 : : assert(val && PyExceptionInstance_Check(val));
3261 : : exc = PyExceptionInstance_Class(val);
3262 : : tb = PyException_GetTraceback(val);
3263 : : Py_XDECREF(tb);
3264 : : assert(PyLong_Check(lasti));
3265 : : (void)lasti; // Shut up compiler warning if asserts are off
3266 : : PyObject *stack[4] = {NULL, exc, val, tb};
3267 : : res = PyObject_Vectorcall(exit_func, stack + 1,
3268 : : 3 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL);
3269 : : if (res == NULL) goto error;
3270 : : #line 3271 "Python/generated_cases.c.h"
3271 : 293 : STACK_GROW(1);
3272 : 293 : stack_pointer[-1] = res;
3273 : 293 : DISPATCH();
3274 : : }
3275 : :
3276 : 101972 : TARGET(PUSH_EXC_INFO) {
3277 [ + + ]: 101972 : PyObject *new_exc = stack_pointer[-1];
3278 : : PyObject *prev_exc;
3279 : : #line 2282 "Python/bytecodes.c"
3280 : : _PyErr_StackItem *exc_info = tstate->exc_info;
3281 : : if (exc_info->exc_value != NULL) {
3282 : : prev_exc = exc_info->exc_value;
3283 : : }
3284 : : else {
3285 : : prev_exc = Py_NewRef(Py_None);
3286 : : }
3287 : : assert(PyExceptionInstance_Check(new_exc));
3288 : : exc_info->exc_value = Py_NewRef(new_exc);
3289 : : #line 3290 "Python/generated_cases.c.h"
3290 : 101972 : STACK_GROW(1);
3291 : 101972 : stack_pointer[-1] = new_exc;
3292 : 101972 : stack_pointer[-2] = prev_exc;
3293 : 101972 : DISPATCH();
3294 : : }
3295 : :
3296 : 894487 : TARGET(LOAD_ATTR_METHOD_WITH_VALUES) {
3297 : 894487 : PyObject *self = stack_pointer[-1];
3298 : 894487 : PyObject *res2 = NULL;
3299 : : PyObject *res;
3300 : 894487 : uint32_t type_version = read_u32(&next_instr[1].cache);
3301 : 894487 : uint32_t keys_version = read_u32(&next_instr[3].cache);
3302 : 894487 : PyObject *descr = read_obj(&next_instr[5].cache);
3303 : : #line 2294 "Python/bytecodes.c"
3304 : : /* Cached method object */
3305 : : assert(cframe.use_tracing == 0);
3306 : : PyTypeObject *self_cls = Py_TYPE(self);
3307 : : assert(type_version != 0);
3308 : : DEOPT_IF(self_cls->tp_version_tag != type_version, LOAD_ATTR);
3309 : : assert(self_cls->tp_flags & Py_TPFLAGS_MANAGED_DICT);
3310 : : PyDictOrValues dorv = *_PyObject_DictOrValuesPointer(self);
3311 : : DEOPT_IF(!_PyDictOrValues_IsValues(dorv), LOAD_ATTR);
3312 : : PyHeapTypeObject *self_heap_type = (PyHeapTypeObject *)self_cls;
3313 : : DEOPT_IF(self_heap_type->ht_cached_keys->dk_version !=
3314 : : keys_version, LOAD_ATTR);
3315 : : STAT_INC(LOAD_ATTR, hit);
3316 : : assert(descr != NULL);
3317 : : res2 = Py_NewRef(descr);
3318 : : assert(_PyType_HasFeature(Py_TYPE(res2), Py_TPFLAGS_METHOD_DESCRIPTOR));
3319 : : res = self;
3320 : : assert(oparg & 1);
3321 : : #line 3322 "Python/generated_cases.c.h"
3322 : 893123 : STACK_GROW(((oparg & 1) ? 1 : 0));
3323 : 893123 : stack_pointer[-1] = res;
3324 [ + - ]: 893123 : if (oparg & 1) { stack_pointer[-(1 + ((oparg & 1) ? 1 : 0))] = res2; }
3325 : 893123 : next_instr += 9;
3326 : 893123 : DISPATCH();
3327 : : }
3328 : :
3329 : 2507024 : TARGET(LOAD_ATTR_METHOD_NO_DICT) {
3330 : 2507024 : PyObject *self = stack_pointer[-1];
3331 : 2507024 : PyObject *res2 = NULL;
3332 : : PyObject *res;
3333 : 2507024 : uint32_t type_version = read_u32(&next_instr[1].cache);
3334 : 2507024 : PyObject *descr = read_obj(&next_instr[5].cache);
3335 : : #line 2314 "Python/bytecodes.c"
3336 : : assert(cframe.use_tracing == 0);
3337 : : PyTypeObject *self_cls = Py_TYPE(self);
3338 : : DEOPT_IF(self_cls->tp_version_tag != type_version, LOAD_ATTR);
3339 : : assert(self_cls->tp_dictoffset == 0);
3340 : : STAT_INC(LOAD_ATTR, hit);
3341 : : assert(descr != NULL);
3342 : : assert(_PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_METHOD_DESCRIPTOR));
3343 : : res2 = Py_NewRef(descr);
3344 : : res = self;
3345 : : assert(oparg & 1);
3346 : : #line 3347 "Python/generated_cases.c.h"
3347 : 2507024 : STACK_GROW(((oparg & 1) ? 1 : 0));
3348 : 2507024 : stack_pointer[-1] = res;
3349 [ + - ]: 2507024 : if (oparg & 1) { stack_pointer[-(1 + ((oparg & 1) ? 1 : 0))] = res2; }
3350 : 2507024 : next_instr += 9;
3351 : 2507024 : DISPATCH();
3352 : : }
3353 : :
3354 : 919 : TARGET(LOAD_ATTR_METHOD_LAZY_DICT) {
3355 : 919 : PyObject *self = stack_pointer[-1];
3356 : 919 : PyObject *res2 = NULL;
3357 : : PyObject *res;
3358 : 919 : uint32_t type_version = read_u32(&next_instr[1].cache);
3359 : 919 : PyObject *descr = read_obj(&next_instr[5].cache);
3360 : : #line 2327 "Python/bytecodes.c"
3361 : : assert(cframe.use_tracing == 0);
3362 : : PyTypeObject *self_cls = Py_TYPE(self);
3363 : : DEOPT_IF(self_cls->tp_version_tag != type_version, LOAD_ATTR);
3364 : : Py_ssize_t dictoffset = self_cls->tp_dictoffset;
3365 : : assert(dictoffset > 0);
3366 : : PyObject *dict = *(PyObject **)((char *)self + dictoffset);
3367 : : /* This object has a __dict__, just not yet created */
3368 : : DEOPT_IF(dict != NULL, LOAD_ATTR);
3369 : : STAT_INC(LOAD_ATTR, hit);
3370 : : assert(descr != NULL);
3371 : : assert(_PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_METHOD_DESCRIPTOR));
3372 : : res2 = Py_NewRef(descr);
3373 : : res = self;
3374 : : assert(oparg & 1);
3375 : : #line 3376 "Python/generated_cases.c.h"
3376 : 770 : STACK_GROW(((oparg & 1) ? 1 : 0));
3377 : 770 : stack_pointer[-1] = res;
3378 [ + - ]: 770 : if (oparg & 1) { stack_pointer[-(1 + ((oparg & 1) ? 1 : 0))] = res2; }
3379 : 770 : next_instr += 9;
3380 : 770 : DISPATCH();
3381 : : }
3382 : :
3383 : 175409 : TARGET(KW_NAMES) {
3384 : : #line 2344 "Python/bytecodes.c"
3385 : : assert(kwnames == NULL);
3386 : : assert(oparg < PyTuple_GET_SIZE(frame->f_code->co_consts));
3387 : : kwnames = GETITEM(frame->f_code->co_consts, oparg);
3388 : : #line 3389 "Python/generated_cases.c.h"
3389 : 175409 : DISPATCH();
3390 : : }
3391 : :
3392 : 3419612 : TARGET(CALL) {
3393 : 3688976 : PREDICTED(CALL);
3394 : : static_assert(INLINE_CACHE_ENTRIES_CALL == 4, "incorrect cache size");
3395 : 3688976 : PyObject **args = (stack_pointer - oparg);
3396 : 3688976 : PyObject *callable = stack_pointer[-(1 + oparg)];
3397 [ + + ]: 3688976 : PyObject *method = stack_pointer[-(2 + oparg)];
3398 : : PyObject *res;
3399 : : #line 2380 "Python/bytecodes.c"
3400 : : int is_meth = method != NULL;
3401 : : int total_args = oparg;
3402 : : if (is_meth) {
3403 : : callable = method;
3404 : : args--;
3405 : : total_args++;
3406 : : }
3407 : : #if ENABLE_SPECIALIZATION
3408 : : _PyCallCache *cache = (_PyCallCache *)next_instr;
3409 : : if (ADAPTIVE_COUNTER_IS_ZERO(cache->counter)) {
3410 : : assert(cframe.use_tracing == 0);
3411 : : next_instr--;
3412 : : _Py_Specialize_Call(callable, next_instr, total_args, kwnames);
3413 : : DISPATCH_SAME_OPARG();
3414 : : }
3415 : : STAT_INC(CALL, deferred);
3416 : : DECREMENT_ADAPTIVE_COUNTER(cache->counter);
3417 : : #endif /* ENABLE_SPECIALIZATION */
3418 : : if (!is_meth && Py_TYPE(callable) == &PyMethod_Type) {
3419 : : is_meth = 1; // For consistenct; it's dead, though
3420 : : args--;
3421 : : total_args++;
3422 : : PyObject *self = ((PyMethodObject *)callable)->im_self;
3423 : : args[0] = Py_NewRef(self);
3424 : : method = ((PyMethodObject *)callable)->im_func;
3425 : : args[-1] = Py_NewRef(method);
3426 : : Py_DECREF(callable);
3427 : : callable = method;
3428 : : }
3429 : : int positional_args = total_args - KWNAMES_LEN();
3430 : : // Check if the call can be inlined or not
3431 : : if (Py_TYPE(callable) == &PyFunction_Type &&
3432 : : tstate->interp->eval_frame == NULL &&
3433 : : ((PyFunctionObject *)callable)->vectorcall == _PyFunction_Vectorcall)
3434 : : {
3435 : : int code_flags = ((PyCodeObject*)PyFunction_GET_CODE(callable))->co_flags;
3436 : : PyObject *locals = code_flags & CO_OPTIMIZED ? NULL : Py_NewRef(PyFunction_GET_GLOBALS(callable));
3437 : : _PyInterpreterFrame *new_frame = _PyEvalFramePushAndInit(
3438 : : tstate, (PyFunctionObject *)callable, locals,
3439 : : args, positional_args, kwnames
3440 : : );
3441 : : kwnames = NULL;
3442 : : // Manipulate stack directly since we leave using DISPATCH_INLINED().
3443 : : STACK_SHRINK(oparg + 2);
3444 : : // The frame has stolen all the arguments from the stack,
3445 : : // so there is no need to clean them up.
3446 : : if (new_frame == NULL) {
3447 : : goto error;
3448 : : }
3449 : : JUMPBY(INLINE_CACHE_ENTRIES_CALL);
3450 : : DISPATCH_INLINED(new_frame);
3451 : : }
3452 : : /* Callable is not a normal Python function */
3453 : : if (cframe.use_tracing) {
3454 : : res = trace_call_function(
3455 : : tstate, callable, args,
3456 : : positional_args, kwnames);
3457 : : }
3458 : : else {
3459 : : res = PyObject_Vectorcall(
3460 : : callable, args,
3461 : : positional_args | PY_VECTORCALL_ARGUMENTS_OFFSET,
3462 : : kwnames);
3463 : : }
3464 : : kwnames = NULL;
3465 : : assert((res != NULL) ^ (_PyErr_Occurred(tstate) != NULL));
3466 : : Py_DECREF(callable);
3467 : : for (int i = 0; i < total_args; i++) {
3468 : : Py_DECREF(args[i]);
3469 : : }
3470 : : if (res == NULL) { STACK_SHRINK(oparg); goto pop_2_error; }
3471 : : #line 3472 "Python/generated_cases.c.h"
3472 : 3372693 : STACK_SHRINK(oparg);
3473 : 3372693 : STACK_SHRINK(1);
3474 : 3372693 : stack_pointer[-1] = res;
3475 : 3372693 : next_instr += 4;
3476 [ + + ]: 3372693 : CHECK_EVAL_BREAKER();
3477 : 3372609 : DISPATCH();
3478 : : }
3479 : :
3480 : 671078 : TARGET(CALL_BOUND_METHOD_EXACT_ARGS) {
3481 : 671078 : PyObject *callable = stack_pointer[-(1 + oparg)];
3482 [ + + ]: 671078 : PyObject *method = stack_pointer[-(2 + oparg)];
3483 : : #line 2458 "Python/bytecodes.c"
3484 : : DEOPT_IF(method != NULL, CALL);
3485 : : DEOPT_IF(Py_TYPE(callable) != &PyMethod_Type, CALL);
3486 : : STAT_INC(CALL, hit);
3487 : : PyObject *self = ((PyMethodObject *)callable)->im_self;
3488 : : PEEK(oparg + 1) = Py_NewRef(self); // callable
3489 : : PyObject *meth = ((PyMethodObject *)callable)->im_func;
3490 : : PEEK(oparg + 2) = Py_NewRef(meth); // method
3491 : : Py_DECREF(callable);
3492 : : GO_TO_INSTRUCTION(CALL_PY_EXACT_ARGS);
3493 : : #line 3494 "Python/generated_cases.c.h"
3494 : : }
3495 : :
3496 : 1362125 : TARGET(CALL_PY_EXACT_ARGS) {
3497 : 1931482 : PREDICTED(CALL_PY_EXACT_ARGS);
3498 : 1931482 : PyObject **args = (stack_pointer - oparg);
3499 : 1931482 : PyObject *callable = stack_pointer[-(1 + oparg)];
3500 : 1931482 : PyObject *method = stack_pointer[-(2 + oparg)];
3501 : 1931482 : uint32_t func_version = read_u32(&next_instr[1].cache);
3502 : : #line 2470 "Python/bytecodes.c"
3503 : : assert(kwnames == NULL);
3504 : : DEOPT_IF(tstate->interp->eval_frame, CALL);
3505 : : int is_meth = method != NULL;
3506 : : int argcount = oparg;
3507 : : if (is_meth) {
3508 : : callable = method;
3509 : : args--;
3510 : : argcount++;
3511 : : }
3512 : : DEOPT_IF(!PyFunction_Check(callable), CALL);
3513 : : PyFunctionObject *func = (PyFunctionObject *)callable;
3514 : : DEOPT_IF(func->func_version != func_version, CALL);
3515 : : PyCodeObject *code = (PyCodeObject *)func->func_code;
3516 : : DEOPT_IF(code->co_argcount != argcount, CALL);
3517 : : DEOPT_IF(!_PyThreadState_HasStackSpace(tstate, code->co_framesize), CALL);
3518 : : STAT_INC(CALL, hit);
3519 : : _PyInterpreterFrame *new_frame = _PyFrame_PushUnchecked(tstate, func, argcount);
3520 : : for (int i = 0; i < argcount; i++) {
3521 : : new_frame->localsplus[i] = args[i];
3522 : : }
3523 : : // Manipulate stack directly since we leave using DISPATCH_INLINED().
3524 : : STACK_SHRINK(oparg + 2);
3525 : : JUMPBY(INLINE_CACHE_ENTRIES_CALL);
3526 : : DISPATCH_INLINED(new_frame);
3527 : : #line 3528 "Python/generated_cases.c.h"
3528 : : }
3529 : :
3530 : 222502 : TARGET(CALL_PY_WITH_DEFAULTS) {
3531 : 222502 : PyObject **args = (stack_pointer - oparg);
3532 : 222502 : PyObject *callable = stack_pointer[-(1 + oparg)];
3533 : 222502 : PyObject *method = stack_pointer[-(2 + oparg)];
3534 : 222502 : uint32_t func_version = read_u32(&next_instr[1].cache);
3535 : 222502 : uint16_t min_args = read_u16(&next_instr[3].cache);
3536 : : #line 2497 "Python/bytecodes.c"
3537 : : assert(kwnames == NULL);
3538 : : DEOPT_IF(tstate->interp->eval_frame, CALL);
3539 : : int is_meth = method != NULL;
3540 : : int argcount = oparg;
3541 : : if (is_meth) {
3542 : : callable = method;
3543 : : args--;
3544 : : argcount++;
3545 : : }
3546 : : DEOPT_IF(!PyFunction_Check(callable), CALL);
3547 : : PyFunctionObject *func = (PyFunctionObject *)callable;
3548 : : DEOPT_IF(func->func_version != func_version, CALL);
3549 : : PyCodeObject *code = (PyCodeObject *)func->func_code;
3550 : : DEOPT_IF(argcount > code->co_argcount, CALL);
3551 : : DEOPT_IF(argcount < min_args, CALL);
3552 : : DEOPT_IF(!_PyThreadState_HasStackSpace(tstate, code->co_framesize), CALL);
3553 : : STAT_INC(CALL, hit);
3554 : : _PyInterpreterFrame *new_frame = _PyFrame_PushUnchecked(tstate, func, code->co_argcount);
3555 : : for (int i = 0; i < argcount; i++) {
3556 : : new_frame->localsplus[i] = args[i];
3557 : : }
3558 : : for (int i = argcount; i < code->co_argcount; i++) {
3559 : : PyObject *def = PyTuple_GET_ITEM(func->func_defaults, i - min_args);
3560 : : new_frame->localsplus[i] = Py_NewRef(def);
3561 : : }
3562 : : // Manipulate stack and cache directly since we leave using DISPATCH_INLINED().
3563 : : STACK_SHRINK(oparg + 2);
3564 : : JUMPBY(INLINE_CACHE_ENTRIES_CALL);
3565 : : DISPATCH_INLINED(new_frame);
3566 : : #line 3567 "Python/generated_cases.c.h"
3567 : : }
3568 : :
3569 : 597184 : TARGET(CALL_NO_KW_TYPE_1) {
3570 : 597184 : PyObject **args = (stack_pointer - oparg);
3571 : 597184 : PyObject *callable = stack_pointer[-(1 + oparg)];
3572 [ - + ]: 597184 : PyObject *null = stack_pointer[-(2 + oparg)];
3573 : : PyObject *res;
3574 : : #line 2529 "Python/bytecodes.c"
3575 : : assert(kwnames == NULL);
3576 : : assert(cframe.use_tracing == 0);
3577 : : assert(oparg == 1);
3578 : : DEOPT_IF(null != NULL, CALL);
3579 : : PyObject *obj = args[0];
3580 : : DEOPT_IF(callable != (PyObject *)&PyType_Type, CALL);
3581 : : STAT_INC(CALL, hit);
3582 : : res = Py_NewRef(Py_TYPE(obj));
3583 : : Py_DECREF(obj);
3584 : : Py_DECREF(&PyType_Type); // I.e., callable
3585 : : #line 3586 "Python/generated_cases.c.h"
3586 : 597184 : STACK_SHRINK(oparg);
3587 : 597184 : STACK_SHRINK(1);
3588 : 597184 : stack_pointer[-1] = res;
3589 : 597184 : next_instr += 4;
3590 : 597184 : DISPATCH();
3591 : : }
3592 : :
3593 : 262860 : TARGET(CALL_NO_KW_STR_1) {
3594 : 262860 : PyObject **args = (stack_pointer - oparg);
3595 : 262860 : PyObject *callable = stack_pointer[-(1 + oparg)];
3596 [ - + ]: 262860 : PyObject *null = stack_pointer[-(2 + oparg)];
3597 : : PyObject *res;
3598 : : #line 2542 "Python/bytecodes.c"
3599 : : assert(kwnames == NULL);
3600 : : assert(cframe.use_tracing == 0);
3601 : : assert(oparg == 1);
3602 : : DEOPT_IF(null != NULL, CALL);
3603 : : DEOPT_IF(callable != (PyObject *)&PyUnicode_Type, CALL);
3604 : : STAT_INC(CALL, hit);
3605 : : PyObject *arg = args[0];
3606 : : res = PyObject_Str(arg);
3607 : : Py_DECREF(arg);
3608 : : Py_DECREF(&PyUnicode_Type); // I.e., callable
3609 : : if (res == NULL) { STACK_SHRINK(oparg); goto pop_2_error; }
3610 : : #line 3611 "Python/generated_cases.c.h"
3611 : 262860 : STACK_SHRINK(oparg);
3612 : 262860 : STACK_SHRINK(1);
3613 : 262860 : stack_pointer[-1] = res;
3614 : 262860 : next_instr += 4;
3615 [ - + ]: 262860 : CHECK_EVAL_BREAKER();
3616 : 262860 : DISPATCH();
3617 : : }
3618 : :
3619 : 10082 : TARGET(CALL_NO_KW_TUPLE_1) {
3620 : 10082 : PyObject **args = (stack_pointer - oparg);
3621 : 10082 : PyObject *callable = stack_pointer[-(1 + oparg)];
3622 [ - + ]: 10082 : PyObject *null = stack_pointer[-(2 + oparg)];
3623 : : PyObject *res;
3624 : : #line 2557 "Python/bytecodes.c"
3625 : : assert(kwnames == NULL);
3626 : : assert(oparg == 1);
3627 : : DEOPT_IF(null != NULL, CALL);
3628 : : DEOPT_IF(callable != (PyObject *)&PyTuple_Type, CALL);
3629 : : STAT_INC(CALL, hit);
3630 : : PyObject *arg = args[0];
3631 : : res = PySequence_Tuple(arg);
3632 : : Py_DECREF(arg);
3633 : : Py_DECREF(&PyTuple_Type); // I.e., tuple
3634 : : if (res == NULL) { STACK_SHRINK(oparg); goto pop_2_error; }
3635 : : #line 3636 "Python/generated_cases.c.h"
3636 : 10082 : STACK_SHRINK(oparg);
3637 : 10082 : STACK_SHRINK(1);
3638 : 10082 : stack_pointer[-1] = res;
3639 : 10082 : next_instr += 4;
3640 [ - + ]: 10082 : CHECK_EVAL_BREAKER();
3641 : 10082 : DISPATCH();
3642 : : }
3643 : :
3644 : 358271 : TARGET(CALL_BUILTIN_CLASS) {
3645 : 358271 : PyObject **args = (stack_pointer - oparg);
3646 : 358271 : PyObject *callable = stack_pointer[-(1 + oparg)];
3647 [ - + ]: 358271 : PyObject *method = stack_pointer[-(2 + oparg)];
3648 : : PyObject *res;
3649 : : #line 2571 "Python/bytecodes.c"
3650 : : int is_meth = method != NULL;
3651 : : int total_args = oparg;
3652 : : if (is_meth) {
3653 : : callable = method;
3654 : : args--;
3655 : : total_args++;
3656 : : }
3657 : : int kwnames_len = KWNAMES_LEN();
3658 : : DEOPT_IF(!PyType_Check(callable), CALL);
3659 : : PyTypeObject *tp = (PyTypeObject *)callable;
3660 : : DEOPT_IF(tp->tp_vectorcall == NULL, CALL);
3661 : : STAT_INC(CALL, hit);
3662 : : res = tp->tp_vectorcall((PyObject *)tp, args,
3663 : : total_args - kwnames_len, kwnames);
3664 : : kwnames = NULL;
3665 : : /* Free the arguments. */
3666 : : for (int i = 0; i < total_args; i++) {
3667 : : Py_DECREF(args[i]);
3668 : : }
3669 : : Py_DECREF(tp);
3670 : : if (res == NULL) { STACK_SHRINK(oparg); goto pop_2_error; }
3671 : : #line 3672 "Python/generated_cases.c.h"
3672 : 358271 : STACK_SHRINK(oparg);
3673 : 358271 : STACK_SHRINK(1);
3674 : 358271 : stack_pointer[-1] = res;
3675 : 358271 : next_instr += 4;
3676 [ + + ]: 358271 : CHECK_EVAL_BREAKER();
3677 : 358269 : DISPATCH();
3678 : : }
3679 : :
3680 : 1570932 : TARGET(CALL_NO_KW_BUILTIN_O) {
3681 : 1570932 : PyObject **args = (stack_pointer - oparg);
3682 : 1570932 : PyObject *callable = stack_pointer[-(1 + oparg)];
3683 [ - + ]: 1570932 : PyObject *method = stack_pointer[-(2 + oparg)];
3684 : : PyObject *res;
3685 : : #line 2596 "Python/bytecodes.c"
3686 : : assert(cframe.use_tracing == 0);
3687 : : /* Builtin METH_O functions */
3688 : : assert(kwnames == NULL);
3689 : : int is_meth = method != NULL;
3690 : : int total_args = oparg;
3691 : : if (is_meth) {
3692 : : callable = method;
3693 : : args--;
3694 : : total_args++;
3695 : : }
3696 : : DEOPT_IF(total_args != 1, CALL);
3697 : : DEOPT_IF(!PyCFunction_CheckExact(callable), CALL);
3698 : : DEOPT_IF(PyCFunction_GET_FLAGS(callable) != METH_O, CALL);
3699 : : STAT_INC(CALL, hit);
3700 : : PyCFunction cfunc = PyCFunction_GET_FUNCTION(callable);
3701 : : // This is slower but CPython promises to check all non-vectorcall
3702 : : // function calls.
3703 : : if (_Py_EnterRecursiveCallTstate(tstate, " while calling a Python object")) {
3704 : : goto error;
3705 : : }
3706 : : PyObject *arg = args[0];
3707 : : res = _PyCFunction_TrampolineCall(cfunc, PyCFunction_GET_SELF(callable), arg);
3708 : : _Py_LeaveRecursiveCallTstate(tstate);
3709 : : assert((res != NULL) ^ (_PyErr_Occurred(tstate) != NULL));
3710 : :
3711 : : Py_DECREF(arg);
3712 : : Py_DECREF(callable);
3713 : : if (res == NULL) { STACK_SHRINK(oparg); goto pop_2_error; }
3714 : : #line 3715 "Python/generated_cases.c.h"
3715 : 1570293 : STACK_SHRINK(oparg);
3716 : 1570293 : STACK_SHRINK(1);
3717 : 1570293 : stack_pointer[-1] = res;
3718 : 1570293 : next_instr += 4;
3719 [ + + ]: 1570293 : CHECK_EVAL_BREAKER();
3720 : 1570238 : DISPATCH();
3721 : : }
3722 : :
3723 : 1210517 : TARGET(CALL_NO_KW_BUILTIN_FAST) {
3724 : 1210517 : PyObject **args = (stack_pointer - oparg);
3725 : 1210517 : PyObject *callable = stack_pointer[-(1 + oparg)];
3726 [ - + ]: 1210517 : PyObject *method = stack_pointer[-(2 + oparg)];
3727 : : PyObject *res;
3728 : : #line 2628 "Python/bytecodes.c"
3729 : : assert(cframe.use_tracing == 0);
3730 : : /* Builtin METH_FASTCALL functions, without keywords */
3731 : : assert(kwnames == NULL);
3732 : : int is_meth = method != NULL;
3733 : : int total_args = oparg;
3734 : : if (is_meth) {
3735 : : callable = method;
3736 : : args--;
3737 : : total_args++;
3738 : : }
3739 : : DEOPT_IF(!PyCFunction_CheckExact(callable), CALL);
3740 : : DEOPT_IF(PyCFunction_GET_FLAGS(callable) != METH_FASTCALL, CALL);
3741 : : STAT_INC(CALL, hit);
3742 : : PyCFunction cfunc = PyCFunction_GET_FUNCTION(callable);
3743 : : /* res = func(self, args, nargs) */
3744 : : res = ((_PyCFunctionFast)(void(*)(void))cfunc)(
3745 : : PyCFunction_GET_SELF(callable),
3746 : : args,
3747 : : total_args);
3748 : : assert((res != NULL) ^ (_PyErr_Occurred(tstate) != NULL));
3749 : :
3750 : : /* Free the arguments. */
3751 : : for (int i = 0; i < total_args; i++) {
3752 : : Py_DECREF(args[i]);
3753 : : }
3754 : : Py_DECREF(callable);
3755 : : if (res == NULL) { STACK_SHRINK(oparg); goto pop_2_error; }
3756 : : /* Not deopting because this doesn't mean our optimization was
3757 : : wrong. `res` can be NULL for valid reasons. Eg. getattr(x,
3758 : : 'invalid'). In those cases an exception is set, so we must
3759 : : handle it.
3760 : : */
3761 : : #line 3762 "Python/generated_cases.c.h"
3762 : 1112600 : STACK_SHRINK(oparg);
3763 : 1112600 : STACK_SHRINK(1);
3764 : 1112600 : stack_pointer[-1] = res;
3765 : 1112600 : next_instr += 4;
3766 [ + + ]: 1112600 : CHECK_EVAL_BREAKER();
3767 : 1112598 : DISPATCH();
3768 : : }
3769 : :
3770 : 12250 : TARGET(CALL_BUILTIN_FAST_WITH_KEYWORDS) {
3771 : 12250 : PyObject **args = (stack_pointer - oparg);
3772 : 12250 : PyObject *callable = stack_pointer[-(1 + oparg)];
3773 [ - + ]: 12250 : PyObject *method = stack_pointer[-(2 + oparg)];
3774 : : PyObject *res;
3775 : : #line 2664 "Python/bytecodes.c"
3776 : : assert(cframe.use_tracing == 0);
3777 : : /* Builtin METH_FASTCALL | METH_KEYWORDS functions */
3778 : : int is_meth = method != NULL;
3779 : : int total_args = oparg;
3780 : : if (is_meth) {
3781 : : callable = method;
3782 : : args--;
3783 : : total_args++;
3784 : : }
3785 : : DEOPT_IF(!PyCFunction_CheckExact(callable), CALL);
3786 : : DEOPT_IF(PyCFunction_GET_FLAGS(callable) !=
3787 : : (METH_FASTCALL | METH_KEYWORDS), CALL);
3788 : : STAT_INC(CALL, hit);
3789 : : /* res = func(self, args, nargs, kwnames) */
3790 : : _PyCFunctionFastWithKeywords cfunc =
3791 : : (_PyCFunctionFastWithKeywords)(void(*)(void))
3792 : : PyCFunction_GET_FUNCTION(callable);
3793 : : res = cfunc(
3794 : : PyCFunction_GET_SELF(callable),
3795 : : args,
3796 : : total_args - KWNAMES_LEN(),
3797 : : kwnames
3798 : : );
3799 : : assert((res != NULL) ^ (_PyErr_Occurred(tstate) != NULL));
3800 : : kwnames = NULL;
3801 : :
3802 : : /* Free the arguments. */
3803 : : for (int i = 0; i < total_args; i++) {
3804 : : Py_DECREF(args[i]);
3805 : : }
3806 : : Py_DECREF(callable);
3807 : : if (res == NULL) { STACK_SHRINK(oparg); goto pop_2_error; }
3808 : : #line 3809 "Python/generated_cases.c.h"
3809 : 10598 : STACK_SHRINK(oparg);
3810 : 10598 : STACK_SHRINK(1);
3811 : 10598 : stack_pointer[-1] = res;
3812 : 10598 : next_instr += 4;
3813 [ + + ]: 10598 : CHECK_EVAL_BREAKER();
3814 : 10578 : DISPATCH();
3815 : : }
3816 : :
3817 : 44344 : TARGET(CALL_NO_KW_LEN) {
3818 : 44344 : PyObject **args = (stack_pointer - oparg);
3819 : 44344 : PyObject *callable = stack_pointer[-(1 + oparg)];
3820 [ - + ]: 44344 : PyObject *method = stack_pointer[-(2 + oparg)];
3821 : : PyObject *res;
3822 : : #line 2700 "Python/bytecodes.c"
3823 : : assert(cframe.use_tracing == 0);
3824 : : assert(kwnames == NULL);
3825 : : /* len(o) */
3826 : : int is_meth = method != NULL;
3827 : : int total_args = oparg;
3828 : : if (is_meth) {
3829 : : callable = method;
3830 : : args--;
3831 : : total_args++;
3832 : : }
3833 : : DEOPT_IF(total_args != 1, CALL);
3834 : : PyInterpreterState *interp = _PyInterpreterState_GET();
3835 : : DEOPT_IF(callable != interp->callable_cache.len, CALL);
3836 : : STAT_INC(CALL, hit);
3837 : : PyObject *arg = args[0];
3838 : : Py_ssize_t len_i = PyObject_Length(arg);
3839 : : if (len_i < 0) {
3840 : : goto error;
3841 : : }
3842 : : res = PyLong_FromSsize_t(len_i);
3843 : : assert((res != NULL) ^ (_PyErr_Occurred(tstate) != NULL));
3844 : :
3845 : : Py_DECREF(callable);
3846 : : Py_DECREF(arg);
3847 : : if (res == NULL) { STACK_SHRINK(oparg); goto pop_2_error; }
3848 : : #line 3849 "Python/generated_cases.c.h"
3849 : 44344 : STACK_SHRINK(oparg);
3850 : 44344 : STACK_SHRINK(1);
3851 : 44344 : stack_pointer[-1] = res;
3852 : 44344 : next_instr += 4;
3853 : 44344 : DISPATCH();
3854 : : }
3855 : :
3856 : 588295 : TARGET(CALL_NO_KW_ISINSTANCE) {
3857 : 588295 : PyObject **args = (stack_pointer - oparg);
3858 : 588295 : PyObject *callable = stack_pointer[-(1 + oparg)];
3859 [ - + ]: 588295 : PyObject *method = stack_pointer[-(2 + oparg)];
3860 : : PyObject *res;
3861 : : #line 2728 "Python/bytecodes.c"
3862 : : assert(cframe.use_tracing == 0);
3863 : : assert(kwnames == NULL);
3864 : : /* isinstance(o, o2) */
3865 : : int is_meth = method != NULL;
3866 : : int total_args = oparg;
3867 : : if (is_meth) {
3868 : : callable = method;
3869 : : args--;
3870 : : total_args++;
3871 : : }
3872 : : DEOPT_IF(total_args != 2, CALL);
3873 : : PyInterpreterState *interp = _PyInterpreterState_GET();
3874 : : DEOPT_IF(callable != interp->callable_cache.isinstance, CALL);
3875 : : STAT_INC(CALL, hit);
3876 : : PyObject *cls = args[1];
3877 : : PyObject *inst = args[0];
3878 : : int retval = PyObject_IsInstance(inst, cls);
3879 : : if (retval < 0) {
3880 : : goto error;
3881 : : }
3882 : : res = PyBool_FromLong(retval);
3883 : : assert((res != NULL) ^ (_PyErr_Occurred(tstate) != NULL));
3884 : :
3885 : : Py_DECREF(inst);
3886 : : Py_DECREF(cls);
3887 : : Py_DECREF(callable);
3888 : : if (res == NULL) { STACK_SHRINK(oparg); goto pop_2_error; }
3889 : : #line 3890 "Python/generated_cases.c.h"
3890 : 588295 : STACK_SHRINK(oparg);
3891 : 588295 : STACK_SHRINK(1);
3892 : 588295 : stack_pointer[-1] = res;
3893 : 588295 : next_instr += 4;
3894 : 588295 : DISPATCH();
3895 : : }
3896 : :
3897 : 498519 : TARGET(CALL_NO_KW_LIST_APPEND) {
3898 : 498519 : PyObject **args = (stack_pointer - oparg);
3899 : 498519 : PyObject *self = stack_pointer[-(1 + oparg)];
3900 : 498519 : PyObject *method = stack_pointer[-(2 + oparg)];
3901 : : #line 2759 "Python/bytecodes.c"
3902 : : assert(cframe.use_tracing == 0);
3903 : : assert(kwnames == NULL);
3904 : : assert(oparg == 1);
3905 : : assert(method != NULL);
3906 : : PyInterpreterState *interp = _PyInterpreterState_GET();
3907 : : DEOPT_IF(method != interp->callable_cache.list_append, CALL);
3908 : : DEOPT_IF(!PyList_Check(self), CALL);
3909 : : STAT_INC(CALL, hit);
3910 : : if (_PyList_AppendTakeRef((PyListObject *)self, args[0]) < 0) {
3911 : : goto pop_1_error; // Since arg is DECREF'ed already
3912 : : }
3913 : : Py_DECREF(self);
3914 : : Py_DECREF(method);
3915 : : STACK_SHRINK(3);
3916 : : // CALL + POP_TOP
3917 : : JUMPBY(INLINE_CACHE_ENTRIES_CALL + 1);
3918 : : assert(next_instr[-1].op.code == POP_TOP);
3919 : : DISPATCH();
3920 : : #line 3921 "Python/generated_cases.c.h"
3921 : : }
3922 : :
3923 : 237456 : TARGET(CALL_NO_KW_METHOD_DESCRIPTOR_O) {
3924 : 237456 : PyObject **args = (stack_pointer - oparg);
3925 [ + - ]: 237456 : PyObject *method = stack_pointer[-(2 + oparg)];
3926 : : PyObject *res;
3927 : : #line 2780 "Python/bytecodes.c"
3928 : : assert(kwnames == NULL);
3929 : : int is_meth = method != NULL;
3930 : : int total_args = oparg;
3931 : : if (is_meth) {
3932 : : args--;
3933 : : total_args++;
3934 : : }
3935 : : PyMethodDescrObject *callable =
3936 : : (PyMethodDescrObject *)PEEK(total_args + 1);
3937 : : DEOPT_IF(total_args != 2, CALL);
3938 : : DEOPT_IF(!Py_IS_TYPE(callable, &PyMethodDescr_Type), CALL);
3939 : : PyMethodDef *meth = callable->d_method;
3940 : : DEOPT_IF(meth->ml_flags != METH_O, CALL);
3941 : : PyObject *arg = args[1];
3942 : : PyObject *self = args[0];
3943 : : DEOPT_IF(!Py_IS_TYPE(self, callable->d_common.d_type), CALL);
3944 : : STAT_INC(CALL, hit);
3945 : : PyCFunction cfunc = meth->ml_meth;
3946 : : // This is slower but CPython promises to check all non-vectorcall
3947 : : // function calls.
3948 : : if (_Py_EnterRecursiveCallTstate(tstate, " while calling a Python object")) {
3949 : : goto error;
3950 : : }
3951 : : res = _PyCFunction_TrampolineCall(cfunc, self, arg);
3952 : : _Py_LeaveRecursiveCallTstate(tstate);
3953 : : assert((res != NULL) ^ (_PyErr_Occurred(tstate) != NULL));
3954 : : Py_DECREF(self);
3955 : : Py_DECREF(arg);
3956 : : Py_DECREF(callable);
3957 : : if (res == NULL) { STACK_SHRINK(oparg); goto pop_2_error; }
3958 : : #line 3959 "Python/generated_cases.c.h"
3959 : 87920 : STACK_SHRINK(oparg);
3960 : 87920 : STACK_SHRINK(1);
3961 : 87920 : stack_pointer[-1] = res;
3962 : 87920 : next_instr += 4;
3963 [ - + ]: 87920 : CHECK_EVAL_BREAKER();
3964 : 87920 : DISPATCH();
3965 : : }
3966 : :
3967 : 20601 : TARGET(CALL_METHOD_DESCRIPTOR_FAST_WITH_KEYWORDS) {
3968 : 20601 : PyObject **args = (stack_pointer - oparg);
3969 [ + - ]: 20601 : PyObject *method = stack_pointer[-(2 + oparg)];
3970 : : PyObject *res;
3971 : : #line 2814 "Python/bytecodes.c"
3972 : : int is_meth = method != NULL;
3973 : : int total_args = oparg;
3974 : : if (is_meth) {
3975 : : args--;
3976 : : total_args++;
3977 : : }
3978 : : PyMethodDescrObject *callable =
3979 : : (PyMethodDescrObject *)PEEK(total_args + 1);
3980 : : DEOPT_IF(!Py_IS_TYPE(callable, &PyMethodDescr_Type), CALL);
3981 : : PyMethodDef *meth = callable->d_method;
3982 : : DEOPT_IF(meth->ml_flags != (METH_FASTCALL|METH_KEYWORDS), CALL);
3983 : : PyTypeObject *d_type = callable->d_common.d_type;
3984 : : PyObject *self = args[0];
3985 : : DEOPT_IF(!Py_IS_TYPE(self, d_type), CALL);
3986 : : STAT_INC(CALL, hit);
3987 : : int nargs = total_args - 1;
3988 : : _PyCFunctionFastWithKeywords cfunc =
3989 : : (_PyCFunctionFastWithKeywords)(void(*)(void))meth->ml_meth;
3990 : : res = cfunc(self, args + 1, nargs - KWNAMES_LEN(), kwnames);
3991 : : assert((res != NULL) ^ (_PyErr_Occurred(tstate) != NULL));
3992 : : kwnames = NULL;
3993 : :
3994 : : /* Free the arguments. */
3995 : : for (int i = 0; i < total_args; i++) {
3996 : : Py_DECREF(args[i]);
3997 : : }
3998 : : Py_DECREF(callable);
3999 : : if (res == NULL) { STACK_SHRINK(oparg); goto pop_2_error; }
4000 : : #line 4001 "Python/generated_cases.c.h"
4001 : 20601 : STACK_SHRINK(oparg);
4002 : 20601 : STACK_SHRINK(1);
4003 : 20601 : stack_pointer[-1] = res;
4004 : 20601 : next_instr += 4;
4005 [ - + ]: 20601 : CHECK_EVAL_BREAKER();
4006 : 20601 : DISPATCH();
4007 : : }
4008 : :
4009 : 298114 : TARGET(CALL_NO_KW_METHOD_DESCRIPTOR_NOARGS) {
4010 : 298114 : PyObject **args = (stack_pointer - oparg);
4011 [ + + ]: 298114 : PyObject *method = stack_pointer[-(2 + oparg)];
4012 : : PyObject *res;
4013 : : #line 2846 "Python/bytecodes.c"
4014 : : assert(kwnames == NULL);
4015 : : assert(oparg == 0 || oparg == 1);
4016 : : int is_meth = method != NULL;
4017 : : int total_args = oparg;
4018 : : if (is_meth) {
4019 : : args--;
4020 : : total_args++;
4021 : : }
4022 : : DEOPT_IF(total_args != 1, CALL);
4023 : : PyMethodDescrObject *callable = (PyMethodDescrObject *)SECOND();
4024 : : DEOPT_IF(!Py_IS_TYPE(callable, &PyMethodDescr_Type), CALL);
4025 : : PyMethodDef *meth = callable->d_method;
4026 : : PyObject *self = args[0];
4027 : : DEOPT_IF(!Py_IS_TYPE(self, callable->d_common.d_type), CALL);
4028 : : DEOPT_IF(meth->ml_flags != METH_NOARGS, CALL);
4029 : : STAT_INC(CALL, hit);
4030 : : PyCFunction cfunc = meth->ml_meth;
4031 : : // This is slower but CPython promises to check all non-vectorcall
4032 : : // function calls.
4033 : : if (_Py_EnterRecursiveCallTstate(tstate, " while calling a Python object")) {
4034 : : goto error;
4035 : : }
4036 : : res = _PyCFunction_TrampolineCall(cfunc, self, NULL);
4037 : : _Py_LeaveRecursiveCallTstate(tstate);
4038 : : assert((res != NULL) ^ (_PyErr_Occurred(tstate) != NULL));
4039 : : Py_DECREF(self);
4040 : : Py_DECREF(callable);
4041 : : if (res == NULL) { STACK_SHRINK(oparg); goto pop_2_error; }
4042 : : #line 4043 "Python/generated_cases.c.h"
4043 : 295865 : STACK_SHRINK(oparg);
4044 : 295865 : STACK_SHRINK(1);
4045 : 295865 : stack_pointer[-1] = res;
4046 : 295865 : next_instr += 4;
4047 [ - + ]: 295865 : CHECK_EVAL_BREAKER();
4048 : 295865 : DISPATCH();
4049 : : }
4050 : :
4051 : 164246 : TARGET(CALL_NO_KW_METHOD_DESCRIPTOR_FAST) {
4052 : 164246 : PyObject **args = (stack_pointer - oparg);
4053 [ + + ]: 164246 : PyObject *method = stack_pointer[-(2 + oparg)];
4054 : : PyObject *res;
4055 : : #line 2878 "Python/bytecodes.c"
4056 : : assert(kwnames == NULL);
4057 : : int is_meth = method != NULL;
4058 : : int total_args = oparg;
4059 : : if (is_meth) {
4060 : : args--;
4061 : : total_args++;
4062 : : }
4063 : : PyMethodDescrObject *callable =
4064 : : (PyMethodDescrObject *)PEEK(total_args + 1);
4065 : : /* Builtin METH_FASTCALL methods, without keywords */
4066 : : DEOPT_IF(!Py_IS_TYPE(callable, &PyMethodDescr_Type), CALL);
4067 : : PyMethodDef *meth = callable->d_method;
4068 : : DEOPT_IF(meth->ml_flags != METH_FASTCALL, CALL);
4069 : : PyObject *self = args[0];
4070 : : DEOPT_IF(!Py_IS_TYPE(self, callable->d_common.d_type), CALL);
4071 : : STAT_INC(CALL, hit);
4072 : : _PyCFunctionFast cfunc =
4073 : : (_PyCFunctionFast)(void(*)(void))meth->ml_meth;
4074 : : int nargs = total_args - 1;
4075 : : res = cfunc(self, args + 1, nargs);
4076 : : assert((res != NULL) ^ (_PyErr_Occurred(tstate) != NULL));
4077 : : /* Clear the stack of the arguments. */
4078 : : for (int i = 0; i < total_args; i++) {
4079 : : Py_DECREF(args[i]);
4080 : : }
4081 : : Py_DECREF(callable);
4082 : : if (res == NULL) { STACK_SHRINK(oparg); goto pop_2_error; }
4083 : : #line 4084 "Python/generated_cases.c.h"
4084 : 164027 : STACK_SHRINK(oparg);
4085 : 164027 : STACK_SHRINK(1);
4086 : 164027 : stack_pointer[-1] = res;
4087 : 164027 : next_instr += 4;
4088 [ + + ]: 164027 : CHECK_EVAL_BREAKER();
4089 : 164026 : DISPATCH();
4090 : : }
4091 : :
4092 : 103224 : TARGET(CALL_FUNCTION_EX) {
4093 : 103224 : PREDICTED(CALL_FUNCTION_EX);
4094 [ + + ]: 103224 : PyObject *kwargs = (oparg & 1) ? stack_pointer[-(((oparg & 1) ? 1 : 0))] : NULL;
4095 : 103224 : PyObject *callargs = stack_pointer[-(1 + ((oparg & 1) ? 1 : 0))];
4096 : 103224 : PyObject *func = stack_pointer[-(2 + ((oparg & 1) ? 1 : 0))];
4097 : : PyObject *result;
4098 : : #line 2909 "Python/bytecodes.c"
4099 : : if (oparg & 1) {
4100 : : // DICT_MERGE is called before this opcode if there are kwargs.
4101 : : // It converts all dict subtypes in kwargs into regular dicts.
4102 : : assert(PyDict_CheckExact(kwargs));
4103 : : }
4104 : : if (!PyTuple_CheckExact(callargs)) {
4105 : : if (check_args_iterable(tstate, func, callargs) < 0) {
4106 : : goto error;
4107 : : }
4108 : : PyObject *tuple = PySequence_Tuple(callargs);
4109 : : if (tuple == NULL) {
4110 : : goto error;
4111 : : }
4112 : : Py_SETREF(callargs, tuple);
4113 : : }
4114 : : assert(PyTuple_CheckExact(callargs));
4115 : :
4116 : : result = do_call_core(tstate, func, callargs, kwargs, cframe.use_tracing);
4117 : : #line 4118 "Python/generated_cases.c.h"
4118 [ + + ]: 103224 : Py_DECREF(func);
4119 [ + + ]: 103224 : Py_DECREF(callargs);
4120 [ + + + - ]: 103224 : Py_XDECREF(kwargs);
4121 : : #line 2928 "Python/bytecodes.c"
4122 : :
4123 : : assert(PEEK(3 + (oparg & 1)) == NULL);
4124 : : if (result == NULL) { STACK_SHRINK(((oparg & 1) ? 1 : 0)); goto pop_3_error; }
4125 : : #line 4126 "Python/generated_cases.c.h"
4126 : 103023 : STACK_SHRINK(((oparg & 1) ? 1 : 0));
4127 : 103023 : STACK_SHRINK(2);
4128 : 103023 : stack_pointer[-1] = result;
4129 [ + + ]: 103023 : CHECK_EVAL_BREAKER();
4130 : 102949 : DISPATCH();
4131 : : }
4132 : :
4133 : 197280 : TARGET(MAKE_FUNCTION) {
4134 : 197280 : PyObject *codeobj = stack_pointer[-1];
4135 [ + + ]: 197280 : PyObject *closure = (oparg & 0x08) ? stack_pointer[-(1 + ((oparg & 0x08) ? 1 : 0))] : NULL;
4136 [ + + ]: 197280 : PyObject *annotations = (oparg & 0x04) ? stack_pointer[-(1 + ((oparg & 0x08) ? 1 : 0) + ((oparg & 0x04) ? 1 : 0))] : NULL;
4137 [ + + ]: 197280 : PyObject *kwdefaults = (oparg & 0x02) ? stack_pointer[-(1 + ((oparg & 0x08) ? 1 : 0) + ((oparg & 0x04) ? 1 : 0) + ((oparg & 0x02) ? 1 : 0))] : NULL;
4138 [ + + ]: 197280 : PyObject *defaults = (oparg & 0x01) ? stack_pointer[-(1 + ((oparg & 0x08) ? 1 : 0) + ((oparg & 0x04) ? 1 : 0) + ((oparg & 0x02) ? 1 : 0) + ((oparg & 0x01) ? 1 : 0))] : NULL;
4139 : : PyObject *func;
4140 : : #line 2939 "Python/bytecodes.c"
4141 : :
4142 : : PyFunctionObject *func_obj = (PyFunctionObject *)
4143 : : PyFunction_New(codeobj, GLOBALS());
4144 : :
4145 : : Py_DECREF(codeobj);
4146 : : if (func_obj == NULL) {
4147 : : goto error;
4148 : : }
4149 : :
4150 : : if (oparg & 0x08) {
4151 : : assert(PyTuple_CheckExact(closure));
4152 : : func_obj->func_closure = closure;
4153 : : }
4154 : : if (oparg & 0x04) {
4155 : : assert(PyTuple_CheckExact(annotations));
4156 : : func_obj->func_annotations = annotations;
4157 : : }
4158 : : if (oparg & 0x02) {
4159 : : assert(PyDict_CheckExact(kwdefaults));
4160 : : func_obj->func_kwdefaults = kwdefaults;
4161 : : }
4162 : : if (oparg & 0x01) {
4163 : : assert(PyTuple_CheckExact(defaults));
4164 : : func_obj->func_defaults = defaults;
4165 : : }
4166 : :
4167 : : func_obj->func_version = ((PyCodeObject *)codeobj)->co_version;
4168 : : func = (PyObject *)func_obj;
4169 : : #line 4170 "Python/generated_cases.c.h"
4170 : 197280 : STACK_SHRINK(((oparg & 0x01) ? 1 : 0) + ((oparg & 0x02) ? 1 : 0) + ((oparg & 0x04) ? 1 : 0) + ((oparg & 0x08) ? 1 : 0));
4171 : 197280 : stack_pointer[-1] = func;
4172 : 197280 : DISPATCH();
4173 : : }
4174 : :
4175 : 122420 : TARGET(RETURN_GENERATOR) {
4176 : : #line 2970 "Python/bytecodes.c"
4177 : : assert(PyFunction_Check(frame->f_funcobj));
4178 : : PyFunctionObject *func = (PyFunctionObject *)frame->f_funcobj;
4179 : : PyGenObject *gen = (PyGenObject *)_Py_MakeCoro(func);
4180 : : if (gen == NULL) {
4181 : : goto error;
4182 : : }
4183 : : assert(EMPTY());
4184 : : _PyFrame_SetStackPointer(frame, stack_pointer);
4185 : : _PyInterpreterFrame *gen_frame = (_PyInterpreterFrame *)gen->gi_iframe;
4186 : : _PyFrame_Copy(frame, gen_frame);
4187 : : assert(frame->frame_obj == NULL);
4188 : : gen->gi_frame_state = FRAME_CREATED;
4189 : : gen_frame->owner = FRAME_OWNED_BY_GENERATOR;
4190 : : _Py_LeaveRecursiveCallPy(tstate);
4191 : : assert(frame != &entry_frame);
4192 : : _PyInterpreterFrame *prev = frame->previous;
4193 : : _PyThreadState_PopFrame(tstate, frame);
4194 : : frame = cframe.current_frame = prev;
4195 : : _PyFrame_StackPush(frame, (PyObject *)gen);
4196 : : goto resume_frame;
4197 : : #line 4198 "Python/generated_cases.c.h"
4198 : : }
4199 : :
4200 : 1181 : TARGET(BUILD_SLICE) {
4201 [ + + ]: 1181 : PyObject *step = (oparg == 3) ? stack_pointer[-(((oparg == 3) ? 1 : 0))] : NULL;
4202 [ + + ]: 1181 : PyObject *stop = stack_pointer[-(1 + ((oparg == 3) ? 1 : 0))];
4203 [ + + ]: 1181 : PyObject *start = stack_pointer[-(2 + ((oparg == 3) ? 1 : 0))];
4204 : : PyObject *slice;
4205 : : #line 2993 "Python/bytecodes.c"
4206 : : slice = PySlice_New(start, stop, step);
4207 : : #line 4208 "Python/generated_cases.c.h"
4208 [ - + ]: 1181 : Py_DECREF(start);
4209 [ - + ]: 1181 : Py_DECREF(stop);
4210 [ + + - + ]: 1181 : Py_XDECREF(step);
4211 : : #line 2995 "Python/bytecodes.c"
4212 : : if (slice == NULL) { STACK_SHRINK(((oparg == 3) ? 1 : 0)); goto pop_2_error; }
4213 : : #line 4214 "Python/generated_cases.c.h"
4214 : 1181 : STACK_SHRINK(((oparg == 3) ? 1 : 0));
4215 : 1181 : STACK_SHRINK(1);
4216 : 1181 : stack_pointer[-1] = slice;
4217 : 1181 : DISPATCH();
4218 : : }
4219 : :
4220 : 362437 : TARGET(FORMAT_VALUE) {
4221 [ + + ]: 362437 : PyObject *fmt_spec = ((oparg & FVS_MASK) == FVS_HAVE_SPEC) ? stack_pointer[-((((oparg & FVS_MASK) == FVS_HAVE_SPEC) ? 1 : 0))] : NULL;
4222 [ + + + - : 362437 : PyObject *value = stack_pointer[-(1 + (((oparg & FVS_MASK) == FVS_HAVE_SPEC) ? 1 : 0))];
- ]
4223 : : PyObject *result;
4224 : : #line 2999 "Python/bytecodes.c"
4225 : : /* Handles f-string value formatting. */
4226 : : PyObject *(*conv_fn)(PyObject *);
4227 : : int which_conversion = oparg & FVC_MASK;
4228 : :
4229 : : /* See if any conversion is specified. */
4230 : : switch (which_conversion) {
4231 : : case FVC_NONE: conv_fn = NULL; break;
4232 : : case FVC_STR: conv_fn = PyObject_Str; break;
4233 : : case FVC_REPR: conv_fn = PyObject_Repr; break;
4234 : : case FVC_ASCII: conv_fn = PyObject_ASCII; break;
4235 : : default:
4236 : : _PyErr_Format(tstate, PyExc_SystemError,
4237 : : "unexpected conversion flag %d",
4238 : : which_conversion);
4239 : : goto error;
4240 : : }
4241 : :
4242 : : /* If there's a conversion function, call it and replace
4243 : : value with that result. Otherwise, just use value,
4244 : : without conversion. */
4245 : : if (conv_fn != NULL) {
4246 : : result = conv_fn(value);
4247 : : Py_DECREF(value);
4248 : : if (result == NULL) {
4249 : : Py_XDECREF(fmt_spec);
4250 : : if (true) { STACK_SHRINK((((oparg & FVS_MASK) == FVS_HAVE_SPEC) ? 1 : 0)); goto pop_1_error; }
4251 : : }
4252 : : value = result;
4253 : : }
4254 : :
4255 : : /* If value is a unicode object, and there's no fmt_spec,
4256 : : then we know the result of format(value) is value
4257 : : itself. In that case, skip calling format(). I plan to
4258 : : move this optimization in to PyObject_Format()
4259 : : itself. */
4260 : : if (PyUnicode_CheckExact(value) && fmt_spec == NULL) {
4261 : : /* Do nothing, just transfer ownership to result. */
4262 : : result = value;
4263 : : } else {
4264 : : /* Actually call format(). */
4265 : : result = PyObject_Format(value, fmt_spec);
4266 : : #line 4267 "Python/generated_cases.c.h"
4267 [ + + ]: 304040 : Py_DECREF(value);
4268 [ + + + + ]: 304040 : Py_XDECREF(fmt_spec);
4269 : : #line 3041 "Python/bytecodes.c"
4270 : : if (result == NULL) { STACK_SHRINK((((oparg & FVS_MASK) == FVS_HAVE_SPEC) ? 1 : 0)); goto pop_1_error; }
4271 : : }
4272 : : #line 4273 "Python/generated_cases.c.h"
4273 : 362437 : STACK_SHRINK((((oparg & FVS_MASK) == FVS_HAVE_SPEC) ? 1 : 0));
4274 : 362437 : stack_pointer[-1] = result;
4275 : 362437 : DISPATCH();
4276 : : }
4277 : :
4278 : 225025 : TARGET(COPY) {
4279 : 225025 : PyObject *bottom = stack_pointer[-(1 + (oparg-1))];
4280 : : PyObject *top;
4281 : : #line 3046 "Python/bytecodes.c"
4282 : : assert(oparg > 0);
4283 : : top = Py_NewRef(bottom);
4284 : : #line 4285 "Python/generated_cases.c.h"
4285 : 225025 : STACK_GROW(1);
4286 : 225025 : stack_pointer[-1] = top;
4287 : 225025 : DISPATCH();
4288 : : }
4289 : :
4290 : 2222177 : TARGET(BINARY_OP) {
4291 : 2224339 : PREDICTED(BINARY_OP);
4292 : : static_assert(INLINE_CACHE_ENTRIES_BINARY_OP == 1, "incorrect cache size");
4293 : 2224339 : PyObject *rhs = stack_pointer[-1];
4294 [ + + ]: 2224339 : PyObject *lhs = stack_pointer[-2];
4295 : : PyObject *res;
4296 : : #line 3051 "Python/bytecodes.c"
4297 : : #if ENABLE_SPECIALIZATION
4298 : : _PyBinaryOpCache *cache = (_PyBinaryOpCache *)next_instr;
4299 : : if (ADAPTIVE_COUNTER_IS_ZERO(cache->counter)) {
4300 : : assert(cframe.use_tracing == 0);
4301 : : next_instr--;
4302 : : _Py_Specialize_BinaryOp(lhs, rhs, next_instr, oparg, &GETLOCAL(0));
4303 : : DISPATCH_SAME_OPARG();
4304 : : }
4305 : : STAT_INC(BINARY_OP, deferred);
4306 : : DECREMENT_ADAPTIVE_COUNTER(cache->counter);
4307 : : #endif /* ENABLE_SPECIALIZATION */
4308 : : assert(0 <= oparg);
4309 : : assert((unsigned)oparg < Py_ARRAY_LENGTH(binary_ops));
4310 : : assert(binary_ops[oparg]);
4311 : : res = binary_ops[oparg](lhs, rhs);
4312 : : #line 4313 "Python/generated_cases.c.h"
4313 [ + + ]: 2220938 : Py_DECREF(lhs);
4314 [ + + ]: 2220938 : Py_DECREF(rhs);
4315 : : #line 3067 "Python/bytecodes.c"
4316 : : if (res == NULL) goto pop_2_error;
4317 : : #line 4318 "Python/generated_cases.c.h"
4318 : 2220937 : STACK_SHRINK(1);
4319 : 2220937 : stack_pointer[-1] = res;
4320 : 2220937 : next_instr += 1;
4321 : 2220937 : DISPATCH();
4322 : : }
4323 : :
4324 : 586087 : TARGET(SWAP) {
4325 : 586087 : PyObject *top = stack_pointer[-1];
4326 : 586087 : PyObject *bottom = stack_pointer[-(2 + (oparg-2))];
4327 : : #line 3072 "Python/bytecodes.c"
4328 : : assert(oparg >= 2);
4329 : : #line 4330 "Python/generated_cases.c.h"
4330 : 586087 : stack_pointer[-1] = bottom;
4331 : 586087 : stack_pointer[-(2 + (oparg-2))] = top;
4332 : 586087 : DISPATCH();
4333 : : }
4334 : :
4335 : 92853 : TARGET(EXTENDED_ARG) {
4336 : : #line 3076 "Python/bytecodes.c"
4337 : : assert(oparg);
4338 : : assert(cframe.use_tracing == 0);
4339 : : opcode = next_instr->op.code;
4340 : : oparg = oparg << 8 | next_instr->op.arg;
4341 : : PRE_DISPATCH_GOTO();
4342 : : DISPATCH_GOTO();
4343 : : #line 4344 "Python/generated_cases.c.h"
4344 : : }
4345 : :
4346 : 0 : TARGET(CACHE) {
4347 : : #line 3085 "Python/bytecodes.c"
4348 : : Py_UNREACHABLE();
4349 : : #line 4350 "Python/generated_cases.c.h"
4350 : : }
|