From 7b5afb03b40729063d8139a5d3fa0783c475a4b7 Mon Sep 17 00:00:00 2001 From: Dong-hee Na Date: Sun, 28 May 2023 21:41:03 +0900 Subject: [PATCH 01/13] Implement simple dead store elimination in cfg opt --- Lib/test/test_dis.py | 2 +- Lib/test/test_peepholer.py | 12 +++++++++++- Python/flowgraph.c | 6 ++++++ 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/Lib/test/test_dis.py b/Lib/test/test_dis.py index c90702a408eb33..4bee0901ecbff9 100644 --- a/Lib/test/test_dis.py +++ b/Lib/test/test_dis.py @@ -811,7 +811,7 @@ def extended_arg_quick(): %3d 2 LOAD_CONST 1 (Ellipsis) 4 EXTENDED_ARG 1 6 UNPACK_EX 256 - 8 STORE_FAST 0 (_) + 8 POP_TOP 10 STORE_FAST 0 (_) 12 RETURN_CONST 0 (None) """% (extended_arg_quick.__code__.co_firstlineno, diff --git a/Lib/test/test_peepholer.py b/Lib/test/test_peepholer.py index 255e9280421423..006ee15c7b8f71 100644 --- a/Lib/test/test_peepholer.py +++ b/Lib/test/test_peepholer.py @@ -1071,7 +1071,17 @@ def test_no_unsafe_static_swap(self): ('POP_TOP', 0, 4), ('RETURN_VALUE', 5) ] - self.cfg_optimization_test(insts, insts, consts=list(range(3)), nlocals=1) + expected_insts = [ + ('LOAD_CONST', 0, 1), + ('LOAD_CONST', 1, 2), + ('LOAD_CONST', 2, 3), + ('SWAP', 3, 4), + ('POP_TOP', 0, 4), + ('STORE_FAST', 1, 4), + ('POP_TOP', 0, 4), + ('RETURN_VALUE', 5) + ] + self.cfg_optimization_test(insts, expected_insts, consts=list(range(3)), nlocals=1) if __name__ == "__main__": unittest.main() diff --git a/Python/flowgraph.c b/Python/flowgraph.c index f8039a4985d948..a6639a26503801 100644 --- a/Python/flowgraph.c +++ b/Python/flowgraph.c @@ -1515,6 +1515,12 @@ optimize_basic_block(PyObject *const_cache, basicblock *bb, PyObject *consts) */ } break; + case STORE_FAST: + if (opcode == nextop && oparg == bb->b_instr[i+1].i_oparg) { + bb->b_instr[i].i_opcode = POP_TOP; + bb->b_instr[i].i_oparg = 0; + } + break; case SWAP: if (oparg == 1) { INSTR_SET_OP0(inst, NOP); From 2a886baa303290e1e36f619708a136d077a9d528 Mon Sep 17 00:00:00 2001 From: Dong-hee Na Date: Sun, 28 May 2023 22:34:38 +0900 Subject: [PATCH 02/13] Implement POP_TOP__STORE_FAST super instruction --- Include/internal/pycore_opcode.h | 4 +- Include/internal/pycore_opcode_utils.h | 3 +- Include/opcode.h | 1 + Lib/opcode.py | 3 + Python/bytecodes.c | 1 + Python/generated_cases.c.h | 984 +++++++++++++------------ Python/instrumentation.c | 1 + Python/opcode_metadata.h | 7 +- Python/opcode_targets.h | 2 +- Python/specialize.c | 3 + 10 files changed, 522 insertions(+), 487 deletions(-) diff --git a/Include/internal/pycore_opcode.h b/Include/internal/pycore_opcode.h index 15d96503830f93..c1e2a1e138dde0 100644 --- a/Include/internal/pycore_opcode.h +++ b/Include/internal/pycore_opcode.h @@ -201,6 +201,7 @@ const uint8_t _PyOpcode_Deopt[256] = { [POP_JUMP_IF_NOT_NONE] = POP_JUMP_IF_NOT_NONE, [POP_JUMP_IF_TRUE] = POP_JUMP_IF_TRUE, [POP_TOP] = POP_TOP, + [POP_TOP__STORE_FAST] = POP_TOP, [PUSH_EXC_INFO] = PUSH_EXC_INFO, [PUSH_NULL] = PUSH_NULL, [RAISE_VARARGS] = RAISE_VARARGS, @@ -414,7 +415,7 @@ static const char *const _PyOpcode_OpName[267] = { [UNPACK_SEQUENCE_TUPLE] = "UNPACK_SEQUENCE_TUPLE", [UNPACK_SEQUENCE_TWO_TUPLE] = "UNPACK_SEQUENCE_TWO_TUPLE", [SEND_GEN] = "SEND_GEN", - [169] = "<169>", + [POP_TOP__STORE_FAST] = "POP_TOP__STORE_FAST", [170] = "<170>", [CALL] = "CALL", [KW_NAMES] = "KW_NAMES", @@ -516,7 +517,6 @@ static const char *const _PyOpcode_OpName[267] = { #endif #define EXTRA_CASES \ - case 169: \ case 170: \ case 177: \ case 178: \ diff --git a/Include/internal/pycore_opcode_utils.h b/Include/internal/pycore_opcode_utils.h index 1d5ff988290bd4..faf6614622c80d 100644 --- a/Include/internal/pycore_opcode_utils.h +++ b/Include/internal/pycore_opcode_utils.h @@ -60,7 +60,8 @@ extern "C" { (opcode) == LOAD_FAST__LOAD_CONST || \ (opcode) == LOAD_CONST__LOAD_FAST || \ (opcode) == STORE_FAST__LOAD_FAST || \ - (opcode) == STORE_FAST__STORE_FAST) + (opcode) == STORE_FAST__STORE_FAST) || \ + (opcode) == POP_TOP__STORE_FAST #define LOG_BITS_PER_INT 5 diff --git a/Include/opcode.h b/Include/opcode.h index 9806511ba4286a..02dd9427090aa4 100644 --- a/Include/opcode.h +++ b/Include/opcode.h @@ -216,6 +216,7 @@ extern "C" { #define UNPACK_SEQUENCE_TUPLE 166 #define UNPACK_SEQUENCE_TWO_TUPLE 167 #define SEND_GEN 168 +#define POP_TOP__STORE_FAST 169 #define HAS_ARG(op) ((((op) >= HAVE_ARGUMENT) && (!IS_PSEUDO_OPCODE(op)))\ || ((op) == JUMP) \ diff --git a/Lib/opcode.py b/Lib/opcode.py index 6bb2f1c140b15a..c5ab4c11130481 100644 --- a/Lib/opcode.py +++ b/Lib/opcode.py @@ -435,6 +435,9 @@ def pseudo_op(name, op, real_ops): "SEND": [ "SEND_GEN", ], + "POP_TOP": [ + "POP_TOP__STORE_FAST" + ] } _specialized_instructions = [ opcode for family in _specializations.values() for opcode in family diff --git a/Python/bytecodes.c b/Python/bytecodes.c index 43e3877268873d..ea197fdb7735d9 100644 --- a/Python/bytecodes.c +++ b/Python/bytecodes.c @@ -213,6 +213,7 @@ dummy_func( super(STORE_FAST__LOAD_FAST) = STORE_FAST + LOAD_FAST; super(STORE_FAST__STORE_FAST) = STORE_FAST + STORE_FAST; super(LOAD_CONST__LOAD_FAST) = LOAD_CONST + LOAD_FAST; + super(POP_TOP__STORE_FAST) = POP_TOP + STORE_FAST; inst(POP_TOP, (value --)) { DECREF_INPUTS(); diff --git a/Python/generated_cases.c.h b/Python/generated_cases.c.h index c349e47578bdc0..bf37b2bfb03449 100644 --- a/Python/generated_cases.c.h +++ b/Python/generated_cases.c.h @@ -249,10 +249,30 @@ DISPATCH(); } + TARGET(POP_TOP__STORE_FAST) { + PyObject *_tmp_1 = stack_pointer[-1]; + PyObject *_tmp_2 = stack_pointer[-2]; + { + PyObject *value = _tmp_1; + #line 219 "Python/bytecodes.c" + #line 259 "Python/generated_cases.c.h" + Py_DECREF(value); + } + oparg = (next_instr++)->op.arg; + { + PyObject *value = _tmp_2; + #line 208 "Python/bytecodes.c" + SETLOCAL(oparg, value); + #line 267 "Python/generated_cases.c.h" + } + STACK_SHRINK(2); + DISPATCH(); + } + TARGET(POP_TOP) { PyObject *value = stack_pointer[-1]; - #line 218 "Python/bytecodes.c" - #line 256 "Python/generated_cases.c.h" + #line 219 "Python/bytecodes.c" + #line 276 "Python/generated_cases.c.h" Py_DECREF(value); STACK_SHRINK(1); DISPATCH(); @@ -260,9 +280,9 @@ TARGET(PUSH_NULL) { PyObject *res; - #line 222 "Python/bytecodes.c" + #line 223 "Python/bytecodes.c" res = NULL; - #line 266 "Python/generated_cases.c.h" + #line 286 "Python/generated_cases.c.h" STACK_GROW(1); stack_pointer[-1] = res; DISPATCH(); @@ -273,14 +293,14 @@ PyObject *_tmp_2 = stack_pointer[-2]; { PyObject *value = _tmp_1; - #line 218 "Python/bytecodes.c" - #line 278 "Python/generated_cases.c.h" + #line 219 "Python/bytecodes.c" + #line 298 "Python/generated_cases.c.h" Py_DECREF(value); } { PyObject *value = _tmp_2; - #line 218 "Python/bytecodes.c" - #line 284 "Python/generated_cases.c.h" + #line 219 "Python/bytecodes.c" + #line 304 "Python/generated_cases.c.h" Py_DECREF(value); } STACK_SHRINK(2); @@ -290,7 +310,7 @@ TARGET(INSTRUMENTED_END_FOR) { PyObject *value = stack_pointer[-1]; PyObject *receiver = stack_pointer[-2]; - #line 228 "Python/bytecodes.c" + #line 229 "Python/bytecodes.c" /* Need to create a fake StopIteration error here, * to conform to PEP 380 */ if (PyGen_Check(receiver)) { @@ -300,7 +320,7 @@ } PyErr_SetRaisedException(NULL); } - #line 304 "Python/generated_cases.c.h" + #line 324 "Python/generated_cases.c.h" Py_DECREF(receiver); Py_DECREF(value); STACK_SHRINK(2); @@ -310,9 +330,9 @@ TARGET(END_SEND) { PyObject *value = stack_pointer[-1]; PyObject *receiver = stack_pointer[-2]; - #line 241 "Python/bytecodes.c" + #line 242 "Python/bytecodes.c" Py_DECREF(receiver); - #line 316 "Python/generated_cases.c.h" + #line 336 "Python/generated_cases.c.h" STACK_SHRINK(1); stack_pointer[-1] = value; DISPATCH(); @@ -321,7 +341,7 @@ TARGET(INSTRUMENTED_END_SEND) { PyObject *value = stack_pointer[-1]; PyObject *receiver = stack_pointer[-2]; - #line 245 "Python/bytecodes.c" + #line 246 "Python/bytecodes.c" if (PyGen_Check(receiver) || PyCoro_CheckExact(receiver)) { PyErr_SetObject(PyExc_StopIteration, value); if (monitor_stop_iteration(tstate, frame, next_instr-1)) { @@ -330,7 +350,7 @@ PyErr_SetRaisedException(NULL); } Py_DECREF(receiver); - #line 334 "Python/generated_cases.c.h" + #line 354 "Python/generated_cases.c.h" STACK_SHRINK(1); stack_pointer[-1] = value; DISPATCH(); @@ -339,13 +359,13 @@ TARGET(UNARY_NEGATIVE) { PyObject *value = stack_pointer[-1]; PyObject *res; - #line 256 "Python/bytecodes.c" + #line 257 "Python/bytecodes.c" res = PyNumber_Negative(value); - #line 345 "Python/generated_cases.c.h" + #line 365 "Python/generated_cases.c.h" Py_DECREF(value); - #line 258 "Python/bytecodes.c" + #line 259 "Python/bytecodes.c" if (res == NULL) goto pop_1_error; - #line 349 "Python/generated_cases.c.h" + #line 369 "Python/generated_cases.c.h" stack_pointer[-1] = res; DISPATCH(); } @@ -353,11 +373,11 @@ TARGET(UNARY_NOT) { PyObject *value = stack_pointer[-1]; PyObject *res; - #line 262 "Python/bytecodes.c" + #line 263 "Python/bytecodes.c" int err = PyObject_IsTrue(value); - #line 359 "Python/generated_cases.c.h" + #line 379 "Python/generated_cases.c.h" Py_DECREF(value); - #line 264 "Python/bytecodes.c" + #line 265 "Python/bytecodes.c" if (err < 0) goto pop_1_error; if (err == 0) { res = Py_True; @@ -365,7 +385,7 @@ else { res = Py_False; } - #line 369 "Python/generated_cases.c.h" + #line 389 "Python/generated_cases.c.h" stack_pointer[-1] = res; DISPATCH(); } @@ -373,13 +393,13 @@ TARGET(UNARY_INVERT) { PyObject *value = stack_pointer[-1]; PyObject *res; - #line 274 "Python/bytecodes.c" + #line 275 "Python/bytecodes.c" res = PyNumber_Invert(value); - #line 379 "Python/generated_cases.c.h" + #line 399 "Python/generated_cases.c.h" Py_DECREF(value); - #line 276 "Python/bytecodes.c" + #line 277 "Python/bytecodes.c" if (res == NULL) goto pop_1_error; - #line 383 "Python/generated_cases.c.h" + #line 403 "Python/generated_cases.c.h" stack_pointer[-1] = res; DISPATCH(); } @@ -390,10 +410,10 @@ { PyObject *right = _tmp_1; PyObject *left = _tmp_2; - #line 292 "Python/bytecodes.c" + #line 293 "Python/bytecodes.c" DEOPT_IF(!PyLong_CheckExact(left), BINARY_OP); DEOPT_IF(!PyLong_CheckExact(right), BINARY_OP); - #line 397 "Python/generated_cases.c.h" + #line 417 "Python/generated_cases.c.h" _tmp_2 = left; _tmp_1 = right; } @@ -401,13 +421,13 @@ PyObject *right = _tmp_1; PyObject *left = _tmp_2; PyObject *res; - #line 297 "Python/bytecodes.c" + #line 298 "Python/bytecodes.c" STAT_INC(BINARY_OP, hit); res = _PyLong_Multiply((PyLongObject *)left, (PyLongObject *)right); _Py_DECREF_SPECIALIZED(right, (destructor)PyObject_Free); _Py_DECREF_SPECIALIZED(left, (destructor)PyObject_Free); if (res == NULL) goto pop_2_error; - #line 411 "Python/generated_cases.c.h" + #line 431 "Python/generated_cases.c.h" _tmp_2 = res; } next_instr += 1; @@ -422,10 +442,10 @@ { PyObject *right = _tmp_1; PyObject *left = _tmp_2; - #line 292 "Python/bytecodes.c" + #line 293 "Python/bytecodes.c" DEOPT_IF(!PyLong_CheckExact(left), BINARY_OP); DEOPT_IF(!PyLong_CheckExact(right), BINARY_OP); - #line 429 "Python/generated_cases.c.h" + #line 449 "Python/generated_cases.c.h" _tmp_2 = left; _tmp_1 = right; } @@ -433,13 +453,13 @@ PyObject *right = _tmp_1; PyObject *left = _tmp_2; PyObject *res; - #line 305 "Python/bytecodes.c" + #line 306 "Python/bytecodes.c" STAT_INC(BINARY_OP, hit); res = _PyLong_Add((PyLongObject *)left, (PyLongObject *)right); _Py_DECREF_SPECIALIZED(right, (destructor)PyObject_Free); _Py_DECREF_SPECIALIZED(left, (destructor)PyObject_Free); if (res == NULL) goto pop_2_error; - #line 443 "Python/generated_cases.c.h" + #line 463 "Python/generated_cases.c.h" _tmp_2 = res; } next_instr += 1; @@ -454,10 +474,10 @@ { PyObject *right = _tmp_1; PyObject *left = _tmp_2; - #line 292 "Python/bytecodes.c" + #line 293 "Python/bytecodes.c" DEOPT_IF(!PyLong_CheckExact(left), BINARY_OP); DEOPT_IF(!PyLong_CheckExact(right), BINARY_OP); - #line 461 "Python/generated_cases.c.h" + #line 481 "Python/generated_cases.c.h" _tmp_2 = left; _tmp_1 = right; } @@ -465,13 +485,13 @@ PyObject *right = _tmp_1; PyObject *left = _tmp_2; PyObject *res; - #line 313 "Python/bytecodes.c" + #line 314 "Python/bytecodes.c" STAT_INC(BINARY_OP, hit); res = _PyLong_Subtract((PyLongObject *)left, (PyLongObject *)right); _Py_DECREF_SPECIALIZED(right, (destructor)PyObject_Free); _Py_DECREF_SPECIALIZED(left, (destructor)PyObject_Free); if (res == NULL) goto pop_2_error; - #line 475 "Python/generated_cases.c.h" + #line 495 "Python/generated_cases.c.h" _tmp_2 = res; } next_instr += 1; @@ -486,10 +506,10 @@ { PyObject *right = _tmp_1; PyObject *left = _tmp_2; - #line 328 "Python/bytecodes.c" + #line 329 "Python/bytecodes.c" DEOPT_IF(!PyFloat_CheckExact(left), BINARY_OP); DEOPT_IF(!PyFloat_CheckExact(right), BINARY_OP); - #line 493 "Python/generated_cases.c.h" + #line 513 "Python/generated_cases.c.h" _tmp_2 = left; _tmp_1 = right; } @@ -497,13 +517,13 @@ PyObject *right = _tmp_1; PyObject *left = _tmp_2; PyObject *res; - #line 333 "Python/bytecodes.c" + #line 334 "Python/bytecodes.c" STAT_INC(BINARY_OP, hit); double dres = ((PyFloatObject *)left)->ob_fval * ((PyFloatObject *)right)->ob_fval; DECREF_INPUTS_AND_REUSE_FLOAT(left, right, dres, res); - #line 507 "Python/generated_cases.c.h" + #line 527 "Python/generated_cases.c.h" _tmp_2 = res; } next_instr += 1; @@ -518,10 +538,10 @@ { PyObject *right = _tmp_1; PyObject *left = _tmp_2; - #line 328 "Python/bytecodes.c" + #line 329 "Python/bytecodes.c" DEOPT_IF(!PyFloat_CheckExact(left), BINARY_OP); DEOPT_IF(!PyFloat_CheckExact(right), BINARY_OP); - #line 525 "Python/generated_cases.c.h" + #line 545 "Python/generated_cases.c.h" _tmp_2 = left; _tmp_1 = right; } @@ -529,13 +549,13 @@ PyObject *right = _tmp_1; PyObject *left = _tmp_2; PyObject *res; - #line 341 "Python/bytecodes.c" + #line 342 "Python/bytecodes.c" STAT_INC(BINARY_OP, hit); double dres = ((PyFloatObject *)left)->ob_fval + ((PyFloatObject *)right)->ob_fval; DECREF_INPUTS_AND_REUSE_FLOAT(left, right, dres, res); - #line 539 "Python/generated_cases.c.h" + #line 559 "Python/generated_cases.c.h" _tmp_2 = res; } next_instr += 1; @@ -550,10 +570,10 @@ { PyObject *right = _tmp_1; PyObject *left = _tmp_2; - #line 328 "Python/bytecodes.c" + #line 329 "Python/bytecodes.c" DEOPT_IF(!PyFloat_CheckExact(left), BINARY_OP); DEOPT_IF(!PyFloat_CheckExact(right), BINARY_OP); - #line 557 "Python/generated_cases.c.h" + #line 577 "Python/generated_cases.c.h" _tmp_2 = left; _tmp_1 = right; } @@ -561,13 +581,13 @@ PyObject *right = _tmp_1; PyObject *left = _tmp_2; PyObject *res; - #line 349 "Python/bytecodes.c" + #line 350 "Python/bytecodes.c" STAT_INC(BINARY_OP, hit); double dres = ((PyFloatObject *)left)->ob_fval - ((PyFloatObject *)right)->ob_fval; DECREF_INPUTS_AND_REUSE_FLOAT(left, right, dres, res); - #line 571 "Python/generated_cases.c.h" + #line 591 "Python/generated_cases.c.h" _tmp_2 = res; } next_instr += 1; @@ -582,10 +602,10 @@ { PyObject *right = _tmp_1; PyObject *left = _tmp_2; - #line 364 "Python/bytecodes.c" + #line 365 "Python/bytecodes.c" DEOPT_IF(!PyUnicode_CheckExact(left), BINARY_OP); DEOPT_IF(!PyUnicode_CheckExact(right), BINARY_OP); - #line 589 "Python/generated_cases.c.h" + #line 609 "Python/generated_cases.c.h" _tmp_2 = left; _tmp_1 = right; } @@ -593,13 +613,13 @@ PyObject *right = _tmp_1; PyObject *left = _tmp_2; PyObject *res; - #line 369 "Python/bytecodes.c" + #line 370 "Python/bytecodes.c" STAT_INC(BINARY_OP, hit); res = PyUnicode_Concat(left, right); _Py_DECREF_SPECIALIZED(left, _PyUnicode_ExactDealloc); _Py_DECREF_SPECIALIZED(right, _PyUnicode_ExactDealloc); if (res == NULL) goto pop_2_error; - #line 603 "Python/generated_cases.c.h" + #line 623 "Python/generated_cases.c.h" _tmp_2 = res; } next_instr += 1; @@ -614,17 +634,17 @@ { PyObject *right = _tmp_1; PyObject *left = _tmp_2; - #line 364 "Python/bytecodes.c" + #line 365 "Python/bytecodes.c" DEOPT_IF(!PyUnicode_CheckExact(left), BINARY_OP); DEOPT_IF(!PyUnicode_CheckExact(right), BINARY_OP); - #line 621 "Python/generated_cases.c.h" + #line 641 "Python/generated_cases.c.h" _tmp_2 = left; _tmp_1 = right; } { PyObject *right = _tmp_1; PyObject *left = _tmp_2; - #line 386 "Python/bytecodes.c" + #line 387 "Python/bytecodes.c" _Py_CODEUNIT true_next = next_instr[INLINE_CACHE_ENTRIES_BINARY_OP]; assert(true_next.op.code == STORE_FAST || true_next.op.code == STORE_FAST__LOAD_FAST); @@ -649,7 +669,7 @@ if (*target_local == NULL) goto pop_2_error; // The STORE_FAST is already done. JUMPBY(INLINE_CACHE_ENTRIES_BINARY_OP + 1); - #line 653 "Python/generated_cases.c.h" + #line 673 "Python/generated_cases.c.h" } STACK_SHRINK(2); DISPATCH(); @@ -661,7 +681,7 @@ PyObject *sub = stack_pointer[-1]; PyObject *container = stack_pointer[-2]; PyObject *res; - #line 424 "Python/bytecodes.c" + #line 425 "Python/bytecodes.c" #if ENABLE_SPECIALIZATION _PyBinarySubscrCache *cache = (_PyBinarySubscrCache *)next_instr; if (ADAPTIVE_COUNTER_IS_ZERO(cache->counter)) { @@ -673,12 +693,12 @@ DECREMENT_ADAPTIVE_COUNTER(cache->counter); #endif /* ENABLE_SPECIALIZATION */ res = PyObject_GetItem(container, sub); - #line 677 "Python/generated_cases.c.h" + #line 697 "Python/generated_cases.c.h" Py_DECREF(container); Py_DECREF(sub); - #line 436 "Python/bytecodes.c" + #line 437 "Python/bytecodes.c" if (res == NULL) goto pop_2_error; - #line 682 "Python/generated_cases.c.h" + #line 702 "Python/generated_cases.c.h" STACK_SHRINK(1); stack_pointer[-1] = res; next_instr += 1; @@ -690,7 +710,7 @@ PyObject *start = stack_pointer[-2]; PyObject *container = stack_pointer[-3]; PyObject *res; - #line 440 "Python/bytecodes.c" + #line 441 "Python/bytecodes.c" PyObject *slice = _PyBuildSlice_ConsumeRefs(start, stop); // Can't use ERROR_IF() here, because we haven't // DECREF'ed container yet, and we still own slice. @@ -703,7 +723,7 @@ } Py_DECREF(container); if (res == NULL) goto pop_3_error; - #line 707 "Python/generated_cases.c.h" + #line 727 "Python/generated_cases.c.h" STACK_SHRINK(2); stack_pointer[-1] = res; DISPATCH(); @@ -714,7 +734,7 @@ PyObject *start = stack_pointer[-2]; PyObject *container = stack_pointer[-3]; PyObject *v = stack_pointer[-4]; - #line 455 "Python/bytecodes.c" + #line 456 "Python/bytecodes.c" PyObject *slice = _PyBuildSlice_ConsumeRefs(start, stop); int err; if (slice == NULL) { @@ -727,7 +747,7 @@ Py_DECREF(v); Py_DECREF(container); if (err) goto pop_4_error; - #line 731 "Python/generated_cases.c.h" + #line 751 "Python/generated_cases.c.h" STACK_SHRINK(4); DISPATCH(); } @@ -736,7 +756,7 @@ PyObject *sub = stack_pointer[-1]; PyObject *list = stack_pointer[-2]; PyObject *res; - #line 470 "Python/bytecodes.c" + #line 471 "Python/bytecodes.c" DEOPT_IF(!PyLong_CheckExact(sub), BINARY_SUBSCR); DEOPT_IF(!PyList_CheckExact(list), BINARY_SUBSCR); @@ -750,7 +770,7 @@ Py_INCREF(res); _Py_DECREF_SPECIALIZED(sub, (destructor)PyObject_Free); Py_DECREF(list); - #line 754 "Python/generated_cases.c.h" + #line 774 "Python/generated_cases.c.h" STACK_SHRINK(1); stack_pointer[-1] = res; next_instr += 1; @@ -761,7 +781,7 @@ PyObject *sub = stack_pointer[-1]; PyObject *tuple = stack_pointer[-2]; PyObject *res; - #line 486 "Python/bytecodes.c" + #line 487 "Python/bytecodes.c" DEOPT_IF(!PyLong_CheckExact(sub), BINARY_SUBSCR); DEOPT_IF(!PyTuple_CheckExact(tuple), BINARY_SUBSCR); @@ -775,7 +795,7 @@ Py_INCREF(res); _Py_DECREF_SPECIALIZED(sub, (destructor)PyObject_Free); Py_DECREF(tuple); - #line 779 "Python/generated_cases.c.h" + #line 799 "Python/generated_cases.c.h" STACK_SHRINK(1); stack_pointer[-1] = res; next_instr += 1; @@ -786,7 +806,7 @@ PyObject *sub = stack_pointer[-1]; PyObject *dict = stack_pointer[-2]; PyObject *res; - #line 502 "Python/bytecodes.c" + #line 503 "Python/bytecodes.c" DEOPT_IF(!PyDict_CheckExact(dict), BINARY_SUBSCR); STAT_INC(BINARY_SUBSCR, hit); res = PyDict_GetItemWithError(dict, sub); @@ -794,14 +814,14 @@ if (!_PyErr_Occurred(tstate)) { _PyErr_SetKeyError(sub); } - #line 798 "Python/generated_cases.c.h" + #line 818 "Python/generated_cases.c.h" Py_DECREF(dict); Py_DECREF(sub); - #line 510 "Python/bytecodes.c" + #line 511 "Python/bytecodes.c" if (true) goto pop_2_error; } Py_INCREF(res); // Do this before DECREF'ing dict, sub - #line 805 "Python/generated_cases.c.h" + #line 825 "Python/generated_cases.c.h" Py_DECREF(dict); Py_DECREF(sub); STACK_SHRINK(1); @@ -813,7 +833,7 @@ TARGET(BINARY_SUBSCR_GETITEM) { PyObject *sub = stack_pointer[-1]; PyObject *container = stack_pointer[-2]; - #line 517 "Python/bytecodes.c" + #line 518 "Python/bytecodes.c" DEOPT_IF(tstate->interp->eval_frame, BINARY_SUBSCR); PyTypeObject *tp = Py_TYPE(container); DEOPT_IF(!PyType_HasFeature(tp, Py_TPFLAGS_HEAPTYPE), BINARY_SUBSCR); @@ -836,15 +856,15 @@ JUMPBY(INLINE_CACHE_ENTRIES_BINARY_SUBSCR); frame->return_offset = 0; DISPATCH_INLINED(new_frame); - #line 840 "Python/generated_cases.c.h" + #line 860 "Python/generated_cases.c.h" } TARGET(LIST_APPEND) { PyObject *v = stack_pointer[-1]; PyObject *list = stack_pointer[-(2 + (oparg-1))]; - #line 542 "Python/bytecodes.c" + #line 543 "Python/bytecodes.c" if (_PyList_AppendTakeRef((PyListObject *)list, v) < 0) goto pop_1_error; - #line 848 "Python/generated_cases.c.h" + #line 868 "Python/generated_cases.c.h" STACK_SHRINK(1); PREDICT(JUMP_BACKWARD); DISPATCH(); @@ -853,13 +873,13 @@ TARGET(SET_ADD) { PyObject *v = stack_pointer[-1]; PyObject *set = stack_pointer[-(2 + (oparg-1))]; - #line 547 "Python/bytecodes.c" + #line 548 "Python/bytecodes.c" int err = PySet_Add(set, v); - #line 859 "Python/generated_cases.c.h" + #line 879 "Python/generated_cases.c.h" Py_DECREF(v); - #line 549 "Python/bytecodes.c" + #line 550 "Python/bytecodes.c" if (err) goto pop_1_error; - #line 863 "Python/generated_cases.c.h" + #line 883 "Python/generated_cases.c.h" STACK_SHRINK(1); PREDICT(JUMP_BACKWARD); DISPATCH(); @@ -872,7 +892,7 @@ PyObject *container = stack_pointer[-2]; PyObject *v = stack_pointer[-3]; uint16_t counter = read_u16(&next_instr[0].cache); - #line 560 "Python/bytecodes.c" + #line 561 "Python/bytecodes.c" #if ENABLE_SPECIALIZATION if (ADAPTIVE_COUNTER_IS_ZERO(counter)) { next_instr--; @@ -887,13 +907,13 @@ #endif /* ENABLE_SPECIALIZATION */ /* container[sub] = v */ int err = PyObject_SetItem(container, sub, v); - #line 891 "Python/generated_cases.c.h" + #line 911 "Python/generated_cases.c.h" Py_DECREF(v); Py_DECREF(container); Py_DECREF(sub); - #line 575 "Python/bytecodes.c" + #line 576 "Python/bytecodes.c" if (err) goto pop_3_error; - #line 897 "Python/generated_cases.c.h" + #line 917 "Python/generated_cases.c.h" STACK_SHRINK(3); next_instr += 1; DISPATCH(); @@ -903,7 +923,7 @@ PyObject *sub = stack_pointer[-1]; PyObject *list = stack_pointer[-2]; PyObject *value = stack_pointer[-3]; - #line 579 "Python/bytecodes.c" + #line 580 "Python/bytecodes.c" DEOPT_IF(!PyLong_CheckExact(sub), STORE_SUBSCR); DEOPT_IF(!PyList_CheckExact(list), STORE_SUBSCR); @@ -920,7 +940,7 @@ Py_DECREF(old_value); _Py_DECREF_SPECIALIZED(sub, (destructor)PyObject_Free); Py_DECREF(list); - #line 924 "Python/generated_cases.c.h" + #line 944 "Python/generated_cases.c.h" STACK_SHRINK(3); next_instr += 1; DISPATCH(); @@ -930,13 +950,13 @@ PyObject *sub = stack_pointer[-1]; PyObject *dict = stack_pointer[-2]; PyObject *value = stack_pointer[-3]; - #line 598 "Python/bytecodes.c" + #line 599 "Python/bytecodes.c" DEOPT_IF(!PyDict_CheckExact(dict), STORE_SUBSCR); STAT_INC(STORE_SUBSCR, hit); int err = _PyDict_SetItem_Take2((PyDictObject *)dict, sub, value); Py_DECREF(dict); if (err) goto pop_3_error; - #line 940 "Python/generated_cases.c.h" + #line 960 "Python/generated_cases.c.h" STACK_SHRINK(3); next_instr += 1; DISPATCH(); @@ -945,15 +965,15 @@ TARGET(DELETE_SUBSCR) { PyObject *sub = stack_pointer[-1]; PyObject *container = stack_pointer[-2]; - #line 606 "Python/bytecodes.c" + #line 607 "Python/bytecodes.c" /* del container[sub] */ int err = PyObject_DelItem(container, sub); - #line 952 "Python/generated_cases.c.h" + #line 972 "Python/generated_cases.c.h" Py_DECREF(container); Py_DECREF(sub); - #line 609 "Python/bytecodes.c" + #line 610 "Python/bytecodes.c" if (err) goto pop_2_error; - #line 957 "Python/generated_cases.c.h" + #line 977 "Python/generated_cases.c.h" STACK_SHRINK(2); DISPATCH(); } @@ -961,14 +981,14 @@ TARGET(CALL_INTRINSIC_1) { PyObject *value = stack_pointer[-1]; PyObject *res; - #line 613 "Python/bytecodes.c" + #line 614 "Python/bytecodes.c" assert(oparg <= MAX_INTRINSIC_1); res = _PyIntrinsics_UnaryFunctions[oparg](tstate, value); - #line 968 "Python/generated_cases.c.h" + #line 988 "Python/generated_cases.c.h" Py_DECREF(value); - #line 616 "Python/bytecodes.c" + #line 617 "Python/bytecodes.c" if (res == NULL) goto pop_1_error; - #line 972 "Python/generated_cases.c.h" + #line 992 "Python/generated_cases.c.h" stack_pointer[-1] = res; DISPATCH(); } @@ -977,15 +997,15 @@ PyObject *value1 = stack_pointer[-1]; PyObject *value2 = stack_pointer[-2]; PyObject *res; - #line 620 "Python/bytecodes.c" + #line 621 "Python/bytecodes.c" assert(oparg <= MAX_INTRINSIC_2); res = _PyIntrinsics_BinaryFunctions[oparg](tstate, value2, value1); - #line 984 "Python/generated_cases.c.h" + #line 1004 "Python/generated_cases.c.h" Py_DECREF(value2); Py_DECREF(value1); - #line 623 "Python/bytecodes.c" + #line 624 "Python/bytecodes.c" if (res == NULL) goto pop_2_error; - #line 989 "Python/generated_cases.c.h" + #line 1009 "Python/generated_cases.c.h" STACK_SHRINK(1); stack_pointer[-1] = res; DISPATCH(); @@ -993,7 +1013,7 @@ TARGET(RAISE_VARARGS) { PyObject **args = (stack_pointer - oparg); - #line 627 "Python/bytecodes.c" + #line 628 "Python/bytecodes.c" PyObject *cause = NULL, *exc = NULL; switch (oparg) { case 2: @@ -1011,12 +1031,12 @@ break; } if (true) { STACK_SHRINK(oparg); goto error; } - #line 1015 "Python/generated_cases.c.h" + #line 1035 "Python/generated_cases.c.h" } TARGET(INTERPRETER_EXIT) { PyObject *retval = stack_pointer[-1]; - #line 647 "Python/bytecodes.c" + #line 648 "Python/bytecodes.c" assert(frame == &entry_frame); assert(_PyFrame_IsIncomplete(frame)); STACK_SHRINK(1); // Since we're not going to DISPATCH() @@ -1027,12 +1047,12 @@ assert(!_PyErr_Occurred(tstate)); _Py_LeaveRecursiveCallTstate(tstate); return retval; - #line 1031 "Python/generated_cases.c.h" + #line 1051 "Python/generated_cases.c.h" } TARGET(RETURN_VALUE) { PyObject *retval = stack_pointer[-1]; - #line 660 "Python/bytecodes.c" + #line 661 "Python/bytecodes.c" STACK_SHRINK(1); assert(EMPTY()); _PyFrame_SetStackPointer(frame, stack_pointer); @@ -1045,12 +1065,12 @@ frame->prev_instr += frame->return_offset; _PyFrame_StackPush(frame, retval); goto resume_frame; - #line 1049 "Python/generated_cases.c.h" + #line 1069 "Python/generated_cases.c.h" } TARGET(INSTRUMENTED_RETURN_VALUE) { PyObject *retval = stack_pointer[-1]; - #line 675 "Python/bytecodes.c" + #line 676 "Python/bytecodes.c" int err = _Py_call_instrumentation_arg( tstate, PY_MONITORING_EVENT_PY_RETURN, frame, next_instr-1, retval); @@ -1067,11 +1087,11 @@ frame->prev_instr += frame->return_offset; _PyFrame_StackPush(frame, retval); goto resume_frame; - #line 1071 "Python/generated_cases.c.h" + #line 1091 "Python/generated_cases.c.h" } TARGET(RETURN_CONST) { - #line 694 "Python/bytecodes.c" + #line 695 "Python/bytecodes.c" PyObject *retval = GETITEM(frame->f_code->co_consts, oparg); Py_INCREF(retval); assert(EMPTY()); @@ -1085,11 +1105,11 @@ frame->prev_instr += frame->return_offset; _PyFrame_StackPush(frame, retval); goto resume_frame; - #line 1089 "Python/generated_cases.c.h" + #line 1109 "Python/generated_cases.c.h" } TARGET(INSTRUMENTED_RETURN_CONST) { - #line 710 "Python/bytecodes.c" + #line 711 "Python/bytecodes.c" PyObject *retval = GETITEM(frame->f_code->co_consts, oparg); int err = _Py_call_instrumentation_arg( tstate, PY_MONITORING_EVENT_PY_RETURN, @@ -1107,13 +1127,13 @@ frame->prev_instr += frame->return_offset; _PyFrame_StackPush(frame, retval); goto resume_frame; - #line 1111 "Python/generated_cases.c.h" + #line 1131 "Python/generated_cases.c.h" } TARGET(GET_AITER) { PyObject *obj = stack_pointer[-1]; PyObject *iter; - #line 730 "Python/bytecodes.c" + #line 731 "Python/bytecodes.c" unaryfunc getter = NULL; PyTypeObject *type = Py_TYPE(obj); @@ -1126,16 +1146,16 @@ "'async for' requires an object with " "__aiter__ method, got %.100s", type->tp_name); - #line 1130 "Python/generated_cases.c.h" + #line 1150 "Python/generated_cases.c.h" Py_DECREF(obj); - #line 743 "Python/bytecodes.c" + #line 744 "Python/bytecodes.c" if (true) goto pop_1_error; } iter = (*getter)(obj); - #line 1137 "Python/generated_cases.c.h" + #line 1157 "Python/generated_cases.c.h" Py_DECREF(obj); - #line 748 "Python/bytecodes.c" + #line 749 "Python/bytecodes.c" if (iter == NULL) goto pop_1_error; if (Py_TYPE(iter)->tp_as_async == NULL || @@ -1148,7 +1168,7 @@ Py_DECREF(iter); if (true) goto pop_1_error; } - #line 1152 "Python/generated_cases.c.h" + #line 1172 "Python/generated_cases.c.h" stack_pointer[-1] = iter; DISPATCH(); } @@ -1156,7 +1176,7 @@ TARGET(GET_ANEXT) { PyObject *aiter = stack_pointer[-1]; PyObject *awaitable; - #line 763 "Python/bytecodes.c" + #line 764 "Python/bytecodes.c" unaryfunc getter = NULL; PyObject *next_iter = NULL; PyTypeObject *type = Py_TYPE(aiter); @@ -1200,7 +1220,7 @@ } } - #line 1204 "Python/generated_cases.c.h" + #line 1224 "Python/generated_cases.c.h" STACK_GROW(1); stack_pointer[-1] = awaitable; PREDICT(LOAD_CONST); @@ -1211,16 +1231,16 @@ PREDICTED(GET_AWAITABLE); PyObject *iterable = stack_pointer[-1]; PyObject *iter; - #line 810 "Python/bytecodes.c" + #line 811 "Python/bytecodes.c" iter = _PyCoro_GetAwaitableIter(iterable); if (iter == NULL) { format_awaitable_error(tstate, Py_TYPE(iterable), oparg); } - #line 1222 "Python/generated_cases.c.h" + #line 1242 "Python/generated_cases.c.h" Py_DECREF(iterable); - #line 817 "Python/bytecodes.c" + #line 818 "Python/bytecodes.c" if (iter != NULL && PyCoro_CheckExact(iter)) { PyObject *yf = _PyGen_yf((PyGenObject*)iter); @@ -1238,7 +1258,7 @@ if (iter == NULL) goto pop_1_error; - #line 1242 "Python/generated_cases.c.h" + #line 1262 "Python/generated_cases.c.h" stack_pointer[-1] = iter; PREDICT(LOAD_CONST); DISPATCH(); @@ -1250,7 +1270,7 @@ PyObject *v = stack_pointer[-1]; PyObject *receiver = stack_pointer[-2]; PyObject *retval; - #line 843 "Python/bytecodes.c" + #line 844 "Python/bytecodes.c" #if ENABLE_SPECIALIZATION _PySendCache *cache = (_PySendCache *)next_instr; if (ADAPTIVE_COUNTER_IS_ZERO(cache->counter)) { @@ -1297,7 +1317,7 @@ } } Py_DECREF(v); - #line 1301 "Python/generated_cases.c.h" + #line 1321 "Python/generated_cases.c.h" stack_pointer[-1] = retval; next_instr += 1; DISPATCH(); @@ -1306,7 +1326,7 @@ TARGET(SEND_GEN) { PyObject *v = stack_pointer[-1]; PyObject *receiver = stack_pointer[-2]; - #line 892 "Python/bytecodes.c" + #line 893 "Python/bytecodes.c" DEOPT_IF(tstate->interp->eval_frame, SEND); PyGenObject *gen = (PyGenObject *)receiver; DEOPT_IF(Py_TYPE(gen) != &PyGen_Type && @@ -1322,12 +1342,12 @@ tstate->exc_info = &gen->gi_exc_state; JUMPBY(INLINE_CACHE_ENTRIES_SEND); DISPATCH_INLINED(gen_frame); - #line 1326 "Python/generated_cases.c.h" + #line 1346 "Python/generated_cases.c.h" } TARGET(INSTRUMENTED_YIELD_VALUE) { PyObject *retval = stack_pointer[-1]; - #line 910 "Python/bytecodes.c" + #line 911 "Python/bytecodes.c" assert(frame != &entry_frame); PyGenObject *gen = _PyFrame_GetGenerator(frame); gen->gi_frame_state = FRAME_SUSPENDED; @@ -1344,12 +1364,12 @@ gen_frame->previous = NULL; _PyFrame_StackPush(frame, retval); goto resume_frame; - #line 1348 "Python/generated_cases.c.h" + #line 1368 "Python/generated_cases.c.h" } TARGET(YIELD_VALUE) { PyObject *retval = stack_pointer[-1]; - #line 929 "Python/bytecodes.c" + #line 930 "Python/bytecodes.c" // NOTE: It's important that YIELD_VALUE never raises an exception! // The compiler treats any exception raised here as a failed close() // or throw() call. @@ -1365,15 +1385,15 @@ gen_frame->previous = NULL; _PyFrame_StackPush(frame, retval); goto resume_frame; - #line 1369 "Python/generated_cases.c.h" + #line 1389 "Python/generated_cases.c.h" } TARGET(POP_EXCEPT) { PyObject *exc_value = stack_pointer[-1]; - #line 947 "Python/bytecodes.c" + #line 948 "Python/bytecodes.c" _PyErr_StackItem *exc_info = tstate->exc_info; Py_XSETREF(exc_info->exc_value, exc_value); - #line 1377 "Python/generated_cases.c.h" + #line 1397 "Python/generated_cases.c.h" STACK_SHRINK(1); DISPATCH(); } @@ -1381,7 +1401,7 @@ TARGET(RERAISE) { PyObject *exc = stack_pointer[-1]; PyObject **values = (stack_pointer - (1 + oparg)); - #line 952 "Python/bytecodes.c" + #line 953 "Python/bytecodes.c" assert(oparg >= 0 && oparg <= 2); if (oparg) { PyObject *lasti = values[0]; @@ -1399,26 +1419,26 @@ Py_INCREF(exc); _PyErr_SetRaisedException(tstate, exc); goto exception_unwind; - #line 1403 "Python/generated_cases.c.h" + #line 1423 "Python/generated_cases.c.h" } TARGET(END_ASYNC_FOR) { PyObject *exc = stack_pointer[-1]; PyObject *awaitable = stack_pointer[-2]; - #line 972 "Python/bytecodes.c" + #line 973 "Python/bytecodes.c" assert(exc && PyExceptionInstance_Check(exc)); if (PyErr_GivenExceptionMatches(exc, PyExc_StopAsyncIteration)) { - #line 1412 "Python/generated_cases.c.h" + #line 1432 "Python/generated_cases.c.h" Py_DECREF(awaitable); Py_DECREF(exc); - #line 975 "Python/bytecodes.c" + #line 976 "Python/bytecodes.c" } else { Py_INCREF(exc); _PyErr_SetRaisedException(tstate, exc); goto exception_unwind; } - #line 1422 "Python/generated_cases.c.h" + #line 1442 "Python/generated_cases.c.h" STACK_SHRINK(2); DISPATCH(); } @@ -1429,23 +1449,23 @@ PyObject *sub_iter = stack_pointer[-3]; PyObject *none; PyObject *value; - #line 984 "Python/bytecodes.c" + #line 985 "Python/bytecodes.c" assert(throwflag); assert(exc_value && PyExceptionInstance_Check(exc_value)); if (PyErr_GivenExceptionMatches(exc_value, PyExc_StopIteration)) { value = Py_NewRef(((PyStopIterationObject *)exc_value)->value); - #line 1438 "Python/generated_cases.c.h" + #line 1458 "Python/generated_cases.c.h" Py_DECREF(sub_iter); Py_DECREF(last_sent_val); Py_DECREF(exc_value); - #line 989 "Python/bytecodes.c" + #line 990 "Python/bytecodes.c" none = Py_None; } else { _PyErr_SetRaisedException(tstate, Py_NewRef(exc_value)); goto exception_unwind; } - #line 1449 "Python/generated_cases.c.h" + #line 1469 "Python/generated_cases.c.h" STACK_SHRINK(1); stack_pointer[-1] = value; stack_pointer[-2] = none; @@ -1454,9 +1474,9 @@ TARGET(LOAD_ASSERTION_ERROR) { PyObject *value; - #line 998 "Python/bytecodes.c" + #line 999 "Python/bytecodes.c" value = Py_NewRef(PyExc_AssertionError); - #line 1460 "Python/generated_cases.c.h" + #line 1480 "Python/generated_cases.c.h" STACK_GROW(1); stack_pointer[-1] = value; DISPATCH(); @@ -1464,7 +1484,7 @@ TARGET(LOAD_BUILD_CLASS) { PyObject *bc; - #line 1002 "Python/bytecodes.c" + #line 1003 "Python/bytecodes.c" if (PyDict_CheckExact(BUILTINS())) { bc = _PyDict_GetItemWithError(BUILTINS(), &_Py_ID(__build_class__)); @@ -1486,7 +1506,7 @@ if (true) goto error; } } - #line 1490 "Python/generated_cases.c.h" + #line 1510 "Python/generated_cases.c.h" STACK_GROW(1); stack_pointer[-1] = bc; DISPATCH(); @@ -1494,33 +1514,33 @@ TARGET(STORE_NAME) { PyObject *v = stack_pointer[-1]; - #line 1027 "Python/bytecodes.c" + #line 1028 "Python/bytecodes.c" PyObject *name = GETITEM(frame->f_code->co_names, oparg); PyObject *ns = LOCALS(); int err; if (ns == NULL) { _PyErr_Format(tstate, PyExc_SystemError, "no locals found when storing %R", name); - #line 1505 "Python/generated_cases.c.h" + #line 1525 "Python/generated_cases.c.h" Py_DECREF(v); - #line 1034 "Python/bytecodes.c" + #line 1035 "Python/bytecodes.c" if (true) goto pop_1_error; } if (PyDict_CheckExact(ns)) err = PyDict_SetItem(ns, name, v); else err = PyObject_SetItem(ns, name, v); - #line 1514 "Python/generated_cases.c.h" + #line 1534 "Python/generated_cases.c.h" Py_DECREF(v); - #line 1041 "Python/bytecodes.c" + #line 1042 "Python/bytecodes.c" if (err) goto pop_1_error; - #line 1518 "Python/generated_cases.c.h" + #line 1538 "Python/generated_cases.c.h" STACK_SHRINK(1); DISPATCH(); } TARGET(DELETE_NAME) { - #line 1045 "Python/bytecodes.c" + #line 1046 "Python/bytecodes.c" PyObject *name = GETITEM(frame->f_code->co_names, oparg); PyObject *ns = LOCALS(); int err; @@ -1537,7 +1557,7 @@ name); goto error; } - #line 1541 "Python/generated_cases.c.h" + #line 1561 "Python/generated_cases.c.h" DISPATCH(); } @@ -1545,7 +1565,7 @@ PREDICTED(UNPACK_SEQUENCE); static_assert(INLINE_CACHE_ENTRIES_UNPACK_SEQUENCE == 1, "incorrect cache size"); PyObject *seq = stack_pointer[-1]; - #line 1071 "Python/bytecodes.c" + #line 1072 "Python/bytecodes.c" #if ENABLE_SPECIALIZATION _PyUnpackSequenceCache *cache = (_PyUnpackSequenceCache *)next_instr; if (ADAPTIVE_COUNTER_IS_ZERO(cache->counter)) { @@ -1558,11 +1578,11 @@ #endif /* ENABLE_SPECIALIZATION */ PyObject **top = stack_pointer + oparg - 1; int res = unpack_iterable(tstate, seq, oparg, -1, top); - #line 1562 "Python/generated_cases.c.h" + #line 1582 "Python/generated_cases.c.h" Py_DECREF(seq); - #line 1084 "Python/bytecodes.c" + #line 1085 "Python/bytecodes.c" if (res == 0) goto pop_1_error; - #line 1566 "Python/generated_cases.c.h" + #line 1586 "Python/generated_cases.c.h" STACK_SHRINK(1); STACK_GROW(oparg); next_instr += 1; @@ -1572,14 +1592,14 @@ TARGET(UNPACK_SEQUENCE_TWO_TUPLE) { PyObject *seq = stack_pointer[-1]; PyObject **values = stack_pointer - (1); - #line 1088 "Python/bytecodes.c" + #line 1089 "Python/bytecodes.c" DEOPT_IF(!PyTuple_CheckExact(seq), UNPACK_SEQUENCE); DEOPT_IF(PyTuple_GET_SIZE(seq) != 2, UNPACK_SEQUENCE); assert(oparg == 2); STAT_INC(UNPACK_SEQUENCE, hit); values[0] = Py_NewRef(PyTuple_GET_ITEM(seq, 1)); values[1] = Py_NewRef(PyTuple_GET_ITEM(seq, 0)); - #line 1583 "Python/generated_cases.c.h" + #line 1603 "Python/generated_cases.c.h" Py_DECREF(seq); STACK_SHRINK(1); STACK_GROW(oparg); @@ -1590,7 +1610,7 @@ TARGET(UNPACK_SEQUENCE_TUPLE) { PyObject *seq = stack_pointer[-1]; PyObject **values = stack_pointer - (1); - #line 1098 "Python/bytecodes.c" + #line 1099 "Python/bytecodes.c" DEOPT_IF(!PyTuple_CheckExact(seq), UNPACK_SEQUENCE); DEOPT_IF(PyTuple_GET_SIZE(seq) != oparg, UNPACK_SEQUENCE); STAT_INC(UNPACK_SEQUENCE, hit); @@ -1598,7 +1618,7 @@ for (int i = oparg; --i >= 0; ) { *values++ = Py_NewRef(items[i]); } - #line 1602 "Python/generated_cases.c.h" + #line 1622 "Python/generated_cases.c.h" Py_DECREF(seq); STACK_SHRINK(1); STACK_GROW(oparg); @@ -1609,7 +1629,7 @@ TARGET(UNPACK_SEQUENCE_LIST) { PyObject *seq = stack_pointer[-1]; PyObject **values = stack_pointer - (1); - #line 1109 "Python/bytecodes.c" + #line 1110 "Python/bytecodes.c" DEOPT_IF(!PyList_CheckExact(seq), UNPACK_SEQUENCE); DEOPT_IF(PyList_GET_SIZE(seq) != oparg, UNPACK_SEQUENCE); STAT_INC(UNPACK_SEQUENCE, hit); @@ -1617,7 +1637,7 @@ for (int i = oparg; --i >= 0; ) { *values++ = Py_NewRef(items[i]); } - #line 1621 "Python/generated_cases.c.h" + #line 1641 "Python/generated_cases.c.h" Py_DECREF(seq); STACK_SHRINK(1); STACK_GROW(oparg); @@ -1627,15 +1647,15 @@ TARGET(UNPACK_EX) { PyObject *seq = stack_pointer[-1]; - #line 1120 "Python/bytecodes.c" + #line 1121 "Python/bytecodes.c" int totalargs = 1 + (oparg & 0xFF) + (oparg >> 8); PyObject **top = stack_pointer + totalargs - 1; int res = unpack_iterable(tstate, seq, oparg & 0xFF, oparg >> 8, top); - #line 1635 "Python/generated_cases.c.h" + #line 1655 "Python/generated_cases.c.h" Py_DECREF(seq); - #line 1124 "Python/bytecodes.c" + #line 1125 "Python/bytecodes.c" if (res == 0) goto pop_1_error; - #line 1639 "Python/generated_cases.c.h" + #line 1659 "Python/generated_cases.c.h" STACK_GROW((oparg & 0xFF) + (oparg >> 8)); DISPATCH(); } @@ -1646,7 +1666,7 @@ PyObject *owner = stack_pointer[-1]; PyObject *v = stack_pointer[-2]; uint16_t counter = read_u16(&next_instr[0].cache); - #line 1135 "Python/bytecodes.c" + #line 1136 "Python/bytecodes.c" #if ENABLE_SPECIALIZATION if (ADAPTIVE_COUNTER_IS_ZERO(counter)) { PyObject *name = GETITEM(frame->f_code->co_names, oparg); @@ -1662,12 +1682,12 @@ #endif /* ENABLE_SPECIALIZATION */ PyObject *name = GETITEM(frame->f_code->co_names, oparg); int err = PyObject_SetAttr(owner, name, v); - #line 1666 "Python/generated_cases.c.h" + #line 1686 "Python/generated_cases.c.h" Py_DECREF(v); Py_DECREF(owner); - #line 1151 "Python/bytecodes.c" + #line 1152 "Python/bytecodes.c" if (err) goto pop_2_error; - #line 1671 "Python/generated_cases.c.h" + #line 1691 "Python/generated_cases.c.h" STACK_SHRINK(2); next_instr += 4; DISPATCH(); @@ -1675,34 +1695,34 @@ TARGET(DELETE_ATTR) { PyObject *owner = stack_pointer[-1]; - #line 1155 "Python/bytecodes.c" + #line 1156 "Python/bytecodes.c" PyObject *name = GETITEM(frame->f_code->co_names, oparg); int err = PyObject_SetAttr(owner, name, (PyObject *)NULL); - #line 1682 "Python/generated_cases.c.h" + #line 1702 "Python/generated_cases.c.h" Py_DECREF(owner); - #line 1158 "Python/bytecodes.c" + #line 1159 "Python/bytecodes.c" if (err) goto pop_1_error; - #line 1686 "Python/generated_cases.c.h" + #line 1706 "Python/generated_cases.c.h" STACK_SHRINK(1); DISPATCH(); } TARGET(STORE_GLOBAL) { PyObject *v = stack_pointer[-1]; - #line 1162 "Python/bytecodes.c" + #line 1163 "Python/bytecodes.c" PyObject *name = GETITEM(frame->f_code->co_names, oparg); int err = PyDict_SetItem(GLOBALS(), name, v); - #line 1696 "Python/generated_cases.c.h" + #line 1716 "Python/generated_cases.c.h" Py_DECREF(v); - #line 1165 "Python/bytecodes.c" + #line 1166 "Python/bytecodes.c" if (err) goto pop_1_error; - #line 1700 "Python/generated_cases.c.h" + #line 1720 "Python/generated_cases.c.h" STACK_SHRINK(1); DISPATCH(); } TARGET(DELETE_GLOBAL) { - #line 1169 "Python/bytecodes.c" + #line 1170 "Python/bytecodes.c" PyObject *name = GETITEM(frame->f_code->co_names, oparg); int err; err = PyDict_DelItem(GLOBALS(), name); @@ -1714,7 +1734,7 @@ } goto error; } - #line 1718 "Python/generated_cases.c.h" + #line 1738 "Python/generated_cases.c.h" DISPATCH(); } @@ -1722,7 +1742,7 @@ PyObject *_tmp_1; { PyObject *locals; - #line 1183 "Python/bytecodes.c" + #line 1184 "Python/bytecodes.c" locals = LOCALS(); if (locals == NULL) { _PyErr_SetString(tstate, PyExc_SystemError, @@ -1730,7 +1750,7 @@ if (true) goto error; } Py_INCREF(locals); - #line 1734 "Python/generated_cases.c.h" + #line 1754 "Python/generated_cases.c.h" _tmp_1 = locals; } STACK_GROW(1); @@ -1742,7 +1762,7 @@ PyObject *_tmp_1; { PyObject *locals; - #line 1183 "Python/bytecodes.c" + #line 1184 "Python/bytecodes.c" locals = LOCALS(); if (locals == NULL) { _PyErr_SetString(tstate, PyExc_SystemError, @@ -1750,13 +1770,13 @@ if (true) goto error; } Py_INCREF(locals); - #line 1754 "Python/generated_cases.c.h" + #line 1774 "Python/generated_cases.c.h" _tmp_1 = locals; } { PyObject *mod_or_class_dict = _tmp_1; PyObject *v; - #line 1195 "Python/bytecodes.c" + #line 1196 "Python/bytecodes.c" PyObject *name = GETITEM(frame->f_code->co_names, oparg); if (PyDict_CheckExact(mod_or_class_dict)) { v = PyDict_GetItemWithError(mod_or_class_dict, name); @@ -1813,7 +1833,7 @@ } } } - #line 1817 "Python/generated_cases.c.h" + #line 1837 "Python/generated_cases.c.h" _tmp_1 = v; } STACK_GROW(1); @@ -1826,7 +1846,7 @@ { PyObject *mod_or_class_dict = _tmp_1; PyObject *v; - #line 1195 "Python/bytecodes.c" + #line 1196 "Python/bytecodes.c" PyObject *name = GETITEM(frame->f_code->co_names, oparg); if (PyDict_CheckExact(mod_or_class_dict)) { v = PyDict_GetItemWithError(mod_or_class_dict, name); @@ -1883,7 +1903,7 @@ } } } - #line 1887 "Python/generated_cases.c.h" + #line 1907 "Python/generated_cases.c.h" _tmp_1 = v; } stack_pointer[-1] = _tmp_1; @@ -1895,7 +1915,7 @@ static_assert(INLINE_CACHE_ENTRIES_LOAD_GLOBAL == 4, "incorrect cache size"); PyObject *null = NULL; PyObject *v; - #line 1264 "Python/bytecodes.c" + #line 1265 "Python/bytecodes.c" #if ENABLE_SPECIALIZATION _PyLoadGlobalCache *cache = (_PyLoadGlobalCache *)next_instr; if (ADAPTIVE_COUNTER_IS_ZERO(cache->counter)) { @@ -1947,7 +1967,7 @@ } } null = NULL; - #line 1951 "Python/generated_cases.c.h" + #line 1971 "Python/generated_cases.c.h" STACK_GROW(1); STACK_GROW(((oparg & 1) ? 1 : 0)); stack_pointer[-1] = v; @@ -1961,7 +1981,7 @@ PyObject *res; uint16_t index = read_u16(&next_instr[1].cache); uint16_t version = read_u16(&next_instr[2].cache); - #line 1318 "Python/bytecodes.c" + #line 1319 "Python/bytecodes.c" DEOPT_IF(!PyDict_CheckExact(GLOBALS()), LOAD_GLOBAL); PyDictObject *dict = (PyDictObject *)GLOBALS(); DEOPT_IF(dict->ma_keys->dk_version != version, LOAD_GLOBAL); @@ -1972,7 +1992,7 @@ Py_INCREF(res); STAT_INC(LOAD_GLOBAL, hit); null = NULL; - #line 1976 "Python/generated_cases.c.h" + #line 1996 "Python/generated_cases.c.h" STACK_GROW(1); STACK_GROW(((oparg & 1) ? 1 : 0)); stack_pointer[-1] = res; @@ -1987,7 +2007,7 @@ uint16_t index = read_u16(&next_instr[1].cache); uint16_t mod_version = read_u16(&next_instr[2].cache); uint16_t bltn_version = read_u16(&next_instr[3].cache); - #line 1331 "Python/bytecodes.c" + #line 1332 "Python/bytecodes.c" DEOPT_IF(!PyDict_CheckExact(GLOBALS()), LOAD_GLOBAL); DEOPT_IF(!PyDict_CheckExact(BUILTINS()), LOAD_GLOBAL); PyDictObject *mdict = (PyDictObject *)GLOBALS(); @@ -2002,7 +2022,7 @@ Py_INCREF(res); STAT_INC(LOAD_GLOBAL, hit); null = NULL; - #line 2006 "Python/generated_cases.c.h" + #line 2026 "Python/generated_cases.c.h" STACK_GROW(1); STACK_GROW(((oparg & 1) ? 1 : 0)); stack_pointer[-1] = res; @@ -2012,16 +2032,16 @@ } TARGET(DELETE_FAST) { - #line 1348 "Python/bytecodes.c" + #line 1349 "Python/bytecodes.c" PyObject *v = GETLOCAL(oparg); if (v == NULL) goto unbound_local_error; SETLOCAL(oparg, NULL); - #line 2020 "Python/generated_cases.c.h" + #line 2040 "Python/generated_cases.c.h" DISPATCH(); } TARGET(MAKE_CELL) { - #line 1354 "Python/bytecodes.c" + #line 1355 "Python/bytecodes.c" // "initial" is probably NULL but not if it's an arg (or set // via PyFrame_LocalsToFast() before MAKE_CELL has run). PyObject *initial = GETLOCAL(oparg); @@ -2030,12 +2050,12 @@ goto resume_with_error; } SETLOCAL(oparg, cell); - #line 2034 "Python/generated_cases.c.h" + #line 2054 "Python/generated_cases.c.h" DISPATCH(); } TARGET(DELETE_DEREF) { - #line 1365 "Python/bytecodes.c" + #line 1366 "Python/bytecodes.c" PyObject *cell = GETLOCAL(oparg); PyObject *oldobj = PyCell_GET(cell); // Can't use ERROR_IF here. @@ -2046,14 +2066,14 @@ } PyCell_SET(cell, NULL); Py_DECREF(oldobj); - #line 2050 "Python/generated_cases.c.h" + #line 2070 "Python/generated_cases.c.h" DISPATCH(); } TARGET(LOAD_FROM_DICT_OR_DEREF) { PyObject *class_dict = stack_pointer[-1]; PyObject *value; - #line 1378 "Python/bytecodes.c" + #line 1379 "Python/bytecodes.c" PyObject *name; assert(class_dict); assert(oparg >= 0 && oparg < frame->f_code->co_nlocalsplus); @@ -2088,14 +2108,14 @@ } Py_INCREF(value); } - #line 2092 "Python/generated_cases.c.h" + #line 2112 "Python/generated_cases.c.h" stack_pointer[-1] = value; DISPATCH(); } TARGET(LOAD_DEREF) { PyObject *value; - #line 1415 "Python/bytecodes.c" + #line 1416 "Python/bytecodes.c" PyObject *cell = GETLOCAL(oparg); value = PyCell_GET(cell); if (value == NULL) { @@ -2103,7 +2123,7 @@ if (true) goto error; } Py_INCREF(value); - #line 2107 "Python/generated_cases.c.h" + #line 2127 "Python/generated_cases.c.h" STACK_GROW(1); stack_pointer[-1] = value; DISPATCH(); @@ -2111,18 +2131,18 @@ TARGET(STORE_DEREF) { PyObject *v = stack_pointer[-1]; - #line 1425 "Python/bytecodes.c" + #line 1426 "Python/bytecodes.c" PyObject *cell = GETLOCAL(oparg); PyObject *oldobj = PyCell_GET(cell); PyCell_SET(cell, v); Py_XDECREF(oldobj); - #line 2120 "Python/generated_cases.c.h" + #line 2140 "Python/generated_cases.c.h" STACK_SHRINK(1); DISPATCH(); } TARGET(COPY_FREE_VARS) { - #line 1432 "Python/bytecodes.c" + #line 1433 "Python/bytecodes.c" /* Copy closure variables to free variables */ PyCodeObject *co = frame->f_code; assert(PyFunction_Check(frame->f_funcobj)); @@ -2133,22 +2153,22 @@ PyObject *o = PyTuple_GET_ITEM(closure, i); frame->localsplus[offset + i] = Py_NewRef(o); } - #line 2137 "Python/generated_cases.c.h" + #line 2157 "Python/generated_cases.c.h" DISPATCH(); } TARGET(BUILD_STRING) { PyObject **pieces = (stack_pointer - oparg); PyObject *str; - #line 1445 "Python/bytecodes.c" + #line 1446 "Python/bytecodes.c" str = _PyUnicode_JoinArray(&_Py_STR(empty), pieces, oparg); - #line 2146 "Python/generated_cases.c.h" + #line 2166 "Python/generated_cases.c.h" for (int _i = oparg; --_i >= 0;) { Py_DECREF(pieces[_i]); } - #line 1447 "Python/bytecodes.c" + #line 1448 "Python/bytecodes.c" if (str == NULL) { STACK_SHRINK(oparg); goto error; } - #line 2152 "Python/generated_cases.c.h" + #line 2172 "Python/generated_cases.c.h" STACK_SHRINK(oparg); STACK_GROW(1); stack_pointer[-1] = str; @@ -2158,10 +2178,10 @@ TARGET(BUILD_TUPLE) { PyObject **values = (stack_pointer - oparg); PyObject *tup; - #line 1451 "Python/bytecodes.c" + #line 1452 "Python/bytecodes.c" tup = _PyTuple_FromArraySteal(values, oparg); if (tup == NULL) { STACK_SHRINK(oparg); goto error; } - #line 2165 "Python/generated_cases.c.h" + #line 2185 "Python/generated_cases.c.h" STACK_SHRINK(oparg); STACK_GROW(1); stack_pointer[-1] = tup; @@ -2171,10 +2191,10 @@ TARGET(BUILD_LIST) { PyObject **values = (stack_pointer - oparg); PyObject *list; - #line 1456 "Python/bytecodes.c" + #line 1457 "Python/bytecodes.c" list = _PyList_FromArraySteal(values, oparg); if (list == NULL) { STACK_SHRINK(oparg); goto error; } - #line 2178 "Python/generated_cases.c.h" + #line 2198 "Python/generated_cases.c.h" STACK_SHRINK(oparg); STACK_GROW(1); stack_pointer[-1] = list; @@ -2184,7 +2204,7 @@ TARGET(LIST_EXTEND) { PyObject *iterable = stack_pointer[-1]; PyObject *list = stack_pointer[-(2 + (oparg-1))]; - #line 1461 "Python/bytecodes.c" + #line 1462 "Python/bytecodes.c" PyObject *none_val = _PyList_Extend((PyListObject *)list, iterable); if (none_val == NULL) { if (_PyErr_ExceptionMatches(tstate, PyExc_TypeError) && @@ -2195,13 +2215,13 @@ "Value after * must be an iterable, not %.200s", Py_TYPE(iterable)->tp_name); } - #line 2199 "Python/generated_cases.c.h" + #line 2219 "Python/generated_cases.c.h" Py_DECREF(iterable); - #line 1472 "Python/bytecodes.c" + #line 1473 "Python/bytecodes.c" if (true) goto pop_1_error; } assert(Py_IsNone(none_val)); - #line 2205 "Python/generated_cases.c.h" + #line 2225 "Python/generated_cases.c.h" Py_DECREF(iterable); STACK_SHRINK(1); DISPATCH(); @@ -2210,13 +2230,13 @@ TARGET(SET_UPDATE) { PyObject *iterable = stack_pointer[-1]; PyObject *set = stack_pointer[-(2 + (oparg-1))]; - #line 1479 "Python/bytecodes.c" + #line 1480 "Python/bytecodes.c" int err = _PySet_Update(set, iterable); - #line 2216 "Python/generated_cases.c.h" + #line 2236 "Python/generated_cases.c.h" Py_DECREF(iterable); - #line 1481 "Python/bytecodes.c" + #line 1482 "Python/bytecodes.c" if (err < 0) goto pop_1_error; - #line 2220 "Python/generated_cases.c.h" + #line 2240 "Python/generated_cases.c.h" STACK_SHRINK(1); DISPATCH(); } @@ -2224,7 +2244,7 @@ TARGET(BUILD_SET) { PyObject **values = (stack_pointer - oparg); PyObject *set; - #line 1485 "Python/bytecodes.c" + #line 1486 "Python/bytecodes.c" set = PySet_New(NULL); if (set == NULL) goto error; @@ -2239,7 +2259,7 @@ Py_DECREF(set); if (true) { STACK_SHRINK(oparg); goto error; } } - #line 2243 "Python/generated_cases.c.h" + #line 2263 "Python/generated_cases.c.h" STACK_SHRINK(oparg); STACK_GROW(1); stack_pointer[-1] = set; @@ -2249,7 +2269,7 @@ TARGET(BUILD_MAP) { PyObject **values = (stack_pointer - oparg*2); PyObject *map; - #line 1502 "Python/bytecodes.c" + #line 1503 "Python/bytecodes.c" map = _PyDict_FromItems( values, 2, values+1, 2, @@ -2257,13 +2277,13 @@ if (map == NULL) goto error; - #line 2261 "Python/generated_cases.c.h" + #line 2281 "Python/generated_cases.c.h" for (int _i = oparg*2; --_i >= 0;) { Py_DECREF(values[_i]); } - #line 1510 "Python/bytecodes.c" + #line 1511 "Python/bytecodes.c" if (map == NULL) { STACK_SHRINK(oparg*2); goto error; } - #line 2267 "Python/generated_cases.c.h" + #line 2287 "Python/generated_cases.c.h" STACK_SHRINK(oparg*2); STACK_GROW(1); stack_pointer[-1] = map; @@ -2271,7 +2291,7 @@ } TARGET(SETUP_ANNOTATIONS) { - #line 1514 "Python/bytecodes.c" + #line 1515 "Python/bytecodes.c" int err; PyObject *ann_dict; if (LOCALS() == NULL) { @@ -2311,7 +2331,7 @@ Py_DECREF(ann_dict); } } - #line 2315 "Python/generated_cases.c.h" + #line 2335 "Python/generated_cases.c.h" DISPATCH(); } @@ -2319,7 +2339,7 @@ PyObject *keys = stack_pointer[-1]; PyObject **values = (stack_pointer - (1 + oparg)); PyObject *map; - #line 1556 "Python/bytecodes.c" + #line 1557 "Python/bytecodes.c" if (!PyTuple_CheckExact(keys) || PyTuple_GET_SIZE(keys) != (Py_ssize_t)oparg) { _PyErr_SetString(tstate, PyExc_SystemError, @@ -2329,14 +2349,14 @@ map = _PyDict_FromItems( &PyTuple_GET_ITEM(keys, 0), 1, values, 1, oparg); - #line 2333 "Python/generated_cases.c.h" + #line 2353 "Python/generated_cases.c.h" for (int _i = oparg; --_i >= 0;) { Py_DECREF(values[_i]); } Py_DECREF(keys); - #line 1566 "Python/bytecodes.c" + #line 1567 "Python/bytecodes.c" if (map == NULL) { STACK_SHRINK(oparg); goto pop_1_error; } - #line 2340 "Python/generated_cases.c.h" + #line 2360 "Python/generated_cases.c.h" STACK_SHRINK(oparg); stack_pointer[-1] = map; DISPATCH(); @@ -2344,7 +2364,7 @@ TARGET(DICT_UPDATE) { PyObject *update = stack_pointer[-1]; - #line 1570 "Python/bytecodes.c" + #line 1571 "Python/bytecodes.c" PyObject *dict = PEEK(oparg + 1); // update is still on the stack if (PyDict_Update(dict, update) < 0) { if (_PyErr_ExceptionMatches(tstate, PyExc_AttributeError)) { @@ -2352,12 +2372,12 @@ "'%.200s' object is not a mapping", Py_TYPE(update)->tp_name); } - #line 2356 "Python/generated_cases.c.h" + #line 2376 "Python/generated_cases.c.h" Py_DECREF(update); - #line 1578 "Python/bytecodes.c" + #line 1579 "Python/bytecodes.c" if (true) goto pop_1_error; } - #line 2361 "Python/generated_cases.c.h" + #line 2381 "Python/generated_cases.c.h" Py_DECREF(update); STACK_SHRINK(1); DISPATCH(); @@ -2365,17 +2385,17 @@ TARGET(DICT_MERGE) { PyObject *update = stack_pointer[-1]; - #line 1584 "Python/bytecodes.c" + #line 1585 "Python/bytecodes.c" PyObject *dict = PEEK(oparg + 1); // update is still on the stack if (_PyDict_MergeEx(dict, update, 2) < 0) { format_kwargs_error(tstate, PEEK(3 + oparg), update); - #line 2374 "Python/generated_cases.c.h" + #line 2394 "Python/generated_cases.c.h" Py_DECREF(update); - #line 1589 "Python/bytecodes.c" + #line 1590 "Python/bytecodes.c" if (true) goto pop_1_error; } - #line 2379 "Python/generated_cases.c.h" + #line 2399 "Python/generated_cases.c.h" Py_DECREF(update); STACK_SHRINK(1); PREDICT(CALL_FUNCTION_EX); @@ -2385,26 +2405,26 @@ TARGET(MAP_ADD) { PyObject *value = stack_pointer[-1]; PyObject *key = stack_pointer[-2]; - #line 1596 "Python/bytecodes.c" + #line 1597 "Python/bytecodes.c" PyObject *dict = PEEK(oparg + 2); // key, value are still on the stack assert(PyDict_CheckExact(dict)); /* dict[key] = value */ // Do not DECREF INPUTS because the function steals the references if (_PyDict_SetItem_Take2((PyDictObject *)dict, key, value) != 0) goto pop_2_error; - #line 2395 "Python/generated_cases.c.h" + #line 2415 "Python/generated_cases.c.h" STACK_SHRINK(2); PREDICT(JUMP_BACKWARD); DISPATCH(); } TARGET(INSTRUMENTED_LOAD_SUPER_ATTR) { - #line 1605 "Python/bytecodes.c" + #line 1606 "Python/bytecodes.c" _PySuperAttrCache *cache = (_PySuperAttrCache *)next_instr; // cancel out the decrement that will happen in LOAD_SUPER_ATTR; we // don't want to specialize instrumented instructions INCREMENT_ADAPTIVE_COUNTER(cache->counter); GO_TO_INSTRUCTION(LOAD_SUPER_ATTR); - #line 2408 "Python/generated_cases.c.h" + #line 2428 "Python/generated_cases.c.h" } TARGET(LOAD_SUPER_ATTR) { @@ -2415,7 +2435,7 @@ PyObject *global_super = stack_pointer[-3]; PyObject *res2 = NULL; PyObject *res; - #line 1619 "Python/bytecodes.c" + #line 1620 "Python/bytecodes.c" PyObject *name = GETITEM(frame->f_code->co_names, oparg >> 2); int load_method = oparg & 1; #if ENABLE_SPECIALIZATION @@ -2457,16 +2477,16 @@ } } } - #line 2461 "Python/generated_cases.c.h" + #line 2481 "Python/generated_cases.c.h" Py_DECREF(global_super); Py_DECREF(class); Py_DECREF(self); - #line 1661 "Python/bytecodes.c" + #line 1662 "Python/bytecodes.c" if (super == NULL) goto pop_3_error; res = PyObject_GetAttr(super, name); Py_DECREF(super); if (res == NULL) goto pop_3_error; - #line 2470 "Python/generated_cases.c.h" + #line 2490 "Python/generated_cases.c.h" STACK_SHRINK(2); STACK_GROW(((oparg & 1) ? 1 : 0)); stack_pointer[-1] = res; @@ -2481,20 +2501,20 @@ PyObject *global_super = stack_pointer[-3]; PyObject *res2 = NULL; PyObject *res; - #line 1668 "Python/bytecodes.c" + #line 1669 "Python/bytecodes.c" assert(!(oparg & 1)); DEOPT_IF(global_super != (PyObject *)&PySuper_Type, LOAD_SUPER_ATTR); DEOPT_IF(!PyType_Check(class), LOAD_SUPER_ATTR); STAT_INC(LOAD_SUPER_ATTR, hit); PyObject *name = GETITEM(frame->f_code->co_names, oparg >> 2); res = _PySuper_Lookup((PyTypeObject *)class, self, name, NULL); - #line 2492 "Python/generated_cases.c.h" + #line 2512 "Python/generated_cases.c.h" Py_DECREF(global_super); Py_DECREF(class); Py_DECREF(self); - #line 1675 "Python/bytecodes.c" + #line 1676 "Python/bytecodes.c" if (res == NULL) goto pop_3_error; - #line 2498 "Python/generated_cases.c.h" + #line 2518 "Python/generated_cases.c.h" STACK_SHRINK(2); STACK_GROW(((oparg & 1) ? 1 : 0)); stack_pointer[-1] = res; @@ -2509,7 +2529,7 @@ PyObject *global_super = stack_pointer[-3]; PyObject *res2; PyObject *res; - #line 1679 "Python/bytecodes.c" + #line 1680 "Python/bytecodes.c" assert(oparg & 1); DEOPT_IF(global_super != (PyObject *)&PySuper_Type, LOAD_SUPER_ATTR); DEOPT_IF(!PyType_Check(class), LOAD_SUPER_ATTR); @@ -2532,7 +2552,7 @@ res = res2; res2 = NULL; } - #line 2536 "Python/generated_cases.c.h" + #line 2556 "Python/generated_cases.c.h" STACK_SHRINK(1); stack_pointer[-1] = res; stack_pointer[-2] = res2; @@ -2546,7 +2566,7 @@ PyObject *owner = stack_pointer[-1]; PyObject *res2 = NULL; PyObject *res; - #line 1718 "Python/bytecodes.c" + #line 1719 "Python/bytecodes.c" #if ENABLE_SPECIALIZATION _PyAttrCache *cache = (_PyAttrCache *)next_instr; if (ADAPTIVE_COUNTER_IS_ZERO(cache->counter)) { @@ -2580,9 +2600,9 @@ NULL | meth | arg1 | ... | argN */ - #line 2584 "Python/generated_cases.c.h" + #line 2604 "Python/generated_cases.c.h" Py_DECREF(owner); - #line 1752 "Python/bytecodes.c" + #line 1753 "Python/bytecodes.c" if (meth == NULL) goto pop_1_error; res2 = NULL; res = meth; @@ -2591,12 +2611,12 @@ else { /* Classic, pushes one value. */ res = PyObject_GetAttr(owner, name); - #line 2595 "Python/generated_cases.c.h" + #line 2615 "Python/generated_cases.c.h" Py_DECREF(owner); - #line 1761 "Python/bytecodes.c" + #line 1762 "Python/bytecodes.c" if (res == NULL) goto pop_1_error; } - #line 2600 "Python/generated_cases.c.h" + #line 2620 "Python/generated_cases.c.h" STACK_GROW(((oparg & 1) ? 1 : 0)); stack_pointer[-1] = res; if (oparg & 1) { stack_pointer[-(1 + ((oparg & 1) ? 1 : 0))] = res2; } @@ -2610,7 +2630,7 @@ PyObject *res; uint32_t type_version = read_u32(&next_instr[1].cache); uint16_t index = read_u16(&next_instr[3].cache); - #line 1766 "Python/bytecodes.c" + #line 1767 "Python/bytecodes.c" PyTypeObject *tp = Py_TYPE(owner); assert(type_version != 0); DEOPT_IF(tp->tp_version_tag != type_version, LOAD_ATTR); @@ -2623,7 +2643,7 @@ STAT_INC(LOAD_ATTR, hit); Py_INCREF(res); res2 = NULL; - #line 2627 "Python/generated_cases.c.h" + #line 2647 "Python/generated_cases.c.h" Py_DECREF(owner); STACK_GROW(((oparg & 1) ? 1 : 0)); stack_pointer[-1] = res; @@ -2638,7 +2658,7 @@ PyObject *res; uint32_t type_version = read_u32(&next_instr[1].cache); uint16_t index = read_u16(&next_instr[3].cache); - #line 1782 "Python/bytecodes.c" + #line 1783 "Python/bytecodes.c" DEOPT_IF(!PyModule_CheckExact(owner), LOAD_ATTR); PyDictObject *dict = (PyDictObject *)((PyModuleObject *)owner)->md_dict; assert(dict != NULL); @@ -2651,7 +2671,7 @@ STAT_INC(LOAD_ATTR, hit); Py_INCREF(res); res2 = NULL; - #line 2655 "Python/generated_cases.c.h" + #line 2675 "Python/generated_cases.c.h" Py_DECREF(owner); STACK_GROW(((oparg & 1) ? 1 : 0)); stack_pointer[-1] = res; @@ -2666,7 +2686,7 @@ PyObject *res; uint32_t type_version = read_u32(&next_instr[1].cache); uint16_t index = read_u16(&next_instr[3].cache); - #line 1798 "Python/bytecodes.c" + #line 1799 "Python/bytecodes.c" PyTypeObject *tp = Py_TYPE(owner); assert(type_version != 0); DEOPT_IF(tp->tp_version_tag != type_version, LOAD_ATTR); @@ -2693,7 +2713,7 @@ STAT_INC(LOAD_ATTR, hit); Py_INCREF(res); res2 = NULL; - #line 2697 "Python/generated_cases.c.h" + #line 2717 "Python/generated_cases.c.h" Py_DECREF(owner); STACK_GROW(((oparg & 1) ? 1 : 0)); stack_pointer[-1] = res; @@ -2708,7 +2728,7 @@ PyObject *res; uint32_t type_version = read_u32(&next_instr[1].cache); uint16_t index = read_u16(&next_instr[3].cache); - #line 1828 "Python/bytecodes.c" + #line 1829 "Python/bytecodes.c" PyTypeObject *tp = Py_TYPE(owner); assert(type_version != 0); DEOPT_IF(tp->tp_version_tag != type_version, LOAD_ATTR); @@ -2718,7 +2738,7 @@ STAT_INC(LOAD_ATTR, hit); Py_INCREF(res); res2 = NULL; - #line 2722 "Python/generated_cases.c.h" + #line 2742 "Python/generated_cases.c.h" Py_DECREF(owner); STACK_GROW(((oparg & 1) ? 1 : 0)); stack_pointer[-1] = res; @@ -2733,7 +2753,7 @@ PyObject *res; uint32_t type_version = read_u32(&next_instr[1].cache); PyObject *descr = read_obj(&next_instr[5].cache); - #line 1841 "Python/bytecodes.c" + #line 1842 "Python/bytecodes.c" DEOPT_IF(!PyType_Check(cls), LOAD_ATTR); DEOPT_IF(((PyTypeObject *)cls)->tp_version_tag != type_version, @@ -2745,7 +2765,7 @@ res = descr; assert(res != NULL); Py_INCREF(res); - #line 2749 "Python/generated_cases.c.h" + #line 2769 "Python/generated_cases.c.h" Py_DECREF(cls); STACK_GROW(((oparg & 1) ? 1 : 0)); stack_pointer[-1] = res; @@ -2759,7 +2779,7 @@ uint32_t type_version = read_u32(&next_instr[1].cache); uint32_t func_version = read_u32(&next_instr[3].cache); PyObject *fget = read_obj(&next_instr[5].cache); - #line 1856 "Python/bytecodes.c" + #line 1857 "Python/bytecodes.c" DEOPT_IF(tstate->interp->eval_frame, LOAD_ATTR); PyTypeObject *cls = Py_TYPE(owner); @@ -2783,7 +2803,7 @@ JUMPBY(INLINE_CACHE_ENTRIES_LOAD_ATTR); frame->return_offset = 0; DISPATCH_INLINED(new_frame); - #line 2787 "Python/generated_cases.c.h" + #line 2807 "Python/generated_cases.c.h" } TARGET(LOAD_ATTR_GETATTRIBUTE_OVERRIDDEN) { @@ -2791,7 +2811,7 @@ uint32_t type_version = read_u32(&next_instr[1].cache); uint32_t func_version = read_u32(&next_instr[3].cache); PyObject *getattribute = read_obj(&next_instr[5].cache); - #line 1882 "Python/bytecodes.c" + #line 1883 "Python/bytecodes.c" DEOPT_IF(tstate->interp->eval_frame, LOAD_ATTR); PyTypeObject *cls = Py_TYPE(owner); DEOPT_IF(cls->tp_version_tag != type_version, LOAD_ATTR); @@ -2817,7 +2837,7 @@ JUMPBY(INLINE_CACHE_ENTRIES_LOAD_ATTR); frame->return_offset = 0; DISPATCH_INLINED(new_frame); - #line 2821 "Python/generated_cases.c.h" + #line 2841 "Python/generated_cases.c.h" } TARGET(STORE_ATTR_INSTANCE_VALUE) { @@ -2825,7 +2845,7 @@ PyObject *value = stack_pointer[-2]; uint32_t type_version = read_u32(&next_instr[1].cache); uint16_t index = read_u16(&next_instr[3].cache); - #line 1910 "Python/bytecodes.c" + #line 1911 "Python/bytecodes.c" PyTypeObject *tp = Py_TYPE(owner); assert(type_version != 0); DEOPT_IF(tp->tp_version_tag != type_version, STORE_ATTR); @@ -2843,7 +2863,7 @@ Py_DECREF(old_value); } Py_DECREF(owner); - #line 2847 "Python/generated_cases.c.h" + #line 2867 "Python/generated_cases.c.h" STACK_SHRINK(2); next_instr += 4; DISPATCH(); @@ -2854,7 +2874,7 @@ PyObject *value = stack_pointer[-2]; uint32_t type_version = read_u32(&next_instr[1].cache); uint16_t hint = read_u16(&next_instr[3].cache); - #line 1930 "Python/bytecodes.c" + #line 1931 "Python/bytecodes.c" PyTypeObject *tp = Py_TYPE(owner); assert(type_version != 0); DEOPT_IF(tp->tp_version_tag != type_version, STORE_ATTR); @@ -2893,7 +2913,7 @@ /* PEP 509 */ dict->ma_version_tag = new_version; Py_DECREF(owner); - #line 2897 "Python/generated_cases.c.h" + #line 2917 "Python/generated_cases.c.h" STACK_SHRINK(2); next_instr += 4; DISPATCH(); @@ -2904,7 +2924,7 @@ PyObject *value = stack_pointer[-2]; uint32_t type_version = read_u32(&next_instr[1].cache); uint16_t index = read_u16(&next_instr[3].cache); - #line 1971 "Python/bytecodes.c" + #line 1972 "Python/bytecodes.c" PyTypeObject *tp = Py_TYPE(owner); assert(type_version != 0); DEOPT_IF(tp->tp_version_tag != type_version, STORE_ATTR); @@ -2914,7 +2934,7 @@ *(PyObject **)addr = value; Py_XDECREF(old_value); Py_DECREF(owner); - #line 2918 "Python/generated_cases.c.h" + #line 2938 "Python/generated_cases.c.h" STACK_SHRINK(2); next_instr += 4; DISPATCH(); @@ -2926,7 +2946,7 @@ PyObject *right = stack_pointer[-1]; PyObject *left = stack_pointer[-2]; PyObject *res; - #line 1990 "Python/bytecodes.c" + #line 1991 "Python/bytecodes.c" #if ENABLE_SPECIALIZATION _PyCompareOpCache *cache = (_PyCompareOpCache *)next_instr; if (ADAPTIVE_COUNTER_IS_ZERO(cache->counter)) { @@ -2939,12 +2959,12 @@ #endif /* ENABLE_SPECIALIZATION */ assert((oparg >> 4) <= Py_GE); res = PyObject_RichCompare(left, right, oparg>>4); - #line 2943 "Python/generated_cases.c.h" + #line 2963 "Python/generated_cases.c.h" Py_DECREF(left); Py_DECREF(right); - #line 2003 "Python/bytecodes.c" + #line 2004 "Python/bytecodes.c" if (res == NULL) goto pop_2_error; - #line 2948 "Python/generated_cases.c.h" + #line 2968 "Python/generated_cases.c.h" STACK_SHRINK(1); stack_pointer[-1] = res; next_instr += 1; @@ -2955,7 +2975,7 @@ PyObject *right = stack_pointer[-1]; PyObject *left = stack_pointer[-2]; PyObject *res; - #line 2007 "Python/bytecodes.c" + #line 2008 "Python/bytecodes.c" DEOPT_IF(!PyFloat_CheckExact(left), COMPARE_OP); DEOPT_IF(!PyFloat_CheckExact(right), COMPARE_OP); STAT_INC(COMPARE_OP, hit); @@ -2966,7 +2986,7 @@ _Py_DECREF_SPECIALIZED(left, _PyFloat_ExactDealloc); _Py_DECREF_SPECIALIZED(right, _PyFloat_ExactDealloc); res = (sign_ish & oparg) ? Py_True : Py_False; - #line 2970 "Python/generated_cases.c.h" + #line 2990 "Python/generated_cases.c.h" STACK_SHRINK(1); stack_pointer[-1] = res; next_instr += 1; @@ -2977,7 +2997,7 @@ PyObject *right = stack_pointer[-1]; PyObject *left = stack_pointer[-2]; PyObject *res; - #line 2021 "Python/bytecodes.c" + #line 2022 "Python/bytecodes.c" DEOPT_IF(!PyLong_CheckExact(left), COMPARE_OP); DEOPT_IF(!PyLong_CheckExact(right), COMPARE_OP); DEOPT_IF(!_PyLong_IsCompact((PyLongObject *)left), COMPARE_OP); @@ -2992,7 +3012,7 @@ _Py_DECREF_SPECIALIZED(left, (destructor)PyObject_Free); _Py_DECREF_SPECIALIZED(right, (destructor)PyObject_Free); res = (sign_ish & oparg) ? Py_True : Py_False; - #line 2996 "Python/generated_cases.c.h" + #line 3016 "Python/generated_cases.c.h" STACK_SHRINK(1); stack_pointer[-1] = res; next_instr += 1; @@ -3003,7 +3023,7 @@ PyObject *right = stack_pointer[-1]; PyObject *left = stack_pointer[-2]; PyObject *res; - #line 2039 "Python/bytecodes.c" + #line 2040 "Python/bytecodes.c" DEOPT_IF(!PyUnicode_CheckExact(left), COMPARE_OP); DEOPT_IF(!PyUnicode_CheckExact(right), COMPARE_OP); STAT_INC(COMPARE_OP, hit); @@ -3015,7 +3035,7 @@ assert((oparg & 0xf) == COMPARISON_NOT_EQUALS || (oparg & 0xf) == COMPARISON_EQUALS); assert(COMPARISON_NOT_EQUALS + 1 == COMPARISON_EQUALS); res = ((COMPARISON_NOT_EQUALS + eq) & oparg) ? Py_True : Py_False; - #line 3019 "Python/generated_cases.c.h" + #line 3039 "Python/generated_cases.c.h" STACK_SHRINK(1); stack_pointer[-1] = res; next_instr += 1; @@ -3026,14 +3046,14 @@ PyObject *right = stack_pointer[-1]; PyObject *left = stack_pointer[-2]; PyObject *b; - #line 2053 "Python/bytecodes.c" + #line 2054 "Python/bytecodes.c" int res = Py_Is(left, right) ^ oparg; - #line 3032 "Python/generated_cases.c.h" + #line 3052 "Python/generated_cases.c.h" Py_DECREF(left); Py_DECREF(right); - #line 2055 "Python/bytecodes.c" + #line 2056 "Python/bytecodes.c" b = res ? Py_True : Py_False; - #line 3037 "Python/generated_cases.c.h" + #line 3057 "Python/generated_cases.c.h" STACK_SHRINK(1); stack_pointer[-1] = b; DISPATCH(); @@ -3043,15 +3063,15 @@ PyObject *right = stack_pointer[-1]; PyObject *left = stack_pointer[-2]; PyObject *b; - #line 2059 "Python/bytecodes.c" + #line 2060 "Python/bytecodes.c" int res = PySequence_Contains(right, left); - #line 3049 "Python/generated_cases.c.h" + #line 3069 "Python/generated_cases.c.h" Py_DECREF(left); Py_DECREF(right); - #line 2061 "Python/bytecodes.c" + #line 2062 "Python/bytecodes.c" if (res < 0) goto pop_2_error; b = (res ^ oparg) ? Py_True : Py_False; - #line 3055 "Python/generated_cases.c.h" + #line 3075 "Python/generated_cases.c.h" STACK_SHRINK(1); stack_pointer[-1] = b; DISPATCH(); @@ -3062,12 +3082,12 @@ PyObject *exc_value = stack_pointer[-2]; PyObject *rest; PyObject *match; - #line 2066 "Python/bytecodes.c" + #line 2067 "Python/bytecodes.c" if (check_except_star_type_valid(tstate, match_type) < 0) { - #line 3068 "Python/generated_cases.c.h" + #line 3088 "Python/generated_cases.c.h" Py_DECREF(exc_value); Py_DECREF(match_type); - #line 2068 "Python/bytecodes.c" + #line 2069 "Python/bytecodes.c" if (true) goto pop_2_error; } @@ -3075,10 +3095,10 @@ rest = NULL; int res = exception_group_match(exc_value, match_type, &match, &rest); - #line 3079 "Python/generated_cases.c.h" + #line 3099 "Python/generated_cases.c.h" Py_DECREF(exc_value); Py_DECREF(match_type); - #line 2076 "Python/bytecodes.c" + #line 2077 "Python/bytecodes.c" if (res < 0) goto pop_2_error; assert((match == NULL) == (rest == NULL)); @@ -3087,7 +3107,7 @@ if (!Py_IsNone(match)) { PyErr_SetHandledException(match); } - #line 3091 "Python/generated_cases.c.h" + #line 3111 "Python/generated_cases.c.h" stack_pointer[-1] = match; stack_pointer[-2] = rest; DISPATCH(); @@ -3097,21 +3117,21 @@ PyObject *right = stack_pointer[-1]; PyObject *left = stack_pointer[-2]; PyObject *b; - #line 2087 "Python/bytecodes.c" + #line 2088 "Python/bytecodes.c" assert(PyExceptionInstance_Check(left)); if (check_except_type_valid(tstate, right) < 0) { - #line 3104 "Python/generated_cases.c.h" + #line 3124 "Python/generated_cases.c.h" Py_DECREF(right); - #line 2090 "Python/bytecodes.c" + #line 2091 "Python/bytecodes.c" if (true) goto pop_1_error; } int res = PyErr_GivenExceptionMatches(left, right); - #line 3111 "Python/generated_cases.c.h" + #line 3131 "Python/generated_cases.c.h" Py_DECREF(right); - #line 2095 "Python/bytecodes.c" + #line 2096 "Python/bytecodes.c" b = res ? Py_True : Py_False; - #line 3115 "Python/generated_cases.c.h" + #line 3135 "Python/generated_cases.c.h" stack_pointer[-1] = b; DISPATCH(); } @@ -3120,15 +3140,15 @@ PyObject *fromlist = stack_pointer[-1]; PyObject *level = stack_pointer[-2]; PyObject *res; - #line 2099 "Python/bytecodes.c" + #line 2100 "Python/bytecodes.c" PyObject *name = GETITEM(frame->f_code->co_names, oparg); res = import_name(tstate, frame, name, fromlist, level); - #line 3127 "Python/generated_cases.c.h" + #line 3147 "Python/generated_cases.c.h" Py_DECREF(level); Py_DECREF(fromlist); - #line 2102 "Python/bytecodes.c" + #line 2103 "Python/bytecodes.c" if (res == NULL) goto pop_2_error; - #line 3132 "Python/generated_cases.c.h" + #line 3152 "Python/generated_cases.c.h" STACK_SHRINK(1); stack_pointer[-1] = res; DISPATCH(); @@ -3137,29 +3157,29 @@ TARGET(IMPORT_FROM) { PyObject *from = stack_pointer[-1]; PyObject *res; - #line 2106 "Python/bytecodes.c" + #line 2107 "Python/bytecodes.c" PyObject *name = GETITEM(frame->f_code->co_names, oparg); res = import_from(tstate, from, name); if (res == NULL) goto error; - #line 3145 "Python/generated_cases.c.h" + #line 3165 "Python/generated_cases.c.h" STACK_GROW(1); stack_pointer[-1] = res; DISPATCH(); } TARGET(JUMP_FORWARD) { - #line 2112 "Python/bytecodes.c" + #line 2113 "Python/bytecodes.c" JUMPBY(oparg); - #line 3154 "Python/generated_cases.c.h" + #line 3174 "Python/generated_cases.c.h" DISPATCH(); } TARGET(JUMP_BACKWARD) { PREDICTED(JUMP_BACKWARD); - #line 2116 "Python/bytecodes.c" + #line 2117 "Python/bytecodes.c" assert(oparg < INSTR_OFFSET()); JUMPBY(-oparg); - #line 3163 "Python/generated_cases.c.h" + #line 3183 "Python/generated_cases.c.h" CHECK_EVAL_BREAKER(); DISPATCH(); } @@ -3167,15 +3187,15 @@ TARGET(POP_JUMP_IF_FALSE) { PREDICTED(POP_JUMP_IF_FALSE); PyObject *cond = stack_pointer[-1]; - #line 2122 "Python/bytecodes.c" + #line 2123 "Python/bytecodes.c" if (Py_IsFalse(cond)) { JUMPBY(oparg); } else if (!Py_IsTrue(cond)) { int err = PyObject_IsTrue(cond); - #line 3177 "Python/generated_cases.c.h" + #line 3197 "Python/generated_cases.c.h" Py_DECREF(cond); - #line 2128 "Python/bytecodes.c" + #line 2129 "Python/bytecodes.c" if (err == 0) { JUMPBY(oparg); } @@ -3183,22 +3203,22 @@ if (err < 0) goto pop_1_error; } } - #line 3187 "Python/generated_cases.c.h" + #line 3207 "Python/generated_cases.c.h" STACK_SHRINK(1); DISPATCH(); } TARGET(POP_JUMP_IF_TRUE) { PyObject *cond = stack_pointer[-1]; - #line 2138 "Python/bytecodes.c" + #line 2139 "Python/bytecodes.c" if (Py_IsTrue(cond)) { JUMPBY(oparg); } else if (!Py_IsFalse(cond)) { int err = PyObject_IsTrue(cond); - #line 3200 "Python/generated_cases.c.h" + #line 3220 "Python/generated_cases.c.h" Py_DECREF(cond); - #line 2144 "Python/bytecodes.c" + #line 2145 "Python/bytecodes.c" if (err > 0) { JUMPBY(oparg); } @@ -3206,63 +3226,63 @@ if (err < 0) goto pop_1_error; } } - #line 3210 "Python/generated_cases.c.h" + #line 3230 "Python/generated_cases.c.h" STACK_SHRINK(1); DISPATCH(); } TARGET(POP_JUMP_IF_NOT_NONE) { PyObject *value = stack_pointer[-1]; - #line 2154 "Python/bytecodes.c" + #line 2155 "Python/bytecodes.c" if (!Py_IsNone(value)) { - #line 3219 "Python/generated_cases.c.h" + #line 3239 "Python/generated_cases.c.h" Py_DECREF(value); - #line 2156 "Python/bytecodes.c" + #line 2157 "Python/bytecodes.c" JUMPBY(oparg); } - #line 3224 "Python/generated_cases.c.h" + #line 3244 "Python/generated_cases.c.h" STACK_SHRINK(1); DISPATCH(); } TARGET(POP_JUMP_IF_NONE) { PyObject *value = stack_pointer[-1]; - #line 2161 "Python/bytecodes.c" + #line 2162 "Python/bytecodes.c" if (Py_IsNone(value)) { JUMPBY(oparg); } else { - #line 3236 "Python/generated_cases.c.h" + #line 3256 "Python/generated_cases.c.h" Py_DECREF(value); - #line 2166 "Python/bytecodes.c" + #line 2167 "Python/bytecodes.c" } - #line 3240 "Python/generated_cases.c.h" + #line 3260 "Python/generated_cases.c.h" STACK_SHRINK(1); DISPATCH(); } TARGET(JUMP_BACKWARD_NO_INTERRUPT) { - #line 2170 "Python/bytecodes.c" + #line 2171 "Python/bytecodes.c" /* This bytecode is used in the `yield from` or `await` loop. * If there is an interrupt, we want it handled in the innermost * generator or coroutine, so we deliberately do not check it here. * (see bpo-30039). */ JUMPBY(-oparg); - #line 3253 "Python/generated_cases.c.h" + #line 3273 "Python/generated_cases.c.h" DISPATCH(); } TARGET(GET_LEN) { PyObject *obj = stack_pointer[-1]; PyObject *len_o; - #line 2179 "Python/bytecodes.c" + #line 2180 "Python/bytecodes.c" // PUSH(len(TOS)) Py_ssize_t len_i = PyObject_Length(obj); if (len_i < 0) goto error; len_o = PyLong_FromSsize_t(len_i); if (len_o == NULL) goto error; - #line 3266 "Python/generated_cases.c.h" + #line 3286 "Python/generated_cases.c.h" STACK_GROW(1); stack_pointer[-1] = len_o; DISPATCH(); @@ -3273,16 +3293,16 @@ PyObject *type = stack_pointer[-2]; PyObject *subject = stack_pointer[-3]; PyObject *attrs; - #line 2187 "Python/bytecodes.c" + #line 2188 "Python/bytecodes.c" // Pop TOS and TOS1. Set TOS to a tuple of attributes on success, or // None on failure. assert(PyTuple_CheckExact(names)); attrs = match_class(tstate, subject, type, oparg, names); - #line 3282 "Python/generated_cases.c.h" + #line 3302 "Python/generated_cases.c.h" Py_DECREF(subject); Py_DECREF(type); Py_DECREF(names); - #line 2192 "Python/bytecodes.c" + #line 2193 "Python/bytecodes.c" if (attrs) { assert(PyTuple_CheckExact(attrs)); // Success! } @@ -3290,7 +3310,7 @@ if (_PyErr_Occurred(tstate)) goto pop_3_error; attrs = Py_None; // Failure! } - #line 3294 "Python/generated_cases.c.h" + #line 3314 "Python/generated_cases.c.h" STACK_SHRINK(2); stack_pointer[-1] = attrs; DISPATCH(); @@ -3299,10 +3319,10 @@ TARGET(MATCH_MAPPING) { PyObject *subject = stack_pointer[-1]; PyObject *res; - #line 2202 "Python/bytecodes.c" + #line 2203 "Python/bytecodes.c" int match = Py_TYPE(subject)->tp_flags & Py_TPFLAGS_MAPPING; res = match ? Py_True : Py_False; - #line 3306 "Python/generated_cases.c.h" + #line 3326 "Python/generated_cases.c.h" STACK_GROW(1); stack_pointer[-1] = res; PREDICT(POP_JUMP_IF_FALSE); @@ -3312,10 +3332,10 @@ TARGET(MATCH_SEQUENCE) { PyObject *subject = stack_pointer[-1]; PyObject *res; - #line 2208 "Python/bytecodes.c" + #line 2209 "Python/bytecodes.c" int match = Py_TYPE(subject)->tp_flags & Py_TPFLAGS_SEQUENCE; res = match ? Py_True : Py_False; - #line 3319 "Python/generated_cases.c.h" + #line 3339 "Python/generated_cases.c.h" STACK_GROW(1); stack_pointer[-1] = res; PREDICT(POP_JUMP_IF_FALSE); @@ -3326,11 +3346,11 @@ PyObject *keys = stack_pointer[-1]; PyObject *subject = stack_pointer[-2]; PyObject *values_or_none; - #line 2214 "Python/bytecodes.c" + #line 2215 "Python/bytecodes.c" // On successful match, PUSH(values). Otherwise, PUSH(None). values_or_none = match_keys(tstate, subject, keys); if (values_or_none == NULL) goto error; - #line 3334 "Python/generated_cases.c.h" + #line 3354 "Python/generated_cases.c.h" STACK_GROW(1); stack_pointer[-1] = values_or_none; DISPATCH(); @@ -3339,14 +3359,14 @@ TARGET(GET_ITER) { PyObject *iterable = stack_pointer[-1]; PyObject *iter; - #line 2220 "Python/bytecodes.c" + #line 2221 "Python/bytecodes.c" /* before: [obj]; after [getiter(obj)] */ iter = PyObject_GetIter(iterable); - #line 3346 "Python/generated_cases.c.h" + #line 3366 "Python/generated_cases.c.h" Py_DECREF(iterable); - #line 2223 "Python/bytecodes.c" + #line 2224 "Python/bytecodes.c" if (iter == NULL) goto pop_1_error; - #line 3350 "Python/generated_cases.c.h" + #line 3370 "Python/generated_cases.c.h" stack_pointer[-1] = iter; DISPATCH(); } @@ -3354,7 +3374,7 @@ TARGET(GET_YIELD_FROM_ITER) { PyObject *iterable = stack_pointer[-1]; PyObject *iter; - #line 2227 "Python/bytecodes.c" + #line 2228 "Python/bytecodes.c" /* before: [obj]; after [getiter(obj)] */ if (PyCoro_CheckExact(iterable)) { /* `iterable` is a coroutine */ @@ -3377,11 +3397,11 @@ if (iter == NULL) { goto error; } - #line 3381 "Python/generated_cases.c.h" + #line 3401 "Python/generated_cases.c.h" Py_DECREF(iterable); - #line 2250 "Python/bytecodes.c" + #line 2251 "Python/bytecodes.c" } - #line 3385 "Python/generated_cases.c.h" + #line 3405 "Python/generated_cases.c.h" stack_pointer[-1] = iter; PREDICT(LOAD_CONST); DISPATCH(); @@ -3392,7 +3412,7 @@ static_assert(INLINE_CACHE_ENTRIES_FOR_ITER == 1, "incorrect cache size"); PyObject *iter = stack_pointer[-1]; PyObject *next; - #line 2269 "Python/bytecodes.c" + #line 2270 "Python/bytecodes.c" #if ENABLE_SPECIALIZATION _PyForIterCache *cache = (_PyForIterCache *)next_instr; if (ADAPTIVE_COUNTER_IS_ZERO(cache->counter)) { @@ -3423,7 +3443,7 @@ DISPATCH(); } // Common case: no jump, leave it to the code generator - #line 3427 "Python/generated_cases.c.h" + #line 3447 "Python/generated_cases.c.h" STACK_GROW(1); stack_pointer[-1] = next; next_instr += 1; @@ -3431,7 +3451,7 @@ } TARGET(INSTRUMENTED_FOR_ITER) { - #line 2302 "Python/bytecodes.c" + #line 2303 "Python/bytecodes.c" _Py_CODEUNIT *here = next_instr-1; _Py_CODEUNIT *target; PyObject *iter = TOP(); @@ -3457,14 +3477,14 @@ target = next_instr + INLINE_CACHE_ENTRIES_FOR_ITER + oparg + 1; } INSTRUMENTED_JUMP(here, target, PY_MONITORING_EVENT_BRANCH); - #line 3461 "Python/generated_cases.c.h" + #line 3481 "Python/generated_cases.c.h" DISPATCH(); } TARGET(FOR_ITER_LIST) { PyObject *iter = stack_pointer[-1]; PyObject *next; - #line 2330 "Python/bytecodes.c" + #line 2331 "Python/bytecodes.c" DEOPT_IF(Py_TYPE(iter) != &PyListIter_Type, FOR_ITER); _PyListIterObject *it = (_PyListIterObject *)iter; STAT_INC(FOR_ITER, hit); @@ -3484,7 +3504,7 @@ DISPATCH(); end_for_iter_list: // Common case: no jump, leave it to the code generator - #line 3488 "Python/generated_cases.c.h" + #line 3508 "Python/generated_cases.c.h" STACK_GROW(1); stack_pointer[-1] = next; next_instr += 1; @@ -3494,7 +3514,7 @@ TARGET(FOR_ITER_TUPLE) { PyObject *iter = stack_pointer[-1]; PyObject *next; - #line 2352 "Python/bytecodes.c" + #line 2353 "Python/bytecodes.c" _PyTupleIterObject *it = (_PyTupleIterObject *)iter; DEOPT_IF(Py_TYPE(it) != &PyTupleIter_Type, FOR_ITER); STAT_INC(FOR_ITER, hit); @@ -3514,7 +3534,7 @@ DISPATCH(); end_for_iter_tuple: // Common case: no jump, leave it to the code generator - #line 3518 "Python/generated_cases.c.h" + #line 3538 "Python/generated_cases.c.h" STACK_GROW(1); stack_pointer[-1] = next; next_instr += 1; @@ -3524,7 +3544,7 @@ TARGET(FOR_ITER_RANGE) { PyObject *iter = stack_pointer[-1]; PyObject *next; - #line 2374 "Python/bytecodes.c" + #line 2375 "Python/bytecodes.c" _PyRangeIterObject *r = (_PyRangeIterObject *)iter; DEOPT_IF(Py_TYPE(r) != &PyRangeIter_Type, FOR_ITER); STAT_INC(FOR_ITER, hit); @@ -3542,7 +3562,7 @@ if (next == NULL) { goto error; } - #line 3546 "Python/generated_cases.c.h" + #line 3566 "Python/generated_cases.c.h" STACK_GROW(1); stack_pointer[-1] = next; next_instr += 1; @@ -3551,7 +3571,7 @@ TARGET(FOR_ITER_GEN) { PyObject *iter = stack_pointer[-1]; - #line 2394 "Python/bytecodes.c" + #line 2395 "Python/bytecodes.c" DEOPT_IF(tstate->interp->eval_frame, FOR_ITER); PyGenObject *gen = (PyGenObject *)iter; DEOPT_IF(Py_TYPE(gen) != &PyGen_Type, FOR_ITER); @@ -3567,14 +3587,14 @@ assert(next_instr[oparg].op.code == END_FOR || next_instr[oparg].op.code == INSTRUMENTED_END_FOR); DISPATCH_INLINED(gen_frame); - #line 3571 "Python/generated_cases.c.h" + #line 3591 "Python/generated_cases.c.h" } TARGET(BEFORE_ASYNC_WITH) { PyObject *mgr = stack_pointer[-1]; PyObject *exit; PyObject *res; - #line 2412 "Python/bytecodes.c" + #line 2413 "Python/bytecodes.c" PyObject *enter = _PyObject_LookupSpecial(mgr, &_Py_ID(__aenter__)); if (enter == NULL) { if (!_PyErr_Occurred(tstate)) { @@ -3597,16 +3617,16 @@ Py_DECREF(enter); goto error; } - #line 3601 "Python/generated_cases.c.h" + #line 3621 "Python/generated_cases.c.h" Py_DECREF(mgr); - #line 2435 "Python/bytecodes.c" + #line 2436 "Python/bytecodes.c" res = _PyObject_CallNoArgs(enter); Py_DECREF(enter); if (res == NULL) { Py_DECREF(exit); if (true) goto pop_1_error; } - #line 3610 "Python/generated_cases.c.h" + #line 3630 "Python/generated_cases.c.h" STACK_GROW(1); stack_pointer[-1] = res; stack_pointer[-2] = exit; @@ -3618,7 +3638,7 @@ PyObject *mgr = stack_pointer[-1]; PyObject *exit; PyObject *res; - #line 2445 "Python/bytecodes.c" + #line 2446 "Python/bytecodes.c" /* pop the context manager, push its __exit__ and the * value returned from calling its __enter__ */ @@ -3644,16 +3664,16 @@ Py_DECREF(enter); goto error; } - #line 3648 "Python/generated_cases.c.h" + #line 3668 "Python/generated_cases.c.h" Py_DECREF(mgr); - #line 2471 "Python/bytecodes.c" + #line 2472 "Python/bytecodes.c" res = _PyObject_CallNoArgs(enter); Py_DECREF(enter); if (res == NULL) { Py_DECREF(exit); if (true) goto pop_1_error; } - #line 3657 "Python/generated_cases.c.h" + #line 3677 "Python/generated_cases.c.h" STACK_GROW(1); stack_pointer[-1] = res; stack_pointer[-2] = exit; @@ -3665,7 +3685,7 @@ PyObject *lasti = stack_pointer[-3]; PyObject *exit_func = stack_pointer[-4]; PyObject *res; - #line 2480 "Python/bytecodes.c" + #line 2481 "Python/bytecodes.c" /* At the top of the stack are 4 values: - val: TOP = exc_info() - unused: SECOND = previous exception @@ -3686,7 +3706,7 @@ res = PyObject_Vectorcall(exit_func, stack + 1, 3 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL); if (res == NULL) goto error; - #line 3690 "Python/generated_cases.c.h" + #line 3710 "Python/generated_cases.c.h" STACK_GROW(1); stack_pointer[-1] = res; DISPATCH(); @@ -3695,7 +3715,7 @@ TARGET(PUSH_EXC_INFO) { PyObject *new_exc = stack_pointer[-1]; PyObject *prev_exc; - #line 2503 "Python/bytecodes.c" + #line 2504 "Python/bytecodes.c" _PyErr_StackItem *exc_info = tstate->exc_info; if (exc_info->exc_value != NULL) { prev_exc = exc_info->exc_value; @@ -3705,7 +3725,7 @@ } assert(PyExceptionInstance_Check(new_exc)); exc_info->exc_value = Py_NewRef(new_exc); - #line 3709 "Python/generated_cases.c.h" + #line 3729 "Python/generated_cases.c.h" STACK_GROW(1); stack_pointer[-1] = new_exc; stack_pointer[-2] = prev_exc; @@ -3719,7 +3739,7 @@ uint32_t type_version = read_u32(&next_instr[1].cache); uint32_t keys_version = read_u32(&next_instr[3].cache); PyObject *descr = read_obj(&next_instr[5].cache); - #line 2515 "Python/bytecodes.c" + #line 2516 "Python/bytecodes.c" /* Cached method object */ PyTypeObject *self_cls = Py_TYPE(self); assert(type_version != 0); @@ -3736,7 +3756,7 @@ assert(_PyType_HasFeature(Py_TYPE(res2), Py_TPFLAGS_METHOD_DESCRIPTOR)); res = self; assert(oparg & 1); - #line 3740 "Python/generated_cases.c.h" + #line 3760 "Python/generated_cases.c.h" STACK_GROW(((oparg & 1) ? 1 : 0)); stack_pointer[-1] = res; if (oparg & 1) { stack_pointer[-(1 + ((oparg & 1) ? 1 : 0))] = res2; } @@ -3750,7 +3770,7 @@ PyObject *res; uint32_t type_version = read_u32(&next_instr[1].cache); PyObject *descr = read_obj(&next_instr[5].cache); - #line 2534 "Python/bytecodes.c" + #line 2535 "Python/bytecodes.c" PyTypeObject *self_cls = Py_TYPE(self); DEOPT_IF(self_cls->tp_version_tag != type_version, LOAD_ATTR); assert(self_cls->tp_dictoffset == 0); @@ -3760,7 +3780,7 @@ res2 = Py_NewRef(descr); res = self; assert(oparg & 1); - #line 3764 "Python/generated_cases.c.h" + #line 3784 "Python/generated_cases.c.h" STACK_GROW(((oparg & 1) ? 1 : 0)); stack_pointer[-1] = res; if (oparg & 1) { stack_pointer[-(1 + ((oparg & 1) ? 1 : 0))] = res2; } @@ -3774,7 +3794,7 @@ PyObject *res; uint32_t type_version = read_u32(&next_instr[1].cache); PyObject *descr = read_obj(&next_instr[5].cache); - #line 2546 "Python/bytecodes.c" + #line 2547 "Python/bytecodes.c" PyTypeObject *self_cls = Py_TYPE(self); DEOPT_IF(self_cls->tp_version_tag != type_version, LOAD_ATTR); Py_ssize_t dictoffset = self_cls->tp_dictoffset; @@ -3788,7 +3808,7 @@ res2 = Py_NewRef(descr); res = self; assert(oparg & 1); - #line 3792 "Python/generated_cases.c.h" + #line 3812 "Python/generated_cases.c.h" STACK_GROW(((oparg & 1) ? 1 : 0)); stack_pointer[-1] = res; if (oparg & 1) { stack_pointer[-(1 + ((oparg & 1) ? 1 : 0))] = res2; } @@ -3797,16 +3817,16 @@ } TARGET(KW_NAMES) { - #line 2562 "Python/bytecodes.c" + #line 2563 "Python/bytecodes.c" assert(kwnames == NULL); assert(oparg < PyTuple_GET_SIZE(frame->f_code->co_consts)); kwnames = GETITEM(frame->f_code->co_consts, oparg); - #line 3805 "Python/generated_cases.c.h" + #line 3825 "Python/generated_cases.c.h" DISPATCH(); } TARGET(INSTRUMENTED_CALL) { - #line 2568 "Python/bytecodes.c" + #line 2569 "Python/bytecodes.c" int is_meth = PEEK(oparg+2) != NULL; int total_args = oparg + is_meth; PyObject *function = PEEK(total_args + 1); @@ -3819,7 +3839,7 @@ _PyCallCache *cache = (_PyCallCache *)next_instr; INCREMENT_ADAPTIVE_COUNTER(cache->counter); GO_TO_INSTRUCTION(CALL); - #line 3823 "Python/generated_cases.c.h" + #line 3843 "Python/generated_cases.c.h" } TARGET(CALL) { @@ -3829,7 +3849,7 @@ PyObject *callable = stack_pointer[-(1 + oparg)]; PyObject *method = stack_pointer[-(2 + oparg)]; PyObject *res; - #line 2613 "Python/bytecodes.c" + #line 2614 "Python/bytecodes.c" int is_meth = method != NULL; int total_args = oparg; if (is_meth) { @@ -3911,7 +3931,7 @@ Py_DECREF(args[i]); } if (res == NULL) { STACK_SHRINK(oparg); goto pop_2_error; } - #line 3915 "Python/generated_cases.c.h" + #line 3935 "Python/generated_cases.c.h" STACK_SHRINK(oparg); STACK_SHRINK(1); stack_pointer[-1] = res; @@ -3923,7 +3943,7 @@ TARGET(CALL_BOUND_METHOD_EXACT_ARGS) { PyObject *callable = stack_pointer[-(1 + oparg)]; PyObject *method = stack_pointer[-(2 + oparg)]; - #line 2701 "Python/bytecodes.c" + #line 2702 "Python/bytecodes.c" DEOPT_IF(method != NULL, CALL); DEOPT_IF(Py_TYPE(callable) != &PyMethod_Type, CALL); STAT_INC(CALL, hit); @@ -3933,7 +3953,7 @@ PEEK(oparg + 2) = Py_NewRef(meth); // method Py_DECREF(callable); GO_TO_INSTRUCTION(CALL_PY_EXACT_ARGS); - #line 3937 "Python/generated_cases.c.h" + #line 3957 "Python/generated_cases.c.h" } TARGET(CALL_PY_EXACT_ARGS) { @@ -3942,7 +3962,7 @@ PyObject *callable = stack_pointer[-(1 + oparg)]; PyObject *method = stack_pointer[-(2 + oparg)]; uint32_t func_version = read_u32(&next_instr[1].cache); - #line 2713 "Python/bytecodes.c" + #line 2714 "Python/bytecodes.c" assert(kwnames == NULL); DEOPT_IF(tstate->interp->eval_frame, CALL); int is_meth = method != NULL; @@ -3968,7 +3988,7 @@ JUMPBY(INLINE_CACHE_ENTRIES_CALL); frame->return_offset = 0; DISPATCH_INLINED(new_frame); - #line 3972 "Python/generated_cases.c.h" + #line 3992 "Python/generated_cases.c.h" } TARGET(CALL_PY_WITH_DEFAULTS) { @@ -3976,7 +3996,7 @@ PyObject *callable = stack_pointer[-(1 + oparg)]; PyObject *method = stack_pointer[-(2 + oparg)]; uint32_t func_version = read_u32(&next_instr[1].cache); - #line 2741 "Python/bytecodes.c" + #line 2742 "Python/bytecodes.c" assert(kwnames == NULL); DEOPT_IF(tstate->interp->eval_frame, CALL); int is_meth = method != NULL; @@ -4012,7 +4032,7 @@ JUMPBY(INLINE_CACHE_ENTRIES_CALL); frame->return_offset = 0; DISPATCH_INLINED(new_frame); - #line 4016 "Python/generated_cases.c.h" + #line 4036 "Python/generated_cases.c.h" } TARGET(CALL_NO_KW_TYPE_1) { @@ -4020,7 +4040,7 @@ PyObject *callable = stack_pointer[-(1 + oparg)]; PyObject *null = stack_pointer[-(2 + oparg)]; PyObject *res; - #line 2779 "Python/bytecodes.c" + #line 2780 "Python/bytecodes.c" assert(kwnames == NULL); assert(oparg == 1); DEOPT_IF(null != NULL, CALL); @@ -4030,7 +4050,7 @@ res = Py_NewRef(Py_TYPE(obj)); Py_DECREF(obj); Py_DECREF(&PyType_Type); // I.e., callable - #line 4034 "Python/generated_cases.c.h" + #line 4054 "Python/generated_cases.c.h" STACK_SHRINK(oparg); STACK_SHRINK(1); stack_pointer[-1] = res; @@ -4043,7 +4063,7 @@ PyObject *callable = stack_pointer[-(1 + oparg)]; PyObject *null = stack_pointer[-(2 + oparg)]; PyObject *res; - #line 2791 "Python/bytecodes.c" + #line 2792 "Python/bytecodes.c" assert(kwnames == NULL); assert(oparg == 1); DEOPT_IF(null != NULL, CALL); @@ -4054,7 +4074,7 @@ Py_DECREF(arg); Py_DECREF(&PyUnicode_Type); // I.e., callable if (res == NULL) { STACK_SHRINK(oparg); goto pop_2_error; } - #line 4058 "Python/generated_cases.c.h" + #line 4078 "Python/generated_cases.c.h" STACK_SHRINK(oparg); STACK_SHRINK(1); stack_pointer[-1] = res; @@ -4068,7 +4088,7 @@ PyObject *callable = stack_pointer[-(1 + oparg)]; PyObject *null = stack_pointer[-(2 + oparg)]; PyObject *res; - #line 2805 "Python/bytecodes.c" + #line 2806 "Python/bytecodes.c" assert(kwnames == NULL); assert(oparg == 1); DEOPT_IF(null != NULL, CALL); @@ -4079,7 +4099,7 @@ Py_DECREF(arg); Py_DECREF(&PyTuple_Type); // I.e., tuple if (res == NULL) { STACK_SHRINK(oparg); goto pop_2_error; } - #line 4083 "Python/generated_cases.c.h" + #line 4103 "Python/generated_cases.c.h" STACK_SHRINK(oparg); STACK_SHRINK(1); stack_pointer[-1] = res; @@ -4093,7 +4113,7 @@ PyObject *callable = stack_pointer[-(1 + oparg)]; PyObject *method = stack_pointer[-(2 + oparg)]; PyObject *res; - #line 2819 "Python/bytecodes.c" + #line 2820 "Python/bytecodes.c" int is_meth = method != NULL; int total_args = oparg; if (is_meth) { @@ -4115,7 +4135,7 @@ } Py_DECREF(tp); if (res == NULL) { STACK_SHRINK(oparg); goto pop_2_error; } - #line 4119 "Python/generated_cases.c.h" + #line 4139 "Python/generated_cases.c.h" STACK_SHRINK(oparg); STACK_SHRINK(1); stack_pointer[-1] = res; @@ -4129,7 +4149,7 @@ PyObject *callable = stack_pointer[-(1 + oparg)]; PyObject *method = stack_pointer[-(2 + oparg)]; PyObject *res; - #line 2844 "Python/bytecodes.c" + #line 2845 "Python/bytecodes.c" /* Builtin METH_O functions */ assert(kwnames == NULL); int is_meth = method != NULL; @@ -4157,7 +4177,7 @@ Py_DECREF(arg); Py_DECREF(callable); if (res == NULL) { STACK_SHRINK(oparg); goto pop_2_error; } - #line 4161 "Python/generated_cases.c.h" + #line 4181 "Python/generated_cases.c.h" STACK_SHRINK(oparg); STACK_SHRINK(1); stack_pointer[-1] = res; @@ -4171,7 +4191,7 @@ PyObject *callable = stack_pointer[-(1 + oparg)]; PyObject *method = stack_pointer[-(2 + oparg)]; PyObject *res; - #line 2875 "Python/bytecodes.c" + #line 2876 "Python/bytecodes.c" /* Builtin METH_FASTCALL functions, without keywords */ assert(kwnames == NULL); int is_meth = method != NULL; @@ -4203,7 +4223,7 @@ 'invalid'). In those cases an exception is set, so we must handle it. */ - #line 4207 "Python/generated_cases.c.h" + #line 4227 "Python/generated_cases.c.h" STACK_SHRINK(oparg); STACK_SHRINK(1); stack_pointer[-1] = res; @@ -4217,7 +4237,7 @@ PyObject *callable = stack_pointer[-(1 + oparg)]; PyObject *method = stack_pointer[-(2 + oparg)]; PyObject *res; - #line 2910 "Python/bytecodes.c" + #line 2911 "Python/bytecodes.c" /* Builtin METH_FASTCALL | METH_KEYWORDS functions */ int is_meth = method != NULL; int total_args = oparg; @@ -4249,7 +4269,7 @@ } Py_DECREF(callable); if (res == NULL) { STACK_SHRINK(oparg); goto pop_2_error; } - #line 4253 "Python/generated_cases.c.h" + #line 4273 "Python/generated_cases.c.h" STACK_SHRINK(oparg); STACK_SHRINK(1); stack_pointer[-1] = res; @@ -4263,7 +4283,7 @@ PyObject *callable = stack_pointer[-(1 + oparg)]; PyObject *method = stack_pointer[-(2 + oparg)]; PyObject *res; - #line 2945 "Python/bytecodes.c" + #line 2946 "Python/bytecodes.c" assert(kwnames == NULL); /* len(o) */ int is_meth = method != NULL; @@ -4288,7 +4308,7 @@ Py_DECREF(callable); Py_DECREF(arg); if (res == NULL) { STACK_SHRINK(oparg); goto pop_2_error; } - #line 4292 "Python/generated_cases.c.h" + #line 4312 "Python/generated_cases.c.h" STACK_SHRINK(oparg); STACK_SHRINK(1); stack_pointer[-1] = res; @@ -4301,7 +4321,7 @@ PyObject *callable = stack_pointer[-(1 + oparg)]; PyObject *method = stack_pointer[-(2 + oparg)]; PyObject *res; - #line 2972 "Python/bytecodes.c" + #line 2973 "Python/bytecodes.c" assert(kwnames == NULL); /* isinstance(o, o2) */ int is_meth = method != NULL; @@ -4328,7 +4348,7 @@ Py_DECREF(cls); Py_DECREF(callable); if (res == NULL) { STACK_SHRINK(oparg); goto pop_2_error; } - #line 4332 "Python/generated_cases.c.h" + #line 4352 "Python/generated_cases.c.h" STACK_SHRINK(oparg); STACK_SHRINK(1); stack_pointer[-1] = res; @@ -4340,7 +4360,7 @@ PyObject **args = (stack_pointer - oparg); PyObject *self = stack_pointer[-(1 + oparg)]; PyObject *method = stack_pointer[-(2 + oparg)]; - #line 3002 "Python/bytecodes.c" + #line 3003 "Python/bytecodes.c" assert(kwnames == NULL); assert(oparg == 1); assert(method != NULL); @@ -4358,14 +4378,14 @@ JUMPBY(INLINE_CACHE_ENTRIES_CALL + 1); assert(next_instr[-1].op.code == POP_TOP); DISPATCH(); - #line 4362 "Python/generated_cases.c.h" + #line 4382 "Python/generated_cases.c.h" } TARGET(CALL_NO_KW_METHOD_DESCRIPTOR_O) { PyObject **args = (stack_pointer - oparg); PyObject *method = stack_pointer[-(2 + oparg)]; PyObject *res; - #line 3022 "Python/bytecodes.c" + #line 3023 "Python/bytecodes.c" assert(kwnames == NULL); int is_meth = method != NULL; int total_args = oparg; @@ -4396,7 +4416,7 @@ Py_DECREF(arg); Py_DECREF(callable); if (res == NULL) { STACK_SHRINK(oparg); goto pop_2_error; } - #line 4400 "Python/generated_cases.c.h" + #line 4420 "Python/generated_cases.c.h" STACK_SHRINK(oparg); STACK_SHRINK(1); stack_pointer[-1] = res; @@ -4409,7 +4429,7 @@ PyObject **args = (stack_pointer - oparg); PyObject *method = stack_pointer[-(2 + oparg)]; PyObject *res; - #line 3056 "Python/bytecodes.c" + #line 3057 "Python/bytecodes.c" int is_meth = method != NULL; int total_args = oparg; if (is_meth) { @@ -4438,7 +4458,7 @@ } Py_DECREF(callable); if (res == NULL) { STACK_SHRINK(oparg); goto pop_2_error; } - #line 4442 "Python/generated_cases.c.h" + #line 4462 "Python/generated_cases.c.h" STACK_SHRINK(oparg); STACK_SHRINK(1); stack_pointer[-1] = res; @@ -4451,7 +4471,7 @@ PyObject **args = (stack_pointer - oparg); PyObject *method = stack_pointer[-(2 + oparg)]; PyObject *res; - #line 3088 "Python/bytecodes.c" + #line 3089 "Python/bytecodes.c" assert(kwnames == NULL); assert(oparg == 0 || oparg == 1); int is_meth = method != NULL; @@ -4480,7 +4500,7 @@ Py_DECREF(self); Py_DECREF(callable); if (res == NULL) { STACK_SHRINK(oparg); goto pop_2_error; } - #line 4484 "Python/generated_cases.c.h" + #line 4504 "Python/generated_cases.c.h" STACK_SHRINK(oparg); STACK_SHRINK(1); stack_pointer[-1] = res; @@ -4493,7 +4513,7 @@ PyObject **args = (stack_pointer - oparg); PyObject *method = stack_pointer[-(2 + oparg)]; PyObject *res; - #line 3120 "Python/bytecodes.c" + #line 3121 "Python/bytecodes.c" assert(kwnames == NULL); int is_meth = method != NULL; int total_args = oparg; @@ -4521,7 +4541,7 @@ } Py_DECREF(callable); if (res == NULL) { STACK_SHRINK(oparg); goto pop_2_error; } - #line 4525 "Python/generated_cases.c.h" + #line 4545 "Python/generated_cases.c.h" STACK_SHRINK(oparg); STACK_SHRINK(1); stack_pointer[-1] = res; @@ -4531,9 +4551,9 @@ } TARGET(INSTRUMENTED_CALL_FUNCTION_EX) { - #line 3151 "Python/bytecodes.c" + #line 3152 "Python/bytecodes.c" GO_TO_INSTRUCTION(CALL_FUNCTION_EX); - #line 4537 "Python/generated_cases.c.h" + #line 4557 "Python/generated_cases.c.h" } TARGET(CALL_FUNCTION_EX) { @@ -4542,7 +4562,7 @@ PyObject *callargs = stack_pointer[-(1 + ((oparg & 1) ? 1 : 0))]; PyObject *func = stack_pointer[-(2 + ((oparg & 1) ? 1 : 0))]; PyObject *result; - #line 3155 "Python/bytecodes.c" + #line 3156 "Python/bytecodes.c" // DICT_MERGE is called before this opcode if there are kwargs. // It converts all dict subtypes in kwargs into regular dicts. assert(kwargs == NULL || PyDict_CheckExact(kwargs)); @@ -4604,14 +4624,14 @@ } result = PyObject_Call(func, callargs, kwargs); } - #line 4608 "Python/generated_cases.c.h" + #line 4628 "Python/generated_cases.c.h" Py_DECREF(func); Py_DECREF(callargs); Py_XDECREF(kwargs); - #line 3217 "Python/bytecodes.c" + #line 3218 "Python/bytecodes.c" assert(PEEK(3 + (oparg & 1)) == NULL); if (result == NULL) { STACK_SHRINK(((oparg & 1) ? 1 : 0)); goto pop_3_error; } - #line 4615 "Python/generated_cases.c.h" + #line 4635 "Python/generated_cases.c.h" STACK_SHRINK(((oparg & 1) ? 1 : 0)); STACK_SHRINK(2); stack_pointer[-1] = result; @@ -4626,7 +4646,7 @@ PyObject *kwdefaults = (oparg & 0x02) ? stack_pointer[-(1 + ((oparg & 0x08) ? 1 : 0) + ((oparg & 0x04) ? 1 : 0) + ((oparg & 0x02) ? 1 : 0))] : NULL; PyObject *defaults = (oparg & 0x01) ? stack_pointer[-(1 + ((oparg & 0x08) ? 1 : 0) + ((oparg & 0x04) ? 1 : 0) + ((oparg & 0x02) ? 1 : 0) + ((oparg & 0x01) ? 1 : 0))] : NULL; PyObject *func; - #line 3227 "Python/bytecodes.c" + #line 3228 "Python/bytecodes.c" PyFunctionObject *func_obj = (PyFunctionObject *) PyFunction_New(codeobj, GLOBALS()); @@ -4655,14 +4675,14 @@ func_obj->func_version = ((PyCodeObject *)codeobj)->co_version; func = (PyObject *)func_obj; - #line 4659 "Python/generated_cases.c.h" + #line 4679 "Python/generated_cases.c.h" STACK_SHRINK(((oparg & 0x01) ? 1 : 0) + ((oparg & 0x02) ? 1 : 0) + ((oparg & 0x04) ? 1 : 0) + ((oparg & 0x08) ? 1 : 0)); stack_pointer[-1] = func; DISPATCH(); } TARGET(RETURN_GENERATOR) { - #line 3258 "Python/bytecodes.c" + #line 3259 "Python/bytecodes.c" assert(PyFunction_Check(frame->f_funcobj)); PyFunctionObject *func = (PyFunctionObject *)frame->f_funcobj; PyGenObject *gen = (PyGenObject *)_Py_MakeCoro(func); @@ -4683,7 +4703,7 @@ frame = cframe.current_frame = prev; _PyFrame_StackPush(frame, (PyObject *)gen); goto resume_frame; - #line 4687 "Python/generated_cases.c.h" + #line 4707 "Python/generated_cases.c.h" } TARGET(BUILD_SLICE) { @@ -4691,15 +4711,15 @@ PyObject *stop = stack_pointer[-(1 + ((oparg == 3) ? 1 : 0))]; PyObject *start = stack_pointer[-(2 + ((oparg == 3) ? 1 : 0))]; PyObject *slice; - #line 3281 "Python/bytecodes.c" + #line 3282 "Python/bytecodes.c" slice = PySlice_New(start, stop, step); - #line 4697 "Python/generated_cases.c.h" + #line 4717 "Python/generated_cases.c.h" Py_DECREF(start); Py_DECREF(stop); Py_XDECREF(step); - #line 3283 "Python/bytecodes.c" + #line 3284 "Python/bytecodes.c" if (slice == NULL) { STACK_SHRINK(((oparg == 3) ? 1 : 0)); goto pop_2_error; } - #line 4703 "Python/generated_cases.c.h" + #line 4723 "Python/generated_cases.c.h" STACK_SHRINK(((oparg == 3) ? 1 : 0)); STACK_SHRINK(1); stack_pointer[-1] = slice; @@ -4710,7 +4730,7 @@ PyObject *fmt_spec = ((oparg & FVS_MASK) == FVS_HAVE_SPEC) ? stack_pointer[-((((oparg & FVS_MASK) == FVS_HAVE_SPEC) ? 1 : 0))] : NULL; PyObject *value = stack_pointer[-(1 + (((oparg & FVS_MASK) == FVS_HAVE_SPEC) ? 1 : 0))]; PyObject *result; - #line 3287 "Python/bytecodes.c" + #line 3288 "Python/bytecodes.c" /* Handles f-string value formatting. */ PyObject *(*conv_fn)(PyObject *); int which_conversion = oparg & FVC_MASK; @@ -4745,7 +4765,7 @@ Py_DECREF(value); Py_XDECREF(fmt_spec); if (result == NULL) { STACK_SHRINK((((oparg & FVS_MASK) == FVS_HAVE_SPEC) ? 1 : 0)); goto pop_1_error; } - #line 4749 "Python/generated_cases.c.h" + #line 4769 "Python/generated_cases.c.h" STACK_SHRINK((((oparg & FVS_MASK) == FVS_HAVE_SPEC) ? 1 : 0)); stack_pointer[-1] = result; DISPATCH(); @@ -4754,10 +4774,10 @@ TARGET(COPY) { PyObject *bottom = stack_pointer[-(1 + (oparg-1))]; PyObject *top; - #line 3324 "Python/bytecodes.c" + #line 3325 "Python/bytecodes.c" assert(oparg > 0); top = Py_NewRef(bottom); - #line 4761 "Python/generated_cases.c.h" + #line 4781 "Python/generated_cases.c.h" STACK_GROW(1); stack_pointer[-1] = top; DISPATCH(); @@ -4769,7 +4789,7 @@ PyObject *rhs = stack_pointer[-1]; PyObject *lhs = stack_pointer[-2]; PyObject *res; - #line 3329 "Python/bytecodes.c" + #line 3330 "Python/bytecodes.c" #if ENABLE_SPECIALIZATION _PyBinaryOpCache *cache = (_PyBinaryOpCache *)next_instr; if (ADAPTIVE_COUNTER_IS_ZERO(cache->counter)) { @@ -4784,12 +4804,12 @@ assert((unsigned)oparg < Py_ARRAY_LENGTH(binary_ops)); assert(binary_ops[oparg]); res = binary_ops[oparg](lhs, rhs); - #line 4788 "Python/generated_cases.c.h" + #line 4808 "Python/generated_cases.c.h" Py_DECREF(lhs); Py_DECREF(rhs); - #line 3344 "Python/bytecodes.c" + #line 3345 "Python/bytecodes.c" if (res == NULL) goto pop_2_error; - #line 4793 "Python/generated_cases.c.h" + #line 4813 "Python/generated_cases.c.h" STACK_SHRINK(1); stack_pointer[-1] = res; next_instr += 1; @@ -4799,16 +4819,16 @@ TARGET(SWAP) { PyObject *top = stack_pointer[-1]; PyObject *bottom = stack_pointer[-(2 + (oparg-2))]; - #line 3349 "Python/bytecodes.c" + #line 3350 "Python/bytecodes.c" assert(oparg >= 2); - #line 4805 "Python/generated_cases.c.h" + #line 4825 "Python/generated_cases.c.h" stack_pointer[-1] = bottom; stack_pointer[-(2 + (oparg-2))] = top; DISPATCH(); } TARGET(INSTRUMENTED_INSTRUCTION) { - #line 3353 "Python/bytecodes.c" + #line 3354 "Python/bytecodes.c" int next_opcode = _Py_call_instrumentation_instruction( tstate, frame, next_instr-1); if (next_opcode < 0) goto error; @@ -4820,26 +4840,26 @@ assert(next_opcode > 0 && next_opcode < 256); opcode = next_opcode; DISPATCH_GOTO(); - #line 4824 "Python/generated_cases.c.h" + #line 4844 "Python/generated_cases.c.h" } TARGET(INSTRUMENTED_JUMP_FORWARD) { - #line 3367 "Python/bytecodes.c" + #line 3368 "Python/bytecodes.c" INSTRUMENTED_JUMP(next_instr-1, next_instr+oparg, PY_MONITORING_EVENT_JUMP); - #line 4830 "Python/generated_cases.c.h" + #line 4850 "Python/generated_cases.c.h" DISPATCH(); } TARGET(INSTRUMENTED_JUMP_BACKWARD) { - #line 3371 "Python/bytecodes.c" + #line 3372 "Python/bytecodes.c" INSTRUMENTED_JUMP(next_instr-1, next_instr-oparg, PY_MONITORING_EVENT_JUMP); - #line 4837 "Python/generated_cases.c.h" + #line 4857 "Python/generated_cases.c.h" CHECK_EVAL_BREAKER(); DISPATCH(); } TARGET(INSTRUMENTED_POP_JUMP_IF_TRUE) { - #line 3376 "Python/bytecodes.c" + #line 3377 "Python/bytecodes.c" PyObject *cond = POP(); int err = PyObject_IsTrue(cond); Py_DECREF(cond); @@ -4848,12 +4868,12 @@ assert(err == 0 || err == 1); int offset = err*oparg; INSTRUMENTED_JUMP(here, next_instr + offset, PY_MONITORING_EVENT_BRANCH); - #line 4852 "Python/generated_cases.c.h" + #line 4872 "Python/generated_cases.c.h" DISPATCH(); } TARGET(INSTRUMENTED_POP_JUMP_IF_FALSE) { - #line 3387 "Python/bytecodes.c" + #line 3388 "Python/bytecodes.c" PyObject *cond = POP(); int err = PyObject_IsTrue(cond); Py_DECREF(cond); @@ -4862,12 +4882,12 @@ assert(err == 0 || err == 1); int offset = (1-err)*oparg; INSTRUMENTED_JUMP(here, next_instr + offset, PY_MONITORING_EVENT_BRANCH); - #line 4866 "Python/generated_cases.c.h" + #line 4886 "Python/generated_cases.c.h" DISPATCH(); } TARGET(INSTRUMENTED_POP_JUMP_IF_NONE) { - #line 3398 "Python/bytecodes.c" + #line 3399 "Python/bytecodes.c" PyObject *value = POP(); _Py_CODEUNIT *here = next_instr-1; int offset; @@ -4879,12 +4899,12 @@ offset = 0; } INSTRUMENTED_JUMP(here, next_instr + offset, PY_MONITORING_EVENT_BRANCH); - #line 4883 "Python/generated_cases.c.h" + #line 4903 "Python/generated_cases.c.h" DISPATCH(); } TARGET(INSTRUMENTED_POP_JUMP_IF_NOT_NONE) { - #line 3412 "Python/bytecodes.c" + #line 3413 "Python/bytecodes.c" PyObject *value = POP(); _Py_CODEUNIT *here = next_instr-1; int offset; @@ -4896,30 +4916,30 @@ offset = oparg; } INSTRUMENTED_JUMP(here, next_instr + offset, PY_MONITORING_EVENT_BRANCH); - #line 4900 "Python/generated_cases.c.h" + #line 4920 "Python/generated_cases.c.h" DISPATCH(); } TARGET(EXTENDED_ARG) { - #line 3426 "Python/bytecodes.c" + #line 3427 "Python/bytecodes.c" assert(oparg); opcode = next_instr->op.code; oparg = oparg << 8 | next_instr->op.arg; PRE_DISPATCH_GOTO(); DISPATCH_GOTO(); - #line 4911 "Python/generated_cases.c.h" + #line 4931 "Python/generated_cases.c.h" } TARGET(CACHE) { - #line 3434 "Python/bytecodes.c" + #line 3435 "Python/bytecodes.c" assert(0 && "Executing a cache."); Py_UNREACHABLE(); - #line 4918 "Python/generated_cases.c.h" + #line 4938 "Python/generated_cases.c.h" } TARGET(RESERVED) { - #line 3439 "Python/bytecodes.c" + #line 3440 "Python/bytecodes.c" assert(0 && "Executing RESERVED instruction."); Py_UNREACHABLE(); - #line 4925 "Python/generated_cases.c.h" + #line 4945 "Python/generated_cases.c.h" } diff --git a/Python/instrumentation.c b/Python/instrumentation.c index c70668e8295ae5..218a1d53468865 100644 --- a/Python/instrumentation.c +++ b/Python/instrumentation.c @@ -1493,6 +1493,7 @@ static const uint8_t super_instructions[256] = { [STORE_FAST__LOAD_FAST] = 1, [STORE_FAST__STORE_FAST] = 1, [LOAD_CONST__LOAD_FAST] = 1, + [POP_TOP__STORE_FAST] = 1, }; /* Should use instruction metadata for this */ diff --git a/Python/opcode_metadata.h b/Python/opcode_metadata.h index 75c7dc1218f910..84f1230ddab626 100644 --- a/Python/opcode_metadata.h +++ b/Python/opcode_metadata.h @@ -37,6 +37,8 @@ _PyOpcode_num_popped(int opcode, int oparg, bool jump) { return 1+1; case LOAD_CONST__LOAD_FAST: return 0+0; + case POP_TOP__STORE_FAST: + return 1+1; case POP_TOP: return 1; case PUSH_NULL: @@ -433,6 +435,8 @@ _PyOpcode_num_pushed(int opcode, int oparg, bool jump) { return 0+0; case LOAD_CONST__LOAD_FAST: return 1+1; + case POP_TOP__STORE_FAST: + return 0+0; case POP_TOP: return 0; case PUSH_NULL: @@ -795,7 +799,7 @@ _PyOpcode_num_pushed(int opcode, int oparg, bool jump) { } #endif -enum InstructionFormat { INSTR_FMT_IB, INSTR_FMT_IBC, INSTR_FMT_IBC00, INSTR_FMT_IBC000, INSTR_FMT_IBC00000000, INSTR_FMT_IBIB, INSTR_FMT_IX, INSTR_FMT_IXC, INSTR_FMT_IXC000 }; +enum InstructionFormat { INSTR_FMT_IB, INSTR_FMT_IBC, INSTR_FMT_IBC00, INSTR_FMT_IBC000, INSTR_FMT_IBC00000000, INSTR_FMT_IBIB, INSTR_FMT_IX, INSTR_FMT_IXC, INSTR_FMT_IXC000, INSTR_FMT_IXIB }; struct opcode_metadata { bool valid_entry; enum InstructionFormat instr_format; @@ -819,6 +823,7 @@ const struct opcode_metadata _PyOpcode_opcode_metadata[256] = { [STORE_FAST__LOAD_FAST] = { true, INSTR_FMT_IBIB }, [STORE_FAST__STORE_FAST] = { true, INSTR_FMT_IBIB }, [LOAD_CONST__LOAD_FAST] = { true, INSTR_FMT_IBIB }, + [POP_TOP__STORE_FAST] = { true, INSTR_FMT_IXIB }, [POP_TOP] = { true, INSTR_FMT_IX }, [PUSH_NULL] = { true, INSTR_FMT_IX }, [END_FOR] = { true, INSTR_FMT_IB }, diff --git a/Python/opcode_targets.h b/Python/opcode_targets.h index 3add06362711c9..fb563cf11077e4 100644 --- a/Python/opcode_targets.h +++ b/Python/opcode_targets.h @@ -168,7 +168,7 @@ static void *opcode_targets[256] = { &&TARGET_UNPACK_SEQUENCE_TUPLE, &&TARGET_UNPACK_SEQUENCE_TWO_TUPLE, &&TARGET_SEND_GEN, - &&_unknown_opcode, + &&TARGET_POP_TOP__STORE_FAST, &&_unknown_opcode, &&TARGET_CALL, &&TARGET_KW_NAMES, diff --git a/Python/specialize.c b/Python/specialize.c index f1684913b1bc30..04a0febea48008 100644 --- a/Python/specialize.c +++ b/Python/specialize.c @@ -298,6 +298,9 @@ _PyCode_Quicken(PyCodeObject *code) case STORE_FAST << 8 | STORE_FAST: instructions[i - 1].op.code = STORE_FAST__STORE_FAST; break; + case POP_TOP << 8 | STORE_FAST: + instructions[i - 1].op.code = POP_TOP__STORE_FAST; + break; } } #endif /* ENABLE_SPECIALIZATION */ From 553b361803eeaccc8d0be2103377f5fb387ebdc9 Mon Sep 17 00:00:00 2001 From: Dong-hee Na Date: Sun, 28 May 2023 22:41:31 +0900 Subject: [PATCH 03/13] Only when same line number --- Python/flowgraph.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Python/flowgraph.c b/Python/flowgraph.c index a6639a26503801..e20cf725b8deb4 100644 --- a/Python/flowgraph.c +++ b/Python/flowgraph.c @@ -1516,7 +1516,9 @@ optimize_basic_block(PyObject *const_cache, basicblock *bb, PyObject *consts) } break; case STORE_FAST: - if (opcode == nextop && oparg == bb->b_instr[i+1].i_oparg) { + if (opcode == nextop && + oparg == bb->b_instr[i+1].i_oparg && + bb->b_instr[i].i_loc.lineno == bb->b_instr[i+1].i_loc.lineno) { bb->b_instr[i].i_opcode = POP_TOP; bb->b_instr[i].i_oparg = 0; } From 0b601dc5b6ca71a3eb746a0208aa049df1c6d78c Mon Sep 17 00:00:00 2001 From: Dong-hee Na Date: Sun, 28 May 2023 22:44:53 +0900 Subject: [PATCH 04/13] remove white space --- Python/flowgraph.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Python/flowgraph.c b/Python/flowgraph.c index e20cf725b8deb4..f5f0ff7120923d 100644 --- a/Python/flowgraph.c +++ b/Python/flowgraph.c @@ -1516,8 +1516,8 @@ optimize_basic_block(PyObject *const_cache, basicblock *bb, PyObject *consts) } break; case STORE_FAST: - if (opcode == nextop && - oparg == bb->b_instr[i+1].i_oparg && + if (opcode == nextop && + oparg == bb->b_instr[i+1].i_oparg && bb->b_instr[i].i_loc.lineno == bb->b_instr[i+1].i_loc.lineno) { bb->b_instr[i].i_opcode = POP_TOP; bb->b_instr[i].i_oparg = 0; From 9039dfe831de5cfe80350eec9b54e4527f66d587 Mon Sep 17 00:00:00 2001 From: Dong-hee Na Date: Sun, 28 May 2023 23:25:37 +0900 Subject: [PATCH 05/13] Implement POP_TOP__POP_TOP --- Include/internal/pycore_opcode.h | 4 ++-- Include/opcode.h | 3 ++- Lib/opcode.py | 1 + Python/bytecodes.c | 1 + Python/generated_cases.c.h | 16 ++++++++++++++++ Python/opcode_metadata.h | 7 ++++++- Python/opcode_targets.h | 2 +- Python/specialize.c | 3 +++ 8 files changed, 32 insertions(+), 5 deletions(-) diff --git a/Include/internal/pycore_opcode.h b/Include/internal/pycore_opcode.h index c1e2a1e138dde0..beeab77a1d6767 100644 --- a/Include/internal/pycore_opcode.h +++ b/Include/internal/pycore_opcode.h @@ -201,6 +201,7 @@ const uint8_t _PyOpcode_Deopt[256] = { [POP_JUMP_IF_NOT_NONE] = POP_JUMP_IF_NOT_NONE, [POP_JUMP_IF_TRUE] = POP_JUMP_IF_TRUE, [POP_TOP] = POP_TOP, + [POP_TOP__POP_TOP] = POP_TOP, [POP_TOP__STORE_FAST] = POP_TOP, [PUSH_EXC_INFO] = PUSH_EXC_INFO, [PUSH_NULL] = PUSH_NULL, @@ -415,8 +416,8 @@ static const char *const _PyOpcode_OpName[267] = { [UNPACK_SEQUENCE_TUPLE] = "UNPACK_SEQUENCE_TUPLE", [UNPACK_SEQUENCE_TWO_TUPLE] = "UNPACK_SEQUENCE_TWO_TUPLE", [SEND_GEN] = "SEND_GEN", + [POP_TOP__POP_TOP] = "POP_TOP__POP_TOP", [POP_TOP__STORE_FAST] = "POP_TOP__STORE_FAST", - [170] = "<170>", [CALL] = "CALL", [KW_NAMES] = "KW_NAMES", [CALL_INTRINSIC_1] = "CALL_INTRINSIC_1", @@ -517,7 +518,6 @@ static const char *const _PyOpcode_OpName[267] = { #endif #define EXTRA_CASES \ - case 170: \ case 177: \ case 178: \ case 179: \ diff --git a/Include/opcode.h b/Include/opcode.h index 02dd9427090aa4..fe239b92441fe3 100644 --- a/Include/opcode.h +++ b/Include/opcode.h @@ -216,7 +216,8 @@ extern "C" { #define UNPACK_SEQUENCE_TUPLE 166 #define UNPACK_SEQUENCE_TWO_TUPLE 167 #define SEND_GEN 168 -#define POP_TOP__STORE_FAST 169 +#define POP_TOP__POP_TOP 169 +#define POP_TOP__STORE_FAST 170 #define HAS_ARG(op) ((((op) >= HAVE_ARGUMENT) && (!IS_PSEUDO_OPCODE(op)))\ || ((op) == JUMP) \ diff --git a/Lib/opcode.py b/Lib/opcode.py index c5ab4c11130481..c8051129467a5d 100644 --- a/Lib/opcode.py +++ b/Lib/opcode.py @@ -436,6 +436,7 @@ def pseudo_op(name, op, real_ops): "SEND_GEN", ], "POP_TOP": [ + "POP_TOP__POP_TOP", "POP_TOP__STORE_FAST" ] } diff --git a/Python/bytecodes.c b/Python/bytecodes.c index ea197fdb7735d9..c54308e46eba73 100644 --- a/Python/bytecodes.c +++ b/Python/bytecodes.c @@ -213,6 +213,7 @@ dummy_func( super(STORE_FAST__LOAD_FAST) = STORE_FAST + LOAD_FAST; super(STORE_FAST__STORE_FAST) = STORE_FAST + STORE_FAST; super(LOAD_CONST__LOAD_FAST) = LOAD_CONST + LOAD_FAST; + super(POP_TOP__POP_TOP) = POP_TOP + POP_TOP; super(POP_TOP__STORE_FAST) = POP_TOP + STORE_FAST; inst(POP_TOP, (value --)) { diff --git a/Python/generated_cases.c.h b/Python/generated_cases.c.h index bf37b2bfb03449..d90e0641f58b99 100644 --- a/Python/generated_cases.c.h +++ b/Python/generated_cases.c.h @@ -249,6 +249,22 @@ DISPATCH(); } + TARGET(POP_TOP__POP_TOP) { + PyObject *_tmp_1 = stack_pointer[-1]; + PyObject *_tmp_2 = stack_pointer[-2]; + { + PyObject *value = _tmp_1; + Py_DECREF(value); + } + oparg = (next_instr++)->op.arg; + { + PyObject *value = _tmp_2; + Py_DECREF(value); + } + STACK_SHRINK(2); + DISPATCH(); + } + TARGET(POP_TOP__STORE_FAST) { PyObject *_tmp_1 = stack_pointer[-1]; PyObject *_tmp_2 = stack_pointer[-2]; diff --git a/Python/opcode_metadata.h b/Python/opcode_metadata.h index 84f1230ddab626..c35f3571c817f7 100644 --- a/Python/opcode_metadata.h +++ b/Python/opcode_metadata.h @@ -37,6 +37,8 @@ _PyOpcode_num_popped(int opcode, int oparg, bool jump) { return 1+1; case LOAD_CONST__LOAD_FAST: return 0+0; + case POP_TOP__POP_TOP: + return 1+1; case POP_TOP__STORE_FAST: return 1+1; case POP_TOP: @@ -435,6 +437,8 @@ _PyOpcode_num_pushed(int opcode, int oparg, bool jump) { return 0+0; case LOAD_CONST__LOAD_FAST: return 1+1; + case POP_TOP__POP_TOP: + return 0+0; case POP_TOP__STORE_FAST: return 0+0; case POP_TOP: @@ -799,7 +803,7 @@ _PyOpcode_num_pushed(int opcode, int oparg, bool jump) { } #endif -enum InstructionFormat { INSTR_FMT_IB, INSTR_FMT_IBC, INSTR_FMT_IBC00, INSTR_FMT_IBC000, INSTR_FMT_IBC00000000, INSTR_FMT_IBIB, INSTR_FMT_IX, INSTR_FMT_IXC, INSTR_FMT_IXC000, INSTR_FMT_IXIB }; +enum InstructionFormat { INSTR_FMT_IB, INSTR_FMT_IBC, INSTR_FMT_IBC00, INSTR_FMT_IBC000, INSTR_FMT_IBC00000000, INSTR_FMT_IBIB, INSTR_FMT_IX, INSTR_FMT_IXC, INSTR_FMT_IXC000, INSTR_FMT_IXIB, INSTR_FMT_IXIX }; struct opcode_metadata { bool valid_entry; enum InstructionFormat instr_format; @@ -823,6 +827,7 @@ const struct opcode_metadata _PyOpcode_opcode_metadata[256] = { [STORE_FAST__LOAD_FAST] = { true, INSTR_FMT_IBIB }, [STORE_FAST__STORE_FAST] = { true, INSTR_FMT_IBIB }, [LOAD_CONST__LOAD_FAST] = { true, INSTR_FMT_IBIB }, + [POP_TOP__POP_TOP] = { true, INSTR_FMT_IXIX }, [POP_TOP__STORE_FAST] = { true, INSTR_FMT_IXIB }, [POP_TOP] = { true, INSTR_FMT_IX }, [PUSH_NULL] = { true, INSTR_FMT_IX }, diff --git a/Python/opcode_targets.h b/Python/opcode_targets.h index fb563cf11077e4..9742c52bba4986 100644 --- a/Python/opcode_targets.h +++ b/Python/opcode_targets.h @@ -168,8 +168,8 @@ static void *opcode_targets[256] = { &&TARGET_UNPACK_SEQUENCE_TUPLE, &&TARGET_UNPACK_SEQUENCE_TWO_TUPLE, &&TARGET_SEND_GEN, + &&TARGET_POP_TOP__POP_TOP, &&TARGET_POP_TOP__STORE_FAST, - &&_unknown_opcode, &&TARGET_CALL, &&TARGET_KW_NAMES, &&TARGET_CALL_INTRINSIC_1, diff --git a/Python/specialize.c b/Python/specialize.c index 04a0febea48008..79fa5acb8a1577 100644 --- a/Python/specialize.c +++ b/Python/specialize.c @@ -301,6 +301,9 @@ _PyCode_Quicken(PyCodeObject *code) case POP_TOP << 8 | STORE_FAST: instructions[i - 1].op.code = POP_TOP__STORE_FAST; break; + case POP_TOP << 8 | POP_TOP: + instructions[i - 1].op.code = POP_TOP__POP_TOP; + break; } } #endif /* ENABLE_SPECIALIZATION */ From 067fc536423d833fbc3757943e87119f9e99248c Mon Sep 17 00:00:00 2001 From: Dong-hee Na Date: Wed, 31 May 2023 14:53:06 +0900 Subject: [PATCH 06/13] Address code review --- Include/internal/pycore_opcode_utils.h | 1 + Python/instrumentation.c | 1 + 2 files changed, 2 insertions(+) diff --git a/Include/internal/pycore_opcode_utils.h b/Include/internal/pycore_opcode_utils.h index faf6614622c80d..7c1c745cbcc0cf 100644 --- a/Include/internal/pycore_opcode_utils.h +++ b/Include/internal/pycore_opcode_utils.h @@ -61,6 +61,7 @@ extern "C" { (opcode) == LOAD_CONST__LOAD_FAST || \ (opcode) == STORE_FAST__LOAD_FAST || \ (opcode) == STORE_FAST__STORE_FAST) || \ + (opcode) == POP_TOP__POP_TOP || \ (opcode) == POP_TOP__STORE_FAST diff --git a/Python/instrumentation.c b/Python/instrumentation.c index 218a1d53468865..c089e333b11bfe 100644 --- a/Python/instrumentation.c +++ b/Python/instrumentation.c @@ -1493,6 +1493,7 @@ static const uint8_t super_instructions[256] = { [STORE_FAST__LOAD_FAST] = 1, [STORE_FAST__STORE_FAST] = 1, [LOAD_CONST__LOAD_FAST] = 1, + [POP_TOP__POP_TOP] = 1, [POP_TOP__STORE_FAST] = 1, }; From 827fd69236a6bcfb4ce07458be0fc9a362718ffe Mon Sep 17 00:00:00 2001 From: Dong-hee Na Date: Wed, 31 May 2023 16:53:59 +0900 Subject: [PATCH 07/13] Add NEWS.d --- .../2023-05-31-16-53-17.gh-issue-104635.iwf0d8.rst | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 Misc/NEWS.d/next/Core and Builtins/2023-05-31-16-53-17.gh-issue-104635.iwf0d8.rst diff --git a/Misc/NEWS.d/next/Core and Builtins/2023-05-31-16-53-17.gh-issue-104635.iwf0d8.rst b/Misc/NEWS.d/next/Core and Builtins/2023-05-31-16-53-17.gh-issue-104635.iwf0d8.rst new file mode 100644 index 00000000000000..c915bf0c02c6f0 --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2023-05-31-16-53-17.gh-issue-104635.iwf0d8.rst @@ -0,0 +1,2 @@ +The basic dead store elimination is adopted in the basic block optimization +process. Patch by Dong-hee Na and Carl Meyer. From 99a2ceabb9a4f1810b4d17e26b8632fa1c3b8362 Mon Sep 17 00:00:00 2001 From: Dong-hee Na Date: Wed, 31 May 2023 18:22:36 +0900 Subject: [PATCH 08/13] Add test code --- Lib/test/test_peepholer.py | 47 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/Lib/test/test_peepholer.py b/Lib/test/test_peepholer.py index 006ee15c7b8f71..07a50e82a077a3 100644 --- a/Lib/test/test_peepholer.py +++ b/Lib/test/test_peepholer.py @@ -1083,5 +1083,52 @@ def test_no_unsafe_static_swap(self): ] self.cfg_optimization_test(insts, expected_insts, consts=list(range(3)), nlocals=1) + def test_dead_store_elimination_in_same_lineno(self): + insts = [ + ('LOAD_CONST', 0, 1), + ('LOAD_CONST', 1, 2), + ('LOAD_CONST', 2, 3), + ('SWAP', 3, 4), + ('STORE_FAST', 1, 4), + ('STORE_FAST', 1, 4), + ('STORE_FAST', 1, 4), + ('RETURN_VALUE', 5) + ] + expected_insts = [ + ('LOAD_CONST', 0, 1), + ('LOAD_CONST', 1, 2), + ('LOAD_CONST', 2, 3), + ('SWAP', 3, 4), + ('POP_TOP', 0, 4), + ('POP_TOP', 0, 4), + ('STORE_FAST', 1, 4), + ('RETURN_VALUE', 5) + ] + self.cfg_optimization_test(insts, expected_insts, consts=list(range(3)), nlocals=1) + + def test_no_dead_store_elimination_in_different_lineno(self): + insts = [ + ('LOAD_CONST', 0, 1), + ('LOAD_CONST', 1, 2), + ('LOAD_CONST', 2, 3), + ('SWAP', 3, 4), + ('STORE_FAST', 1, 4), + ('STORE_FAST', 1, 5), + ('STORE_FAST', 1, 6), + ('RETURN_VALUE', 5) + ] + expected_insts = [ + ('LOAD_CONST', 0, 1), + ('LOAD_CONST', 1, 2), + ('LOAD_CONST', 2, 3), + ('SWAP', 3, 4), + ('STORE_FAST', 1, 4), + ('STORE_FAST', 1, 5), + ('STORE_FAST', 1, 6), + ('RETURN_VALUE', 5) + ] + self.cfg_optimization_test(insts, expected_insts, consts=list(range(3)), nlocals=1) + + if __name__ == "__main__": unittest.main() From 69c1aaeee5daf3ed4c8a7ac11a47382055b3da0d Mon Sep 17 00:00:00 2001 From: Dong-hee Na Date: Thu, 1 Jun 2023 01:22:30 +0900 Subject: [PATCH 09/13] fix --- Python/generated_cases.c.h | 974 +++++++++++++++++++------------------ 1 file changed, 489 insertions(+), 485 deletions(-) diff --git a/Python/generated_cases.c.h b/Python/generated_cases.c.h index d90e0641f58b99..19bd70d7001cbe 100644 --- a/Python/generated_cases.c.h +++ b/Python/generated_cases.c.h @@ -254,11 +254,15 @@ PyObject *_tmp_2 = stack_pointer[-2]; { PyObject *value = _tmp_1; + #line 220 "Python/bytecodes.c" + #line 259 "Python/generated_cases.c.h" Py_DECREF(value); } oparg = (next_instr++)->op.arg; { PyObject *value = _tmp_2; + #line 220 "Python/bytecodes.c" + #line 266 "Python/generated_cases.c.h" Py_DECREF(value); } STACK_SHRINK(2); @@ -270,8 +274,8 @@ PyObject *_tmp_2 = stack_pointer[-2]; { PyObject *value = _tmp_1; - #line 219 "Python/bytecodes.c" - #line 259 "Python/generated_cases.c.h" + #line 220 "Python/bytecodes.c" + #line 279 "Python/generated_cases.c.h" Py_DECREF(value); } oparg = (next_instr++)->op.arg; @@ -279,7 +283,7 @@ PyObject *value = _tmp_2; #line 208 "Python/bytecodes.c" SETLOCAL(oparg, value); - #line 267 "Python/generated_cases.c.h" + #line 287 "Python/generated_cases.c.h" } STACK_SHRINK(2); DISPATCH(); @@ -287,8 +291,8 @@ TARGET(POP_TOP) { PyObject *value = stack_pointer[-1]; - #line 219 "Python/bytecodes.c" - #line 276 "Python/generated_cases.c.h" + #line 220 "Python/bytecodes.c" + #line 296 "Python/generated_cases.c.h" Py_DECREF(value); STACK_SHRINK(1); DISPATCH(); @@ -296,9 +300,9 @@ TARGET(PUSH_NULL) { PyObject *res; - #line 223 "Python/bytecodes.c" + #line 224 "Python/bytecodes.c" res = NULL; - #line 286 "Python/generated_cases.c.h" + #line 306 "Python/generated_cases.c.h" STACK_GROW(1); stack_pointer[-1] = res; DISPATCH(); @@ -309,14 +313,14 @@ PyObject *_tmp_2 = stack_pointer[-2]; { PyObject *value = _tmp_1; - #line 219 "Python/bytecodes.c" - #line 298 "Python/generated_cases.c.h" + #line 220 "Python/bytecodes.c" + #line 318 "Python/generated_cases.c.h" Py_DECREF(value); } { PyObject *value = _tmp_2; - #line 219 "Python/bytecodes.c" - #line 304 "Python/generated_cases.c.h" + #line 220 "Python/bytecodes.c" + #line 324 "Python/generated_cases.c.h" Py_DECREF(value); } STACK_SHRINK(2); @@ -326,7 +330,7 @@ TARGET(INSTRUMENTED_END_FOR) { PyObject *value = stack_pointer[-1]; PyObject *receiver = stack_pointer[-2]; - #line 229 "Python/bytecodes.c" + #line 230 "Python/bytecodes.c" /* Need to create a fake StopIteration error here, * to conform to PEP 380 */ if (PyGen_Check(receiver)) { @@ -336,7 +340,7 @@ } PyErr_SetRaisedException(NULL); } - #line 324 "Python/generated_cases.c.h" + #line 344 "Python/generated_cases.c.h" Py_DECREF(receiver); Py_DECREF(value); STACK_SHRINK(2); @@ -346,9 +350,9 @@ TARGET(END_SEND) { PyObject *value = stack_pointer[-1]; PyObject *receiver = stack_pointer[-2]; - #line 242 "Python/bytecodes.c" + #line 243 "Python/bytecodes.c" Py_DECREF(receiver); - #line 336 "Python/generated_cases.c.h" + #line 356 "Python/generated_cases.c.h" STACK_SHRINK(1); stack_pointer[-1] = value; DISPATCH(); @@ -357,7 +361,7 @@ TARGET(INSTRUMENTED_END_SEND) { PyObject *value = stack_pointer[-1]; PyObject *receiver = stack_pointer[-2]; - #line 246 "Python/bytecodes.c" + #line 247 "Python/bytecodes.c" if (PyGen_Check(receiver) || PyCoro_CheckExact(receiver)) { PyErr_SetObject(PyExc_StopIteration, value); if (monitor_stop_iteration(tstate, frame, next_instr-1)) { @@ -366,7 +370,7 @@ PyErr_SetRaisedException(NULL); } Py_DECREF(receiver); - #line 354 "Python/generated_cases.c.h" + #line 374 "Python/generated_cases.c.h" STACK_SHRINK(1); stack_pointer[-1] = value; DISPATCH(); @@ -375,13 +379,13 @@ TARGET(UNARY_NEGATIVE) { PyObject *value = stack_pointer[-1]; PyObject *res; - #line 257 "Python/bytecodes.c" + #line 258 "Python/bytecodes.c" res = PyNumber_Negative(value); - #line 365 "Python/generated_cases.c.h" + #line 385 "Python/generated_cases.c.h" Py_DECREF(value); - #line 259 "Python/bytecodes.c" + #line 260 "Python/bytecodes.c" if (res == NULL) goto pop_1_error; - #line 369 "Python/generated_cases.c.h" + #line 389 "Python/generated_cases.c.h" stack_pointer[-1] = res; DISPATCH(); } @@ -389,11 +393,11 @@ TARGET(UNARY_NOT) { PyObject *value = stack_pointer[-1]; PyObject *res; - #line 263 "Python/bytecodes.c" + #line 264 "Python/bytecodes.c" int err = PyObject_IsTrue(value); - #line 379 "Python/generated_cases.c.h" + #line 399 "Python/generated_cases.c.h" Py_DECREF(value); - #line 265 "Python/bytecodes.c" + #line 266 "Python/bytecodes.c" if (err < 0) goto pop_1_error; if (err == 0) { res = Py_True; @@ -401,7 +405,7 @@ else { res = Py_False; } - #line 389 "Python/generated_cases.c.h" + #line 409 "Python/generated_cases.c.h" stack_pointer[-1] = res; DISPATCH(); } @@ -409,13 +413,13 @@ TARGET(UNARY_INVERT) { PyObject *value = stack_pointer[-1]; PyObject *res; - #line 275 "Python/bytecodes.c" + #line 276 "Python/bytecodes.c" res = PyNumber_Invert(value); - #line 399 "Python/generated_cases.c.h" + #line 419 "Python/generated_cases.c.h" Py_DECREF(value); - #line 277 "Python/bytecodes.c" + #line 278 "Python/bytecodes.c" if (res == NULL) goto pop_1_error; - #line 403 "Python/generated_cases.c.h" + #line 423 "Python/generated_cases.c.h" stack_pointer[-1] = res; DISPATCH(); } @@ -426,10 +430,10 @@ { PyObject *right = _tmp_1; PyObject *left = _tmp_2; - #line 293 "Python/bytecodes.c" + #line 294 "Python/bytecodes.c" DEOPT_IF(!PyLong_CheckExact(left), BINARY_OP); DEOPT_IF(!PyLong_CheckExact(right), BINARY_OP); - #line 417 "Python/generated_cases.c.h" + #line 437 "Python/generated_cases.c.h" _tmp_2 = left; _tmp_1 = right; } @@ -437,13 +441,13 @@ PyObject *right = _tmp_1; PyObject *left = _tmp_2; PyObject *res; - #line 298 "Python/bytecodes.c" + #line 299 "Python/bytecodes.c" STAT_INC(BINARY_OP, hit); res = _PyLong_Multiply((PyLongObject *)left, (PyLongObject *)right); _Py_DECREF_SPECIALIZED(right, (destructor)PyObject_Free); _Py_DECREF_SPECIALIZED(left, (destructor)PyObject_Free); if (res == NULL) goto pop_2_error; - #line 431 "Python/generated_cases.c.h" + #line 451 "Python/generated_cases.c.h" _tmp_2 = res; } next_instr += 1; @@ -458,10 +462,10 @@ { PyObject *right = _tmp_1; PyObject *left = _tmp_2; - #line 293 "Python/bytecodes.c" + #line 294 "Python/bytecodes.c" DEOPT_IF(!PyLong_CheckExact(left), BINARY_OP); DEOPT_IF(!PyLong_CheckExact(right), BINARY_OP); - #line 449 "Python/generated_cases.c.h" + #line 469 "Python/generated_cases.c.h" _tmp_2 = left; _tmp_1 = right; } @@ -469,13 +473,13 @@ PyObject *right = _tmp_1; PyObject *left = _tmp_2; PyObject *res; - #line 306 "Python/bytecodes.c" + #line 307 "Python/bytecodes.c" STAT_INC(BINARY_OP, hit); res = _PyLong_Add((PyLongObject *)left, (PyLongObject *)right); _Py_DECREF_SPECIALIZED(right, (destructor)PyObject_Free); _Py_DECREF_SPECIALIZED(left, (destructor)PyObject_Free); if (res == NULL) goto pop_2_error; - #line 463 "Python/generated_cases.c.h" + #line 483 "Python/generated_cases.c.h" _tmp_2 = res; } next_instr += 1; @@ -490,10 +494,10 @@ { PyObject *right = _tmp_1; PyObject *left = _tmp_2; - #line 293 "Python/bytecodes.c" + #line 294 "Python/bytecodes.c" DEOPT_IF(!PyLong_CheckExact(left), BINARY_OP); DEOPT_IF(!PyLong_CheckExact(right), BINARY_OP); - #line 481 "Python/generated_cases.c.h" + #line 501 "Python/generated_cases.c.h" _tmp_2 = left; _tmp_1 = right; } @@ -501,13 +505,13 @@ PyObject *right = _tmp_1; PyObject *left = _tmp_2; PyObject *res; - #line 314 "Python/bytecodes.c" + #line 315 "Python/bytecodes.c" STAT_INC(BINARY_OP, hit); res = _PyLong_Subtract((PyLongObject *)left, (PyLongObject *)right); _Py_DECREF_SPECIALIZED(right, (destructor)PyObject_Free); _Py_DECREF_SPECIALIZED(left, (destructor)PyObject_Free); if (res == NULL) goto pop_2_error; - #line 495 "Python/generated_cases.c.h" + #line 515 "Python/generated_cases.c.h" _tmp_2 = res; } next_instr += 1; @@ -522,10 +526,10 @@ { PyObject *right = _tmp_1; PyObject *left = _tmp_2; - #line 329 "Python/bytecodes.c" + #line 330 "Python/bytecodes.c" DEOPT_IF(!PyFloat_CheckExact(left), BINARY_OP); DEOPT_IF(!PyFloat_CheckExact(right), BINARY_OP); - #line 513 "Python/generated_cases.c.h" + #line 533 "Python/generated_cases.c.h" _tmp_2 = left; _tmp_1 = right; } @@ -533,13 +537,13 @@ PyObject *right = _tmp_1; PyObject *left = _tmp_2; PyObject *res; - #line 334 "Python/bytecodes.c" + #line 335 "Python/bytecodes.c" STAT_INC(BINARY_OP, hit); double dres = ((PyFloatObject *)left)->ob_fval * ((PyFloatObject *)right)->ob_fval; DECREF_INPUTS_AND_REUSE_FLOAT(left, right, dres, res); - #line 527 "Python/generated_cases.c.h" + #line 547 "Python/generated_cases.c.h" _tmp_2 = res; } next_instr += 1; @@ -554,10 +558,10 @@ { PyObject *right = _tmp_1; PyObject *left = _tmp_2; - #line 329 "Python/bytecodes.c" + #line 330 "Python/bytecodes.c" DEOPT_IF(!PyFloat_CheckExact(left), BINARY_OP); DEOPT_IF(!PyFloat_CheckExact(right), BINARY_OP); - #line 545 "Python/generated_cases.c.h" + #line 565 "Python/generated_cases.c.h" _tmp_2 = left; _tmp_1 = right; } @@ -565,13 +569,13 @@ PyObject *right = _tmp_1; PyObject *left = _tmp_2; PyObject *res; - #line 342 "Python/bytecodes.c" + #line 343 "Python/bytecodes.c" STAT_INC(BINARY_OP, hit); double dres = ((PyFloatObject *)left)->ob_fval + ((PyFloatObject *)right)->ob_fval; DECREF_INPUTS_AND_REUSE_FLOAT(left, right, dres, res); - #line 559 "Python/generated_cases.c.h" + #line 579 "Python/generated_cases.c.h" _tmp_2 = res; } next_instr += 1; @@ -586,10 +590,10 @@ { PyObject *right = _tmp_1; PyObject *left = _tmp_2; - #line 329 "Python/bytecodes.c" + #line 330 "Python/bytecodes.c" DEOPT_IF(!PyFloat_CheckExact(left), BINARY_OP); DEOPT_IF(!PyFloat_CheckExact(right), BINARY_OP); - #line 577 "Python/generated_cases.c.h" + #line 597 "Python/generated_cases.c.h" _tmp_2 = left; _tmp_1 = right; } @@ -597,13 +601,13 @@ PyObject *right = _tmp_1; PyObject *left = _tmp_2; PyObject *res; - #line 350 "Python/bytecodes.c" + #line 351 "Python/bytecodes.c" STAT_INC(BINARY_OP, hit); double dres = ((PyFloatObject *)left)->ob_fval - ((PyFloatObject *)right)->ob_fval; DECREF_INPUTS_AND_REUSE_FLOAT(left, right, dres, res); - #line 591 "Python/generated_cases.c.h" + #line 611 "Python/generated_cases.c.h" _tmp_2 = res; } next_instr += 1; @@ -618,10 +622,10 @@ { PyObject *right = _tmp_1; PyObject *left = _tmp_2; - #line 365 "Python/bytecodes.c" + #line 366 "Python/bytecodes.c" DEOPT_IF(!PyUnicode_CheckExact(left), BINARY_OP); DEOPT_IF(!PyUnicode_CheckExact(right), BINARY_OP); - #line 609 "Python/generated_cases.c.h" + #line 629 "Python/generated_cases.c.h" _tmp_2 = left; _tmp_1 = right; } @@ -629,13 +633,13 @@ PyObject *right = _tmp_1; PyObject *left = _tmp_2; PyObject *res; - #line 370 "Python/bytecodes.c" + #line 371 "Python/bytecodes.c" STAT_INC(BINARY_OP, hit); res = PyUnicode_Concat(left, right); _Py_DECREF_SPECIALIZED(left, _PyUnicode_ExactDealloc); _Py_DECREF_SPECIALIZED(right, _PyUnicode_ExactDealloc); if (res == NULL) goto pop_2_error; - #line 623 "Python/generated_cases.c.h" + #line 643 "Python/generated_cases.c.h" _tmp_2 = res; } next_instr += 1; @@ -650,17 +654,17 @@ { PyObject *right = _tmp_1; PyObject *left = _tmp_2; - #line 365 "Python/bytecodes.c" + #line 366 "Python/bytecodes.c" DEOPT_IF(!PyUnicode_CheckExact(left), BINARY_OP); DEOPT_IF(!PyUnicode_CheckExact(right), BINARY_OP); - #line 641 "Python/generated_cases.c.h" + #line 661 "Python/generated_cases.c.h" _tmp_2 = left; _tmp_1 = right; } { PyObject *right = _tmp_1; PyObject *left = _tmp_2; - #line 387 "Python/bytecodes.c" + #line 388 "Python/bytecodes.c" _Py_CODEUNIT true_next = next_instr[INLINE_CACHE_ENTRIES_BINARY_OP]; assert(true_next.op.code == STORE_FAST || true_next.op.code == STORE_FAST__LOAD_FAST); @@ -685,7 +689,7 @@ if (*target_local == NULL) goto pop_2_error; // The STORE_FAST is already done. JUMPBY(INLINE_CACHE_ENTRIES_BINARY_OP + 1); - #line 673 "Python/generated_cases.c.h" + #line 693 "Python/generated_cases.c.h" } STACK_SHRINK(2); DISPATCH(); @@ -697,7 +701,7 @@ PyObject *sub = stack_pointer[-1]; PyObject *container = stack_pointer[-2]; PyObject *res; - #line 425 "Python/bytecodes.c" + #line 426 "Python/bytecodes.c" #if ENABLE_SPECIALIZATION _PyBinarySubscrCache *cache = (_PyBinarySubscrCache *)next_instr; if (ADAPTIVE_COUNTER_IS_ZERO(cache->counter)) { @@ -709,12 +713,12 @@ DECREMENT_ADAPTIVE_COUNTER(cache->counter); #endif /* ENABLE_SPECIALIZATION */ res = PyObject_GetItem(container, sub); - #line 697 "Python/generated_cases.c.h" + #line 717 "Python/generated_cases.c.h" Py_DECREF(container); Py_DECREF(sub); - #line 437 "Python/bytecodes.c" + #line 438 "Python/bytecodes.c" if (res == NULL) goto pop_2_error; - #line 702 "Python/generated_cases.c.h" + #line 722 "Python/generated_cases.c.h" STACK_SHRINK(1); stack_pointer[-1] = res; next_instr += 1; @@ -726,7 +730,7 @@ PyObject *start = stack_pointer[-2]; PyObject *container = stack_pointer[-3]; PyObject *res; - #line 441 "Python/bytecodes.c" + #line 442 "Python/bytecodes.c" PyObject *slice = _PyBuildSlice_ConsumeRefs(start, stop); // Can't use ERROR_IF() here, because we haven't // DECREF'ed container yet, and we still own slice. @@ -739,7 +743,7 @@ } Py_DECREF(container); if (res == NULL) goto pop_3_error; - #line 727 "Python/generated_cases.c.h" + #line 747 "Python/generated_cases.c.h" STACK_SHRINK(2); stack_pointer[-1] = res; DISPATCH(); @@ -750,7 +754,7 @@ PyObject *start = stack_pointer[-2]; PyObject *container = stack_pointer[-3]; PyObject *v = stack_pointer[-4]; - #line 456 "Python/bytecodes.c" + #line 457 "Python/bytecodes.c" PyObject *slice = _PyBuildSlice_ConsumeRefs(start, stop); int err; if (slice == NULL) { @@ -763,7 +767,7 @@ Py_DECREF(v); Py_DECREF(container); if (err) goto pop_4_error; - #line 751 "Python/generated_cases.c.h" + #line 771 "Python/generated_cases.c.h" STACK_SHRINK(4); DISPATCH(); } @@ -772,7 +776,7 @@ PyObject *sub = stack_pointer[-1]; PyObject *list = stack_pointer[-2]; PyObject *res; - #line 471 "Python/bytecodes.c" + #line 472 "Python/bytecodes.c" DEOPT_IF(!PyLong_CheckExact(sub), BINARY_SUBSCR); DEOPT_IF(!PyList_CheckExact(list), BINARY_SUBSCR); @@ -786,7 +790,7 @@ Py_INCREF(res); _Py_DECREF_SPECIALIZED(sub, (destructor)PyObject_Free); Py_DECREF(list); - #line 774 "Python/generated_cases.c.h" + #line 794 "Python/generated_cases.c.h" STACK_SHRINK(1); stack_pointer[-1] = res; next_instr += 1; @@ -797,7 +801,7 @@ PyObject *sub = stack_pointer[-1]; PyObject *tuple = stack_pointer[-2]; PyObject *res; - #line 487 "Python/bytecodes.c" + #line 488 "Python/bytecodes.c" DEOPT_IF(!PyLong_CheckExact(sub), BINARY_SUBSCR); DEOPT_IF(!PyTuple_CheckExact(tuple), BINARY_SUBSCR); @@ -811,7 +815,7 @@ Py_INCREF(res); _Py_DECREF_SPECIALIZED(sub, (destructor)PyObject_Free); Py_DECREF(tuple); - #line 799 "Python/generated_cases.c.h" + #line 819 "Python/generated_cases.c.h" STACK_SHRINK(1); stack_pointer[-1] = res; next_instr += 1; @@ -822,7 +826,7 @@ PyObject *sub = stack_pointer[-1]; PyObject *dict = stack_pointer[-2]; PyObject *res; - #line 503 "Python/bytecodes.c" + #line 504 "Python/bytecodes.c" DEOPT_IF(!PyDict_CheckExact(dict), BINARY_SUBSCR); STAT_INC(BINARY_SUBSCR, hit); res = PyDict_GetItemWithError(dict, sub); @@ -830,14 +834,14 @@ if (!_PyErr_Occurred(tstate)) { _PyErr_SetKeyError(sub); } - #line 818 "Python/generated_cases.c.h" + #line 838 "Python/generated_cases.c.h" Py_DECREF(dict); Py_DECREF(sub); - #line 511 "Python/bytecodes.c" + #line 512 "Python/bytecodes.c" if (true) goto pop_2_error; } Py_INCREF(res); // Do this before DECREF'ing dict, sub - #line 825 "Python/generated_cases.c.h" + #line 845 "Python/generated_cases.c.h" Py_DECREF(dict); Py_DECREF(sub); STACK_SHRINK(1); @@ -849,7 +853,7 @@ TARGET(BINARY_SUBSCR_GETITEM) { PyObject *sub = stack_pointer[-1]; PyObject *container = stack_pointer[-2]; - #line 518 "Python/bytecodes.c" + #line 519 "Python/bytecodes.c" DEOPT_IF(tstate->interp->eval_frame, BINARY_SUBSCR); PyTypeObject *tp = Py_TYPE(container); DEOPT_IF(!PyType_HasFeature(tp, Py_TPFLAGS_HEAPTYPE), BINARY_SUBSCR); @@ -872,15 +876,15 @@ JUMPBY(INLINE_CACHE_ENTRIES_BINARY_SUBSCR); frame->return_offset = 0; DISPATCH_INLINED(new_frame); - #line 860 "Python/generated_cases.c.h" + #line 880 "Python/generated_cases.c.h" } TARGET(LIST_APPEND) { PyObject *v = stack_pointer[-1]; PyObject *list = stack_pointer[-(2 + (oparg-1))]; - #line 543 "Python/bytecodes.c" + #line 544 "Python/bytecodes.c" if (_PyList_AppendTakeRef((PyListObject *)list, v) < 0) goto pop_1_error; - #line 868 "Python/generated_cases.c.h" + #line 888 "Python/generated_cases.c.h" STACK_SHRINK(1); PREDICT(JUMP_BACKWARD); DISPATCH(); @@ -889,13 +893,13 @@ TARGET(SET_ADD) { PyObject *v = stack_pointer[-1]; PyObject *set = stack_pointer[-(2 + (oparg-1))]; - #line 548 "Python/bytecodes.c" + #line 549 "Python/bytecodes.c" int err = PySet_Add(set, v); - #line 879 "Python/generated_cases.c.h" + #line 899 "Python/generated_cases.c.h" Py_DECREF(v); - #line 550 "Python/bytecodes.c" + #line 551 "Python/bytecodes.c" if (err) goto pop_1_error; - #line 883 "Python/generated_cases.c.h" + #line 903 "Python/generated_cases.c.h" STACK_SHRINK(1); PREDICT(JUMP_BACKWARD); DISPATCH(); @@ -908,7 +912,7 @@ PyObject *container = stack_pointer[-2]; PyObject *v = stack_pointer[-3]; uint16_t counter = read_u16(&next_instr[0].cache); - #line 561 "Python/bytecodes.c" + #line 562 "Python/bytecodes.c" #if ENABLE_SPECIALIZATION if (ADAPTIVE_COUNTER_IS_ZERO(counter)) { next_instr--; @@ -923,13 +927,13 @@ #endif /* ENABLE_SPECIALIZATION */ /* container[sub] = v */ int err = PyObject_SetItem(container, sub, v); - #line 911 "Python/generated_cases.c.h" + #line 931 "Python/generated_cases.c.h" Py_DECREF(v); Py_DECREF(container); Py_DECREF(sub); - #line 576 "Python/bytecodes.c" + #line 577 "Python/bytecodes.c" if (err) goto pop_3_error; - #line 917 "Python/generated_cases.c.h" + #line 937 "Python/generated_cases.c.h" STACK_SHRINK(3); next_instr += 1; DISPATCH(); @@ -939,7 +943,7 @@ PyObject *sub = stack_pointer[-1]; PyObject *list = stack_pointer[-2]; PyObject *value = stack_pointer[-3]; - #line 580 "Python/bytecodes.c" + #line 581 "Python/bytecodes.c" DEOPT_IF(!PyLong_CheckExact(sub), STORE_SUBSCR); DEOPT_IF(!PyList_CheckExact(list), STORE_SUBSCR); @@ -956,7 +960,7 @@ Py_DECREF(old_value); _Py_DECREF_SPECIALIZED(sub, (destructor)PyObject_Free); Py_DECREF(list); - #line 944 "Python/generated_cases.c.h" + #line 964 "Python/generated_cases.c.h" STACK_SHRINK(3); next_instr += 1; DISPATCH(); @@ -966,13 +970,13 @@ PyObject *sub = stack_pointer[-1]; PyObject *dict = stack_pointer[-2]; PyObject *value = stack_pointer[-3]; - #line 599 "Python/bytecodes.c" + #line 600 "Python/bytecodes.c" DEOPT_IF(!PyDict_CheckExact(dict), STORE_SUBSCR); STAT_INC(STORE_SUBSCR, hit); int err = _PyDict_SetItem_Take2((PyDictObject *)dict, sub, value); Py_DECREF(dict); if (err) goto pop_3_error; - #line 960 "Python/generated_cases.c.h" + #line 980 "Python/generated_cases.c.h" STACK_SHRINK(3); next_instr += 1; DISPATCH(); @@ -981,15 +985,15 @@ TARGET(DELETE_SUBSCR) { PyObject *sub = stack_pointer[-1]; PyObject *container = stack_pointer[-2]; - #line 607 "Python/bytecodes.c" + #line 608 "Python/bytecodes.c" /* del container[sub] */ int err = PyObject_DelItem(container, sub); - #line 972 "Python/generated_cases.c.h" + #line 992 "Python/generated_cases.c.h" Py_DECREF(container); Py_DECREF(sub); - #line 610 "Python/bytecodes.c" + #line 611 "Python/bytecodes.c" if (err) goto pop_2_error; - #line 977 "Python/generated_cases.c.h" + #line 997 "Python/generated_cases.c.h" STACK_SHRINK(2); DISPATCH(); } @@ -997,14 +1001,14 @@ TARGET(CALL_INTRINSIC_1) { PyObject *value = stack_pointer[-1]; PyObject *res; - #line 614 "Python/bytecodes.c" + #line 615 "Python/bytecodes.c" assert(oparg <= MAX_INTRINSIC_1); res = _PyIntrinsics_UnaryFunctions[oparg](tstate, value); - #line 988 "Python/generated_cases.c.h" + #line 1008 "Python/generated_cases.c.h" Py_DECREF(value); - #line 617 "Python/bytecodes.c" + #line 618 "Python/bytecodes.c" if (res == NULL) goto pop_1_error; - #line 992 "Python/generated_cases.c.h" + #line 1012 "Python/generated_cases.c.h" stack_pointer[-1] = res; DISPATCH(); } @@ -1013,15 +1017,15 @@ PyObject *value1 = stack_pointer[-1]; PyObject *value2 = stack_pointer[-2]; PyObject *res; - #line 621 "Python/bytecodes.c" + #line 622 "Python/bytecodes.c" assert(oparg <= MAX_INTRINSIC_2); res = _PyIntrinsics_BinaryFunctions[oparg](tstate, value2, value1); - #line 1004 "Python/generated_cases.c.h" + #line 1024 "Python/generated_cases.c.h" Py_DECREF(value2); Py_DECREF(value1); - #line 624 "Python/bytecodes.c" + #line 625 "Python/bytecodes.c" if (res == NULL) goto pop_2_error; - #line 1009 "Python/generated_cases.c.h" + #line 1029 "Python/generated_cases.c.h" STACK_SHRINK(1); stack_pointer[-1] = res; DISPATCH(); @@ -1029,7 +1033,7 @@ TARGET(RAISE_VARARGS) { PyObject **args = (stack_pointer - oparg); - #line 628 "Python/bytecodes.c" + #line 629 "Python/bytecodes.c" PyObject *cause = NULL, *exc = NULL; switch (oparg) { case 2: @@ -1047,12 +1051,12 @@ break; } if (true) { STACK_SHRINK(oparg); goto error; } - #line 1035 "Python/generated_cases.c.h" + #line 1055 "Python/generated_cases.c.h" } TARGET(INTERPRETER_EXIT) { PyObject *retval = stack_pointer[-1]; - #line 648 "Python/bytecodes.c" + #line 649 "Python/bytecodes.c" assert(frame == &entry_frame); assert(_PyFrame_IsIncomplete(frame)); STACK_SHRINK(1); // Since we're not going to DISPATCH() @@ -1063,12 +1067,12 @@ assert(!_PyErr_Occurred(tstate)); _Py_LeaveRecursiveCallTstate(tstate); return retval; - #line 1051 "Python/generated_cases.c.h" + #line 1071 "Python/generated_cases.c.h" } TARGET(RETURN_VALUE) { PyObject *retval = stack_pointer[-1]; - #line 661 "Python/bytecodes.c" + #line 662 "Python/bytecodes.c" STACK_SHRINK(1); assert(EMPTY()); _PyFrame_SetStackPointer(frame, stack_pointer); @@ -1081,12 +1085,12 @@ frame->prev_instr += frame->return_offset; _PyFrame_StackPush(frame, retval); goto resume_frame; - #line 1069 "Python/generated_cases.c.h" + #line 1089 "Python/generated_cases.c.h" } TARGET(INSTRUMENTED_RETURN_VALUE) { PyObject *retval = stack_pointer[-1]; - #line 676 "Python/bytecodes.c" + #line 677 "Python/bytecodes.c" int err = _Py_call_instrumentation_arg( tstate, PY_MONITORING_EVENT_PY_RETURN, frame, next_instr-1, retval); @@ -1103,11 +1107,11 @@ frame->prev_instr += frame->return_offset; _PyFrame_StackPush(frame, retval); goto resume_frame; - #line 1091 "Python/generated_cases.c.h" + #line 1111 "Python/generated_cases.c.h" } TARGET(RETURN_CONST) { - #line 695 "Python/bytecodes.c" + #line 696 "Python/bytecodes.c" PyObject *retval = GETITEM(frame->f_code->co_consts, oparg); Py_INCREF(retval); assert(EMPTY()); @@ -1121,11 +1125,11 @@ frame->prev_instr += frame->return_offset; _PyFrame_StackPush(frame, retval); goto resume_frame; - #line 1109 "Python/generated_cases.c.h" + #line 1129 "Python/generated_cases.c.h" } TARGET(INSTRUMENTED_RETURN_CONST) { - #line 711 "Python/bytecodes.c" + #line 712 "Python/bytecodes.c" PyObject *retval = GETITEM(frame->f_code->co_consts, oparg); int err = _Py_call_instrumentation_arg( tstate, PY_MONITORING_EVENT_PY_RETURN, @@ -1143,13 +1147,13 @@ frame->prev_instr += frame->return_offset; _PyFrame_StackPush(frame, retval); goto resume_frame; - #line 1131 "Python/generated_cases.c.h" + #line 1151 "Python/generated_cases.c.h" } TARGET(GET_AITER) { PyObject *obj = stack_pointer[-1]; PyObject *iter; - #line 731 "Python/bytecodes.c" + #line 732 "Python/bytecodes.c" unaryfunc getter = NULL; PyTypeObject *type = Py_TYPE(obj); @@ -1162,16 +1166,16 @@ "'async for' requires an object with " "__aiter__ method, got %.100s", type->tp_name); - #line 1150 "Python/generated_cases.c.h" + #line 1170 "Python/generated_cases.c.h" Py_DECREF(obj); - #line 744 "Python/bytecodes.c" + #line 745 "Python/bytecodes.c" if (true) goto pop_1_error; } iter = (*getter)(obj); - #line 1157 "Python/generated_cases.c.h" + #line 1177 "Python/generated_cases.c.h" Py_DECREF(obj); - #line 749 "Python/bytecodes.c" + #line 750 "Python/bytecodes.c" if (iter == NULL) goto pop_1_error; if (Py_TYPE(iter)->tp_as_async == NULL || @@ -1184,7 +1188,7 @@ Py_DECREF(iter); if (true) goto pop_1_error; } - #line 1172 "Python/generated_cases.c.h" + #line 1192 "Python/generated_cases.c.h" stack_pointer[-1] = iter; DISPATCH(); } @@ -1192,7 +1196,7 @@ TARGET(GET_ANEXT) { PyObject *aiter = stack_pointer[-1]; PyObject *awaitable; - #line 764 "Python/bytecodes.c" + #line 765 "Python/bytecodes.c" unaryfunc getter = NULL; PyObject *next_iter = NULL; PyTypeObject *type = Py_TYPE(aiter); @@ -1236,7 +1240,7 @@ } } - #line 1224 "Python/generated_cases.c.h" + #line 1244 "Python/generated_cases.c.h" STACK_GROW(1); stack_pointer[-1] = awaitable; PREDICT(LOAD_CONST); @@ -1247,16 +1251,16 @@ PREDICTED(GET_AWAITABLE); PyObject *iterable = stack_pointer[-1]; PyObject *iter; - #line 811 "Python/bytecodes.c" + #line 812 "Python/bytecodes.c" iter = _PyCoro_GetAwaitableIter(iterable); if (iter == NULL) { format_awaitable_error(tstate, Py_TYPE(iterable), oparg); } - #line 1242 "Python/generated_cases.c.h" + #line 1262 "Python/generated_cases.c.h" Py_DECREF(iterable); - #line 818 "Python/bytecodes.c" + #line 819 "Python/bytecodes.c" if (iter != NULL && PyCoro_CheckExact(iter)) { PyObject *yf = _PyGen_yf((PyGenObject*)iter); @@ -1274,7 +1278,7 @@ if (iter == NULL) goto pop_1_error; - #line 1262 "Python/generated_cases.c.h" + #line 1282 "Python/generated_cases.c.h" stack_pointer[-1] = iter; PREDICT(LOAD_CONST); DISPATCH(); @@ -1286,7 +1290,7 @@ PyObject *v = stack_pointer[-1]; PyObject *receiver = stack_pointer[-2]; PyObject *retval; - #line 844 "Python/bytecodes.c" + #line 845 "Python/bytecodes.c" #if ENABLE_SPECIALIZATION _PySendCache *cache = (_PySendCache *)next_instr; if (ADAPTIVE_COUNTER_IS_ZERO(cache->counter)) { @@ -1333,7 +1337,7 @@ } } Py_DECREF(v); - #line 1321 "Python/generated_cases.c.h" + #line 1341 "Python/generated_cases.c.h" stack_pointer[-1] = retval; next_instr += 1; DISPATCH(); @@ -1342,7 +1346,7 @@ TARGET(SEND_GEN) { PyObject *v = stack_pointer[-1]; PyObject *receiver = stack_pointer[-2]; - #line 893 "Python/bytecodes.c" + #line 894 "Python/bytecodes.c" DEOPT_IF(tstate->interp->eval_frame, SEND); PyGenObject *gen = (PyGenObject *)receiver; DEOPT_IF(Py_TYPE(gen) != &PyGen_Type && @@ -1358,12 +1362,12 @@ tstate->exc_info = &gen->gi_exc_state; JUMPBY(INLINE_CACHE_ENTRIES_SEND); DISPATCH_INLINED(gen_frame); - #line 1346 "Python/generated_cases.c.h" + #line 1366 "Python/generated_cases.c.h" } TARGET(INSTRUMENTED_YIELD_VALUE) { PyObject *retval = stack_pointer[-1]; - #line 911 "Python/bytecodes.c" + #line 912 "Python/bytecodes.c" assert(frame != &entry_frame); PyGenObject *gen = _PyFrame_GetGenerator(frame); gen->gi_frame_state = FRAME_SUSPENDED; @@ -1380,12 +1384,12 @@ gen_frame->previous = NULL; _PyFrame_StackPush(frame, retval); goto resume_frame; - #line 1368 "Python/generated_cases.c.h" + #line 1388 "Python/generated_cases.c.h" } TARGET(YIELD_VALUE) { PyObject *retval = stack_pointer[-1]; - #line 930 "Python/bytecodes.c" + #line 931 "Python/bytecodes.c" // NOTE: It's important that YIELD_VALUE never raises an exception! // The compiler treats any exception raised here as a failed close() // or throw() call. @@ -1401,15 +1405,15 @@ gen_frame->previous = NULL; _PyFrame_StackPush(frame, retval); goto resume_frame; - #line 1389 "Python/generated_cases.c.h" + #line 1409 "Python/generated_cases.c.h" } TARGET(POP_EXCEPT) { PyObject *exc_value = stack_pointer[-1]; - #line 948 "Python/bytecodes.c" + #line 949 "Python/bytecodes.c" _PyErr_StackItem *exc_info = tstate->exc_info; Py_XSETREF(exc_info->exc_value, exc_value); - #line 1397 "Python/generated_cases.c.h" + #line 1417 "Python/generated_cases.c.h" STACK_SHRINK(1); DISPATCH(); } @@ -1417,7 +1421,7 @@ TARGET(RERAISE) { PyObject *exc = stack_pointer[-1]; PyObject **values = (stack_pointer - (1 + oparg)); - #line 953 "Python/bytecodes.c" + #line 954 "Python/bytecodes.c" assert(oparg >= 0 && oparg <= 2); if (oparg) { PyObject *lasti = values[0]; @@ -1435,26 +1439,26 @@ Py_INCREF(exc); _PyErr_SetRaisedException(tstate, exc); goto exception_unwind; - #line 1423 "Python/generated_cases.c.h" + #line 1443 "Python/generated_cases.c.h" } TARGET(END_ASYNC_FOR) { PyObject *exc = stack_pointer[-1]; PyObject *awaitable = stack_pointer[-2]; - #line 973 "Python/bytecodes.c" + #line 974 "Python/bytecodes.c" assert(exc && PyExceptionInstance_Check(exc)); if (PyErr_GivenExceptionMatches(exc, PyExc_StopAsyncIteration)) { - #line 1432 "Python/generated_cases.c.h" + #line 1452 "Python/generated_cases.c.h" Py_DECREF(awaitable); Py_DECREF(exc); - #line 976 "Python/bytecodes.c" + #line 977 "Python/bytecodes.c" } else { Py_INCREF(exc); _PyErr_SetRaisedException(tstate, exc); goto exception_unwind; } - #line 1442 "Python/generated_cases.c.h" + #line 1462 "Python/generated_cases.c.h" STACK_SHRINK(2); DISPATCH(); } @@ -1465,23 +1469,23 @@ PyObject *sub_iter = stack_pointer[-3]; PyObject *none; PyObject *value; - #line 985 "Python/bytecodes.c" + #line 986 "Python/bytecodes.c" assert(throwflag); assert(exc_value && PyExceptionInstance_Check(exc_value)); if (PyErr_GivenExceptionMatches(exc_value, PyExc_StopIteration)) { value = Py_NewRef(((PyStopIterationObject *)exc_value)->value); - #line 1458 "Python/generated_cases.c.h" + #line 1478 "Python/generated_cases.c.h" Py_DECREF(sub_iter); Py_DECREF(last_sent_val); Py_DECREF(exc_value); - #line 990 "Python/bytecodes.c" + #line 991 "Python/bytecodes.c" none = Py_None; } else { _PyErr_SetRaisedException(tstate, Py_NewRef(exc_value)); goto exception_unwind; } - #line 1469 "Python/generated_cases.c.h" + #line 1489 "Python/generated_cases.c.h" STACK_SHRINK(1); stack_pointer[-1] = value; stack_pointer[-2] = none; @@ -1490,9 +1494,9 @@ TARGET(LOAD_ASSERTION_ERROR) { PyObject *value; - #line 999 "Python/bytecodes.c" + #line 1000 "Python/bytecodes.c" value = Py_NewRef(PyExc_AssertionError); - #line 1480 "Python/generated_cases.c.h" + #line 1500 "Python/generated_cases.c.h" STACK_GROW(1); stack_pointer[-1] = value; DISPATCH(); @@ -1500,7 +1504,7 @@ TARGET(LOAD_BUILD_CLASS) { PyObject *bc; - #line 1003 "Python/bytecodes.c" + #line 1004 "Python/bytecodes.c" if (PyDict_CheckExact(BUILTINS())) { bc = _PyDict_GetItemWithError(BUILTINS(), &_Py_ID(__build_class__)); @@ -1522,7 +1526,7 @@ if (true) goto error; } } - #line 1510 "Python/generated_cases.c.h" + #line 1530 "Python/generated_cases.c.h" STACK_GROW(1); stack_pointer[-1] = bc; DISPATCH(); @@ -1530,33 +1534,33 @@ TARGET(STORE_NAME) { PyObject *v = stack_pointer[-1]; - #line 1028 "Python/bytecodes.c" + #line 1029 "Python/bytecodes.c" PyObject *name = GETITEM(frame->f_code->co_names, oparg); PyObject *ns = LOCALS(); int err; if (ns == NULL) { _PyErr_Format(tstate, PyExc_SystemError, "no locals found when storing %R", name); - #line 1525 "Python/generated_cases.c.h" + #line 1545 "Python/generated_cases.c.h" Py_DECREF(v); - #line 1035 "Python/bytecodes.c" + #line 1036 "Python/bytecodes.c" if (true) goto pop_1_error; } if (PyDict_CheckExact(ns)) err = PyDict_SetItem(ns, name, v); else err = PyObject_SetItem(ns, name, v); - #line 1534 "Python/generated_cases.c.h" + #line 1554 "Python/generated_cases.c.h" Py_DECREF(v); - #line 1042 "Python/bytecodes.c" + #line 1043 "Python/bytecodes.c" if (err) goto pop_1_error; - #line 1538 "Python/generated_cases.c.h" + #line 1558 "Python/generated_cases.c.h" STACK_SHRINK(1); DISPATCH(); } TARGET(DELETE_NAME) { - #line 1046 "Python/bytecodes.c" + #line 1047 "Python/bytecodes.c" PyObject *name = GETITEM(frame->f_code->co_names, oparg); PyObject *ns = LOCALS(); int err; @@ -1573,7 +1577,7 @@ name); goto error; } - #line 1561 "Python/generated_cases.c.h" + #line 1581 "Python/generated_cases.c.h" DISPATCH(); } @@ -1581,7 +1585,7 @@ PREDICTED(UNPACK_SEQUENCE); static_assert(INLINE_CACHE_ENTRIES_UNPACK_SEQUENCE == 1, "incorrect cache size"); PyObject *seq = stack_pointer[-1]; - #line 1072 "Python/bytecodes.c" + #line 1073 "Python/bytecodes.c" #if ENABLE_SPECIALIZATION _PyUnpackSequenceCache *cache = (_PyUnpackSequenceCache *)next_instr; if (ADAPTIVE_COUNTER_IS_ZERO(cache->counter)) { @@ -1594,11 +1598,11 @@ #endif /* ENABLE_SPECIALIZATION */ PyObject **top = stack_pointer + oparg - 1; int res = unpack_iterable(tstate, seq, oparg, -1, top); - #line 1582 "Python/generated_cases.c.h" + #line 1602 "Python/generated_cases.c.h" Py_DECREF(seq); - #line 1085 "Python/bytecodes.c" + #line 1086 "Python/bytecodes.c" if (res == 0) goto pop_1_error; - #line 1586 "Python/generated_cases.c.h" + #line 1606 "Python/generated_cases.c.h" STACK_SHRINK(1); STACK_GROW(oparg); next_instr += 1; @@ -1608,14 +1612,14 @@ TARGET(UNPACK_SEQUENCE_TWO_TUPLE) { PyObject *seq = stack_pointer[-1]; PyObject **values = stack_pointer - (1); - #line 1089 "Python/bytecodes.c" + #line 1090 "Python/bytecodes.c" DEOPT_IF(!PyTuple_CheckExact(seq), UNPACK_SEQUENCE); DEOPT_IF(PyTuple_GET_SIZE(seq) != 2, UNPACK_SEQUENCE); assert(oparg == 2); STAT_INC(UNPACK_SEQUENCE, hit); values[0] = Py_NewRef(PyTuple_GET_ITEM(seq, 1)); values[1] = Py_NewRef(PyTuple_GET_ITEM(seq, 0)); - #line 1603 "Python/generated_cases.c.h" + #line 1623 "Python/generated_cases.c.h" Py_DECREF(seq); STACK_SHRINK(1); STACK_GROW(oparg); @@ -1626,7 +1630,7 @@ TARGET(UNPACK_SEQUENCE_TUPLE) { PyObject *seq = stack_pointer[-1]; PyObject **values = stack_pointer - (1); - #line 1099 "Python/bytecodes.c" + #line 1100 "Python/bytecodes.c" DEOPT_IF(!PyTuple_CheckExact(seq), UNPACK_SEQUENCE); DEOPT_IF(PyTuple_GET_SIZE(seq) != oparg, UNPACK_SEQUENCE); STAT_INC(UNPACK_SEQUENCE, hit); @@ -1634,7 +1638,7 @@ for (int i = oparg; --i >= 0; ) { *values++ = Py_NewRef(items[i]); } - #line 1622 "Python/generated_cases.c.h" + #line 1642 "Python/generated_cases.c.h" Py_DECREF(seq); STACK_SHRINK(1); STACK_GROW(oparg); @@ -1645,7 +1649,7 @@ TARGET(UNPACK_SEQUENCE_LIST) { PyObject *seq = stack_pointer[-1]; PyObject **values = stack_pointer - (1); - #line 1110 "Python/bytecodes.c" + #line 1111 "Python/bytecodes.c" DEOPT_IF(!PyList_CheckExact(seq), UNPACK_SEQUENCE); DEOPT_IF(PyList_GET_SIZE(seq) != oparg, UNPACK_SEQUENCE); STAT_INC(UNPACK_SEQUENCE, hit); @@ -1653,7 +1657,7 @@ for (int i = oparg; --i >= 0; ) { *values++ = Py_NewRef(items[i]); } - #line 1641 "Python/generated_cases.c.h" + #line 1661 "Python/generated_cases.c.h" Py_DECREF(seq); STACK_SHRINK(1); STACK_GROW(oparg); @@ -1663,15 +1667,15 @@ TARGET(UNPACK_EX) { PyObject *seq = stack_pointer[-1]; - #line 1121 "Python/bytecodes.c" + #line 1122 "Python/bytecodes.c" int totalargs = 1 + (oparg & 0xFF) + (oparg >> 8); PyObject **top = stack_pointer + totalargs - 1; int res = unpack_iterable(tstate, seq, oparg & 0xFF, oparg >> 8, top); - #line 1655 "Python/generated_cases.c.h" + #line 1675 "Python/generated_cases.c.h" Py_DECREF(seq); - #line 1125 "Python/bytecodes.c" + #line 1126 "Python/bytecodes.c" if (res == 0) goto pop_1_error; - #line 1659 "Python/generated_cases.c.h" + #line 1679 "Python/generated_cases.c.h" STACK_GROW((oparg & 0xFF) + (oparg >> 8)); DISPATCH(); } @@ -1682,7 +1686,7 @@ PyObject *owner = stack_pointer[-1]; PyObject *v = stack_pointer[-2]; uint16_t counter = read_u16(&next_instr[0].cache); - #line 1136 "Python/bytecodes.c" + #line 1137 "Python/bytecodes.c" #if ENABLE_SPECIALIZATION if (ADAPTIVE_COUNTER_IS_ZERO(counter)) { PyObject *name = GETITEM(frame->f_code->co_names, oparg); @@ -1698,12 +1702,12 @@ #endif /* ENABLE_SPECIALIZATION */ PyObject *name = GETITEM(frame->f_code->co_names, oparg); int err = PyObject_SetAttr(owner, name, v); - #line 1686 "Python/generated_cases.c.h" + #line 1706 "Python/generated_cases.c.h" Py_DECREF(v); Py_DECREF(owner); - #line 1152 "Python/bytecodes.c" + #line 1153 "Python/bytecodes.c" if (err) goto pop_2_error; - #line 1691 "Python/generated_cases.c.h" + #line 1711 "Python/generated_cases.c.h" STACK_SHRINK(2); next_instr += 4; DISPATCH(); @@ -1711,34 +1715,34 @@ TARGET(DELETE_ATTR) { PyObject *owner = stack_pointer[-1]; - #line 1156 "Python/bytecodes.c" + #line 1157 "Python/bytecodes.c" PyObject *name = GETITEM(frame->f_code->co_names, oparg); int err = PyObject_SetAttr(owner, name, (PyObject *)NULL); - #line 1702 "Python/generated_cases.c.h" + #line 1722 "Python/generated_cases.c.h" Py_DECREF(owner); - #line 1159 "Python/bytecodes.c" + #line 1160 "Python/bytecodes.c" if (err) goto pop_1_error; - #line 1706 "Python/generated_cases.c.h" + #line 1726 "Python/generated_cases.c.h" STACK_SHRINK(1); DISPATCH(); } TARGET(STORE_GLOBAL) { PyObject *v = stack_pointer[-1]; - #line 1163 "Python/bytecodes.c" + #line 1164 "Python/bytecodes.c" PyObject *name = GETITEM(frame->f_code->co_names, oparg); int err = PyDict_SetItem(GLOBALS(), name, v); - #line 1716 "Python/generated_cases.c.h" + #line 1736 "Python/generated_cases.c.h" Py_DECREF(v); - #line 1166 "Python/bytecodes.c" + #line 1167 "Python/bytecodes.c" if (err) goto pop_1_error; - #line 1720 "Python/generated_cases.c.h" + #line 1740 "Python/generated_cases.c.h" STACK_SHRINK(1); DISPATCH(); } TARGET(DELETE_GLOBAL) { - #line 1170 "Python/bytecodes.c" + #line 1171 "Python/bytecodes.c" PyObject *name = GETITEM(frame->f_code->co_names, oparg); int err; err = PyDict_DelItem(GLOBALS(), name); @@ -1750,7 +1754,7 @@ } goto error; } - #line 1738 "Python/generated_cases.c.h" + #line 1758 "Python/generated_cases.c.h" DISPATCH(); } @@ -1758,7 +1762,7 @@ PyObject *_tmp_1; { PyObject *locals; - #line 1184 "Python/bytecodes.c" + #line 1185 "Python/bytecodes.c" locals = LOCALS(); if (locals == NULL) { _PyErr_SetString(tstate, PyExc_SystemError, @@ -1766,7 +1770,7 @@ if (true) goto error; } Py_INCREF(locals); - #line 1754 "Python/generated_cases.c.h" + #line 1774 "Python/generated_cases.c.h" _tmp_1 = locals; } STACK_GROW(1); @@ -1778,7 +1782,7 @@ PyObject *_tmp_1; { PyObject *locals; - #line 1184 "Python/bytecodes.c" + #line 1185 "Python/bytecodes.c" locals = LOCALS(); if (locals == NULL) { _PyErr_SetString(tstate, PyExc_SystemError, @@ -1786,13 +1790,13 @@ if (true) goto error; } Py_INCREF(locals); - #line 1774 "Python/generated_cases.c.h" + #line 1794 "Python/generated_cases.c.h" _tmp_1 = locals; } { PyObject *mod_or_class_dict = _tmp_1; PyObject *v; - #line 1196 "Python/bytecodes.c" + #line 1197 "Python/bytecodes.c" PyObject *name = GETITEM(frame->f_code->co_names, oparg); if (PyDict_CheckExact(mod_or_class_dict)) { v = PyDict_GetItemWithError(mod_or_class_dict, name); @@ -1849,7 +1853,7 @@ } } } - #line 1837 "Python/generated_cases.c.h" + #line 1857 "Python/generated_cases.c.h" _tmp_1 = v; } STACK_GROW(1); @@ -1862,7 +1866,7 @@ { PyObject *mod_or_class_dict = _tmp_1; PyObject *v; - #line 1196 "Python/bytecodes.c" + #line 1197 "Python/bytecodes.c" PyObject *name = GETITEM(frame->f_code->co_names, oparg); if (PyDict_CheckExact(mod_or_class_dict)) { v = PyDict_GetItemWithError(mod_or_class_dict, name); @@ -1919,7 +1923,7 @@ } } } - #line 1907 "Python/generated_cases.c.h" + #line 1927 "Python/generated_cases.c.h" _tmp_1 = v; } stack_pointer[-1] = _tmp_1; @@ -1931,7 +1935,7 @@ static_assert(INLINE_CACHE_ENTRIES_LOAD_GLOBAL == 4, "incorrect cache size"); PyObject *null = NULL; PyObject *v; - #line 1265 "Python/bytecodes.c" + #line 1266 "Python/bytecodes.c" #if ENABLE_SPECIALIZATION _PyLoadGlobalCache *cache = (_PyLoadGlobalCache *)next_instr; if (ADAPTIVE_COUNTER_IS_ZERO(cache->counter)) { @@ -1983,7 +1987,7 @@ } } null = NULL; - #line 1971 "Python/generated_cases.c.h" + #line 1991 "Python/generated_cases.c.h" STACK_GROW(1); STACK_GROW(((oparg & 1) ? 1 : 0)); stack_pointer[-1] = v; @@ -1997,7 +2001,7 @@ PyObject *res; uint16_t index = read_u16(&next_instr[1].cache); uint16_t version = read_u16(&next_instr[2].cache); - #line 1319 "Python/bytecodes.c" + #line 1320 "Python/bytecodes.c" DEOPT_IF(!PyDict_CheckExact(GLOBALS()), LOAD_GLOBAL); PyDictObject *dict = (PyDictObject *)GLOBALS(); DEOPT_IF(dict->ma_keys->dk_version != version, LOAD_GLOBAL); @@ -2008,7 +2012,7 @@ Py_INCREF(res); STAT_INC(LOAD_GLOBAL, hit); null = NULL; - #line 1996 "Python/generated_cases.c.h" + #line 2016 "Python/generated_cases.c.h" STACK_GROW(1); STACK_GROW(((oparg & 1) ? 1 : 0)); stack_pointer[-1] = res; @@ -2023,7 +2027,7 @@ uint16_t index = read_u16(&next_instr[1].cache); uint16_t mod_version = read_u16(&next_instr[2].cache); uint16_t bltn_version = read_u16(&next_instr[3].cache); - #line 1332 "Python/bytecodes.c" + #line 1333 "Python/bytecodes.c" DEOPT_IF(!PyDict_CheckExact(GLOBALS()), LOAD_GLOBAL); DEOPT_IF(!PyDict_CheckExact(BUILTINS()), LOAD_GLOBAL); PyDictObject *mdict = (PyDictObject *)GLOBALS(); @@ -2038,7 +2042,7 @@ Py_INCREF(res); STAT_INC(LOAD_GLOBAL, hit); null = NULL; - #line 2026 "Python/generated_cases.c.h" + #line 2046 "Python/generated_cases.c.h" STACK_GROW(1); STACK_GROW(((oparg & 1) ? 1 : 0)); stack_pointer[-1] = res; @@ -2048,16 +2052,16 @@ } TARGET(DELETE_FAST) { - #line 1349 "Python/bytecodes.c" + #line 1350 "Python/bytecodes.c" PyObject *v = GETLOCAL(oparg); if (v == NULL) goto unbound_local_error; SETLOCAL(oparg, NULL); - #line 2040 "Python/generated_cases.c.h" + #line 2060 "Python/generated_cases.c.h" DISPATCH(); } TARGET(MAKE_CELL) { - #line 1355 "Python/bytecodes.c" + #line 1356 "Python/bytecodes.c" // "initial" is probably NULL but not if it's an arg (or set // via PyFrame_LocalsToFast() before MAKE_CELL has run). PyObject *initial = GETLOCAL(oparg); @@ -2066,12 +2070,12 @@ goto resume_with_error; } SETLOCAL(oparg, cell); - #line 2054 "Python/generated_cases.c.h" + #line 2074 "Python/generated_cases.c.h" DISPATCH(); } TARGET(DELETE_DEREF) { - #line 1366 "Python/bytecodes.c" + #line 1367 "Python/bytecodes.c" PyObject *cell = GETLOCAL(oparg); PyObject *oldobj = PyCell_GET(cell); // Can't use ERROR_IF here. @@ -2082,14 +2086,14 @@ } PyCell_SET(cell, NULL); Py_DECREF(oldobj); - #line 2070 "Python/generated_cases.c.h" + #line 2090 "Python/generated_cases.c.h" DISPATCH(); } TARGET(LOAD_FROM_DICT_OR_DEREF) { PyObject *class_dict = stack_pointer[-1]; PyObject *value; - #line 1379 "Python/bytecodes.c" + #line 1380 "Python/bytecodes.c" PyObject *name; assert(class_dict); assert(oparg >= 0 && oparg < frame->f_code->co_nlocalsplus); @@ -2124,14 +2128,14 @@ } Py_INCREF(value); } - #line 2112 "Python/generated_cases.c.h" + #line 2132 "Python/generated_cases.c.h" stack_pointer[-1] = value; DISPATCH(); } TARGET(LOAD_DEREF) { PyObject *value; - #line 1416 "Python/bytecodes.c" + #line 1417 "Python/bytecodes.c" PyObject *cell = GETLOCAL(oparg); value = PyCell_GET(cell); if (value == NULL) { @@ -2139,7 +2143,7 @@ if (true) goto error; } Py_INCREF(value); - #line 2127 "Python/generated_cases.c.h" + #line 2147 "Python/generated_cases.c.h" STACK_GROW(1); stack_pointer[-1] = value; DISPATCH(); @@ -2147,18 +2151,18 @@ TARGET(STORE_DEREF) { PyObject *v = stack_pointer[-1]; - #line 1426 "Python/bytecodes.c" + #line 1427 "Python/bytecodes.c" PyObject *cell = GETLOCAL(oparg); PyObject *oldobj = PyCell_GET(cell); PyCell_SET(cell, v); Py_XDECREF(oldobj); - #line 2140 "Python/generated_cases.c.h" + #line 2160 "Python/generated_cases.c.h" STACK_SHRINK(1); DISPATCH(); } TARGET(COPY_FREE_VARS) { - #line 1433 "Python/bytecodes.c" + #line 1434 "Python/bytecodes.c" /* Copy closure variables to free variables */ PyCodeObject *co = frame->f_code; assert(PyFunction_Check(frame->f_funcobj)); @@ -2169,22 +2173,22 @@ PyObject *o = PyTuple_GET_ITEM(closure, i); frame->localsplus[offset + i] = Py_NewRef(o); } - #line 2157 "Python/generated_cases.c.h" + #line 2177 "Python/generated_cases.c.h" DISPATCH(); } TARGET(BUILD_STRING) { PyObject **pieces = (stack_pointer - oparg); PyObject *str; - #line 1446 "Python/bytecodes.c" + #line 1447 "Python/bytecodes.c" str = _PyUnicode_JoinArray(&_Py_STR(empty), pieces, oparg); - #line 2166 "Python/generated_cases.c.h" + #line 2186 "Python/generated_cases.c.h" for (int _i = oparg; --_i >= 0;) { Py_DECREF(pieces[_i]); } - #line 1448 "Python/bytecodes.c" + #line 1449 "Python/bytecodes.c" if (str == NULL) { STACK_SHRINK(oparg); goto error; } - #line 2172 "Python/generated_cases.c.h" + #line 2192 "Python/generated_cases.c.h" STACK_SHRINK(oparg); STACK_GROW(1); stack_pointer[-1] = str; @@ -2194,10 +2198,10 @@ TARGET(BUILD_TUPLE) { PyObject **values = (stack_pointer - oparg); PyObject *tup; - #line 1452 "Python/bytecodes.c" + #line 1453 "Python/bytecodes.c" tup = _PyTuple_FromArraySteal(values, oparg); if (tup == NULL) { STACK_SHRINK(oparg); goto error; } - #line 2185 "Python/generated_cases.c.h" + #line 2205 "Python/generated_cases.c.h" STACK_SHRINK(oparg); STACK_GROW(1); stack_pointer[-1] = tup; @@ -2207,10 +2211,10 @@ TARGET(BUILD_LIST) { PyObject **values = (stack_pointer - oparg); PyObject *list; - #line 1457 "Python/bytecodes.c" + #line 1458 "Python/bytecodes.c" list = _PyList_FromArraySteal(values, oparg); if (list == NULL) { STACK_SHRINK(oparg); goto error; } - #line 2198 "Python/generated_cases.c.h" + #line 2218 "Python/generated_cases.c.h" STACK_SHRINK(oparg); STACK_GROW(1); stack_pointer[-1] = list; @@ -2220,7 +2224,7 @@ TARGET(LIST_EXTEND) { PyObject *iterable = stack_pointer[-1]; PyObject *list = stack_pointer[-(2 + (oparg-1))]; - #line 1462 "Python/bytecodes.c" + #line 1463 "Python/bytecodes.c" PyObject *none_val = _PyList_Extend((PyListObject *)list, iterable); if (none_val == NULL) { if (_PyErr_ExceptionMatches(tstate, PyExc_TypeError) && @@ -2231,13 +2235,13 @@ "Value after * must be an iterable, not %.200s", Py_TYPE(iterable)->tp_name); } - #line 2219 "Python/generated_cases.c.h" + #line 2239 "Python/generated_cases.c.h" Py_DECREF(iterable); - #line 1473 "Python/bytecodes.c" + #line 1474 "Python/bytecodes.c" if (true) goto pop_1_error; } assert(Py_IsNone(none_val)); - #line 2225 "Python/generated_cases.c.h" + #line 2245 "Python/generated_cases.c.h" Py_DECREF(iterable); STACK_SHRINK(1); DISPATCH(); @@ -2246,13 +2250,13 @@ TARGET(SET_UPDATE) { PyObject *iterable = stack_pointer[-1]; PyObject *set = stack_pointer[-(2 + (oparg-1))]; - #line 1480 "Python/bytecodes.c" + #line 1481 "Python/bytecodes.c" int err = _PySet_Update(set, iterable); - #line 2236 "Python/generated_cases.c.h" + #line 2256 "Python/generated_cases.c.h" Py_DECREF(iterable); - #line 1482 "Python/bytecodes.c" + #line 1483 "Python/bytecodes.c" if (err < 0) goto pop_1_error; - #line 2240 "Python/generated_cases.c.h" + #line 2260 "Python/generated_cases.c.h" STACK_SHRINK(1); DISPATCH(); } @@ -2260,7 +2264,7 @@ TARGET(BUILD_SET) { PyObject **values = (stack_pointer - oparg); PyObject *set; - #line 1486 "Python/bytecodes.c" + #line 1487 "Python/bytecodes.c" set = PySet_New(NULL); if (set == NULL) goto error; @@ -2275,7 +2279,7 @@ Py_DECREF(set); if (true) { STACK_SHRINK(oparg); goto error; } } - #line 2263 "Python/generated_cases.c.h" + #line 2283 "Python/generated_cases.c.h" STACK_SHRINK(oparg); STACK_GROW(1); stack_pointer[-1] = set; @@ -2285,7 +2289,7 @@ TARGET(BUILD_MAP) { PyObject **values = (stack_pointer - oparg*2); PyObject *map; - #line 1503 "Python/bytecodes.c" + #line 1504 "Python/bytecodes.c" map = _PyDict_FromItems( values, 2, values+1, 2, @@ -2293,13 +2297,13 @@ if (map == NULL) goto error; - #line 2281 "Python/generated_cases.c.h" + #line 2301 "Python/generated_cases.c.h" for (int _i = oparg*2; --_i >= 0;) { Py_DECREF(values[_i]); } - #line 1511 "Python/bytecodes.c" + #line 1512 "Python/bytecodes.c" if (map == NULL) { STACK_SHRINK(oparg*2); goto error; } - #line 2287 "Python/generated_cases.c.h" + #line 2307 "Python/generated_cases.c.h" STACK_SHRINK(oparg*2); STACK_GROW(1); stack_pointer[-1] = map; @@ -2307,7 +2311,7 @@ } TARGET(SETUP_ANNOTATIONS) { - #line 1515 "Python/bytecodes.c" + #line 1516 "Python/bytecodes.c" int err; PyObject *ann_dict; if (LOCALS() == NULL) { @@ -2347,7 +2351,7 @@ Py_DECREF(ann_dict); } } - #line 2335 "Python/generated_cases.c.h" + #line 2355 "Python/generated_cases.c.h" DISPATCH(); } @@ -2355,7 +2359,7 @@ PyObject *keys = stack_pointer[-1]; PyObject **values = (stack_pointer - (1 + oparg)); PyObject *map; - #line 1557 "Python/bytecodes.c" + #line 1558 "Python/bytecodes.c" if (!PyTuple_CheckExact(keys) || PyTuple_GET_SIZE(keys) != (Py_ssize_t)oparg) { _PyErr_SetString(tstate, PyExc_SystemError, @@ -2365,14 +2369,14 @@ map = _PyDict_FromItems( &PyTuple_GET_ITEM(keys, 0), 1, values, 1, oparg); - #line 2353 "Python/generated_cases.c.h" + #line 2373 "Python/generated_cases.c.h" for (int _i = oparg; --_i >= 0;) { Py_DECREF(values[_i]); } Py_DECREF(keys); - #line 1567 "Python/bytecodes.c" + #line 1568 "Python/bytecodes.c" if (map == NULL) { STACK_SHRINK(oparg); goto pop_1_error; } - #line 2360 "Python/generated_cases.c.h" + #line 2380 "Python/generated_cases.c.h" STACK_SHRINK(oparg); stack_pointer[-1] = map; DISPATCH(); @@ -2380,7 +2384,7 @@ TARGET(DICT_UPDATE) { PyObject *update = stack_pointer[-1]; - #line 1571 "Python/bytecodes.c" + #line 1572 "Python/bytecodes.c" PyObject *dict = PEEK(oparg + 1); // update is still on the stack if (PyDict_Update(dict, update) < 0) { if (_PyErr_ExceptionMatches(tstate, PyExc_AttributeError)) { @@ -2388,12 +2392,12 @@ "'%.200s' object is not a mapping", Py_TYPE(update)->tp_name); } - #line 2376 "Python/generated_cases.c.h" + #line 2396 "Python/generated_cases.c.h" Py_DECREF(update); - #line 1579 "Python/bytecodes.c" + #line 1580 "Python/bytecodes.c" if (true) goto pop_1_error; } - #line 2381 "Python/generated_cases.c.h" + #line 2401 "Python/generated_cases.c.h" Py_DECREF(update); STACK_SHRINK(1); DISPATCH(); @@ -2401,17 +2405,17 @@ TARGET(DICT_MERGE) { PyObject *update = stack_pointer[-1]; - #line 1585 "Python/bytecodes.c" + #line 1586 "Python/bytecodes.c" PyObject *dict = PEEK(oparg + 1); // update is still on the stack if (_PyDict_MergeEx(dict, update, 2) < 0) { format_kwargs_error(tstate, PEEK(3 + oparg), update); - #line 2394 "Python/generated_cases.c.h" + #line 2414 "Python/generated_cases.c.h" Py_DECREF(update); - #line 1590 "Python/bytecodes.c" + #line 1591 "Python/bytecodes.c" if (true) goto pop_1_error; } - #line 2399 "Python/generated_cases.c.h" + #line 2419 "Python/generated_cases.c.h" Py_DECREF(update); STACK_SHRINK(1); PREDICT(CALL_FUNCTION_EX); @@ -2421,26 +2425,26 @@ TARGET(MAP_ADD) { PyObject *value = stack_pointer[-1]; PyObject *key = stack_pointer[-2]; - #line 1597 "Python/bytecodes.c" + #line 1598 "Python/bytecodes.c" PyObject *dict = PEEK(oparg + 2); // key, value are still on the stack assert(PyDict_CheckExact(dict)); /* dict[key] = value */ // Do not DECREF INPUTS because the function steals the references if (_PyDict_SetItem_Take2((PyDictObject *)dict, key, value) != 0) goto pop_2_error; - #line 2415 "Python/generated_cases.c.h" + #line 2435 "Python/generated_cases.c.h" STACK_SHRINK(2); PREDICT(JUMP_BACKWARD); DISPATCH(); } TARGET(INSTRUMENTED_LOAD_SUPER_ATTR) { - #line 1606 "Python/bytecodes.c" + #line 1607 "Python/bytecodes.c" _PySuperAttrCache *cache = (_PySuperAttrCache *)next_instr; // cancel out the decrement that will happen in LOAD_SUPER_ATTR; we // don't want to specialize instrumented instructions INCREMENT_ADAPTIVE_COUNTER(cache->counter); GO_TO_INSTRUCTION(LOAD_SUPER_ATTR); - #line 2428 "Python/generated_cases.c.h" + #line 2448 "Python/generated_cases.c.h" } TARGET(LOAD_SUPER_ATTR) { @@ -2451,7 +2455,7 @@ PyObject *global_super = stack_pointer[-3]; PyObject *res2 = NULL; PyObject *res; - #line 1620 "Python/bytecodes.c" + #line 1621 "Python/bytecodes.c" PyObject *name = GETITEM(frame->f_code->co_names, oparg >> 2); int load_method = oparg & 1; #if ENABLE_SPECIALIZATION @@ -2493,16 +2497,16 @@ } } } - #line 2481 "Python/generated_cases.c.h" + #line 2501 "Python/generated_cases.c.h" Py_DECREF(global_super); Py_DECREF(class); Py_DECREF(self); - #line 1662 "Python/bytecodes.c" + #line 1663 "Python/bytecodes.c" if (super == NULL) goto pop_3_error; res = PyObject_GetAttr(super, name); Py_DECREF(super); if (res == NULL) goto pop_3_error; - #line 2490 "Python/generated_cases.c.h" + #line 2510 "Python/generated_cases.c.h" STACK_SHRINK(2); STACK_GROW(((oparg & 1) ? 1 : 0)); stack_pointer[-1] = res; @@ -2517,20 +2521,20 @@ PyObject *global_super = stack_pointer[-3]; PyObject *res2 = NULL; PyObject *res; - #line 1669 "Python/bytecodes.c" + #line 1670 "Python/bytecodes.c" assert(!(oparg & 1)); DEOPT_IF(global_super != (PyObject *)&PySuper_Type, LOAD_SUPER_ATTR); DEOPT_IF(!PyType_Check(class), LOAD_SUPER_ATTR); STAT_INC(LOAD_SUPER_ATTR, hit); PyObject *name = GETITEM(frame->f_code->co_names, oparg >> 2); res = _PySuper_Lookup((PyTypeObject *)class, self, name, NULL); - #line 2512 "Python/generated_cases.c.h" + #line 2532 "Python/generated_cases.c.h" Py_DECREF(global_super); Py_DECREF(class); Py_DECREF(self); - #line 1676 "Python/bytecodes.c" + #line 1677 "Python/bytecodes.c" if (res == NULL) goto pop_3_error; - #line 2518 "Python/generated_cases.c.h" + #line 2538 "Python/generated_cases.c.h" STACK_SHRINK(2); STACK_GROW(((oparg & 1) ? 1 : 0)); stack_pointer[-1] = res; @@ -2545,7 +2549,7 @@ PyObject *global_super = stack_pointer[-3]; PyObject *res2; PyObject *res; - #line 1680 "Python/bytecodes.c" + #line 1681 "Python/bytecodes.c" assert(oparg & 1); DEOPT_IF(global_super != (PyObject *)&PySuper_Type, LOAD_SUPER_ATTR); DEOPT_IF(!PyType_Check(class), LOAD_SUPER_ATTR); @@ -2568,7 +2572,7 @@ res = res2; res2 = NULL; } - #line 2556 "Python/generated_cases.c.h" + #line 2576 "Python/generated_cases.c.h" STACK_SHRINK(1); stack_pointer[-1] = res; stack_pointer[-2] = res2; @@ -2582,7 +2586,7 @@ PyObject *owner = stack_pointer[-1]; PyObject *res2 = NULL; PyObject *res; - #line 1719 "Python/bytecodes.c" + #line 1720 "Python/bytecodes.c" #if ENABLE_SPECIALIZATION _PyAttrCache *cache = (_PyAttrCache *)next_instr; if (ADAPTIVE_COUNTER_IS_ZERO(cache->counter)) { @@ -2616,9 +2620,9 @@ NULL | meth | arg1 | ... | argN */ - #line 2604 "Python/generated_cases.c.h" + #line 2624 "Python/generated_cases.c.h" Py_DECREF(owner); - #line 1753 "Python/bytecodes.c" + #line 1754 "Python/bytecodes.c" if (meth == NULL) goto pop_1_error; res2 = NULL; res = meth; @@ -2627,12 +2631,12 @@ else { /* Classic, pushes one value. */ res = PyObject_GetAttr(owner, name); - #line 2615 "Python/generated_cases.c.h" + #line 2635 "Python/generated_cases.c.h" Py_DECREF(owner); - #line 1762 "Python/bytecodes.c" + #line 1763 "Python/bytecodes.c" if (res == NULL) goto pop_1_error; } - #line 2620 "Python/generated_cases.c.h" + #line 2640 "Python/generated_cases.c.h" STACK_GROW(((oparg & 1) ? 1 : 0)); stack_pointer[-1] = res; if (oparg & 1) { stack_pointer[-(1 + ((oparg & 1) ? 1 : 0))] = res2; } @@ -2646,7 +2650,7 @@ PyObject *res; uint32_t type_version = read_u32(&next_instr[1].cache); uint16_t index = read_u16(&next_instr[3].cache); - #line 1767 "Python/bytecodes.c" + #line 1768 "Python/bytecodes.c" PyTypeObject *tp = Py_TYPE(owner); assert(type_version != 0); DEOPT_IF(tp->tp_version_tag != type_version, LOAD_ATTR); @@ -2659,7 +2663,7 @@ STAT_INC(LOAD_ATTR, hit); Py_INCREF(res); res2 = NULL; - #line 2647 "Python/generated_cases.c.h" + #line 2667 "Python/generated_cases.c.h" Py_DECREF(owner); STACK_GROW(((oparg & 1) ? 1 : 0)); stack_pointer[-1] = res; @@ -2674,7 +2678,7 @@ PyObject *res; uint32_t type_version = read_u32(&next_instr[1].cache); uint16_t index = read_u16(&next_instr[3].cache); - #line 1783 "Python/bytecodes.c" + #line 1784 "Python/bytecodes.c" DEOPT_IF(!PyModule_CheckExact(owner), LOAD_ATTR); PyDictObject *dict = (PyDictObject *)((PyModuleObject *)owner)->md_dict; assert(dict != NULL); @@ -2687,7 +2691,7 @@ STAT_INC(LOAD_ATTR, hit); Py_INCREF(res); res2 = NULL; - #line 2675 "Python/generated_cases.c.h" + #line 2695 "Python/generated_cases.c.h" Py_DECREF(owner); STACK_GROW(((oparg & 1) ? 1 : 0)); stack_pointer[-1] = res; @@ -2702,7 +2706,7 @@ PyObject *res; uint32_t type_version = read_u32(&next_instr[1].cache); uint16_t index = read_u16(&next_instr[3].cache); - #line 1799 "Python/bytecodes.c" + #line 1800 "Python/bytecodes.c" PyTypeObject *tp = Py_TYPE(owner); assert(type_version != 0); DEOPT_IF(tp->tp_version_tag != type_version, LOAD_ATTR); @@ -2729,7 +2733,7 @@ STAT_INC(LOAD_ATTR, hit); Py_INCREF(res); res2 = NULL; - #line 2717 "Python/generated_cases.c.h" + #line 2737 "Python/generated_cases.c.h" Py_DECREF(owner); STACK_GROW(((oparg & 1) ? 1 : 0)); stack_pointer[-1] = res; @@ -2744,7 +2748,7 @@ PyObject *res; uint32_t type_version = read_u32(&next_instr[1].cache); uint16_t index = read_u16(&next_instr[3].cache); - #line 1829 "Python/bytecodes.c" + #line 1830 "Python/bytecodes.c" PyTypeObject *tp = Py_TYPE(owner); assert(type_version != 0); DEOPT_IF(tp->tp_version_tag != type_version, LOAD_ATTR); @@ -2754,7 +2758,7 @@ STAT_INC(LOAD_ATTR, hit); Py_INCREF(res); res2 = NULL; - #line 2742 "Python/generated_cases.c.h" + #line 2762 "Python/generated_cases.c.h" Py_DECREF(owner); STACK_GROW(((oparg & 1) ? 1 : 0)); stack_pointer[-1] = res; @@ -2769,7 +2773,7 @@ PyObject *res; uint32_t type_version = read_u32(&next_instr[1].cache); PyObject *descr = read_obj(&next_instr[5].cache); - #line 1842 "Python/bytecodes.c" + #line 1843 "Python/bytecodes.c" DEOPT_IF(!PyType_Check(cls), LOAD_ATTR); DEOPT_IF(((PyTypeObject *)cls)->tp_version_tag != type_version, @@ -2781,7 +2785,7 @@ res = descr; assert(res != NULL); Py_INCREF(res); - #line 2769 "Python/generated_cases.c.h" + #line 2789 "Python/generated_cases.c.h" Py_DECREF(cls); STACK_GROW(((oparg & 1) ? 1 : 0)); stack_pointer[-1] = res; @@ -2795,7 +2799,7 @@ uint32_t type_version = read_u32(&next_instr[1].cache); uint32_t func_version = read_u32(&next_instr[3].cache); PyObject *fget = read_obj(&next_instr[5].cache); - #line 1857 "Python/bytecodes.c" + #line 1858 "Python/bytecodes.c" DEOPT_IF(tstate->interp->eval_frame, LOAD_ATTR); PyTypeObject *cls = Py_TYPE(owner); @@ -2819,7 +2823,7 @@ JUMPBY(INLINE_CACHE_ENTRIES_LOAD_ATTR); frame->return_offset = 0; DISPATCH_INLINED(new_frame); - #line 2807 "Python/generated_cases.c.h" + #line 2827 "Python/generated_cases.c.h" } TARGET(LOAD_ATTR_GETATTRIBUTE_OVERRIDDEN) { @@ -2827,7 +2831,7 @@ uint32_t type_version = read_u32(&next_instr[1].cache); uint32_t func_version = read_u32(&next_instr[3].cache); PyObject *getattribute = read_obj(&next_instr[5].cache); - #line 1883 "Python/bytecodes.c" + #line 1884 "Python/bytecodes.c" DEOPT_IF(tstate->interp->eval_frame, LOAD_ATTR); PyTypeObject *cls = Py_TYPE(owner); DEOPT_IF(cls->tp_version_tag != type_version, LOAD_ATTR); @@ -2853,7 +2857,7 @@ JUMPBY(INLINE_CACHE_ENTRIES_LOAD_ATTR); frame->return_offset = 0; DISPATCH_INLINED(new_frame); - #line 2841 "Python/generated_cases.c.h" + #line 2861 "Python/generated_cases.c.h" } TARGET(STORE_ATTR_INSTANCE_VALUE) { @@ -2861,7 +2865,7 @@ PyObject *value = stack_pointer[-2]; uint32_t type_version = read_u32(&next_instr[1].cache); uint16_t index = read_u16(&next_instr[3].cache); - #line 1911 "Python/bytecodes.c" + #line 1912 "Python/bytecodes.c" PyTypeObject *tp = Py_TYPE(owner); assert(type_version != 0); DEOPT_IF(tp->tp_version_tag != type_version, STORE_ATTR); @@ -2879,7 +2883,7 @@ Py_DECREF(old_value); } Py_DECREF(owner); - #line 2867 "Python/generated_cases.c.h" + #line 2887 "Python/generated_cases.c.h" STACK_SHRINK(2); next_instr += 4; DISPATCH(); @@ -2890,7 +2894,7 @@ PyObject *value = stack_pointer[-2]; uint32_t type_version = read_u32(&next_instr[1].cache); uint16_t hint = read_u16(&next_instr[3].cache); - #line 1931 "Python/bytecodes.c" + #line 1932 "Python/bytecodes.c" PyTypeObject *tp = Py_TYPE(owner); assert(type_version != 0); DEOPT_IF(tp->tp_version_tag != type_version, STORE_ATTR); @@ -2929,7 +2933,7 @@ /* PEP 509 */ dict->ma_version_tag = new_version; Py_DECREF(owner); - #line 2917 "Python/generated_cases.c.h" + #line 2937 "Python/generated_cases.c.h" STACK_SHRINK(2); next_instr += 4; DISPATCH(); @@ -2940,7 +2944,7 @@ PyObject *value = stack_pointer[-2]; uint32_t type_version = read_u32(&next_instr[1].cache); uint16_t index = read_u16(&next_instr[3].cache); - #line 1972 "Python/bytecodes.c" + #line 1973 "Python/bytecodes.c" PyTypeObject *tp = Py_TYPE(owner); assert(type_version != 0); DEOPT_IF(tp->tp_version_tag != type_version, STORE_ATTR); @@ -2950,7 +2954,7 @@ *(PyObject **)addr = value; Py_XDECREF(old_value); Py_DECREF(owner); - #line 2938 "Python/generated_cases.c.h" + #line 2958 "Python/generated_cases.c.h" STACK_SHRINK(2); next_instr += 4; DISPATCH(); @@ -2962,7 +2966,7 @@ PyObject *right = stack_pointer[-1]; PyObject *left = stack_pointer[-2]; PyObject *res; - #line 1991 "Python/bytecodes.c" + #line 1992 "Python/bytecodes.c" #if ENABLE_SPECIALIZATION _PyCompareOpCache *cache = (_PyCompareOpCache *)next_instr; if (ADAPTIVE_COUNTER_IS_ZERO(cache->counter)) { @@ -2975,12 +2979,12 @@ #endif /* ENABLE_SPECIALIZATION */ assert((oparg >> 4) <= Py_GE); res = PyObject_RichCompare(left, right, oparg>>4); - #line 2963 "Python/generated_cases.c.h" + #line 2983 "Python/generated_cases.c.h" Py_DECREF(left); Py_DECREF(right); - #line 2004 "Python/bytecodes.c" + #line 2005 "Python/bytecodes.c" if (res == NULL) goto pop_2_error; - #line 2968 "Python/generated_cases.c.h" + #line 2988 "Python/generated_cases.c.h" STACK_SHRINK(1); stack_pointer[-1] = res; next_instr += 1; @@ -2991,7 +2995,7 @@ PyObject *right = stack_pointer[-1]; PyObject *left = stack_pointer[-2]; PyObject *res; - #line 2008 "Python/bytecodes.c" + #line 2009 "Python/bytecodes.c" DEOPT_IF(!PyFloat_CheckExact(left), COMPARE_OP); DEOPT_IF(!PyFloat_CheckExact(right), COMPARE_OP); STAT_INC(COMPARE_OP, hit); @@ -3002,7 +3006,7 @@ _Py_DECREF_SPECIALIZED(left, _PyFloat_ExactDealloc); _Py_DECREF_SPECIALIZED(right, _PyFloat_ExactDealloc); res = (sign_ish & oparg) ? Py_True : Py_False; - #line 2990 "Python/generated_cases.c.h" + #line 3010 "Python/generated_cases.c.h" STACK_SHRINK(1); stack_pointer[-1] = res; next_instr += 1; @@ -3013,7 +3017,7 @@ PyObject *right = stack_pointer[-1]; PyObject *left = stack_pointer[-2]; PyObject *res; - #line 2022 "Python/bytecodes.c" + #line 2023 "Python/bytecodes.c" DEOPT_IF(!PyLong_CheckExact(left), COMPARE_OP); DEOPT_IF(!PyLong_CheckExact(right), COMPARE_OP); DEOPT_IF(!_PyLong_IsCompact((PyLongObject *)left), COMPARE_OP); @@ -3028,7 +3032,7 @@ _Py_DECREF_SPECIALIZED(left, (destructor)PyObject_Free); _Py_DECREF_SPECIALIZED(right, (destructor)PyObject_Free); res = (sign_ish & oparg) ? Py_True : Py_False; - #line 3016 "Python/generated_cases.c.h" + #line 3036 "Python/generated_cases.c.h" STACK_SHRINK(1); stack_pointer[-1] = res; next_instr += 1; @@ -3039,7 +3043,7 @@ PyObject *right = stack_pointer[-1]; PyObject *left = stack_pointer[-2]; PyObject *res; - #line 2040 "Python/bytecodes.c" + #line 2041 "Python/bytecodes.c" DEOPT_IF(!PyUnicode_CheckExact(left), COMPARE_OP); DEOPT_IF(!PyUnicode_CheckExact(right), COMPARE_OP); STAT_INC(COMPARE_OP, hit); @@ -3051,7 +3055,7 @@ assert((oparg & 0xf) == COMPARISON_NOT_EQUALS || (oparg & 0xf) == COMPARISON_EQUALS); assert(COMPARISON_NOT_EQUALS + 1 == COMPARISON_EQUALS); res = ((COMPARISON_NOT_EQUALS + eq) & oparg) ? Py_True : Py_False; - #line 3039 "Python/generated_cases.c.h" + #line 3059 "Python/generated_cases.c.h" STACK_SHRINK(1); stack_pointer[-1] = res; next_instr += 1; @@ -3062,14 +3066,14 @@ PyObject *right = stack_pointer[-1]; PyObject *left = stack_pointer[-2]; PyObject *b; - #line 2054 "Python/bytecodes.c" + #line 2055 "Python/bytecodes.c" int res = Py_Is(left, right) ^ oparg; - #line 3052 "Python/generated_cases.c.h" + #line 3072 "Python/generated_cases.c.h" Py_DECREF(left); Py_DECREF(right); - #line 2056 "Python/bytecodes.c" + #line 2057 "Python/bytecodes.c" b = res ? Py_True : Py_False; - #line 3057 "Python/generated_cases.c.h" + #line 3077 "Python/generated_cases.c.h" STACK_SHRINK(1); stack_pointer[-1] = b; DISPATCH(); @@ -3079,15 +3083,15 @@ PyObject *right = stack_pointer[-1]; PyObject *left = stack_pointer[-2]; PyObject *b; - #line 2060 "Python/bytecodes.c" + #line 2061 "Python/bytecodes.c" int res = PySequence_Contains(right, left); - #line 3069 "Python/generated_cases.c.h" + #line 3089 "Python/generated_cases.c.h" Py_DECREF(left); Py_DECREF(right); - #line 2062 "Python/bytecodes.c" + #line 2063 "Python/bytecodes.c" if (res < 0) goto pop_2_error; b = (res ^ oparg) ? Py_True : Py_False; - #line 3075 "Python/generated_cases.c.h" + #line 3095 "Python/generated_cases.c.h" STACK_SHRINK(1); stack_pointer[-1] = b; DISPATCH(); @@ -3098,12 +3102,12 @@ PyObject *exc_value = stack_pointer[-2]; PyObject *rest; PyObject *match; - #line 2067 "Python/bytecodes.c" + #line 2068 "Python/bytecodes.c" if (check_except_star_type_valid(tstate, match_type) < 0) { - #line 3088 "Python/generated_cases.c.h" + #line 3108 "Python/generated_cases.c.h" Py_DECREF(exc_value); Py_DECREF(match_type); - #line 2069 "Python/bytecodes.c" + #line 2070 "Python/bytecodes.c" if (true) goto pop_2_error; } @@ -3111,10 +3115,10 @@ rest = NULL; int res = exception_group_match(exc_value, match_type, &match, &rest); - #line 3099 "Python/generated_cases.c.h" + #line 3119 "Python/generated_cases.c.h" Py_DECREF(exc_value); Py_DECREF(match_type); - #line 2077 "Python/bytecodes.c" + #line 2078 "Python/bytecodes.c" if (res < 0) goto pop_2_error; assert((match == NULL) == (rest == NULL)); @@ -3123,7 +3127,7 @@ if (!Py_IsNone(match)) { PyErr_SetHandledException(match); } - #line 3111 "Python/generated_cases.c.h" + #line 3131 "Python/generated_cases.c.h" stack_pointer[-1] = match; stack_pointer[-2] = rest; DISPATCH(); @@ -3133,21 +3137,21 @@ PyObject *right = stack_pointer[-1]; PyObject *left = stack_pointer[-2]; PyObject *b; - #line 2088 "Python/bytecodes.c" + #line 2089 "Python/bytecodes.c" assert(PyExceptionInstance_Check(left)); if (check_except_type_valid(tstate, right) < 0) { - #line 3124 "Python/generated_cases.c.h" + #line 3144 "Python/generated_cases.c.h" Py_DECREF(right); - #line 2091 "Python/bytecodes.c" + #line 2092 "Python/bytecodes.c" if (true) goto pop_1_error; } int res = PyErr_GivenExceptionMatches(left, right); - #line 3131 "Python/generated_cases.c.h" + #line 3151 "Python/generated_cases.c.h" Py_DECREF(right); - #line 2096 "Python/bytecodes.c" + #line 2097 "Python/bytecodes.c" b = res ? Py_True : Py_False; - #line 3135 "Python/generated_cases.c.h" + #line 3155 "Python/generated_cases.c.h" stack_pointer[-1] = b; DISPATCH(); } @@ -3156,15 +3160,15 @@ PyObject *fromlist = stack_pointer[-1]; PyObject *level = stack_pointer[-2]; PyObject *res; - #line 2100 "Python/bytecodes.c" + #line 2101 "Python/bytecodes.c" PyObject *name = GETITEM(frame->f_code->co_names, oparg); res = import_name(tstate, frame, name, fromlist, level); - #line 3147 "Python/generated_cases.c.h" + #line 3167 "Python/generated_cases.c.h" Py_DECREF(level); Py_DECREF(fromlist); - #line 2103 "Python/bytecodes.c" + #line 2104 "Python/bytecodes.c" if (res == NULL) goto pop_2_error; - #line 3152 "Python/generated_cases.c.h" + #line 3172 "Python/generated_cases.c.h" STACK_SHRINK(1); stack_pointer[-1] = res; DISPATCH(); @@ -3173,29 +3177,29 @@ TARGET(IMPORT_FROM) { PyObject *from = stack_pointer[-1]; PyObject *res; - #line 2107 "Python/bytecodes.c" + #line 2108 "Python/bytecodes.c" PyObject *name = GETITEM(frame->f_code->co_names, oparg); res = import_from(tstate, from, name); if (res == NULL) goto error; - #line 3165 "Python/generated_cases.c.h" + #line 3185 "Python/generated_cases.c.h" STACK_GROW(1); stack_pointer[-1] = res; DISPATCH(); } TARGET(JUMP_FORWARD) { - #line 2113 "Python/bytecodes.c" + #line 2114 "Python/bytecodes.c" JUMPBY(oparg); - #line 3174 "Python/generated_cases.c.h" + #line 3194 "Python/generated_cases.c.h" DISPATCH(); } TARGET(JUMP_BACKWARD) { PREDICTED(JUMP_BACKWARD); - #line 2117 "Python/bytecodes.c" + #line 2118 "Python/bytecodes.c" assert(oparg < INSTR_OFFSET()); JUMPBY(-oparg); - #line 3183 "Python/generated_cases.c.h" + #line 3203 "Python/generated_cases.c.h" CHECK_EVAL_BREAKER(); DISPATCH(); } @@ -3203,15 +3207,15 @@ TARGET(POP_JUMP_IF_FALSE) { PREDICTED(POP_JUMP_IF_FALSE); PyObject *cond = stack_pointer[-1]; - #line 2123 "Python/bytecodes.c" + #line 2124 "Python/bytecodes.c" if (Py_IsFalse(cond)) { JUMPBY(oparg); } else if (!Py_IsTrue(cond)) { int err = PyObject_IsTrue(cond); - #line 3197 "Python/generated_cases.c.h" + #line 3217 "Python/generated_cases.c.h" Py_DECREF(cond); - #line 2129 "Python/bytecodes.c" + #line 2130 "Python/bytecodes.c" if (err == 0) { JUMPBY(oparg); } @@ -3219,22 +3223,22 @@ if (err < 0) goto pop_1_error; } } - #line 3207 "Python/generated_cases.c.h" + #line 3227 "Python/generated_cases.c.h" STACK_SHRINK(1); DISPATCH(); } TARGET(POP_JUMP_IF_TRUE) { PyObject *cond = stack_pointer[-1]; - #line 2139 "Python/bytecodes.c" + #line 2140 "Python/bytecodes.c" if (Py_IsTrue(cond)) { JUMPBY(oparg); } else if (!Py_IsFalse(cond)) { int err = PyObject_IsTrue(cond); - #line 3220 "Python/generated_cases.c.h" + #line 3240 "Python/generated_cases.c.h" Py_DECREF(cond); - #line 2145 "Python/bytecodes.c" + #line 2146 "Python/bytecodes.c" if (err > 0) { JUMPBY(oparg); } @@ -3242,63 +3246,63 @@ if (err < 0) goto pop_1_error; } } - #line 3230 "Python/generated_cases.c.h" + #line 3250 "Python/generated_cases.c.h" STACK_SHRINK(1); DISPATCH(); } TARGET(POP_JUMP_IF_NOT_NONE) { PyObject *value = stack_pointer[-1]; - #line 2155 "Python/bytecodes.c" + #line 2156 "Python/bytecodes.c" if (!Py_IsNone(value)) { - #line 3239 "Python/generated_cases.c.h" + #line 3259 "Python/generated_cases.c.h" Py_DECREF(value); - #line 2157 "Python/bytecodes.c" + #line 2158 "Python/bytecodes.c" JUMPBY(oparg); } - #line 3244 "Python/generated_cases.c.h" + #line 3264 "Python/generated_cases.c.h" STACK_SHRINK(1); DISPATCH(); } TARGET(POP_JUMP_IF_NONE) { PyObject *value = stack_pointer[-1]; - #line 2162 "Python/bytecodes.c" + #line 2163 "Python/bytecodes.c" if (Py_IsNone(value)) { JUMPBY(oparg); } else { - #line 3256 "Python/generated_cases.c.h" + #line 3276 "Python/generated_cases.c.h" Py_DECREF(value); - #line 2167 "Python/bytecodes.c" + #line 2168 "Python/bytecodes.c" } - #line 3260 "Python/generated_cases.c.h" + #line 3280 "Python/generated_cases.c.h" STACK_SHRINK(1); DISPATCH(); } TARGET(JUMP_BACKWARD_NO_INTERRUPT) { - #line 2171 "Python/bytecodes.c" + #line 2172 "Python/bytecodes.c" /* This bytecode is used in the `yield from` or `await` loop. * If there is an interrupt, we want it handled in the innermost * generator or coroutine, so we deliberately do not check it here. * (see bpo-30039). */ JUMPBY(-oparg); - #line 3273 "Python/generated_cases.c.h" + #line 3293 "Python/generated_cases.c.h" DISPATCH(); } TARGET(GET_LEN) { PyObject *obj = stack_pointer[-1]; PyObject *len_o; - #line 2180 "Python/bytecodes.c" + #line 2181 "Python/bytecodes.c" // PUSH(len(TOS)) Py_ssize_t len_i = PyObject_Length(obj); if (len_i < 0) goto error; len_o = PyLong_FromSsize_t(len_i); if (len_o == NULL) goto error; - #line 3286 "Python/generated_cases.c.h" + #line 3306 "Python/generated_cases.c.h" STACK_GROW(1); stack_pointer[-1] = len_o; DISPATCH(); @@ -3309,16 +3313,16 @@ PyObject *type = stack_pointer[-2]; PyObject *subject = stack_pointer[-3]; PyObject *attrs; - #line 2188 "Python/bytecodes.c" + #line 2189 "Python/bytecodes.c" // Pop TOS and TOS1. Set TOS to a tuple of attributes on success, or // None on failure. assert(PyTuple_CheckExact(names)); attrs = match_class(tstate, subject, type, oparg, names); - #line 3302 "Python/generated_cases.c.h" + #line 3322 "Python/generated_cases.c.h" Py_DECREF(subject); Py_DECREF(type); Py_DECREF(names); - #line 2193 "Python/bytecodes.c" + #line 2194 "Python/bytecodes.c" if (attrs) { assert(PyTuple_CheckExact(attrs)); // Success! } @@ -3326,7 +3330,7 @@ if (_PyErr_Occurred(tstate)) goto pop_3_error; attrs = Py_None; // Failure! } - #line 3314 "Python/generated_cases.c.h" + #line 3334 "Python/generated_cases.c.h" STACK_SHRINK(2); stack_pointer[-1] = attrs; DISPATCH(); @@ -3335,10 +3339,10 @@ TARGET(MATCH_MAPPING) { PyObject *subject = stack_pointer[-1]; PyObject *res; - #line 2203 "Python/bytecodes.c" + #line 2204 "Python/bytecodes.c" int match = Py_TYPE(subject)->tp_flags & Py_TPFLAGS_MAPPING; res = match ? Py_True : Py_False; - #line 3326 "Python/generated_cases.c.h" + #line 3346 "Python/generated_cases.c.h" STACK_GROW(1); stack_pointer[-1] = res; PREDICT(POP_JUMP_IF_FALSE); @@ -3348,10 +3352,10 @@ TARGET(MATCH_SEQUENCE) { PyObject *subject = stack_pointer[-1]; PyObject *res; - #line 2209 "Python/bytecodes.c" + #line 2210 "Python/bytecodes.c" int match = Py_TYPE(subject)->tp_flags & Py_TPFLAGS_SEQUENCE; res = match ? Py_True : Py_False; - #line 3339 "Python/generated_cases.c.h" + #line 3359 "Python/generated_cases.c.h" STACK_GROW(1); stack_pointer[-1] = res; PREDICT(POP_JUMP_IF_FALSE); @@ -3362,11 +3366,11 @@ PyObject *keys = stack_pointer[-1]; PyObject *subject = stack_pointer[-2]; PyObject *values_or_none; - #line 2215 "Python/bytecodes.c" + #line 2216 "Python/bytecodes.c" // On successful match, PUSH(values). Otherwise, PUSH(None). values_or_none = match_keys(tstate, subject, keys); if (values_or_none == NULL) goto error; - #line 3354 "Python/generated_cases.c.h" + #line 3374 "Python/generated_cases.c.h" STACK_GROW(1); stack_pointer[-1] = values_or_none; DISPATCH(); @@ -3375,14 +3379,14 @@ TARGET(GET_ITER) { PyObject *iterable = stack_pointer[-1]; PyObject *iter; - #line 2221 "Python/bytecodes.c" + #line 2222 "Python/bytecodes.c" /* before: [obj]; after [getiter(obj)] */ iter = PyObject_GetIter(iterable); - #line 3366 "Python/generated_cases.c.h" + #line 3386 "Python/generated_cases.c.h" Py_DECREF(iterable); - #line 2224 "Python/bytecodes.c" + #line 2225 "Python/bytecodes.c" if (iter == NULL) goto pop_1_error; - #line 3370 "Python/generated_cases.c.h" + #line 3390 "Python/generated_cases.c.h" stack_pointer[-1] = iter; DISPATCH(); } @@ -3390,7 +3394,7 @@ TARGET(GET_YIELD_FROM_ITER) { PyObject *iterable = stack_pointer[-1]; PyObject *iter; - #line 2228 "Python/bytecodes.c" + #line 2229 "Python/bytecodes.c" /* before: [obj]; after [getiter(obj)] */ if (PyCoro_CheckExact(iterable)) { /* `iterable` is a coroutine */ @@ -3413,11 +3417,11 @@ if (iter == NULL) { goto error; } - #line 3401 "Python/generated_cases.c.h" + #line 3421 "Python/generated_cases.c.h" Py_DECREF(iterable); - #line 2251 "Python/bytecodes.c" + #line 2252 "Python/bytecodes.c" } - #line 3405 "Python/generated_cases.c.h" + #line 3425 "Python/generated_cases.c.h" stack_pointer[-1] = iter; PREDICT(LOAD_CONST); DISPATCH(); @@ -3428,7 +3432,7 @@ static_assert(INLINE_CACHE_ENTRIES_FOR_ITER == 1, "incorrect cache size"); PyObject *iter = stack_pointer[-1]; PyObject *next; - #line 2270 "Python/bytecodes.c" + #line 2271 "Python/bytecodes.c" #if ENABLE_SPECIALIZATION _PyForIterCache *cache = (_PyForIterCache *)next_instr; if (ADAPTIVE_COUNTER_IS_ZERO(cache->counter)) { @@ -3459,7 +3463,7 @@ DISPATCH(); } // Common case: no jump, leave it to the code generator - #line 3447 "Python/generated_cases.c.h" + #line 3467 "Python/generated_cases.c.h" STACK_GROW(1); stack_pointer[-1] = next; next_instr += 1; @@ -3467,7 +3471,7 @@ } TARGET(INSTRUMENTED_FOR_ITER) { - #line 2303 "Python/bytecodes.c" + #line 2304 "Python/bytecodes.c" _Py_CODEUNIT *here = next_instr-1; _Py_CODEUNIT *target; PyObject *iter = TOP(); @@ -3493,14 +3497,14 @@ target = next_instr + INLINE_CACHE_ENTRIES_FOR_ITER + oparg + 1; } INSTRUMENTED_JUMP(here, target, PY_MONITORING_EVENT_BRANCH); - #line 3481 "Python/generated_cases.c.h" + #line 3501 "Python/generated_cases.c.h" DISPATCH(); } TARGET(FOR_ITER_LIST) { PyObject *iter = stack_pointer[-1]; PyObject *next; - #line 2331 "Python/bytecodes.c" + #line 2332 "Python/bytecodes.c" DEOPT_IF(Py_TYPE(iter) != &PyListIter_Type, FOR_ITER); _PyListIterObject *it = (_PyListIterObject *)iter; STAT_INC(FOR_ITER, hit); @@ -3520,7 +3524,7 @@ DISPATCH(); end_for_iter_list: // Common case: no jump, leave it to the code generator - #line 3508 "Python/generated_cases.c.h" + #line 3528 "Python/generated_cases.c.h" STACK_GROW(1); stack_pointer[-1] = next; next_instr += 1; @@ -3530,7 +3534,7 @@ TARGET(FOR_ITER_TUPLE) { PyObject *iter = stack_pointer[-1]; PyObject *next; - #line 2353 "Python/bytecodes.c" + #line 2354 "Python/bytecodes.c" _PyTupleIterObject *it = (_PyTupleIterObject *)iter; DEOPT_IF(Py_TYPE(it) != &PyTupleIter_Type, FOR_ITER); STAT_INC(FOR_ITER, hit); @@ -3550,7 +3554,7 @@ DISPATCH(); end_for_iter_tuple: // Common case: no jump, leave it to the code generator - #line 3538 "Python/generated_cases.c.h" + #line 3558 "Python/generated_cases.c.h" STACK_GROW(1); stack_pointer[-1] = next; next_instr += 1; @@ -3560,7 +3564,7 @@ TARGET(FOR_ITER_RANGE) { PyObject *iter = stack_pointer[-1]; PyObject *next; - #line 2375 "Python/bytecodes.c" + #line 2376 "Python/bytecodes.c" _PyRangeIterObject *r = (_PyRangeIterObject *)iter; DEOPT_IF(Py_TYPE(r) != &PyRangeIter_Type, FOR_ITER); STAT_INC(FOR_ITER, hit); @@ -3578,7 +3582,7 @@ if (next == NULL) { goto error; } - #line 3566 "Python/generated_cases.c.h" + #line 3586 "Python/generated_cases.c.h" STACK_GROW(1); stack_pointer[-1] = next; next_instr += 1; @@ -3587,7 +3591,7 @@ TARGET(FOR_ITER_GEN) { PyObject *iter = stack_pointer[-1]; - #line 2395 "Python/bytecodes.c" + #line 2396 "Python/bytecodes.c" DEOPT_IF(tstate->interp->eval_frame, FOR_ITER); PyGenObject *gen = (PyGenObject *)iter; DEOPT_IF(Py_TYPE(gen) != &PyGen_Type, FOR_ITER); @@ -3603,14 +3607,14 @@ assert(next_instr[oparg].op.code == END_FOR || next_instr[oparg].op.code == INSTRUMENTED_END_FOR); DISPATCH_INLINED(gen_frame); - #line 3591 "Python/generated_cases.c.h" + #line 3611 "Python/generated_cases.c.h" } TARGET(BEFORE_ASYNC_WITH) { PyObject *mgr = stack_pointer[-1]; PyObject *exit; PyObject *res; - #line 2413 "Python/bytecodes.c" + #line 2414 "Python/bytecodes.c" PyObject *enter = _PyObject_LookupSpecial(mgr, &_Py_ID(__aenter__)); if (enter == NULL) { if (!_PyErr_Occurred(tstate)) { @@ -3633,16 +3637,16 @@ Py_DECREF(enter); goto error; } - #line 3621 "Python/generated_cases.c.h" + #line 3641 "Python/generated_cases.c.h" Py_DECREF(mgr); - #line 2436 "Python/bytecodes.c" + #line 2437 "Python/bytecodes.c" res = _PyObject_CallNoArgs(enter); Py_DECREF(enter); if (res == NULL) { Py_DECREF(exit); if (true) goto pop_1_error; } - #line 3630 "Python/generated_cases.c.h" + #line 3650 "Python/generated_cases.c.h" STACK_GROW(1); stack_pointer[-1] = res; stack_pointer[-2] = exit; @@ -3654,7 +3658,7 @@ PyObject *mgr = stack_pointer[-1]; PyObject *exit; PyObject *res; - #line 2446 "Python/bytecodes.c" + #line 2447 "Python/bytecodes.c" /* pop the context manager, push its __exit__ and the * value returned from calling its __enter__ */ @@ -3680,16 +3684,16 @@ Py_DECREF(enter); goto error; } - #line 3668 "Python/generated_cases.c.h" + #line 3688 "Python/generated_cases.c.h" Py_DECREF(mgr); - #line 2472 "Python/bytecodes.c" + #line 2473 "Python/bytecodes.c" res = _PyObject_CallNoArgs(enter); Py_DECREF(enter); if (res == NULL) { Py_DECREF(exit); if (true) goto pop_1_error; } - #line 3677 "Python/generated_cases.c.h" + #line 3697 "Python/generated_cases.c.h" STACK_GROW(1); stack_pointer[-1] = res; stack_pointer[-2] = exit; @@ -3701,7 +3705,7 @@ PyObject *lasti = stack_pointer[-3]; PyObject *exit_func = stack_pointer[-4]; PyObject *res; - #line 2481 "Python/bytecodes.c" + #line 2482 "Python/bytecodes.c" /* At the top of the stack are 4 values: - val: TOP = exc_info() - unused: SECOND = previous exception @@ -3722,7 +3726,7 @@ res = PyObject_Vectorcall(exit_func, stack + 1, 3 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL); if (res == NULL) goto error; - #line 3710 "Python/generated_cases.c.h" + #line 3730 "Python/generated_cases.c.h" STACK_GROW(1); stack_pointer[-1] = res; DISPATCH(); @@ -3731,7 +3735,7 @@ TARGET(PUSH_EXC_INFO) { PyObject *new_exc = stack_pointer[-1]; PyObject *prev_exc; - #line 2504 "Python/bytecodes.c" + #line 2505 "Python/bytecodes.c" _PyErr_StackItem *exc_info = tstate->exc_info; if (exc_info->exc_value != NULL) { prev_exc = exc_info->exc_value; @@ -3741,7 +3745,7 @@ } assert(PyExceptionInstance_Check(new_exc)); exc_info->exc_value = Py_NewRef(new_exc); - #line 3729 "Python/generated_cases.c.h" + #line 3749 "Python/generated_cases.c.h" STACK_GROW(1); stack_pointer[-1] = new_exc; stack_pointer[-2] = prev_exc; @@ -3755,7 +3759,7 @@ uint32_t type_version = read_u32(&next_instr[1].cache); uint32_t keys_version = read_u32(&next_instr[3].cache); PyObject *descr = read_obj(&next_instr[5].cache); - #line 2516 "Python/bytecodes.c" + #line 2517 "Python/bytecodes.c" /* Cached method object */ PyTypeObject *self_cls = Py_TYPE(self); assert(type_version != 0); @@ -3772,7 +3776,7 @@ assert(_PyType_HasFeature(Py_TYPE(res2), Py_TPFLAGS_METHOD_DESCRIPTOR)); res = self; assert(oparg & 1); - #line 3760 "Python/generated_cases.c.h" + #line 3780 "Python/generated_cases.c.h" STACK_GROW(((oparg & 1) ? 1 : 0)); stack_pointer[-1] = res; if (oparg & 1) { stack_pointer[-(1 + ((oparg & 1) ? 1 : 0))] = res2; } @@ -3786,7 +3790,7 @@ PyObject *res; uint32_t type_version = read_u32(&next_instr[1].cache); PyObject *descr = read_obj(&next_instr[5].cache); - #line 2535 "Python/bytecodes.c" + #line 2536 "Python/bytecodes.c" PyTypeObject *self_cls = Py_TYPE(self); DEOPT_IF(self_cls->tp_version_tag != type_version, LOAD_ATTR); assert(self_cls->tp_dictoffset == 0); @@ -3796,7 +3800,7 @@ res2 = Py_NewRef(descr); res = self; assert(oparg & 1); - #line 3784 "Python/generated_cases.c.h" + #line 3804 "Python/generated_cases.c.h" STACK_GROW(((oparg & 1) ? 1 : 0)); stack_pointer[-1] = res; if (oparg & 1) { stack_pointer[-(1 + ((oparg & 1) ? 1 : 0))] = res2; } @@ -3810,7 +3814,7 @@ PyObject *res; uint32_t type_version = read_u32(&next_instr[1].cache); PyObject *descr = read_obj(&next_instr[5].cache); - #line 2547 "Python/bytecodes.c" + #line 2548 "Python/bytecodes.c" PyTypeObject *self_cls = Py_TYPE(self); DEOPT_IF(self_cls->tp_version_tag != type_version, LOAD_ATTR); Py_ssize_t dictoffset = self_cls->tp_dictoffset; @@ -3824,7 +3828,7 @@ res2 = Py_NewRef(descr); res = self; assert(oparg & 1); - #line 3812 "Python/generated_cases.c.h" + #line 3832 "Python/generated_cases.c.h" STACK_GROW(((oparg & 1) ? 1 : 0)); stack_pointer[-1] = res; if (oparg & 1) { stack_pointer[-(1 + ((oparg & 1) ? 1 : 0))] = res2; } @@ -3833,16 +3837,16 @@ } TARGET(KW_NAMES) { - #line 2563 "Python/bytecodes.c" + #line 2564 "Python/bytecodes.c" assert(kwnames == NULL); assert(oparg < PyTuple_GET_SIZE(frame->f_code->co_consts)); kwnames = GETITEM(frame->f_code->co_consts, oparg); - #line 3825 "Python/generated_cases.c.h" + #line 3845 "Python/generated_cases.c.h" DISPATCH(); } TARGET(INSTRUMENTED_CALL) { - #line 2569 "Python/bytecodes.c" + #line 2570 "Python/bytecodes.c" int is_meth = PEEK(oparg+2) != NULL; int total_args = oparg + is_meth; PyObject *function = PEEK(total_args + 1); @@ -3855,7 +3859,7 @@ _PyCallCache *cache = (_PyCallCache *)next_instr; INCREMENT_ADAPTIVE_COUNTER(cache->counter); GO_TO_INSTRUCTION(CALL); - #line 3843 "Python/generated_cases.c.h" + #line 3863 "Python/generated_cases.c.h" } TARGET(CALL) { @@ -3865,7 +3869,7 @@ PyObject *callable = stack_pointer[-(1 + oparg)]; PyObject *method = stack_pointer[-(2 + oparg)]; PyObject *res; - #line 2614 "Python/bytecodes.c" + #line 2615 "Python/bytecodes.c" int is_meth = method != NULL; int total_args = oparg; if (is_meth) { @@ -3947,7 +3951,7 @@ Py_DECREF(args[i]); } if (res == NULL) { STACK_SHRINK(oparg); goto pop_2_error; } - #line 3935 "Python/generated_cases.c.h" + #line 3955 "Python/generated_cases.c.h" STACK_SHRINK(oparg); STACK_SHRINK(1); stack_pointer[-1] = res; @@ -3959,7 +3963,7 @@ TARGET(CALL_BOUND_METHOD_EXACT_ARGS) { PyObject *callable = stack_pointer[-(1 + oparg)]; PyObject *method = stack_pointer[-(2 + oparg)]; - #line 2702 "Python/bytecodes.c" + #line 2703 "Python/bytecodes.c" DEOPT_IF(method != NULL, CALL); DEOPT_IF(Py_TYPE(callable) != &PyMethod_Type, CALL); STAT_INC(CALL, hit); @@ -3969,7 +3973,7 @@ PEEK(oparg + 2) = Py_NewRef(meth); // method Py_DECREF(callable); GO_TO_INSTRUCTION(CALL_PY_EXACT_ARGS); - #line 3957 "Python/generated_cases.c.h" + #line 3977 "Python/generated_cases.c.h" } TARGET(CALL_PY_EXACT_ARGS) { @@ -3978,7 +3982,7 @@ PyObject *callable = stack_pointer[-(1 + oparg)]; PyObject *method = stack_pointer[-(2 + oparg)]; uint32_t func_version = read_u32(&next_instr[1].cache); - #line 2714 "Python/bytecodes.c" + #line 2715 "Python/bytecodes.c" assert(kwnames == NULL); DEOPT_IF(tstate->interp->eval_frame, CALL); int is_meth = method != NULL; @@ -4004,7 +4008,7 @@ JUMPBY(INLINE_CACHE_ENTRIES_CALL); frame->return_offset = 0; DISPATCH_INLINED(new_frame); - #line 3992 "Python/generated_cases.c.h" + #line 4012 "Python/generated_cases.c.h" } TARGET(CALL_PY_WITH_DEFAULTS) { @@ -4012,7 +4016,7 @@ PyObject *callable = stack_pointer[-(1 + oparg)]; PyObject *method = stack_pointer[-(2 + oparg)]; uint32_t func_version = read_u32(&next_instr[1].cache); - #line 2742 "Python/bytecodes.c" + #line 2743 "Python/bytecodes.c" assert(kwnames == NULL); DEOPT_IF(tstate->interp->eval_frame, CALL); int is_meth = method != NULL; @@ -4048,7 +4052,7 @@ JUMPBY(INLINE_CACHE_ENTRIES_CALL); frame->return_offset = 0; DISPATCH_INLINED(new_frame); - #line 4036 "Python/generated_cases.c.h" + #line 4056 "Python/generated_cases.c.h" } TARGET(CALL_NO_KW_TYPE_1) { @@ -4056,7 +4060,7 @@ PyObject *callable = stack_pointer[-(1 + oparg)]; PyObject *null = stack_pointer[-(2 + oparg)]; PyObject *res; - #line 2780 "Python/bytecodes.c" + #line 2781 "Python/bytecodes.c" assert(kwnames == NULL); assert(oparg == 1); DEOPT_IF(null != NULL, CALL); @@ -4066,7 +4070,7 @@ res = Py_NewRef(Py_TYPE(obj)); Py_DECREF(obj); Py_DECREF(&PyType_Type); // I.e., callable - #line 4054 "Python/generated_cases.c.h" + #line 4074 "Python/generated_cases.c.h" STACK_SHRINK(oparg); STACK_SHRINK(1); stack_pointer[-1] = res; @@ -4079,7 +4083,7 @@ PyObject *callable = stack_pointer[-(1 + oparg)]; PyObject *null = stack_pointer[-(2 + oparg)]; PyObject *res; - #line 2792 "Python/bytecodes.c" + #line 2793 "Python/bytecodes.c" assert(kwnames == NULL); assert(oparg == 1); DEOPT_IF(null != NULL, CALL); @@ -4090,7 +4094,7 @@ Py_DECREF(arg); Py_DECREF(&PyUnicode_Type); // I.e., callable if (res == NULL) { STACK_SHRINK(oparg); goto pop_2_error; } - #line 4078 "Python/generated_cases.c.h" + #line 4098 "Python/generated_cases.c.h" STACK_SHRINK(oparg); STACK_SHRINK(1); stack_pointer[-1] = res; @@ -4104,7 +4108,7 @@ PyObject *callable = stack_pointer[-(1 + oparg)]; PyObject *null = stack_pointer[-(2 + oparg)]; PyObject *res; - #line 2806 "Python/bytecodes.c" + #line 2807 "Python/bytecodes.c" assert(kwnames == NULL); assert(oparg == 1); DEOPT_IF(null != NULL, CALL); @@ -4115,7 +4119,7 @@ Py_DECREF(arg); Py_DECREF(&PyTuple_Type); // I.e., tuple if (res == NULL) { STACK_SHRINK(oparg); goto pop_2_error; } - #line 4103 "Python/generated_cases.c.h" + #line 4123 "Python/generated_cases.c.h" STACK_SHRINK(oparg); STACK_SHRINK(1); stack_pointer[-1] = res; @@ -4129,7 +4133,7 @@ PyObject *callable = stack_pointer[-(1 + oparg)]; PyObject *method = stack_pointer[-(2 + oparg)]; PyObject *res; - #line 2820 "Python/bytecodes.c" + #line 2821 "Python/bytecodes.c" int is_meth = method != NULL; int total_args = oparg; if (is_meth) { @@ -4151,7 +4155,7 @@ } Py_DECREF(tp); if (res == NULL) { STACK_SHRINK(oparg); goto pop_2_error; } - #line 4139 "Python/generated_cases.c.h" + #line 4159 "Python/generated_cases.c.h" STACK_SHRINK(oparg); STACK_SHRINK(1); stack_pointer[-1] = res; @@ -4165,7 +4169,7 @@ PyObject *callable = stack_pointer[-(1 + oparg)]; PyObject *method = stack_pointer[-(2 + oparg)]; PyObject *res; - #line 2845 "Python/bytecodes.c" + #line 2846 "Python/bytecodes.c" /* Builtin METH_O functions */ assert(kwnames == NULL); int is_meth = method != NULL; @@ -4193,7 +4197,7 @@ Py_DECREF(arg); Py_DECREF(callable); if (res == NULL) { STACK_SHRINK(oparg); goto pop_2_error; } - #line 4181 "Python/generated_cases.c.h" + #line 4201 "Python/generated_cases.c.h" STACK_SHRINK(oparg); STACK_SHRINK(1); stack_pointer[-1] = res; @@ -4207,7 +4211,7 @@ PyObject *callable = stack_pointer[-(1 + oparg)]; PyObject *method = stack_pointer[-(2 + oparg)]; PyObject *res; - #line 2876 "Python/bytecodes.c" + #line 2877 "Python/bytecodes.c" /* Builtin METH_FASTCALL functions, without keywords */ assert(kwnames == NULL); int is_meth = method != NULL; @@ -4239,7 +4243,7 @@ 'invalid'). In those cases an exception is set, so we must handle it. */ - #line 4227 "Python/generated_cases.c.h" + #line 4247 "Python/generated_cases.c.h" STACK_SHRINK(oparg); STACK_SHRINK(1); stack_pointer[-1] = res; @@ -4253,7 +4257,7 @@ PyObject *callable = stack_pointer[-(1 + oparg)]; PyObject *method = stack_pointer[-(2 + oparg)]; PyObject *res; - #line 2911 "Python/bytecodes.c" + #line 2912 "Python/bytecodes.c" /* Builtin METH_FASTCALL | METH_KEYWORDS functions */ int is_meth = method != NULL; int total_args = oparg; @@ -4285,7 +4289,7 @@ } Py_DECREF(callable); if (res == NULL) { STACK_SHRINK(oparg); goto pop_2_error; } - #line 4273 "Python/generated_cases.c.h" + #line 4293 "Python/generated_cases.c.h" STACK_SHRINK(oparg); STACK_SHRINK(1); stack_pointer[-1] = res; @@ -4299,7 +4303,7 @@ PyObject *callable = stack_pointer[-(1 + oparg)]; PyObject *method = stack_pointer[-(2 + oparg)]; PyObject *res; - #line 2946 "Python/bytecodes.c" + #line 2947 "Python/bytecodes.c" assert(kwnames == NULL); /* len(o) */ int is_meth = method != NULL; @@ -4324,7 +4328,7 @@ Py_DECREF(callable); Py_DECREF(arg); if (res == NULL) { STACK_SHRINK(oparg); goto pop_2_error; } - #line 4312 "Python/generated_cases.c.h" + #line 4332 "Python/generated_cases.c.h" STACK_SHRINK(oparg); STACK_SHRINK(1); stack_pointer[-1] = res; @@ -4337,7 +4341,7 @@ PyObject *callable = stack_pointer[-(1 + oparg)]; PyObject *method = stack_pointer[-(2 + oparg)]; PyObject *res; - #line 2973 "Python/bytecodes.c" + #line 2974 "Python/bytecodes.c" assert(kwnames == NULL); /* isinstance(o, o2) */ int is_meth = method != NULL; @@ -4364,7 +4368,7 @@ Py_DECREF(cls); Py_DECREF(callable); if (res == NULL) { STACK_SHRINK(oparg); goto pop_2_error; } - #line 4352 "Python/generated_cases.c.h" + #line 4372 "Python/generated_cases.c.h" STACK_SHRINK(oparg); STACK_SHRINK(1); stack_pointer[-1] = res; @@ -4376,7 +4380,7 @@ PyObject **args = (stack_pointer - oparg); PyObject *self = stack_pointer[-(1 + oparg)]; PyObject *method = stack_pointer[-(2 + oparg)]; - #line 3003 "Python/bytecodes.c" + #line 3004 "Python/bytecodes.c" assert(kwnames == NULL); assert(oparg == 1); assert(method != NULL); @@ -4394,14 +4398,14 @@ JUMPBY(INLINE_CACHE_ENTRIES_CALL + 1); assert(next_instr[-1].op.code == POP_TOP); DISPATCH(); - #line 4382 "Python/generated_cases.c.h" + #line 4402 "Python/generated_cases.c.h" } TARGET(CALL_NO_KW_METHOD_DESCRIPTOR_O) { PyObject **args = (stack_pointer - oparg); PyObject *method = stack_pointer[-(2 + oparg)]; PyObject *res; - #line 3023 "Python/bytecodes.c" + #line 3024 "Python/bytecodes.c" assert(kwnames == NULL); int is_meth = method != NULL; int total_args = oparg; @@ -4432,7 +4436,7 @@ Py_DECREF(arg); Py_DECREF(callable); if (res == NULL) { STACK_SHRINK(oparg); goto pop_2_error; } - #line 4420 "Python/generated_cases.c.h" + #line 4440 "Python/generated_cases.c.h" STACK_SHRINK(oparg); STACK_SHRINK(1); stack_pointer[-1] = res; @@ -4445,7 +4449,7 @@ PyObject **args = (stack_pointer - oparg); PyObject *method = stack_pointer[-(2 + oparg)]; PyObject *res; - #line 3057 "Python/bytecodes.c" + #line 3058 "Python/bytecodes.c" int is_meth = method != NULL; int total_args = oparg; if (is_meth) { @@ -4474,7 +4478,7 @@ } Py_DECREF(callable); if (res == NULL) { STACK_SHRINK(oparg); goto pop_2_error; } - #line 4462 "Python/generated_cases.c.h" + #line 4482 "Python/generated_cases.c.h" STACK_SHRINK(oparg); STACK_SHRINK(1); stack_pointer[-1] = res; @@ -4487,7 +4491,7 @@ PyObject **args = (stack_pointer - oparg); PyObject *method = stack_pointer[-(2 + oparg)]; PyObject *res; - #line 3089 "Python/bytecodes.c" + #line 3090 "Python/bytecodes.c" assert(kwnames == NULL); assert(oparg == 0 || oparg == 1); int is_meth = method != NULL; @@ -4516,7 +4520,7 @@ Py_DECREF(self); Py_DECREF(callable); if (res == NULL) { STACK_SHRINK(oparg); goto pop_2_error; } - #line 4504 "Python/generated_cases.c.h" + #line 4524 "Python/generated_cases.c.h" STACK_SHRINK(oparg); STACK_SHRINK(1); stack_pointer[-1] = res; @@ -4529,7 +4533,7 @@ PyObject **args = (stack_pointer - oparg); PyObject *method = stack_pointer[-(2 + oparg)]; PyObject *res; - #line 3121 "Python/bytecodes.c" + #line 3122 "Python/bytecodes.c" assert(kwnames == NULL); int is_meth = method != NULL; int total_args = oparg; @@ -4557,7 +4561,7 @@ } Py_DECREF(callable); if (res == NULL) { STACK_SHRINK(oparg); goto pop_2_error; } - #line 4545 "Python/generated_cases.c.h" + #line 4565 "Python/generated_cases.c.h" STACK_SHRINK(oparg); STACK_SHRINK(1); stack_pointer[-1] = res; @@ -4567,9 +4571,9 @@ } TARGET(INSTRUMENTED_CALL_FUNCTION_EX) { - #line 3152 "Python/bytecodes.c" + #line 3153 "Python/bytecodes.c" GO_TO_INSTRUCTION(CALL_FUNCTION_EX); - #line 4557 "Python/generated_cases.c.h" + #line 4577 "Python/generated_cases.c.h" } TARGET(CALL_FUNCTION_EX) { @@ -4578,7 +4582,7 @@ PyObject *callargs = stack_pointer[-(1 + ((oparg & 1) ? 1 : 0))]; PyObject *func = stack_pointer[-(2 + ((oparg & 1) ? 1 : 0))]; PyObject *result; - #line 3156 "Python/bytecodes.c" + #line 3157 "Python/bytecodes.c" // DICT_MERGE is called before this opcode if there are kwargs. // It converts all dict subtypes in kwargs into regular dicts. assert(kwargs == NULL || PyDict_CheckExact(kwargs)); @@ -4640,14 +4644,14 @@ } result = PyObject_Call(func, callargs, kwargs); } - #line 4628 "Python/generated_cases.c.h" + #line 4648 "Python/generated_cases.c.h" Py_DECREF(func); Py_DECREF(callargs); Py_XDECREF(kwargs); - #line 3218 "Python/bytecodes.c" + #line 3219 "Python/bytecodes.c" assert(PEEK(3 + (oparg & 1)) == NULL); if (result == NULL) { STACK_SHRINK(((oparg & 1) ? 1 : 0)); goto pop_3_error; } - #line 4635 "Python/generated_cases.c.h" + #line 4655 "Python/generated_cases.c.h" STACK_SHRINK(((oparg & 1) ? 1 : 0)); STACK_SHRINK(2); stack_pointer[-1] = result; @@ -4662,7 +4666,7 @@ PyObject *kwdefaults = (oparg & 0x02) ? stack_pointer[-(1 + ((oparg & 0x08) ? 1 : 0) + ((oparg & 0x04) ? 1 : 0) + ((oparg & 0x02) ? 1 : 0))] : NULL; PyObject *defaults = (oparg & 0x01) ? stack_pointer[-(1 + ((oparg & 0x08) ? 1 : 0) + ((oparg & 0x04) ? 1 : 0) + ((oparg & 0x02) ? 1 : 0) + ((oparg & 0x01) ? 1 : 0))] : NULL; PyObject *func; - #line 3228 "Python/bytecodes.c" + #line 3229 "Python/bytecodes.c" PyFunctionObject *func_obj = (PyFunctionObject *) PyFunction_New(codeobj, GLOBALS()); @@ -4691,14 +4695,14 @@ func_obj->func_version = ((PyCodeObject *)codeobj)->co_version; func = (PyObject *)func_obj; - #line 4679 "Python/generated_cases.c.h" + #line 4699 "Python/generated_cases.c.h" STACK_SHRINK(((oparg & 0x01) ? 1 : 0) + ((oparg & 0x02) ? 1 : 0) + ((oparg & 0x04) ? 1 : 0) + ((oparg & 0x08) ? 1 : 0)); stack_pointer[-1] = func; DISPATCH(); } TARGET(RETURN_GENERATOR) { - #line 3259 "Python/bytecodes.c" + #line 3260 "Python/bytecodes.c" assert(PyFunction_Check(frame->f_funcobj)); PyFunctionObject *func = (PyFunctionObject *)frame->f_funcobj; PyGenObject *gen = (PyGenObject *)_Py_MakeCoro(func); @@ -4719,7 +4723,7 @@ frame = cframe.current_frame = prev; _PyFrame_StackPush(frame, (PyObject *)gen); goto resume_frame; - #line 4707 "Python/generated_cases.c.h" + #line 4727 "Python/generated_cases.c.h" } TARGET(BUILD_SLICE) { @@ -4727,15 +4731,15 @@ PyObject *stop = stack_pointer[-(1 + ((oparg == 3) ? 1 : 0))]; PyObject *start = stack_pointer[-(2 + ((oparg == 3) ? 1 : 0))]; PyObject *slice; - #line 3282 "Python/bytecodes.c" + #line 3283 "Python/bytecodes.c" slice = PySlice_New(start, stop, step); - #line 4717 "Python/generated_cases.c.h" + #line 4737 "Python/generated_cases.c.h" Py_DECREF(start); Py_DECREF(stop); Py_XDECREF(step); - #line 3284 "Python/bytecodes.c" + #line 3285 "Python/bytecodes.c" if (slice == NULL) { STACK_SHRINK(((oparg == 3) ? 1 : 0)); goto pop_2_error; } - #line 4723 "Python/generated_cases.c.h" + #line 4743 "Python/generated_cases.c.h" STACK_SHRINK(((oparg == 3) ? 1 : 0)); STACK_SHRINK(1); stack_pointer[-1] = slice; @@ -4746,7 +4750,7 @@ PyObject *fmt_spec = ((oparg & FVS_MASK) == FVS_HAVE_SPEC) ? stack_pointer[-((((oparg & FVS_MASK) == FVS_HAVE_SPEC) ? 1 : 0))] : NULL; PyObject *value = stack_pointer[-(1 + (((oparg & FVS_MASK) == FVS_HAVE_SPEC) ? 1 : 0))]; PyObject *result; - #line 3288 "Python/bytecodes.c" + #line 3289 "Python/bytecodes.c" /* Handles f-string value formatting. */ PyObject *(*conv_fn)(PyObject *); int which_conversion = oparg & FVC_MASK; @@ -4781,7 +4785,7 @@ Py_DECREF(value); Py_XDECREF(fmt_spec); if (result == NULL) { STACK_SHRINK((((oparg & FVS_MASK) == FVS_HAVE_SPEC) ? 1 : 0)); goto pop_1_error; } - #line 4769 "Python/generated_cases.c.h" + #line 4789 "Python/generated_cases.c.h" STACK_SHRINK((((oparg & FVS_MASK) == FVS_HAVE_SPEC) ? 1 : 0)); stack_pointer[-1] = result; DISPATCH(); @@ -4790,10 +4794,10 @@ TARGET(COPY) { PyObject *bottom = stack_pointer[-(1 + (oparg-1))]; PyObject *top; - #line 3325 "Python/bytecodes.c" + #line 3326 "Python/bytecodes.c" assert(oparg > 0); top = Py_NewRef(bottom); - #line 4781 "Python/generated_cases.c.h" + #line 4801 "Python/generated_cases.c.h" STACK_GROW(1); stack_pointer[-1] = top; DISPATCH(); @@ -4805,7 +4809,7 @@ PyObject *rhs = stack_pointer[-1]; PyObject *lhs = stack_pointer[-2]; PyObject *res; - #line 3330 "Python/bytecodes.c" + #line 3331 "Python/bytecodes.c" #if ENABLE_SPECIALIZATION _PyBinaryOpCache *cache = (_PyBinaryOpCache *)next_instr; if (ADAPTIVE_COUNTER_IS_ZERO(cache->counter)) { @@ -4820,12 +4824,12 @@ assert((unsigned)oparg < Py_ARRAY_LENGTH(binary_ops)); assert(binary_ops[oparg]); res = binary_ops[oparg](lhs, rhs); - #line 4808 "Python/generated_cases.c.h" + #line 4828 "Python/generated_cases.c.h" Py_DECREF(lhs); Py_DECREF(rhs); - #line 3345 "Python/bytecodes.c" + #line 3346 "Python/bytecodes.c" if (res == NULL) goto pop_2_error; - #line 4813 "Python/generated_cases.c.h" + #line 4833 "Python/generated_cases.c.h" STACK_SHRINK(1); stack_pointer[-1] = res; next_instr += 1; @@ -4835,16 +4839,16 @@ TARGET(SWAP) { PyObject *top = stack_pointer[-1]; PyObject *bottom = stack_pointer[-(2 + (oparg-2))]; - #line 3350 "Python/bytecodes.c" + #line 3351 "Python/bytecodes.c" assert(oparg >= 2); - #line 4825 "Python/generated_cases.c.h" + #line 4845 "Python/generated_cases.c.h" stack_pointer[-1] = bottom; stack_pointer[-(2 + (oparg-2))] = top; DISPATCH(); } TARGET(INSTRUMENTED_INSTRUCTION) { - #line 3354 "Python/bytecodes.c" + #line 3355 "Python/bytecodes.c" int next_opcode = _Py_call_instrumentation_instruction( tstate, frame, next_instr-1); if (next_opcode < 0) goto error; @@ -4856,26 +4860,26 @@ assert(next_opcode > 0 && next_opcode < 256); opcode = next_opcode; DISPATCH_GOTO(); - #line 4844 "Python/generated_cases.c.h" + #line 4864 "Python/generated_cases.c.h" } TARGET(INSTRUMENTED_JUMP_FORWARD) { - #line 3368 "Python/bytecodes.c" + #line 3369 "Python/bytecodes.c" INSTRUMENTED_JUMP(next_instr-1, next_instr+oparg, PY_MONITORING_EVENT_JUMP); - #line 4850 "Python/generated_cases.c.h" + #line 4870 "Python/generated_cases.c.h" DISPATCH(); } TARGET(INSTRUMENTED_JUMP_BACKWARD) { - #line 3372 "Python/bytecodes.c" + #line 3373 "Python/bytecodes.c" INSTRUMENTED_JUMP(next_instr-1, next_instr-oparg, PY_MONITORING_EVENT_JUMP); - #line 4857 "Python/generated_cases.c.h" + #line 4877 "Python/generated_cases.c.h" CHECK_EVAL_BREAKER(); DISPATCH(); } TARGET(INSTRUMENTED_POP_JUMP_IF_TRUE) { - #line 3377 "Python/bytecodes.c" + #line 3378 "Python/bytecodes.c" PyObject *cond = POP(); int err = PyObject_IsTrue(cond); Py_DECREF(cond); @@ -4884,12 +4888,12 @@ assert(err == 0 || err == 1); int offset = err*oparg; INSTRUMENTED_JUMP(here, next_instr + offset, PY_MONITORING_EVENT_BRANCH); - #line 4872 "Python/generated_cases.c.h" + #line 4892 "Python/generated_cases.c.h" DISPATCH(); } TARGET(INSTRUMENTED_POP_JUMP_IF_FALSE) { - #line 3388 "Python/bytecodes.c" + #line 3389 "Python/bytecodes.c" PyObject *cond = POP(); int err = PyObject_IsTrue(cond); Py_DECREF(cond); @@ -4898,12 +4902,12 @@ assert(err == 0 || err == 1); int offset = (1-err)*oparg; INSTRUMENTED_JUMP(here, next_instr + offset, PY_MONITORING_EVENT_BRANCH); - #line 4886 "Python/generated_cases.c.h" + #line 4906 "Python/generated_cases.c.h" DISPATCH(); } TARGET(INSTRUMENTED_POP_JUMP_IF_NONE) { - #line 3399 "Python/bytecodes.c" + #line 3400 "Python/bytecodes.c" PyObject *value = POP(); _Py_CODEUNIT *here = next_instr-1; int offset; @@ -4915,12 +4919,12 @@ offset = 0; } INSTRUMENTED_JUMP(here, next_instr + offset, PY_MONITORING_EVENT_BRANCH); - #line 4903 "Python/generated_cases.c.h" + #line 4923 "Python/generated_cases.c.h" DISPATCH(); } TARGET(INSTRUMENTED_POP_JUMP_IF_NOT_NONE) { - #line 3413 "Python/bytecodes.c" + #line 3414 "Python/bytecodes.c" PyObject *value = POP(); _Py_CODEUNIT *here = next_instr-1; int offset; @@ -4932,30 +4936,30 @@ offset = oparg; } INSTRUMENTED_JUMP(here, next_instr + offset, PY_MONITORING_EVENT_BRANCH); - #line 4920 "Python/generated_cases.c.h" + #line 4940 "Python/generated_cases.c.h" DISPATCH(); } TARGET(EXTENDED_ARG) { - #line 3427 "Python/bytecodes.c" + #line 3428 "Python/bytecodes.c" assert(oparg); opcode = next_instr->op.code; oparg = oparg << 8 | next_instr->op.arg; PRE_DISPATCH_GOTO(); DISPATCH_GOTO(); - #line 4931 "Python/generated_cases.c.h" + #line 4951 "Python/generated_cases.c.h" } TARGET(CACHE) { - #line 3435 "Python/bytecodes.c" + #line 3436 "Python/bytecodes.c" assert(0 && "Executing a cache."); Py_UNREACHABLE(); - #line 4938 "Python/generated_cases.c.h" + #line 4958 "Python/generated_cases.c.h" } TARGET(RESERVED) { - #line 3440 "Python/bytecodes.c" + #line 3441 "Python/bytecodes.c" assert(0 && "Executing RESERVED instruction."); Py_UNREACHABLE(); - #line 4945 "Python/generated_cases.c.h" + #line 4965 "Python/generated_cases.c.h" } From c119a6ffc6cbb1a3122e74d6f1e78561d0f69fb7 Mon Sep 17 00:00:00 2001 From: Dong-hee Na Date: Thu, 1 Jun 2023 11:39:36 +0900 Subject: [PATCH 10/13] Update Misc/NEWS.d/next/Core and Builtins/2023-05-31-16-53-17.gh-issue-104635.iwf0d8.rst Co-authored-by: Carl Meyer --- .../2023-05-31-16-53-17.gh-issue-104635.iwf0d8.rst | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Misc/NEWS.d/next/Core and Builtins/2023-05-31-16-53-17.gh-issue-104635.iwf0d8.rst b/Misc/NEWS.d/next/Core and Builtins/2023-05-31-16-53-17.gh-issue-104635.iwf0d8.rst index c915bf0c02c6f0..9448a0e6aa2d8b 100644 --- a/Misc/NEWS.d/next/Core and Builtins/2023-05-31-16-53-17.gh-issue-104635.iwf0d8.rst +++ b/Misc/NEWS.d/next/Core and Builtins/2023-05-31-16-53-17.gh-issue-104635.iwf0d8.rst @@ -1,2 +1 @@ -The basic dead store elimination is adopted in the basic block optimization -process. Patch by Dong-hee Na and Carl Meyer. +Eliminate redundant :opcode:`STORE_FAST` instructions in the compiler. Patch by Dong-hee Na and Carl Meyer. From 6d159bb6057323cc68a3aa4720a708a9adc32009 Mon Sep 17 00:00:00 2001 From: Dong-hee Na Date: Thu, 1 Jun 2023 13:53:03 +0900 Subject: [PATCH 11/13] Address code review --- Lib/test/test_peepholer.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/Lib/test/test_peepholer.py b/Lib/test/test_peepholer.py index 07a50e82a077a3..f49c2172880f40 100644 --- a/Lib/test/test_peepholer.py +++ b/Lib/test/test_peepholer.py @@ -1088,7 +1088,6 @@ def test_dead_store_elimination_in_same_lineno(self): ('LOAD_CONST', 0, 1), ('LOAD_CONST', 1, 2), ('LOAD_CONST', 2, 3), - ('SWAP', 3, 4), ('STORE_FAST', 1, 4), ('STORE_FAST', 1, 4), ('STORE_FAST', 1, 4), @@ -1097,9 +1096,7 @@ def test_dead_store_elimination_in_same_lineno(self): expected_insts = [ ('LOAD_CONST', 0, 1), ('LOAD_CONST', 1, 2), - ('LOAD_CONST', 2, 3), - ('SWAP', 3, 4), - ('POP_TOP', 0, 4), + ('NOP', None, 3), ('POP_TOP', 0, 4), ('STORE_FAST', 1, 4), ('RETURN_VALUE', 5) @@ -1111,7 +1108,6 @@ def test_no_dead_store_elimination_in_different_lineno(self): ('LOAD_CONST', 0, 1), ('LOAD_CONST', 1, 2), ('LOAD_CONST', 2, 3), - ('SWAP', 3, 4), ('STORE_FAST', 1, 4), ('STORE_FAST', 1, 5), ('STORE_FAST', 1, 6), @@ -1121,7 +1117,6 @@ def test_no_dead_store_elimination_in_different_lineno(self): ('LOAD_CONST', 0, 1), ('LOAD_CONST', 1, 2), ('LOAD_CONST', 2, 3), - ('SWAP', 3, 4), ('STORE_FAST', 1, 4), ('STORE_FAST', 1, 5), ('STORE_FAST', 1, 6), From ba46ff373774a730611029e65661dbd0a58a175b Mon Sep 17 00:00:00 2001 From: Dong-hee Na Date: Thu, 1 Jun 2023 13:53:50 +0900 Subject: [PATCH 12/13] Address code review --- .../2023-05-31-16-53-17.gh-issue-104635.iwf0d8.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Misc/NEWS.d/next/Core and Builtins/2023-05-31-16-53-17.gh-issue-104635.iwf0d8.rst b/Misc/NEWS.d/next/Core and Builtins/2023-05-31-16-53-17.gh-issue-104635.iwf0d8.rst index 9448a0e6aa2d8b..ed314f374dc416 100644 --- a/Misc/NEWS.d/next/Core and Builtins/2023-05-31-16-53-17.gh-issue-104635.iwf0d8.rst +++ b/Misc/NEWS.d/next/Core and Builtins/2023-05-31-16-53-17.gh-issue-104635.iwf0d8.rst @@ -1 +1,2 @@ -Eliminate redundant :opcode:`STORE_FAST` instructions in the compiler. Patch by Dong-hee Na and Carl Meyer. +Eliminate redundant :opcode:`STORE_FAST` instructions in the compiler. +Patch by Dong-hee Na and Carl Meyer. From b0e0a0661677c31ecfa3be79cedd1d48e852876c Mon Sep 17 00:00:00 2001 From: Dong-hee Na Date: Thu, 1 Jun 2023 14:03:51 +0900 Subject: [PATCH 13/13] Move apply_static_swap to the last phase of bb optimization --- Lib/test/test_peepholer.py | 6 ++---- Python/flowgraph.c | 14 +++++++++----- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/Lib/test/test_peepholer.py b/Lib/test/test_peepholer.py index f49c2172880f40..4cc17b94882ab2 100644 --- a/Lib/test/test_peepholer.py +++ b/Lib/test/test_peepholer.py @@ -1074,9 +1074,7 @@ def test_no_unsafe_static_swap(self): expected_insts = [ ('LOAD_CONST', 0, 1), ('LOAD_CONST', 1, 2), - ('LOAD_CONST', 2, 3), - ('SWAP', 3, 4), - ('POP_TOP', 0, 4), + ('NOP', 0, 3), ('STORE_FAST', 1, 4), ('POP_TOP', 0, 4), ('RETURN_VALUE', 5) @@ -1096,7 +1094,7 @@ def test_dead_store_elimination_in_same_lineno(self): expected_insts = [ ('LOAD_CONST', 0, 1), ('LOAD_CONST', 1, 2), - ('NOP', None, 3), + ('NOP', 0, 3), ('POP_TOP', 0, 4), ('STORE_FAST', 1, 4), ('RETURN_VALUE', 5) diff --git a/Python/flowgraph.c b/Python/flowgraph.c index f5f0ff7120923d..b5509fe9a35b1a 100644 --- a/Python/flowgraph.c +++ b/Python/flowgraph.c @@ -1526,12 +1526,7 @@ optimize_basic_block(PyObject *const_cache, basicblock *bb, PyObject *consts) case SWAP: if (oparg == 1) { INSTR_SET_OP0(inst, NOP); - break; - } - if (swaptimize(bb, &i) < 0) { - goto error; } - apply_static_swaps(bb, i); break; case KW_NAMES: break; @@ -1546,6 +1541,15 @@ optimize_basic_block(PyObject *const_cache, basicblock *bb, PyObject *consts) assert (!HAS_CONST(inst->i_opcode)); } } + for (int i = 0; i < bb->b_iused; i++) { + cfg_instr *inst = &bb->b_instr[i]; + if (inst->i_opcode == SWAP) { + if (swaptimize(bb, &i) < 0) { + goto error; + } + apply_static_swaps(bb, i); + } + } return SUCCESS; error: return ERROR;