summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
Diffstat (limited to 'Python')
-rw-r--r--Python/ast_opt.c13
-rw-r--r--Python/bltinmodule.c16
-rw-r--r--Python/bytecodes.c19
-rw-r--r--Python/generated_cases.c.h773
-rw-r--r--Python/marshal.c9
-rw-r--r--Python/specialize.c8
6 files changed, 422 insertions, 416 deletions
diff --git a/Python/ast_opt.c b/Python/ast_opt.c
index 1a0b2a0..8270fa8 100644
--- a/Python/ast_opt.c
+++ b/Python/ast_opt.c
@@ -2,6 +2,7 @@
#include "Python.h"
#include "pycore_ast.h" // _PyAST_GetDocString()
#include "pycore_compile.h" // _PyASTOptimizeState
+#include "pycore_long.h" // _PyLong
#include "pycore_pystate.h" // _PyThreadState_GET()
#include "pycore_format.h" // F_LJUST
@@ -152,7 +153,9 @@ check_complexity(PyObject *obj, Py_ssize_t limit)
static PyObject *
safe_multiply(PyObject *v, PyObject *w)
{
- if (PyLong_Check(v) && PyLong_Check(w) && Py_SIZE(v) && Py_SIZE(w)) {
+ if (PyLong_Check(v) && PyLong_Check(w) &&
+ !_PyLong_IsZero((PyLongObject *)v) && !_PyLong_IsZero((PyLongObject *)w)
+ ) {
size_t vbits = _PyLong_NumBits(v);
size_t wbits = _PyLong_NumBits(w);
if (vbits == (size_t)-1 || wbits == (size_t)-1) {
@@ -198,7 +201,9 @@ safe_multiply(PyObject *v, PyObject *w)
static PyObject *
safe_power(PyObject *v, PyObject *w)
{
- if (PyLong_Check(v) && PyLong_Check(w) && Py_SIZE(v) && Py_SIZE(w) > 0) {
+ if (PyLong_Check(v) && PyLong_Check(w) &&
+ !_PyLong_IsZero((PyLongObject *)v) && _PyLong_IsPositive((PyLongObject *)w)
+ ) {
size_t vbits = _PyLong_NumBits(v);
size_t wbits = PyLong_AsSize_t(w);
if (vbits == (size_t)-1 || wbits == (size_t)-1) {
@@ -215,7 +220,9 @@ safe_power(PyObject *v, PyObject *w)
static PyObject *
safe_lshift(PyObject *v, PyObject *w)
{
- if (PyLong_Check(v) && PyLong_Check(w) && Py_SIZE(v) && Py_SIZE(w)) {
+ if (PyLong_Check(v) && PyLong_Check(w) &&
+ !_PyLong_IsZero((PyLongObject *)v) && !_PyLong_IsZero((PyLongObject *)w)
+ ) {
size_t vbits = _PyLong_NumBits(v);
size_t wbits = PyLong_AsSize_t(w);
if (vbits == (size_t)-1 || wbits == (size_t)-1) {
diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c
index 12ca0ba..55fd364 100644
--- a/Python/bltinmodule.c
+++ b/Python/bltinmodule.c
@@ -5,6 +5,7 @@
#include "pycore_ast.h" // _PyAST_Validate()
#include "pycore_call.h" // _PyObject_CallNoArgs()
#include "pycore_compile.h" // _PyAST_Compile()
+#include "pycore_long.h" // _PyLong_CompactValue
#include "pycore_object.h" // _Py_AddToAllObjects()
#include "pycore_pyerrors.h" // _PyErr_NoMemory()
#include "pycore_pystate.h" // _PyThreadState_GET()
@@ -2491,7 +2492,7 @@ builtin_sum_impl(PyObject *module, PyObject *iterable, PyObject *start)
*/
if (PyLong_CheckExact(result)) {
int overflow;
- long i_result = PyLong_AsLongAndOverflow(result, &overflow);
+ Py_ssize_t i_result = PyLong_AsLongAndOverflow(result, &overflow);
/* If this already overflowed, don't even enter the loop. */
if (overflow == 0) {
Py_SETREF(result, NULL);
@@ -2505,15 +2506,14 @@ builtin_sum_impl(PyObject *module, PyObject *iterable, PyObject *start)
return PyLong_FromLong(i_result);
}
if (PyLong_CheckExact(item) || PyBool_Check(item)) {
- long b;
+ Py_ssize_t b;
overflow = 0;
/* Single digits are common, fast, and cannot overflow on unpacking. */
- switch (Py_SIZE(item)) {
- case -1: b = -(sdigit) ((PyLongObject*)item)->long_value.ob_digit[0]; break;
- // Note: the continue goes to the top of the "while" loop that iterates over the elements
- case 0: Py_DECREF(item); continue;
- case 1: b = ((PyLongObject*)item)->long_value.ob_digit[0]; break;
- default: b = PyLong_AsLongAndOverflow(item, &overflow); break;
+ if (_PyLong_IsCompact((PyLongObject *)item)) {
+ b = _PyLong_CompactValue((PyLongObject *)item);
+ }
+ else {
+ b = PyLong_AsLongAndOverflow(item, &overflow);
}
if (overflow == 0 &&
(i_result >= 0 ? (b <= LONG_MAX - i_result)
diff --git a/Python/bytecodes.c b/Python/bytecodes.c
index ce2a58b..f1fec0b 100644
--- a/Python/bytecodes.c
+++ b/Python/bytecodes.c
@@ -345,8 +345,7 @@ dummy_func(
DEOPT_IF(!PyList_CheckExact(list), BINARY_SUBSCR);
// Deopt unless 0 <= sub < PyList_Size(list)
- DEOPT_IF(!_PyLong_IsPositiveSingleDigit(sub), BINARY_SUBSCR);
- assert(((PyLongObject *)_PyLong_GetZero())->long_value.ob_digit[0] == 0);
+ DEOPT_IF(!_PyLong_IsNonNegativeCompact((PyLongObject *)sub), BINARY_SUBSCR);
Py_ssize_t index = ((PyLongObject*)sub)->long_value.ob_digit[0];
DEOPT_IF(index >= PyList_GET_SIZE(list), BINARY_SUBSCR);
STAT_INC(BINARY_SUBSCR, hit);
@@ -363,8 +362,7 @@ dummy_func(
DEOPT_IF(!PyTuple_CheckExact(tuple), BINARY_SUBSCR);
// Deopt unless 0 <= sub < PyTuple_Size(list)
- DEOPT_IF(!_PyLong_IsPositiveSingleDigit(sub), BINARY_SUBSCR);
- assert(((PyLongObject *)_PyLong_GetZero())->long_value.ob_digit[0] == 0);
+ DEOPT_IF(!_PyLong_IsNonNegativeCompact((PyLongObject *)sub), BINARY_SUBSCR);
Py_ssize_t index = ((PyLongObject*)sub)->long_value.ob_digit[0];
DEOPT_IF(index >= PyTuple_GET_SIZE(tuple), BINARY_SUBSCR);
STAT_INC(BINARY_SUBSCR, hit);
@@ -456,7 +454,7 @@ dummy_func(
DEOPT_IF(!PyList_CheckExact(list), STORE_SUBSCR);
// Ensure nonnegative, zero-or-one-digit ints.
- DEOPT_IF(!_PyLong_IsPositiveSingleDigit(sub), STORE_SUBSCR);
+ DEOPT_IF(!_PyLong_IsNonNegativeCompact((PyLongObject *)sub), STORE_SUBSCR);
Py_ssize_t index = ((PyLongObject*)sub)->long_value.ob_digit[0];
// Ensure index < len(list)
DEOPT_IF(index >= PyList_GET_SIZE(list), STORE_SUBSCR);
@@ -1755,12 +1753,13 @@ dummy_func(
assert(cframe.use_tracing == 0);
DEOPT_IF(!PyLong_CheckExact(left), COMPARE_AND_BRANCH);
DEOPT_IF(!PyLong_CheckExact(right), COMPARE_AND_BRANCH);
- DEOPT_IF((size_t)(Py_SIZE(left) + 1) > 2, COMPARE_AND_BRANCH);
- DEOPT_IF((size_t)(Py_SIZE(right) + 1) > 2, COMPARE_AND_BRANCH);
+ DEOPT_IF(!_PyLong_IsCompact((PyLongObject *)left), COMPARE_AND_BRANCH);
+ DEOPT_IF(!_PyLong_IsCompact((PyLongObject *)right), COMPARE_AND_BRANCH);
STAT_INC(COMPARE_AND_BRANCH, hit);
- assert(Py_ABS(Py_SIZE(left)) <= 1 && Py_ABS(Py_SIZE(right)) <= 1);
- Py_ssize_t ileft = Py_SIZE(left) * ((PyLongObject *)left)->long_value.ob_digit[0];
- Py_ssize_t iright = Py_SIZE(right) * ((PyLongObject *)right)->long_value.ob_digit[0];
+ assert(_PyLong_DigitCount((PyLongObject *)left) <= 1 &&
+ _PyLong_DigitCount((PyLongObject *)right) <= 1);
+ Py_ssize_t ileft = _PyLong_CompactValue((PyLongObject *)left);
+ Py_ssize_t iright = _PyLong_CompactValue((PyLongObject *)right);
// 2 if <, 4 if >, 8 if ==; this matches the low 4 bits of the oparg
int sign_ish = COMPARISON_BIT(ileft, iright);
_Py_DECREF_SPECIALIZED(left, (destructor)PyObject_Free);
diff --git a/Python/generated_cases.c.h b/Python/generated_cases.c.h
index 34b608f..e9f28b0 100644
--- a/Python/generated_cases.c.h
+++ b/Python/generated_cases.c.h
@@ -547,8 +547,7 @@
DEOPT_IF(!PyList_CheckExact(list), BINARY_SUBSCR);
// Deopt unless 0 <= sub < PyList_Size(list)
- DEOPT_IF(!_PyLong_IsPositiveSingleDigit(sub), BINARY_SUBSCR);
- assert(((PyLongObject *)_PyLong_GetZero())->long_value.ob_digit[0] == 0);
+ DEOPT_IF(!_PyLong_IsNonNegativeCompact((PyLongObject *)sub), BINARY_SUBSCR);
Py_ssize_t index = ((PyLongObject*)sub)->long_value.ob_digit[0];
DEOPT_IF(index >= PyList_GET_SIZE(list), BINARY_SUBSCR);
STAT_INC(BINARY_SUBSCR, hit);
@@ -557,7 +556,7 @@
Py_INCREF(res);
_Py_DECREF_SPECIALIZED(sub, (destructor)PyObject_Free);
Py_DECREF(list);
- #line 561 "Python/generated_cases.c.h"
+ #line 560 "Python/generated_cases.c.h"
STACK_SHRINK(1);
stack_pointer[-1] = res;
next_instr += 4;
@@ -568,14 +567,13 @@
PyObject *sub = stack_pointer[-1];
PyObject *tuple = stack_pointer[-2];
PyObject *res;
- #line 361 "Python/bytecodes.c"
+ #line 360 "Python/bytecodes.c"
assert(cframe.use_tracing == 0);
DEOPT_IF(!PyLong_CheckExact(sub), BINARY_SUBSCR);
DEOPT_IF(!PyTuple_CheckExact(tuple), BINARY_SUBSCR);
// Deopt unless 0 <= sub < PyTuple_Size(list)
- DEOPT_IF(!_PyLong_IsPositiveSingleDigit(sub), BINARY_SUBSCR);
- assert(((PyLongObject *)_PyLong_GetZero())->long_value.ob_digit[0] == 0);
+ DEOPT_IF(!_PyLong_IsNonNegativeCompact((PyLongObject *)sub), BINARY_SUBSCR);
Py_ssize_t index = ((PyLongObject*)sub)->long_value.ob_digit[0];
DEOPT_IF(index >= PyTuple_GET_SIZE(tuple), BINARY_SUBSCR);
STAT_INC(BINARY_SUBSCR, hit);
@@ -584,7 +582,7 @@
Py_INCREF(res);
_Py_DECREF_SPECIALIZED(sub, (destructor)PyObject_Free);
Py_DECREF(tuple);
- #line 588 "Python/generated_cases.c.h"
+ #line 586 "Python/generated_cases.c.h"
STACK_SHRINK(1);
stack_pointer[-1] = res;
next_instr += 4;
@@ -595,7 +593,7 @@
PyObject *sub = stack_pointer[-1];
PyObject *dict = stack_pointer[-2];
PyObject *res;
- #line 379 "Python/bytecodes.c"
+ #line 377 "Python/bytecodes.c"
assert(cframe.use_tracing == 0);
DEOPT_IF(!PyDict_CheckExact(dict), BINARY_SUBSCR);
STAT_INC(BINARY_SUBSCR, hit);
@@ -604,14 +602,14 @@
if (!_PyErr_Occurred(tstate)) {
_PyErr_SetKeyError(sub);
}
- #line 608 "Python/generated_cases.c.h"
+ #line 606 "Python/generated_cases.c.h"
Py_DECREF(dict);
Py_DECREF(sub);
- #line 388 "Python/bytecodes.c"
+ #line 386 "Python/bytecodes.c"
if (true) goto pop_2_error;
}
Py_INCREF(res); // Do this before DECREF'ing dict, sub
- #line 615 "Python/generated_cases.c.h"
+ #line 613 "Python/generated_cases.c.h"
Py_DECREF(dict);
Py_DECREF(sub);
STACK_SHRINK(1);
@@ -625,7 +623,7 @@
PyObject *container = stack_pointer[-2];
uint32_t type_version = read_u32(&next_instr[1].cache);
uint16_t func_version = read_u16(&next_instr[3].cache);
- #line 395 "Python/bytecodes.c"
+ #line 393 "Python/bytecodes.c"
PyTypeObject *tp = Py_TYPE(container);
DEOPT_IF(tp->tp_version_tag != type_version, BINARY_SUBSCR);
assert(tp->tp_flags & Py_TPFLAGS_HEAPTYPE);
@@ -644,15 +642,15 @@
new_frame->localsplus[1] = sub;
JUMPBY(INLINE_CACHE_ENTRIES_BINARY_SUBSCR);
DISPATCH_INLINED(new_frame);
- #line 648 "Python/generated_cases.c.h"
+ #line 646 "Python/generated_cases.c.h"
}
TARGET(LIST_APPEND) {
PyObject *v = stack_pointer[-1];
PyObject *list = stack_pointer[-(2 + (oparg-1))];
- #line 416 "Python/bytecodes.c"
+ #line 414 "Python/bytecodes.c"
if (_PyList_AppendTakeRef((PyListObject *)list, v) < 0) goto pop_1_error;
- #line 656 "Python/generated_cases.c.h"
+ #line 654 "Python/generated_cases.c.h"
STACK_SHRINK(1);
PREDICT(JUMP_BACKWARD);
DISPATCH();
@@ -661,13 +659,13 @@
TARGET(SET_ADD) {
PyObject *v = stack_pointer[-1];
PyObject *set = stack_pointer[-(2 + (oparg-1))];
- #line 421 "Python/bytecodes.c"
+ #line 419 "Python/bytecodes.c"
int err = PySet_Add(set, v);
- #line 667 "Python/generated_cases.c.h"
+ #line 665 "Python/generated_cases.c.h"
Py_DECREF(v);
- #line 423 "Python/bytecodes.c"
+ #line 421 "Python/bytecodes.c"
if (err) goto pop_1_error;
- #line 671 "Python/generated_cases.c.h"
+ #line 669 "Python/generated_cases.c.h"
STACK_SHRINK(1);
PREDICT(JUMP_BACKWARD);
DISPATCH();
@@ -680,7 +678,7 @@
PyObject *container = stack_pointer[-2];
PyObject *v = stack_pointer[-3];
uint16_t counter = read_u16(&next_instr[0].cache);
- #line 434 "Python/bytecodes.c"
+ #line 432 "Python/bytecodes.c"
#if ENABLE_SPECIALIZATION
if (ADAPTIVE_COUNTER_IS_ZERO(counter)) {
assert(cframe.use_tracing == 0);
@@ -696,13 +694,13 @@
#endif /* ENABLE_SPECIALIZATION */
/* container[sub] = v */
int err = PyObject_SetItem(container, sub, v);
- #line 700 "Python/generated_cases.c.h"
+ #line 698 "Python/generated_cases.c.h"
Py_DECREF(v);
Py_DECREF(container);
Py_DECREF(sub);
- #line 450 "Python/bytecodes.c"
+ #line 448 "Python/bytecodes.c"
if (err) goto pop_3_error;
- #line 706 "Python/generated_cases.c.h"
+ #line 704 "Python/generated_cases.c.h"
STACK_SHRINK(3);
next_instr += 1;
DISPATCH();
@@ -712,13 +710,13 @@
PyObject *sub = stack_pointer[-1];
PyObject *list = stack_pointer[-2];
PyObject *value = stack_pointer[-3];
- #line 454 "Python/bytecodes.c"
+ #line 452 "Python/bytecodes.c"
assert(cframe.use_tracing == 0);
DEOPT_IF(!PyLong_CheckExact(sub), STORE_SUBSCR);
DEOPT_IF(!PyList_CheckExact(list), STORE_SUBSCR);
// Ensure nonnegative, zero-or-one-digit ints.
- DEOPT_IF(!_PyLong_IsPositiveSingleDigit(sub), STORE_SUBSCR);
+ DEOPT_IF(!_PyLong_IsNonNegativeCompact((PyLongObject *)sub), STORE_SUBSCR);
Py_ssize_t index = ((PyLongObject*)sub)->long_value.ob_digit[0];
// Ensure index < len(list)
DEOPT_IF(index >= PyList_GET_SIZE(list), STORE_SUBSCR);
@@ -730,7 +728,7 @@
Py_DECREF(old_value);
_Py_DECREF_SPECIALIZED(sub, (destructor)PyObject_Free);
Py_DECREF(list);
- #line 734 "Python/generated_cases.c.h"
+ #line 732 "Python/generated_cases.c.h"
STACK_SHRINK(3);
next_instr += 1;
DISPATCH();
@@ -740,14 +738,14 @@
PyObject *sub = stack_pointer[-1];
PyObject *dict = stack_pointer[-2];
PyObject *value = stack_pointer[-3];
- #line 474 "Python/bytecodes.c"
+ #line 472 "Python/bytecodes.c"
assert(cframe.use_tracing == 0);
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 751 "Python/generated_cases.c.h"
+ #line 749 "Python/generated_cases.c.h"
STACK_SHRINK(3);
next_instr += 1;
DISPATCH();
@@ -756,15 +754,15 @@
TARGET(DELETE_SUBSCR) {
PyObject *sub = stack_pointer[-1];
PyObject *container = stack_pointer[-2];
- #line 483 "Python/bytecodes.c"
+ #line 481 "Python/bytecodes.c"
/* del container[sub] */
int err = PyObject_DelItem(container, sub);
- #line 763 "Python/generated_cases.c.h"
+ #line 761 "Python/generated_cases.c.h"
Py_DECREF(container);
Py_DECREF(sub);
- #line 486 "Python/bytecodes.c"
+ #line 484 "Python/bytecodes.c"
if (err) goto pop_2_error;
- #line 768 "Python/generated_cases.c.h"
+ #line 766 "Python/generated_cases.c.h"
STACK_SHRINK(2);
DISPATCH();
}
@@ -772,14 +770,14 @@
TARGET(CALL_INTRINSIC_1) {
PyObject *value = stack_pointer[-1];
PyObject *res;
- #line 490 "Python/bytecodes.c"
+ #line 488 "Python/bytecodes.c"
assert(oparg <= MAX_INTRINSIC_1);
res = _PyIntrinsics_UnaryFunctions[oparg](tstate, value);
- #line 779 "Python/generated_cases.c.h"
+ #line 777 "Python/generated_cases.c.h"
Py_DECREF(value);
- #line 493 "Python/bytecodes.c"
+ #line 491 "Python/bytecodes.c"
if (res == NULL) goto pop_1_error;
- #line 783 "Python/generated_cases.c.h"
+ #line 781 "Python/generated_cases.c.h"
stack_pointer[-1] = res;
DISPATCH();
}
@@ -788,15 +786,15 @@
PyObject *value1 = stack_pointer[-1];
PyObject *value2 = stack_pointer[-2];
PyObject *res;
- #line 497 "Python/bytecodes.c"
+ #line 495 "Python/bytecodes.c"
assert(oparg <= MAX_INTRINSIC_2);
res = _PyIntrinsics_BinaryFunctions[oparg](tstate, value2, value1);
- #line 795 "Python/generated_cases.c.h"
+ #line 793 "Python/generated_cases.c.h"
Py_DECREF(value2);
Py_DECREF(value1);
- #line 500 "Python/bytecodes.c"
+ #line 498 "Python/bytecodes.c"
if (res == NULL) goto pop_2_error;
- #line 800 "Python/generated_cases.c.h"
+ #line 798 "Python/generated_cases.c.h"
STACK_SHRINK(1);
stack_pointer[-1] = res;
DISPATCH();
@@ -804,7 +802,7 @@
TARGET(RAISE_VARARGS) {
PyObject **args = (stack_pointer - oparg);
- #line 504 "Python/bytecodes.c"
+ #line 502 "Python/bytecodes.c"
PyObject *cause = NULL, *exc = NULL;
switch (oparg) {
case 2:
@@ -822,12 +820,12 @@
break;
}
if (true) { STACK_SHRINK(oparg); goto error; }
- #line 826 "Python/generated_cases.c.h"
+ #line 824 "Python/generated_cases.c.h"
}
TARGET(INTERPRETER_EXIT) {
PyObject *retval = stack_pointer[-1];
- #line 524 "Python/bytecodes.c"
+ #line 522 "Python/bytecodes.c"
assert(frame == &entry_frame);
assert(_PyFrame_IsIncomplete(frame));
STACK_SHRINK(1); // Since we're not going to DISPATCH()
@@ -839,12 +837,12 @@
assert(!_PyErr_Occurred(tstate));
_Py_LeaveRecursiveCallTstate(tstate);
return retval;
- #line 843 "Python/generated_cases.c.h"
+ #line 841 "Python/generated_cases.c.h"
}
TARGET(RETURN_VALUE) {
PyObject *retval = stack_pointer[-1];
- #line 538 "Python/bytecodes.c"
+ #line 536 "Python/bytecodes.c"
STACK_SHRINK(1);
assert(EMPTY());
_PyFrame_SetStackPointer(frame, stack_pointer);
@@ -858,11 +856,11 @@
_PyEvalFrameClearAndPop(tstate, dying);
_PyFrame_StackPush(frame, retval);
goto resume_frame;
- #line 862 "Python/generated_cases.c.h"
+ #line 860 "Python/generated_cases.c.h"
}
TARGET(RETURN_CONST) {
- #line 554 "Python/bytecodes.c"
+ #line 552 "Python/bytecodes.c"
PyObject *retval = GETITEM(frame->f_code->co_consts, oparg);
Py_INCREF(retval);
assert(EMPTY());
@@ -877,13 +875,13 @@
_PyEvalFrameClearAndPop(tstate, dying);
_PyFrame_StackPush(frame, retval);
goto resume_frame;
- #line 881 "Python/generated_cases.c.h"
+ #line 879 "Python/generated_cases.c.h"
}
TARGET(GET_AITER) {
PyObject *obj = stack_pointer[-1];
PyObject *iter;
- #line 571 "Python/bytecodes.c"
+ #line 569 "Python/bytecodes.c"
unaryfunc getter = NULL;
PyTypeObject *type = Py_TYPE(obj);
@@ -896,16 +894,16 @@
"'async for' requires an object with "
"__aiter__ method, got %.100s",
type->tp_name);
- #line 900 "Python/generated_cases.c.h"
+ #line 898 "Python/generated_cases.c.h"
Py_DECREF(obj);
- #line 584 "Python/bytecodes.c"
+ #line 582 "Python/bytecodes.c"
if (true) goto pop_1_error;
}
iter = (*getter)(obj);
- #line 907 "Python/generated_cases.c.h"
+ #line 905 "Python/generated_cases.c.h"
Py_DECREF(obj);
- #line 589 "Python/bytecodes.c"
+ #line 587 "Python/bytecodes.c"
if (iter == NULL) goto pop_1_error;
if (Py_TYPE(iter)->tp_as_async == NULL ||
@@ -918,7 +916,7 @@
Py_DECREF(iter);
if (true) goto pop_1_error;
}
- #line 922 "Python/generated_cases.c.h"
+ #line 920 "Python/generated_cases.c.h"
stack_pointer[-1] = iter;
DISPATCH();
}
@@ -926,7 +924,7 @@
TARGET(GET_ANEXT) {
PyObject *aiter = stack_pointer[-1];
PyObject *awaitable;
- #line 604 "Python/bytecodes.c"
+ #line 602 "Python/bytecodes.c"
unaryfunc getter = NULL;
PyObject *next_iter = NULL;
PyTypeObject *type = Py_TYPE(aiter);
@@ -970,7 +968,7 @@
}
}
- #line 974 "Python/generated_cases.c.h"
+ #line 972 "Python/generated_cases.c.h"
STACK_GROW(1);
stack_pointer[-1] = awaitable;
PREDICT(LOAD_CONST);
@@ -981,16 +979,16 @@
PREDICTED(GET_AWAITABLE);
PyObject *iterable = stack_pointer[-1];
PyObject *iter;
- #line 651 "Python/bytecodes.c"
+ #line 649 "Python/bytecodes.c"
iter = _PyCoro_GetAwaitableIter(iterable);
if (iter == NULL) {
format_awaitable_error(tstate, Py_TYPE(iterable), oparg);
}
- #line 992 "Python/generated_cases.c.h"
+ #line 990 "Python/generated_cases.c.h"
Py_DECREF(iterable);
- #line 658 "Python/bytecodes.c"
+ #line 656 "Python/bytecodes.c"
if (iter != NULL && PyCoro_CheckExact(iter)) {
PyObject *yf = _PyGen_yf((PyGenObject*)iter);
@@ -1008,7 +1006,7 @@
if (iter == NULL) goto pop_1_error;
- #line 1012 "Python/generated_cases.c.h"
+ #line 1010 "Python/generated_cases.c.h"
stack_pointer[-1] = iter;
PREDICT(LOAD_CONST);
DISPATCH();
@@ -1019,7 +1017,7 @@
PyObject *v = stack_pointer[-1];
PyObject *receiver = stack_pointer[-2];
PyObject *retval;
- #line 684 "Python/bytecodes.c"
+ #line 682 "Python/bytecodes.c"
#if ENABLE_SPECIALIZATION
_PySendCache *cache = (_PySendCache *)next_instr;
if (ADAPTIVE_COUNTER_IS_ZERO(cache->counter)) {
@@ -1055,7 +1053,7 @@
assert(retval != NULL);
}
Py_DECREF(v);
- #line 1059 "Python/generated_cases.c.h"
+ #line 1057 "Python/generated_cases.c.h"
stack_pointer[-1] = retval;
next_instr += 1;
DISPATCH();
@@ -1064,7 +1062,7 @@
TARGET(SEND_GEN) {
PyObject *v = stack_pointer[-1];
PyObject *receiver = stack_pointer[-2];
- #line 722 "Python/bytecodes.c"
+ #line 720 "Python/bytecodes.c"
assert(cframe.use_tracing == 0);
PyGenObject *gen = (PyGenObject *)receiver;
DEOPT_IF(Py_TYPE(gen) != &PyGen_Type &&
@@ -1080,12 +1078,12 @@
tstate->exc_info = &gen->gi_exc_state;
JUMPBY(INLINE_CACHE_ENTRIES_SEND + oparg);
DISPATCH_INLINED(gen_frame);
- #line 1084 "Python/generated_cases.c.h"
+ #line 1082 "Python/generated_cases.c.h"
}
TARGET(YIELD_VALUE) {
PyObject *retval = stack_pointer[-1];
- #line 740 "Python/bytecodes.c"
+ #line 738 "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.
@@ -1104,15 +1102,15 @@
frame->prev_instr -= frame->yield_offset;
_PyFrame_StackPush(frame, retval);
goto resume_frame;
- #line 1108 "Python/generated_cases.c.h"
+ #line 1106 "Python/generated_cases.c.h"
}
TARGET(POP_EXCEPT) {
PyObject *exc_value = stack_pointer[-1];
- #line 761 "Python/bytecodes.c"
+ #line 759 "Python/bytecodes.c"
_PyErr_StackItem *exc_info = tstate->exc_info;
Py_XSETREF(exc_info->exc_value, exc_value);
- #line 1116 "Python/generated_cases.c.h"
+ #line 1114 "Python/generated_cases.c.h"
STACK_SHRINK(1);
DISPATCH();
}
@@ -1120,7 +1118,7 @@
TARGET(RERAISE) {
PyObject *exc = stack_pointer[-1];
PyObject **values = (stack_pointer - (1 + oparg));
- #line 766 "Python/bytecodes.c"
+ #line 764 "Python/bytecodes.c"
assert(oparg >= 0 && oparg <= 2);
if (oparg) {
PyObject *lasti = values[0];
@@ -1138,26 +1136,26 @@
Py_INCREF(exc);
_PyErr_SetRaisedException(tstate, exc);
goto exception_unwind;
- #line 1142 "Python/generated_cases.c.h"
+ #line 1140 "Python/generated_cases.c.h"
}
TARGET(END_ASYNC_FOR) {
PyObject *exc = stack_pointer[-1];
PyObject *awaitable = stack_pointer[-2];
- #line 786 "Python/bytecodes.c"
+ #line 784 "Python/bytecodes.c"
assert(exc && PyExceptionInstance_Check(exc));
if (PyErr_GivenExceptionMatches(exc, PyExc_StopAsyncIteration)) {
- #line 1151 "Python/generated_cases.c.h"
+ #line 1149 "Python/generated_cases.c.h"
Py_DECREF(awaitable);
Py_DECREF(exc);
- #line 789 "Python/bytecodes.c"
+ #line 787 "Python/bytecodes.c"
}
else {
Py_INCREF(exc);
_PyErr_SetRaisedException(tstate, exc);
goto exception_unwind;
}
- #line 1161 "Python/generated_cases.c.h"
+ #line 1159 "Python/generated_cases.c.h"
STACK_SHRINK(2);
DISPATCH();
}
@@ -1168,23 +1166,23 @@
PyObject *sub_iter = stack_pointer[-3];
PyObject *none;
PyObject *value;
- #line 798 "Python/bytecodes.c"
+ #line 796 "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 1177 "Python/generated_cases.c.h"
+ #line 1175 "Python/generated_cases.c.h"
Py_DECREF(sub_iter);
Py_DECREF(last_sent_val);
Py_DECREF(exc_value);
- #line 803 "Python/bytecodes.c"
+ #line 801 "Python/bytecodes.c"
none = Py_NewRef(Py_None);
}
else {
_PyErr_SetRaisedException(tstate, Py_NewRef(exc_value));
goto exception_unwind;
}
- #line 1188 "Python/generated_cases.c.h"
+ #line 1186 "Python/generated_cases.c.h"
STACK_SHRINK(1);
stack_pointer[-1] = value;
stack_pointer[-2] = none;
@@ -1193,9 +1191,9 @@
TARGET(LOAD_ASSERTION_ERROR) {
PyObject *value;
- #line 812 "Python/bytecodes.c"
+ #line 810 "Python/bytecodes.c"
value = Py_NewRef(PyExc_AssertionError);
- #line 1199 "Python/generated_cases.c.h"
+ #line 1197 "Python/generated_cases.c.h"
STACK_GROW(1);
stack_pointer[-1] = value;
DISPATCH();
@@ -1203,7 +1201,7 @@
TARGET(LOAD_BUILD_CLASS) {
PyObject *bc;
- #line 816 "Python/bytecodes.c"
+ #line 814 "Python/bytecodes.c"
if (PyDict_CheckExact(BUILTINS())) {
bc = _PyDict_GetItemWithError(BUILTINS(),
&_Py_ID(__build_class__));
@@ -1225,7 +1223,7 @@
if (true) goto error;
}
}
- #line 1229 "Python/generated_cases.c.h"
+ #line 1227 "Python/generated_cases.c.h"
STACK_GROW(1);
stack_pointer[-1] = bc;
DISPATCH();
@@ -1233,33 +1231,33 @@
TARGET(STORE_NAME) {
PyObject *v = stack_pointer[-1];
- #line 840 "Python/bytecodes.c"
+ #line 838 "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 1244 "Python/generated_cases.c.h"
+ #line 1242 "Python/generated_cases.c.h"
Py_DECREF(v);
- #line 847 "Python/bytecodes.c"
+ #line 845 "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 1253 "Python/generated_cases.c.h"
+ #line 1251 "Python/generated_cases.c.h"
Py_DECREF(v);
- #line 854 "Python/bytecodes.c"
+ #line 852 "Python/bytecodes.c"
if (err) goto pop_1_error;
- #line 1257 "Python/generated_cases.c.h"
+ #line 1255 "Python/generated_cases.c.h"
STACK_SHRINK(1);
DISPATCH();
}
TARGET(DELETE_NAME) {
- #line 858 "Python/bytecodes.c"
+ #line 856 "Python/bytecodes.c"
PyObject *name = GETITEM(frame->f_code->co_names, oparg);
PyObject *ns = LOCALS();
int err;
@@ -1276,7 +1274,7 @@
name);
goto error;
}
- #line 1280 "Python/generated_cases.c.h"
+ #line 1278 "Python/generated_cases.c.h"
DISPATCH();
}
@@ -1284,7 +1282,7 @@
PREDICTED(UNPACK_SEQUENCE);
static_assert(INLINE_CACHE_ENTRIES_UNPACK_SEQUENCE == 1, "incorrect cache size");
PyObject *seq = stack_pointer[-1];
- #line 884 "Python/bytecodes.c"
+ #line 882 "Python/bytecodes.c"
#if ENABLE_SPECIALIZATION
_PyUnpackSequenceCache *cache = (_PyUnpackSequenceCache *)next_instr;
if (ADAPTIVE_COUNTER_IS_ZERO(cache->counter)) {
@@ -1298,11 +1296,11 @@
#endif /* ENABLE_SPECIALIZATION */
PyObject **top = stack_pointer + oparg - 1;
int res = unpack_iterable(tstate, seq, oparg, -1, top);
- #line 1302 "Python/generated_cases.c.h"
+ #line 1300 "Python/generated_cases.c.h"
Py_DECREF(seq);
- #line 898 "Python/bytecodes.c"
+ #line 896 "Python/bytecodes.c"
if (res == 0) goto pop_1_error;
- #line 1306 "Python/generated_cases.c.h"
+ #line 1304 "Python/generated_cases.c.h"
STACK_SHRINK(1);
STACK_GROW(oparg);
next_instr += 1;
@@ -1312,14 +1310,14 @@
TARGET(UNPACK_SEQUENCE_TWO_TUPLE) {
PyObject *seq = stack_pointer[-1];
PyObject **values = stack_pointer - (1);
- #line 902 "Python/bytecodes.c"
+ #line 900 "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 1323 "Python/generated_cases.c.h"
+ #line 1321 "Python/generated_cases.c.h"
Py_DECREF(seq);
STACK_SHRINK(1);
STACK_GROW(oparg);
@@ -1330,7 +1328,7 @@
TARGET(UNPACK_SEQUENCE_TUPLE) {
PyObject *seq = stack_pointer[-1];
PyObject **values = stack_pointer - (1);
- #line 912 "Python/bytecodes.c"
+ #line 910 "Python/bytecodes.c"
DEOPT_IF(!PyTuple_CheckExact(seq), UNPACK_SEQUENCE);
DEOPT_IF(PyTuple_GET_SIZE(seq) != oparg, UNPACK_SEQUENCE);
STAT_INC(UNPACK_SEQUENCE, hit);
@@ -1338,7 +1336,7 @@
for (int i = oparg; --i >= 0; ) {
*values++ = Py_NewRef(items[i]);
}
- #line 1342 "Python/generated_cases.c.h"
+ #line 1340 "Python/generated_cases.c.h"
Py_DECREF(seq);
STACK_SHRINK(1);
STACK_GROW(oparg);
@@ -1349,7 +1347,7 @@
TARGET(UNPACK_SEQUENCE_LIST) {
PyObject *seq = stack_pointer[-1];
PyObject **values = stack_pointer - (1);
- #line 923 "Python/bytecodes.c"
+ #line 921 "Python/bytecodes.c"
DEOPT_IF(!PyList_CheckExact(seq), UNPACK_SEQUENCE);
DEOPT_IF(PyList_GET_SIZE(seq) != oparg, UNPACK_SEQUENCE);
STAT_INC(UNPACK_SEQUENCE, hit);
@@ -1357,7 +1355,7 @@
for (int i = oparg; --i >= 0; ) {
*values++ = Py_NewRef(items[i]);
}
- #line 1361 "Python/generated_cases.c.h"
+ #line 1359 "Python/generated_cases.c.h"
Py_DECREF(seq);
STACK_SHRINK(1);
STACK_GROW(oparg);
@@ -1367,15 +1365,15 @@
TARGET(UNPACK_EX) {
PyObject *seq = stack_pointer[-1];
- #line 934 "Python/bytecodes.c"
+ #line 932 "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 1375 "Python/generated_cases.c.h"
+ #line 1373 "Python/generated_cases.c.h"
Py_DECREF(seq);
- #line 938 "Python/bytecodes.c"
+ #line 936 "Python/bytecodes.c"
if (res == 0) goto pop_1_error;
- #line 1379 "Python/generated_cases.c.h"
+ #line 1377 "Python/generated_cases.c.h"
STACK_GROW((oparg & 0xFF) + (oparg >> 8));
DISPATCH();
}
@@ -1386,7 +1384,7 @@
PyObject *owner = stack_pointer[-1];
PyObject *v = stack_pointer[-2];
uint16_t counter = read_u16(&next_instr[0].cache);
- #line 949 "Python/bytecodes.c"
+ #line 947 "Python/bytecodes.c"
#if ENABLE_SPECIALIZATION
if (ADAPTIVE_COUNTER_IS_ZERO(counter)) {
assert(cframe.use_tracing == 0);
@@ -1403,12 +1401,12 @@
#endif /* ENABLE_SPECIALIZATION */
PyObject *name = GETITEM(frame->f_code->co_names, oparg);
int err = PyObject_SetAttr(owner, name, v);
- #line 1407 "Python/generated_cases.c.h"
+ #line 1405 "Python/generated_cases.c.h"
Py_DECREF(v);
Py_DECREF(owner);
- #line 966 "Python/bytecodes.c"
+ #line 964 "Python/bytecodes.c"
if (err) goto pop_2_error;
- #line 1412 "Python/generated_cases.c.h"
+ #line 1410 "Python/generated_cases.c.h"
STACK_SHRINK(2);
next_instr += 4;
DISPATCH();
@@ -1416,34 +1414,34 @@
TARGET(DELETE_ATTR) {
PyObject *owner = stack_pointer[-1];
- #line 970 "Python/bytecodes.c"
+ #line 968 "Python/bytecodes.c"
PyObject *name = GETITEM(frame->f_code->co_names, oparg);
int err = PyObject_SetAttr(owner, name, (PyObject *)NULL);
- #line 1423 "Python/generated_cases.c.h"
+ #line 1421 "Python/generated_cases.c.h"
Py_DECREF(owner);
- #line 973 "Python/bytecodes.c"
+ #line 971 "Python/bytecodes.c"
if (err) goto pop_1_error;
- #line 1427 "Python/generated_cases.c.h"
+ #line 1425 "Python/generated_cases.c.h"
STACK_SHRINK(1);
DISPATCH();
}
TARGET(STORE_GLOBAL) {
PyObject *v = stack_pointer[-1];
- #line 977 "Python/bytecodes.c"
+ #line 975 "Python/bytecodes.c"
PyObject *name = GETITEM(frame->f_code->co_names, oparg);
int err = PyDict_SetItem(GLOBALS(), name, v);
- #line 1437 "Python/generated_cases.c.h"
+ #line 1435 "Python/generated_cases.c.h"
Py_DECREF(v);
- #line 980 "Python/bytecodes.c"
+ #line 978 "Python/bytecodes.c"
if (err) goto pop_1_error;
- #line 1441 "Python/generated_cases.c.h"
+ #line 1439 "Python/generated_cases.c.h"
STACK_SHRINK(1);
DISPATCH();
}
TARGET(DELETE_GLOBAL) {
- #line 984 "Python/bytecodes.c"
+ #line 982 "Python/bytecodes.c"
PyObject *name = GETITEM(frame->f_code->co_names, oparg);
int err;
err = PyDict_DelItem(GLOBALS(), name);
@@ -1455,13 +1453,13 @@
}
goto error;
}
- #line 1459 "Python/generated_cases.c.h"
+ #line 1457 "Python/generated_cases.c.h"
DISPATCH();
}
TARGET(LOAD_NAME) {
PyObject *v;
- #line 998 "Python/bytecodes.c"
+ #line 996 "Python/bytecodes.c"
PyObject *name = GETITEM(frame->f_code->co_names, oparg);
PyObject *locals = LOCALS();
if (locals == NULL) {
@@ -1520,7 +1518,7 @@
}
}
}
- #line 1524 "Python/generated_cases.c.h"
+ #line 1522 "Python/generated_cases.c.h"
STACK_GROW(1);
stack_pointer[-1] = v;
DISPATCH();
@@ -1531,7 +1529,7 @@
static_assert(INLINE_CACHE_ENTRIES_LOAD_GLOBAL == 4, "incorrect cache size");
PyObject *null = NULL;
PyObject *v;
- #line 1065 "Python/bytecodes.c"
+ #line 1063 "Python/bytecodes.c"
#if ENABLE_SPECIALIZATION
_PyLoadGlobalCache *cache = (_PyLoadGlobalCache *)next_instr;
if (ADAPTIVE_COUNTER_IS_ZERO(cache->counter)) {
@@ -1584,7 +1582,7 @@
}
}
null = NULL;
- #line 1588 "Python/generated_cases.c.h"
+ #line 1586 "Python/generated_cases.c.h"
STACK_GROW(1);
STACK_GROW(((oparg & 1) ? 1 : 0));
stack_pointer[-1] = v;
@@ -1598,7 +1596,7 @@
PyObject *res;
uint16_t index = read_u16(&next_instr[1].cache);
uint16_t version = read_u16(&next_instr[2].cache);
- #line 1120 "Python/bytecodes.c"
+ #line 1118 "Python/bytecodes.c"
assert(cframe.use_tracing == 0);
DEOPT_IF(!PyDict_CheckExact(GLOBALS()), LOAD_GLOBAL);
PyDictObject *dict = (PyDictObject *)GLOBALS();
@@ -1610,7 +1608,7 @@
Py_INCREF(res);
STAT_INC(LOAD_GLOBAL, hit);
null = NULL;
- #line 1614 "Python/generated_cases.c.h"
+ #line 1612 "Python/generated_cases.c.h"
STACK_GROW(1);
STACK_GROW(((oparg & 1) ? 1 : 0));
stack_pointer[-1] = res;
@@ -1625,7 +1623,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 1134 "Python/bytecodes.c"
+ #line 1132 "Python/bytecodes.c"
assert(cframe.use_tracing == 0);
DEOPT_IF(!PyDict_CheckExact(GLOBALS()), LOAD_GLOBAL);
DEOPT_IF(!PyDict_CheckExact(BUILTINS()), LOAD_GLOBAL);
@@ -1640,7 +1638,7 @@
Py_INCREF(res);
STAT_INC(LOAD_GLOBAL, hit);
null = NULL;
- #line 1644 "Python/generated_cases.c.h"
+ #line 1642 "Python/generated_cases.c.h"
STACK_GROW(1);
STACK_GROW(((oparg & 1) ? 1 : 0));
stack_pointer[-1] = res;
@@ -1650,16 +1648,16 @@
}
TARGET(DELETE_FAST) {
- #line 1151 "Python/bytecodes.c"
+ #line 1149 "Python/bytecodes.c"
PyObject *v = GETLOCAL(oparg);
if (v == NULL) goto unbound_local_error;
SETLOCAL(oparg, NULL);
- #line 1658 "Python/generated_cases.c.h"
+ #line 1656 "Python/generated_cases.c.h"
DISPATCH();
}
TARGET(MAKE_CELL) {
- #line 1157 "Python/bytecodes.c"
+ #line 1155 "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);
@@ -1668,12 +1666,12 @@
goto resume_with_error;
}
SETLOCAL(oparg, cell);
- #line 1672 "Python/generated_cases.c.h"
+ #line 1670 "Python/generated_cases.c.h"
DISPATCH();
}
TARGET(DELETE_DEREF) {
- #line 1168 "Python/bytecodes.c"
+ #line 1166 "Python/bytecodes.c"
PyObject *cell = GETLOCAL(oparg);
PyObject *oldobj = PyCell_GET(cell);
// Can't use ERROR_IF here.
@@ -1684,13 +1682,13 @@
}
PyCell_SET(cell, NULL);
Py_DECREF(oldobj);
- #line 1688 "Python/generated_cases.c.h"
+ #line 1686 "Python/generated_cases.c.h"
DISPATCH();
}
TARGET(LOAD_CLASSDEREF) {
PyObject *value;
- #line 1181 "Python/bytecodes.c"
+ #line 1179 "Python/bytecodes.c"
PyObject *name, *locals = LOCALS();
assert(locals);
assert(oparg >= 0 && oparg < frame->f_code->co_nlocalsplus);
@@ -1722,7 +1720,7 @@
}
Py_INCREF(value);
}
- #line 1726 "Python/generated_cases.c.h"
+ #line 1724 "Python/generated_cases.c.h"
STACK_GROW(1);
stack_pointer[-1] = value;
DISPATCH();
@@ -1730,7 +1728,7 @@
TARGET(LOAD_DEREF) {
PyObject *value;
- #line 1215 "Python/bytecodes.c"
+ #line 1213 "Python/bytecodes.c"
PyObject *cell = GETLOCAL(oparg);
value = PyCell_GET(cell);
if (value == NULL) {
@@ -1738,7 +1736,7 @@
if (true) goto error;
}
Py_INCREF(value);
- #line 1742 "Python/generated_cases.c.h"
+ #line 1740 "Python/generated_cases.c.h"
STACK_GROW(1);
stack_pointer[-1] = value;
DISPATCH();
@@ -1746,18 +1744,18 @@
TARGET(STORE_DEREF) {
PyObject *v = stack_pointer[-1];
- #line 1225 "Python/bytecodes.c"
+ #line 1223 "Python/bytecodes.c"
PyObject *cell = GETLOCAL(oparg);
PyObject *oldobj = PyCell_GET(cell);
PyCell_SET(cell, v);
Py_XDECREF(oldobj);
- #line 1755 "Python/generated_cases.c.h"
+ #line 1753 "Python/generated_cases.c.h"
STACK_SHRINK(1);
DISPATCH();
}
TARGET(COPY_FREE_VARS) {
- #line 1232 "Python/bytecodes.c"
+ #line 1230 "Python/bytecodes.c"
/* Copy closure variables to free variables */
PyCodeObject *co = frame->f_code;
assert(PyFunction_Check(frame->f_funcobj));
@@ -1768,22 +1766,22 @@
PyObject *o = PyTuple_GET_ITEM(closure, i);
frame->localsplus[offset + i] = Py_NewRef(o);
}
- #line 1772 "Python/generated_cases.c.h"
+ #line 1770 "Python/generated_cases.c.h"
DISPATCH();
}
TARGET(BUILD_STRING) {
PyObject **pieces = (stack_pointer - oparg);
PyObject *str;
- #line 1245 "Python/bytecodes.c"
+ #line 1243 "Python/bytecodes.c"
str = _PyUnicode_JoinArray(&_Py_STR(empty), pieces, oparg);
- #line 1781 "Python/generated_cases.c.h"
+ #line 1779 "Python/generated_cases.c.h"
for (int _i = oparg; --_i >= 0;) {
Py_DECREF(pieces[_i]);
}
- #line 1247 "Python/bytecodes.c"
+ #line 1245 "Python/bytecodes.c"
if (str == NULL) { STACK_SHRINK(oparg); goto error; }
- #line 1787 "Python/generated_cases.c.h"
+ #line 1785 "Python/generated_cases.c.h"
STACK_SHRINK(oparg);
STACK_GROW(1);
stack_pointer[-1] = str;
@@ -1793,10 +1791,10 @@
TARGET(BUILD_TUPLE) {
PyObject **values = (stack_pointer - oparg);
PyObject *tup;
- #line 1251 "Python/bytecodes.c"
+ #line 1249 "Python/bytecodes.c"
tup = _PyTuple_FromArraySteal(values, oparg);
if (tup == NULL) { STACK_SHRINK(oparg); goto error; }
- #line 1800 "Python/generated_cases.c.h"
+ #line 1798 "Python/generated_cases.c.h"
STACK_SHRINK(oparg);
STACK_GROW(1);
stack_pointer[-1] = tup;
@@ -1806,10 +1804,10 @@
TARGET(BUILD_LIST) {
PyObject **values = (stack_pointer - oparg);
PyObject *list;
- #line 1256 "Python/bytecodes.c"
+ #line 1254 "Python/bytecodes.c"
list = _PyList_FromArraySteal(values, oparg);
if (list == NULL) { STACK_SHRINK(oparg); goto error; }
- #line 1813 "Python/generated_cases.c.h"
+ #line 1811 "Python/generated_cases.c.h"
STACK_SHRINK(oparg);
STACK_GROW(1);
stack_pointer[-1] = list;
@@ -1819,7 +1817,7 @@
TARGET(LIST_EXTEND) {
PyObject *iterable = stack_pointer[-1];
PyObject *list = stack_pointer[-(2 + (oparg-1))];
- #line 1261 "Python/bytecodes.c"
+ #line 1259 "Python/bytecodes.c"
PyObject *none_val = _PyList_Extend((PyListObject *)list, iterable);
if (none_val == NULL) {
if (_PyErr_ExceptionMatches(tstate, PyExc_TypeError) &&
@@ -1830,13 +1828,13 @@
"Value after * must be an iterable, not %.200s",
Py_TYPE(iterable)->tp_name);
}
- #line 1834 "Python/generated_cases.c.h"
+ #line 1832 "Python/generated_cases.c.h"
Py_DECREF(iterable);
- #line 1272 "Python/bytecodes.c"
+ #line 1270 "Python/bytecodes.c"
if (true) goto pop_1_error;
}
Py_DECREF(none_val);
- #line 1840 "Python/generated_cases.c.h"
+ #line 1838 "Python/generated_cases.c.h"
Py_DECREF(iterable);
STACK_SHRINK(1);
DISPATCH();
@@ -1845,13 +1843,13 @@
TARGET(SET_UPDATE) {
PyObject *iterable = stack_pointer[-1];
PyObject *set = stack_pointer[-(2 + (oparg-1))];
- #line 1279 "Python/bytecodes.c"
+ #line 1277 "Python/bytecodes.c"
int err = _PySet_Update(set, iterable);
- #line 1851 "Python/generated_cases.c.h"
+ #line 1849 "Python/generated_cases.c.h"
Py_DECREF(iterable);
- #line 1281 "Python/bytecodes.c"
+ #line 1279 "Python/bytecodes.c"
if (err < 0) goto pop_1_error;
- #line 1855 "Python/generated_cases.c.h"
+ #line 1853 "Python/generated_cases.c.h"
STACK_SHRINK(1);
DISPATCH();
}
@@ -1859,7 +1857,7 @@
TARGET(BUILD_SET) {
PyObject **values = (stack_pointer - oparg);
PyObject *set;
- #line 1285 "Python/bytecodes.c"
+ #line 1283 "Python/bytecodes.c"
set = PySet_New(NULL);
if (set == NULL)
goto error;
@@ -1874,7 +1872,7 @@
Py_DECREF(set);
if (true) { STACK_SHRINK(oparg); goto error; }
}
- #line 1878 "Python/generated_cases.c.h"
+ #line 1876 "Python/generated_cases.c.h"
STACK_SHRINK(oparg);
STACK_GROW(1);
stack_pointer[-1] = set;
@@ -1884,7 +1882,7 @@
TARGET(BUILD_MAP) {
PyObject **values = (stack_pointer - oparg*2);
PyObject *map;
- #line 1302 "Python/bytecodes.c"
+ #line 1300 "Python/bytecodes.c"
map = _PyDict_FromItems(
values, 2,
values+1, 2,
@@ -1892,13 +1890,13 @@
if (map == NULL)
goto error;
- #line 1896 "Python/generated_cases.c.h"
+ #line 1894 "Python/generated_cases.c.h"
for (int _i = oparg*2; --_i >= 0;) {
Py_DECREF(values[_i]);
}
- #line 1310 "Python/bytecodes.c"
+ #line 1308 "Python/bytecodes.c"
if (map == NULL) { STACK_SHRINK(oparg*2); goto error; }
- #line 1902 "Python/generated_cases.c.h"
+ #line 1900 "Python/generated_cases.c.h"
STACK_SHRINK(oparg*2);
STACK_GROW(1);
stack_pointer[-1] = map;
@@ -1906,7 +1904,7 @@
}
TARGET(SETUP_ANNOTATIONS) {
- #line 1314 "Python/bytecodes.c"
+ #line 1312 "Python/bytecodes.c"
int err;
PyObject *ann_dict;
if (LOCALS() == NULL) {
@@ -1946,7 +1944,7 @@
Py_DECREF(ann_dict);
}
}
- #line 1950 "Python/generated_cases.c.h"
+ #line 1948 "Python/generated_cases.c.h"
DISPATCH();
}
@@ -1954,7 +1952,7 @@
PyObject *keys = stack_pointer[-1];
PyObject **values = (stack_pointer - (1 + oparg));
PyObject *map;
- #line 1356 "Python/bytecodes.c"
+ #line 1354 "Python/bytecodes.c"
if (!PyTuple_CheckExact(keys) ||
PyTuple_GET_SIZE(keys) != (Py_ssize_t)oparg) {
_PyErr_SetString(tstate, PyExc_SystemError,
@@ -1964,14 +1962,14 @@
map = _PyDict_FromItems(
&PyTuple_GET_ITEM(keys, 0), 1,
values, 1, oparg);
- #line 1968 "Python/generated_cases.c.h"
+ #line 1966 "Python/generated_cases.c.h"
for (int _i = oparg; --_i >= 0;) {
Py_DECREF(values[_i]);
}
Py_DECREF(keys);
- #line 1366 "Python/bytecodes.c"
+ #line 1364 "Python/bytecodes.c"
if (map == NULL) { STACK_SHRINK(oparg); goto pop_1_error; }
- #line 1975 "Python/generated_cases.c.h"
+ #line 1973 "Python/generated_cases.c.h"
STACK_SHRINK(oparg);
stack_pointer[-1] = map;
DISPATCH();
@@ -1979,7 +1977,7 @@
TARGET(DICT_UPDATE) {
PyObject *update = stack_pointer[-1];
- #line 1370 "Python/bytecodes.c"
+ #line 1368 "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)) {
@@ -1987,12 +1985,12 @@
"'%.200s' object is not a mapping",
Py_TYPE(update)->tp_name);
}
- #line 1991 "Python/generated_cases.c.h"
+ #line 1989 "Python/generated_cases.c.h"
Py_DECREF(update);
- #line 1378 "Python/bytecodes.c"
+ #line 1376 "Python/bytecodes.c"
if (true) goto pop_1_error;
}
- #line 1996 "Python/generated_cases.c.h"
+ #line 1994 "Python/generated_cases.c.h"
Py_DECREF(update);
STACK_SHRINK(1);
DISPATCH();
@@ -2000,17 +1998,17 @@
TARGET(DICT_MERGE) {
PyObject *update = stack_pointer[-1];
- #line 1384 "Python/bytecodes.c"
+ #line 1382 "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 2009 "Python/generated_cases.c.h"
+ #line 2007 "Python/generated_cases.c.h"
Py_DECREF(update);
- #line 1389 "Python/bytecodes.c"
+ #line 1387 "Python/bytecodes.c"
if (true) goto pop_1_error;
}
- #line 2014 "Python/generated_cases.c.h"
+ #line 2012 "Python/generated_cases.c.h"
Py_DECREF(update);
STACK_SHRINK(1);
PREDICT(CALL_FUNCTION_EX);
@@ -2020,13 +2018,13 @@
TARGET(MAP_ADD) {
PyObject *value = stack_pointer[-1];
PyObject *key = stack_pointer[-2];
- #line 1396 "Python/bytecodes.c"
+ #line 1394 "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 2030 "Python/generated_cases.c.h"
+ #line 2028 "Python/generated_cases.c.h"
STACK_SHRINK(2);
PREDICT(JUMP_BACKWARD);
DISPATCH();
@@ -2038,7 +2036,7 @@
PyObject *owner = stack_pointer[-1];
PyObject *res2 = NULL;
PyObject *res;
- #line 1419 "Python/bytecodes.c"
+ #line 1417 "Python/bytecodes.c"
#if ENABLE_SPECIALIZATION
_PyAttrCache *cache = (_PyAttrCache *)next_instr;
if (ADAPTIVE_COUNTER_IS_ZERO(cache->counter)) {
@@ -2073,9 +2071,9 @@
NULL | meth | arg1 | ... | argN
*/
- #line 2077 "Python/generated_cases.c.h"
+ #line 2075 "Python/generated_cases.c.h"
Py_DECREF(owner);
- #line 1454 "Python/bytecodes.c"
+ #line 1452 "Python/bytecodes.c"
if (meth == NULL) goto pop_1_error;
res2 = NULL;
res = meth;
@@ -2084,12 +2082,12 @@
else {
/* Classic, pushes one value. */
res = PyObject_GetAttr(owner, name);
- #line 2088 "Python/generated_cases.c.h"
+ #line 2086 "Python/generated_cases.c.h"
Py_DECREF(owner);
- #line 1463 "Python/bytecodes.c"
+ #line 1461 "Python/bytecodes.c"
if (res == NULL) goto pop_1_error;
}
- #line 2093 "Python/generated_cases.c.h"
+ #line 2091 "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; }
@@ -2103,7 +2101,7 @@
PyObject *res;
uint32_t type_version = read_u32(&next_instr[1].cache);
uint16_t index = read_u16(&next_instr[3].cache);
- #line 1468 "Python/bytecodes.c"
+ #line 1466 "Python/bytecodes.c"
assert(cframe.use_tracing == 0);
PyTypeObject *tp = Py_TYPE(owner);
assert(type_version != 0);
@@ -2117,7 +2115,7 @@
STAT_INC(LOAD_ATTR, hit);
Py_INCREF(res);
res2 = NULL;
- #line 2121 "Python/generated_cases.c.h"
+ #line 2119 "Python/generated_cases.c.h"
Py_DECREF(owner);
STACK_GROW(((oparg & 1) ? 1 : 0));
stack_pointer[-1] = res;
@@ -2132,7 +2130,7 @@
PyObject *res;
uint32_t type_version = read_u32(&next_instr[1].cache);
uint16_t index = read_u16(&next_instr[3].cache);
- #line 1485 "Python/bytecodes.c"
+ #line 1483 "Python/bytecodes.c"
assert(cframe.use_tracing == 0);
DEOPT_IF(!PyModule_CheckExact(owner), LOAD_ATTR);
PyDictObject *dict = (PyDictObject *)((PyModuleObject *)owner)->md_dict;
@@ -2146,7 +2144,7 @@
STAT_INC(LOAD_ATTR, hit);
Py_INCREF(res);
res2 = NULL;
- #line 2150 "Python/generated_cases.c.h"
+ #line 2148 "Python/generated_cases.c.h"
Py_DECREF(owner);
STACK_GROW(((oparg & 1) ? 1 : 0));
stack_pointer[-1] = res;
@@ -2161,7 +2159,7 @@
PyObject *res;
uint32_t type_version = read_u32(&next_instr[1].cache);
uint16_t index = read_u16(&next_instr[3].cache);
- #line 1502 "Python/bytecodes.c"
+ #line 1500 "Python/bytecodes.c"
assert(cframe.use_tracing == 0);
PyTypeObject *tp = Py_TYPE(owner);
assert(type_version != 0);
@@ -2189,7 +2187,7 @@
STAT_INC(LOAD_ATTR, hit);
Py_INCREF(res);
res2 = NULL;
- #line 2193 "Python/generated_cases.c.h"
+ #line 2191 "Python/generated_cases.c.h"
Py_DECREF(owner);
STACK_GROW(((oparg & 1) ? 1 : 0));
stack_pointer[-1] = res;
@@ -2204,7 +2202,7 @@
PyObject *res;
uint32_t type_version = read_u32(&next_instr[1].cache);
uint16_t index = read_u16(&next_instr[3].cache);
- #line 1533 "Python/bytecodes.c"
+ #line 1531 "Python/bytecodes.c"
assert(cframe.use_tracing == 0);
PyTypeObject *tp = Py_TYPE(owner);
assert(type_version != 0);
@@ -2215,7 +2213,7 @@
STAT_INC(LOAD_ATTR, hit);
Py_INCREF(res);
res2 = NULL;
- #line 2219 "Python/generated_cases.c.h"
+ #line 2217 "Python/generated_cases.c.h"
Py_DECREF(owner);
STACK_GROW(((oparg & 1) ? 1 : 0));
stack_pointer[-1] = res;
@@ -2230,7 +2228,7 @@
PyObject *res;
uint32_t type_version = read_u32(&next_instr[1].cache);
PyObject *descr = read_obj(&next_instr[5].cache);
- #line 1547 "Python/bytecodes.c"
+ #line 1545 "Python/bytecodes.c"
assert(cframe.use_tracing == 0);
DEOPT_IF(!PyType_Check(cls), LOAD_ATTR);
@@ -2243,7 +2241,7 @@
res = descr;
assert(res != NULL);
Py_INCREF(res);
- #line 2247 "Python/generated_cases.c.h"
+ #line 2245 "Python/generated_cases.c.h"
Py_DECREF(cls);
STACK_GROW(((oparg & 1) ? 1 : 0));
stack_pointer[-1] = res;
@@ -2257,7 +2255,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 1563 "Python/bytecodes.c"
+ #line 1561 "Python/bytecodes.c"
assert(cframe.use_tracing == 0);
DEOPT_IF(tstate->interp->eval_frame, LOAD_ATTR);
@@ -2281,7 +2279,7 @@
new_frame->localsplus[0] = owner;
JUMPBY(INLINE_CACHE_ENTRIES_LOAD_ATTR);
DISPATCH_INLINED(new_frame);
- #line 2285 "Python/generated_cases.c.h"
+ #line 2283 "Python/generated_cases.c.h"
}
TARGET(LOAD_ATTR_GETATTRIBUTE_OVERRIDDEN) {
@@ -2289,7 +2287,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 1589 "Python/bytecodes.c"
+ #line 1587 "Python/bytecodes.c"
assert(cframe.use_tracing == 0);
DEOPT_IF(tstate->interp->eval_frame, LOAD_ATTR);
PyTypeObject *cls = Py_TYPE(owner);
@@ -2315,7 +2313,7 @@
new_frame->localsplus[1] = Py_NewRef(name);
JUMPBY(INLINE_CACHE_ENTRIES_LOAD_ATTR);
DISPATCH_INLINED(new_frame);
- #line 2319 "Python/generated_cases.c.h"
+ #line 2317 "Python/generated_cases.c.h"
}
TARGET(STORE_ATTR_INSTANCE_VALUE) {
@@ -2323,7 +2321,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 1617 "Python/bytecodes.c"
+ #line 1615 "Python/bytecodes.c"
assert(cframe.use_tracing == 0);
PyTypeObject *tp = Py_TYPE(owner);
assert(type_version != 0);
@@ -2342,7 +2340,7 @@
Py_DECREF(old_value);
}
Py_DECREF(owner);
- #line 2346 "Python/generated_cases.c.h"
+ #line 2344 "Python/generated_cases.c.h"
STACK_SHRINK(2);
next_instr += 4;
DISPATCH();
@@ -2353,7 +2351,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 1638 "Python/bytecodes.c"
+ #line 1636 "Python/bytecodes.c"
assert(cframe.use_tracing == 0);
PyTypeObject *tp = Py_TYPE(owner);
assert(type_version != 0);
@@ -2393,7 +2391,7 @@
/* PEP 509 */
dict->ma_version_tag = new_version;
Py_DECREF(owner);
- #line 2397 "Python/generated_cases.c.h"
+ #line 2395 "Python/generated_cases.c.h"
STACK_SHRINK(2);
next_instr += 4;
DISPATCH();
@@ -2404,7 +2402,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 1680 "Python/bytecodes.c"
+ #line 1678 "Python/bytecodes.c"
assert(cframe.use_tracing == 0);
PyTypeObject *tp = Py_TYPE(owner);
assert(type_version != 0);
@@ -2415,7 +2413,7 @@
*(PyObject **)addr = value;
Py_XDECREF(old_value);
Py_DECREF(owner);
- #line 2419 "Python/generated_cases.c.h"
+ #line 2417 "Python/generated_cases.c.h"
STACK_SHRINK(2);
next_instr += 4;
DISPATCH();
@@ -2425,16 +2423,16 @@
PyObject *right = stack_pointer[-1];
PyObject *left = stack_pointer[-2];
PyObject *res;
- #line 1693 "Python/bytecodes.c"
+ #line 1691 "Python/bytecodes.c"
STAT_INC(COMPARE_OP, deferred);
assert((oparg >> 4) <= Py_GE);
res = PyObject_RichCompare(left, right, oparg>>4);
- #line 2433 "Python/generated_cases.c.h"
+ #line 2431 "Python/generated_cases.c.h"
Py_DECREF(left);
Py_DECREF(right);
- #line 1697 "Python/bytecodes.c"
+ #line 1695 "Python/bytecodes.c"
if (res == NULL) goto pop_2_error;
- #line 2438 "Python/generated_cases.c.h"
+ #line 2436 "Python/generated_cases.c.h"
STACK_SHRINK(1);
stack_pointer[-1] = res;
next_instr += 1;
@@ -2445,7 +2443,7 @@
PREDICTED(COMPARE_AND_BRANCH);
PyObject *right = stack_pointer[-1];
PyObject *left = stack_pointer[-2];
- #line 1709 "Python/bytecodes.c"
+ #line 1707 "Python/bytecodes.c"
#if ENABLE_SPECIALIZATION
_PyCompareOpCache *cache = (_PyCompareOpCache *)next_instr;
if (ADAPTIVE_COUNTER_IS_ZERO(cache->counter)) {
@@ -2459,10 +2457,10 @@
#endif /* ENABLE_SPECIALIZATION */
assert((oparg >> 4) <= Py_GE);
PyObject *cond = PyObject_RichCompare(left, right, oparg>>4);
- #line 2463 "Python/generated_cases.c.h"
+ #line 2461 "Python/generated_cases.c.h"
Py_DECREF(left);
Py_DECREF(right);
- #line 1723 "Python/bytecodes.c"
+ #line 1721 "Python/bytecodes.c"
if (cond == NULL) goto pop_2_error;
assert(next_instr[1].op.code == POP_JUMP_IF_FALSE ||
next_instr[1].op.code == POP_JUMP_IF_TRUE);
@@ -2474,7 +2472,7 @@
if (jump_on_true == (err != 0)) {
JUMPBY(offset);
}
- #line 2478 "Python/generated_cases.c.h"
+ #line 2476 "Python/generated_cases.c.h"
STACK_SHRINK(2);
next_instr += 2;
DISPATCH();
@@ -2483,7 +2481,7 @@
TARGET(COMPARE_AND_BRANCH_FLOAT) {
PyObject *right = stack_pointer[-1];
PyObject *left = stack_pointer[-2];
- #line 1737 "Python/bytecodes.c"
+ #line 1735 "Python/bytecodes.c"
assert(cframe.use_tracing == 0);
DEOPT_IF(!PyFloat_CheckExact(left), COMPARE_AND_BRANCH);
DEOPT_IF(!PyFloat_CheckExact(right), COMPARE_AND_BRANCH);
@@ -2498,7 +2496,7 @@
int offset = next_instr[1].op.arg;
JUMPBY(offset);
}
- #line 2502 "Python/generated_cases.c.h"
+ #line 2500 "Python/generated_cases.c.h"
STACK_SHRINK(2);
next_instr += 2;
DISPATCH();
@@ -2507,16 +2505,17 @@
TARGET(COMPARE_AND_BRANCH_INT) {
PyObject *right = stack_pointer[-1];
PyObject *left = stack_pointer[-2];
- #line 1755 "Python/bytecodes.c"
+ #line 1753 "Python/bytecodes.c"
assert(cframe.use_tracing == 0);
DEOPT_IF(!PyLong_CheckExact(left), COMPARE_AND_BRANCH);
DEOPT_IF(!PyLong_CheckExact(right), COMPARE_AND_BRANCH);
- DEOPT_IF((size_t)(Py_SIZE(left) + 1) > 2, COMPARE_AND_BRANCH);
- DEOPT_IF((size_t)(Py_SIZE(right) + 1) > 2, COMPARE_AND_BRANCH);
+ DEOPT_IF(!_PyLong_IsCompact((PyLongObject *)left), COMPARE_AND_BRANCH);
+ DEOPT_IF(!_PyLong_IsCompact((PyLongObject *)right), COMPARE_AND_BRANCH);
STAT_INC(COMPARE_AND_BRANCH, hit);
- assert(Py_ABS(Py_SIZE(left)) <= 1 && Py_ABS(Py_SIZE(right)) <= 1);
- Py_ssize_t ileft = Py_SIZE(left) * ((PyLongObject *)left)->long_value.ob_digit[0];
- Py_ssize_t iright = Py_SIZE(right) * ((PyLongObject *)right)->long_value.ob_digit[0];
+ assert(_PyLong_DigitCount((PyLongObject *)left) <= 1 &&
+ _PyLong_DigitCount((PyLongObject *)right) <= 1);
+ Py_ssize_t ileft = _PyLong_CompactValue((PyLongObject *)left);
+ Py_ssize_t iright = _PyLong_CompactValue((PyLongObject *)right);
// 2 if <, 4 if >, 8 if ==; this matches the low 4 bits of the oparg
int sign_ish = COMPARISON_BIT(ileft, iright);
_Py_DECREF_SPECIALIZED(left, (destructor)PyObject_Free);
@@ -2525,7 +2524,7 @@
int offset = next_instr[1].op.arg;
JUMPBY(offset);
}
- #line 2529 "Python/generated_cases.c.h"
+ #line 2528 "Python/generated_cases.c.h"
STACK_SHRINK(2);
next_instr += 2;
DISPATCH();
@@ -2534,7 +2533,7 @@
TARGET(COMPARE_AND_BRANCH_STR) {
PyObject *right = stack_pointer[-1];
PyObject *left = stack_pointer[-2];
- #line 1776 "Python/bytecodes.c"
+ #line 1775 "Python/bytecodes.c"
assert(cframe.use_tracing == 0);
DEOPT_IF(!PyUnicode_CheckExact(left), COMPARE_AND_BRANCH);
DEOPT_IF(!PyUnicode_CheckExact(right), COMPARE_AND_BRANCH);
@@ -2550,7 +2549,7 @@
int offset = next_instr[1].op.arg;
JUMPBY(offset);
}
- #line 2554 "Python/generated_cases.c.h"
+ #line 2553 "Python/generated_cases.c.h"
STACK_SHRINK(2);
next_instr += 2;
DISPATCH();
@@ -2560,14 +2559,14 @@
PyObject *right = stack_pointer[-1];
PyObject *left = stack_pointer[-2];
PyObject *b;
- #line 1794 "Python/bytecodes.c"
+ #line 1793 "Python/bytecodes.c"
int res = Py_Is(left, right) ^ oparg;
- #line 2566 "Python/generated_cases.c.h"
+ #line 2565 "Python/generated_cases.c.h"
Py_DECREF(left);
Py_DECREF(right);
- #line 1796 "Python/bytecodes.c"
+ #line 1795 "Python/bytecodes.c"
b = Py_NewRef(res ? Py_True : Py_False);
- #line 2571 "Python/generated_cases.c.h"
+ #line 2570 "Python/generated_cases.c.h"
STACK_SHRINK(1);
stack_pointer[-1] = b;
DISPATCH();
@@ -2577,15 +2576,15 @@
PyObject *right = stack_pointer[-1];
PyObject *left = stack_pointer[-2];
PyObject *b;
- #line 1800 "Python/bytecodes.c"
+ #line 1799 "Python/bytecodes.c"
int res = PySequence_Contains(right, left);
- #line 2583 "Python/generated_cases.c.h"
+ #line 2582 "Python/generated_cases.c.h"
Py_DECREF(left);
Py_DECREF(right);
- #line 1802 "Python/bytecodes.c"
+ #line 1801 "Python/bytecodes.c"
if (res < 0) goto pop_2_error;
b = Py_NewRef((res^oparg) ? Py_True : Py_False);
- #line 2589 "Python/generated_cases.c.h"
+ #line 2588 "Python/generated_cases.c.h"
STACK_SHRINK(1);
stack_pointer[-1] = b;
DISPATCH();
@@ -2596,12 +2595,12 @@
PyObject *exc_value = stack_pointer[-2];
PyObject *rest;
PyObject *match;
- #line 1807 "Python/bytecodes.c"
+ #line 1806 "Python/bytecodes.c"
if (check_except_star_type_valid(tstate, match_type) < 0) {
- #line 2602 "Python/generated_cases.c.h"
+ #line 2601 "Python/generated_cases.c.h"
Py_DECREF(exc_value);
Py_DECREF(match_type);
- #line 1809 "Python/bytecodes.c"
+ #line 1808 "Python/bytecodes.c"
if (true) goto pop_2_error;
}
@@ -2609,10 +2608,10 @@
rest = NULL;
int res = exception_group_match(exc_value, match_type,
&match, &rest);
- #line 2613 "Python/generated_cases.c.h"
+ #line 2612 "Python/generated_cases.c.h"
Py_DECREF(exc_value);
Py_DECREF(match_type);
- #line 1817 "Python/bytecodes.c"
+ #line 1816 "Python/bytecodes.c"
if (res < 0) goto pop_2_error;
assert((match == NULL) == (rest == NULL));
@@ -2621,7 +2620,7 @@
if (!Py_IsNone(match)) {
PyErr_SetExcInfo(NULL, Py_NewRef(match), NULL);
}
- #line 2625 "Python/generated_cases.c.h"
+ #line 2624 "Python/generated_cases.c.h"
stack_pointer[-1] = match;
stack_pointer[-2] = rest;
DISPATCH();
@@ -2631,21 +2630,21 @@
PyObject *right = stack_pointer[-1];
PyObject *left = stack_pointer[-2];
PyObject *b;
- #line 1828 "Python/bytecodes.c"
+ #line 1827 "Python/bytecodes.c"
assert(PyExceptionInstance_Check(left));
if (check_except_type_valid(tstate, right) < 0) {
- #line 2638 "Python/generated_cases.c.h"
+ #line 2637 "Python/generated_cases.c.h"
Py_DECREF(right);
- #line 1831 "Python/bytecodes.c"
+ #line 1830 "Python/bytecodes.c"
if (true) goto pop_1_error;
}
int res = PyErr_GivenExceptionMatches(left, right);
- #line 2645 "Python/generated_cases.c.h"
+ #line 2644 "Python/generated_cases.c.h"
Py_DECREF(right);
- #line 1836 "Python/bytecodes.c"
+ #line 1835 "Python/bytecodes.c"
b = Py_NewRef(res ? Py_True : Py_False);
- #line 2649 "Python/generated_cases.c.h"
+ #line 2648 "Python/generated_cases.c.h"
stack_pointer[-1] = b;
DISPATCH();
}
@@ -2654,15 +2653,15 @@
PyObject *fromlist = stack_pointer[-1];
PyObject *level = stack_pointer[-2];
PyObject *res;
- #line 1840 "Python/bytecodes.c"
+ #line 1839 "Python/bytecodes.c"
PyObject *name = GETITEM(frame->f_code->co_names, oparg);
res = import_name(tstate, frame, name, fromlist, level);
- #line 2661 "Python/generated_cases.c.h"
+ #line 2660 "Python/generated_cases.c.h"
Py_DECREF(level);
Py_DECREF(fromlist);
- #line 1843 "Python/bytecodes.c"
+ #line 1842 "Python/bytecodes.c"
if (res == NULL) goto pop_2_error;
- #line 2666 "Python/generated_cases.c.h"
+ #line 2665 "Python/generated_cases.c.h"
STACK_SHRINK(1);
stack_pointer[-1] = res;
DISPATCH();
@@ -2671,29 +2670,29 @@
TARGET(IMPORT_FROM) {
PyObject *from = stack_pointer[-1];
PyObject *res;
- #line 1847 "Python/bytecodes.c"
+ #line 1846 "Python/bytecodes.c"
PyObject *name = GETITEM(frame->f_code->co_names, oparg);
res = import_from(tstate, from, name);
if (res == NULL) goto error;
- #line 2679 "Python/generated_cases.c.h"
+ #line 2678 "Python/generated_cases.c.h"
STACK_GROW(1);
stack_pointer[-1] = res;
DISPATCH();
}
TARGET(JUMP_FORWARD) {
- #line 1853 "Python/bytecodes.c"
+ #line 1852 "Python/bytecodes.c"
JUMPBY(oparg);
- #line 2688 "Python/generated_cases.c.h"
+ #line 2687 "Python/generated_cases.c.h"
DISPATCH();
}
TARGET(JUMP_BACKWARD) {
PREDICTED(JUMP_BACKWARD);
- #line 1857 "Python/bytecodes.c"
+ #line 1856 "Python/bytecodes.c"
assert(oparg < INSTR_OFFSET());
JUMPBY(-oparg);
- #line 2697 "Python/generated_cases.c.h"
+ #line 2696 "Python/generated_cases.c.h"
CHECK_EVAL_BREAKER();
DISPATCH();
}
@@ -2701,7 +2700,7 @@
TARGET(POP_JUMP_IF_FALSE) {
PREDICTED(POP_JUMP_IF_FALSE);
PyObject *cond = stack_pointer[-1];
- #line 1863 "Python/bytecodes.c"
+ #line 1862 "Python/bytecodes.c"
if (Py_IsTrue(cond)) {
_Py_DECREF_NO_DEALLOC(cond);
}
@@ -2711,9 +2710,9 @@
}
else {
int err = PyObject_IsTrue(cond);
- #line 2715 "Python/generated_cases.c.h"
+ #line 2714 "Python/generated_cases.c.h"
Py_DECREF(cond);
- #line 1873 "Python/bytecodes.c"
+ #line 1872 "Python/bytecodes.c"
if (err == 0) {
JUMPBY(oparg);
}
@@ -2721,14 +2720,14 @@
if (err < 0) goto pop_1_error;
}
}
- #line 2725 "Python/generated_cases.c.h"
+ #line 2724 "Python/generated_cases.c.h"
STACK_SHRINK(1);
DISPATCH();
}
TARGET(POP_JUMP_IF_TRUE) {
PyObject *cond = stack_pointer[-1];
- #line 1883 "Python/bytecodes.c"
+ #line 1882 "Python/bytecodes.c"
if (Py_IsFalse(cond)) {
_Py_DECREF_NO_DEALLOC(cond);
}
@@ -2738,9 +2737,9 @@
}
else {
int err = PyObject_IsTrue(cond);
- #line 2742 "Python/generated_cases.c.h"
+ #line 2741 "Python/generated_cases.c.h"
Py_DECREF(cond);
- #line 1893 "Python/bytecodes.c"
+ #line 1892 "Python/bytecodes.c"
if (err > 0) {
JUMPBY(oparg);
}
@@ -2748,48 +2747,48 @@
if (err < 0) goto pop_1_error;
}
}
- #line 2752 "Python/generated_cases.c.h"
+ #line 2751 "Python/generated_cases.c.h"
STACK_SHRINK(1);
DISPATCH();
}
TARGET(POP_JUMP_IF_NOT_NONE) {
PyObject *value = stack_pointer[-1];
- #line 1903 "Python/bytecodes.c"
+ #line 1902 "Python/bytecodes.c"
if (!Py_IsNone(value)) {
- #line 2761 "Python/generated_cases.c.h"
+ #line 2760 "Python/generated_cases.c.h"
Py_DECREF(value);
- #line 1905 "Python/bytecodes.c"
+ #line 1904 "Python/bytecodes.c"
JUMPBY(oparg);
}
else {
_Py_DECREF_NO_DEALLOC(value);
}
- #line 2769 "Python/generated_cases.c.h"
+ #line 2768 "Python/generated_cases.c.h"
STACK_SHRINK(1);
DISPATCH();
}
TARGET(POP_JUMP_IF_NONE) {
PyObject *value = stack_pointer[-1];
- #line 1913 "Python/bytecodes.c"
+ #line 1912 "Python/bytecodes.c"
if (Py_IsNone(value)) {
_Py_DECREF_NO_DEALLOC(value);
JUMPBY(oparg);
}
else {
- #line 2782 "Python/generated_cases.c.h"
+ #line 2781 "Python/generated_cases.c.h"
Py_DECREF(value);
- #line 1919 "Python/bytecodes.c"
+ #line 1918 "Python/bytecodes.c"
}
- #line 2786 "Python/generated_cases.c.h"
+ #line 2785 "Python/generated_cases.c.h"
STACK_SHRINK(1);
DISPATCH();
}
TARGET(JUMP_IF_FALSE_OR_POP) {
PyObject *cond = stack_pointer[-1];
- #line 1923 "Python/bytecodes.c"
+ #line 1922 "Python/bytecodes.c"
bool jump = false;
int err;
if (Py_IsTrue(cond)) {
@@ -2812,7 +2811,7 @@
goto error;
}
}
- #line 2816 "Python/generated_cases.c.h"
+ #line 2815 "Python/generated_cases.c.h"
STACK_SHRINK(1);
STACK_GROW((jump ? 1 : 0));
DISPATCH();
@@ -2820,7 +2819,7 @@
TARGET(JUMP_IF_TRUE_OR_POP) {
PyObject *cond = stack_pointer[-1];
- #line 1948 "Python/bytecodes.c"
+ #line 1947 "Python/bytecodes.c"
bool jump = false;
int err;
if (Py_IsFalse(cond)) {
@@ -2843,34 +2842,34 @@
goto error;
}
}
- #line 2847 "Python/generated_cases.c.h"
+ #line 2846 "Python/generated_cases.c.h"
STACK_SHRINK(1);
STACK_GROW((jump ? 1 : 0));
DISPATCH();
}
TARGET(JUMP_BACKWARD_NO_INTERRUPT) {
- #line 1973 "Python/bytecodes.c"
+ #line 1972 "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 2861 "Python/generated_cases.c.h"
+ #line 2860 "Python/generated_cases.c.h"
DISPATCH();
}
TARGET(GET_LEN) {
PyObject *obj = stack_pointer[-1];
PyObject *len_o;
- #line 1982 "Python/bytecodes.c"
+ #line 1981 "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 2874 "Python/generated_cases.c.h"
+ #line 2873 "Python/generated_cases.c.h"
STACK_GROW(1);
stack_pointer[-1] = len_o;
DISPATCH();
@@ -2881,16 +2880,16 @@
PyObject *type = stack_pointer[-2];
PyObject *subject = stack_pointer[-3];
PyObject *attrs;
- #line 1990 "Python/bytecodes.c"
+ #line 1989 "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 2890 "Python/generated_cases.c.h"
+ #line 2889 "Python/generated_cases.c.h"
Py_DECREF(subject);
Py_DECREF(type);
Py_DECREF(names);
- #line 1995 "Python/bytecodes.c"
+ #line 1994 "Python/bytecodes.c"
if (attrs) {
assert(PyTuple_CheckExact(attrs)); // Success!
}
@@ -2898,7 +2897,7 @@
if (_PyErr_Occurred(tstate)) goto pop_3_error;
attrs = Py_NewRef(Py_None); // Failure!
}
- #line 2902 "Python/generated_cases.c.h"
+ #line 2901 "Python/generated_cases.c.h"
STACK_SHRINK(2);
stack_pointer[-1] = attrs;
DISPATCH();
@@ -2907,10 +2906,10 @@
TARGET(MATCH_MAPPING) {
PyObject *subject = stack_pointer[-1];
PyObject *res;
- #line 2005 "Python/bytecodes.c"
+ #line 2004 "Python/bytecodes.c"
int match = Py_TYPE(subject)->tp_flags & Py_TPFLAGS_MAPPING;
res = Py_NewRef(match ? Py_True : Py_False);
- #line 2914 "Python/generated_cases.c.h"
+ #line 2913 "Python/generated_cases.c.h"
STACK_GROW(1);
stack_pointer[-1] = res;
PREDICT(POP_JUMP_IF_FALSE);
@@ -2920,10 +2919,10 @@
TARGET(MATCH_SEQUENCE) {
PyObject *subject = stack_pointer[-1];
PyObject *res;
- #line 2011 "Python/bytecodes.c"
+ #line 2010 "Python/bytecodes.c"
int match = Py_TYPE(subject)->tp_flags & Py_TPFLAGS_SEQUENCE;
res = Py_NewRef(match ? Py_True : Py_False);
- #line 2927 "Python/generated_cases.c.h"
+ #line 2926 "Python/generated_cases.c.h"
STACK_GROW(1);
stack_pointer[-1] = res;
PREDICT(POP_JUMP_IF_FALSE);
@@ -2934,11 +2933,11 @@
PyObject *keys = stack_pointer[-1];
PyObject *subject = stack_pointer[-2];
PyObject *values_or_none;
- #line 2017 "Python/bytecodes.c"
+ #line 2016 "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 2942 "Python/generated_cases.c.h"
+ #line 2941 "Python/generated_cases.c.h"
STACK_GROW(1);
stack_pointer[-1] = values_or_none;
DISPATCH();
@@ -2947,14 +2946,14 @@
TARGET(GET_ITER) {
PyObject *iterable = stack_pointer[-1];
PyObject *iter;
- #line 2023 "Python/bytecodes.c"
+ #line 2022 "Python/bytecodes.c"
/* before: [obj]; after [getiter(obj)] */
iter = PyObject_GetIter(iterable);
- #line 2954 "Python/generated_cases.c.h"
+ #line 2953 "Python/generated_cases.c.h"
Py_DECREF(iterable);
- #line 2026 "Python/bytecodes.c"
+ #line 2025 "Python/bytecodes.c"
if (iter == NULL) goto pop_1_error;
- #line 2958 "Python/generated_cases.c.h"
+ #line 2957 "Python/generated_cases.c.h"
stack_pointer[-1] = iter;
DISPATCH();
}
@@ -2962,7 +2961,7 @@
TARGET(GET_YIELD_FROM_ITER) {
PyObject *iterable = stack_pointer[-1];
PyObject *iter;
- #line 2030 "Python/bytecodes.c"
+ #line 2029 "Python/bytecodes.c"
/* before: [obj]; after [getiter(obj)] */
if (PyCoro_CheckExact(iterable)) {
/* `iterable` is a coroutine */
@@ -2985,11 +2984,11 @@
if (iter == NULL) {
goto error;
}
- #line 2989 "Python/generated_cases.c.h"
+ #line 2988 "Python/generated_cases.c.h"
Py_DECREF(iterable);
- #line 2053 "Python/bytecodes.c"
+ #line 2052 "Python/bytecodes.c"
}
- #line 2993 "Python/generated_cases.c.h"
+ #line 2992 "Python/generated_cases.c.h"
stack_pointer[-1] = iter;
PREDICT(LOAD_CONST);
DISPATCH();
@@ -3000,7 +2999,7 @@
static_assert(INLINE_CACHE_ENTRIES_FOR_ITER == 1, "incorrect cache size");
PyObject *iter = stack_pointer[-1];
PyObject *next;
- #line 2072 "Python/bytecodes.c"
+ #line 2071 "Python/bytecodes.c"
#if ENABLE_SPECIALIZATION
_PyForIterCache *cache = (_PyForIterCache *)next_instr;
if (ADAPTIVE_COUNTER_IS_ZERO(cache->counter)) {
@@ -3033,7 +3032,7 @@
DISPATCH();
}
// Common case: no jump, leave it to the code generator
- #line 3037 "Python/generated_cases.c.h"
+ #line 3036 "Python/generated_cases.c.h"
STACK_GROW(1);
stack_pointer[-1] = next;
next_instr += 1;
@@ -3043,7 +3042,7 @@
TARGET(FOR_ITER_LIST) {
PyObject *iter = stack_pointer[-1];
PyObject *next;
- #line 2107 "Python/bytecodes.c"
+ #line 2106 "Python/bytecodes.c"
assert(cframe.use_tracing == 0);
DEOPT_IF(Py_TYPE(iter) != &PyListIter_Type, FOR_ITER);
_PyListIterObject *it = (_PyListIterObject *)iter;
@@ -3064,7 +3063,7 @@
DISPATCH();
end_for_iter_list:
// Common case: no jump, leave it to the code generator
- #line 3068 "Python/generated_cases.c.h"
+ #line 3067 "Python/generated_cases.c.h"
STACK_GROW(1);
stack_pointer[-1] = next;
next_instr += 1;
@@ -3074,7 +3073,7 @@
TARGET(FOR_ITER_TUPLE) {
PyObject *iter = stack_pointer[-1];
PyObject *next;
- #line 2130 "Python/bytecodes.c"
+ #line 2129 "Python/bytecodes.c"
assert(cframe.use_tracing == 0);
_PyTupleIterObject *it = (_PyTupleIterObject *)iter;
DEOPT_IF(Py_TYPE(it) != &PyTupleIter_Type, FOR_ITER);
@@ -3095,7 +3094,7 @@
DISPATCH();
end_for_iter_tuple:
// Common case: no jump, leave it to the code generator
- #line 3099 "Python/generated_cases.c.h"
+ #line 3098 "Python/generated_cases.c.h"
STACK_GROW(1);
stack_pointer[-1] = next;
next_instr += 1;
@@ -3105,7 +3104,7 @@
TARGET(FOR_ITER_RANGE) {
PyObject *iter = stack_pointer[-1];
PyObject *next;
- #line 2153 "Python/bytecodes.c"
+ #line 2152 "Python/bytecodes.c"
assert(cframe.use_tracing == 0);
_PyRangeIterObject *r = (_PyRangeIterObject *)iter;
DEOPT_IF(Py_TYPE(r) != &PyRangeIter_Type, FOR_ITER);
@@ -3124,7 +3123,7 @@
if (next == NULL) {
goto error;
}
- #line 3128 "Python/generated_cases.c.h"
+ #line 3127 "Python/generated_cases.c.h"
STACK_GROW(1);
stack_pointer[-1] = next;
next_instr += 1;
@@ -3133,7 +3132,7 @@
TARGET(FOR_ITER_GEN) {
PyObject *iter = stack_pointer[-1];
- #line 2174 "Python/bytecodes.c"
+ #line 2173 "Python/bytecodes.c"
assert(cframe.use_tracing == 0);
PyGenObject *gen = (PyGenObject *)iter;
DEOPT_IF(Py_TYPE(gen) != &PyGen_Type, FOR_ITER);
@@ -3148,14 +3147,14 @@
JUMPBY(INLINE_CACHE_ENTRIES_FOR_ITER + oparg);
assert(next_instr->op.code == END_FOR);
DISPATCH_INLINED(gen_frame);
- #line 3152 "Python/generated_cases.c.h"
+ #line 3151 "Python/generated_cases.c.h"
}
TARGET(BEFORE_ASYNC_WITH) {
PyObject *mgr = stack_pointer[-1];
PyObject *exit;
PyObject *res;
- #line 2191 "Python/bytecodes.c"
+ #line 2190 "Python/bytecodes.c"
PyObject *enter = _PyObject_LookupSpecial(mgr, &_Py_ID(__aenter__));
if (enter == NULL) {
if (!_PyErr_Occurred(tstate)) {
@@ -3178,16 +3177,16 @@
Py_DECREF(enter);
goto error;
}
- #line 3182 "Python/generated_cases.c.h"
+ #line 3181 "Python/generated_cases.c.h"
Py_DECREF(mgr);
- #line 2214 "Python/bytecodes.c"
+ #line 2213 "Python/bytecodes.c"
res = _PyObject_CallNoArgs(enter);
Py_DECREF(enter);
if (res == NULL) {
Py_DECREF(exit);
if (true) goto pop_1_error;
}
- #line 3191 "Python/generated_cases.c.h"
+ #line 3190 "Python/generated_cases.c.h"
STACK_GROW(1);
stack_pointer[-1] = res;
stack_pointer[-2] = exit;
@@ -3199,7 +3198,7 @@
PyObject *mgr = stack_pointer[-1];
PyObject *exit;
PyObject *res;
- #line 2224 "Python/bytecodes.c"
+ #line 2223 "Python/bytecodes.c"
/* pop the context manager, push its __exit__ and the
* value returned from calling its __enter__
*/
@@ -3225,16 +3224,16 @@
Py_DECREF(enter);
goto error;
}
- #line 3229 "Python/generated_cases.c.h"
+ #line 3228 "Python/generated_cases.c.h"
Py_DECREF(mgr);
- #line 2250 "Python/bytecodes.c"
+ #line 2249 "Python/bytecodes.c"
res = _PyObject_CallNoArgs(enter);
Py_DECREF(enter);
if (res == NULL) {
Py_DECREF(exit);
if (true) goto pop_1_error;
}
- #line 3238 "Python/generated_cases.c.h"
+ #line 3237 "Python/generated_cases.c.h"
STACK_GROW(1);
stack_pointer[-1] = res;
stack_pointer[-2] = exit;
@@ -3246,7 +3245,7 @@
PyObject *lasti = stack_pointer[-3];
PyObject *exit_func = stack_pointer[-4];
PyObject *res;
- #line 2259 "Python/bytecodes.c"
+ #line 2258 "Python/bytecodes.c"
/* At the top of the stack are 4 values:
- val: TOP = exc_info()
- unused: SECOND = previous exception
@@ -3267,7 +3266,7 @@
res = PyObject_Vectorcall(exit_func, stack + 1,
3 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL);
if (res == NULL) goto error;
- #line 3271 "Python/generated_cases.c.h"
+ #line 3270 "Python/generated_cases.c.h"
STACK_GROW(1);
stack_pointer[-1] = res;
DISPATCH();
@@ -3276,7 +3275,7 @@
TARGET(PUSH_EXC_INFO) {
PyObject *new_exc = stack_pointer[-1];
PyObject *prev_exc;
- #line 2282 "Python/bytecodes.c"
+ #line 2281 "Python/bytecodes.c"
_PyErr_StackItem *exc_info = tstate->exc_info;
if (exc_info->exc_value != NULL) {
prev_exc = exc_info->exc_value;
@@ -3286,7 +3285,7 @@
}
assert(PyExceptionInstance_Check(new_exc));
exc_info->exc_value = Py_NewRef(new_exc);
- #line 3290 "Python/generated_cases.c.h"
+ #line 3289 "Python/generated_cases.c.h"
STACK_GROW(1);
stack_pointer[-1] = new_exc;
stack_pointer[-2] = prev_exc;
@@ -3300,7 +3299,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 2294 "Python/bytecodes.c"
+ #line 2293 "Python/bytecodes.c"
/* Cached method object */
assert(cframe.use_tracing == 0);
PyTypeObject *self_cls = Py_TYPE(self);
@@ -3318,7 +3317,7 @@
assert(_PyType_HasFeature(Py_TYPE(res2), Py_TPFLAGS_METHOD_DESCRIPTOR));
res = self;
assert(oparg & 1);
- #line 3322 "Python/generated_cases.c.h"
+ #line 3321 "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; }
@@ -3332,7 +3331,7 @@
PyObject *res;
uint32_t type_version = read_u32(&next_instr[1].cache);
PyObject *descr = read_obj(&next_instr[5].cache);
- #line 2314 "Python/bytecodes.c"
+ #line 2313 "Python/bytecodes.c"
assert(cframe.use_tracing == 0);
PyTypeObject *self_cls = Py_TYPE(self);
DEOPT_IF(self_cls->tp_version_tag != type_version, LOAD_ATTR);
@@ -3343,7 +3342,7 @@
res2 = Py_NewRef(descr);
res = self;
assert(oparg & 1);
- #line 3347 "Python/generated_cases.c.h"
+ #line 3346 "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; }
@@ -3357,7 +3356,7 @@
PyObject *res;
uint32_t type_version = read_u32(&next_instr[1].cache);
PyObject *descr = read_obj(&next_instr[5].cache);
- #line 2327 "Python/bytecodes.c"
+ #line 2326 "Python/bytecodes.c"
assert(cframe.use_tracing == 0);
PyTypeObject *self_cls = Py_TYPE(self);
DEOPT_IF(self_cls->tp_version_tag != type_version, LOAD_ATTR);
@@ -3372,7 +3371,7 @@
res2 = Py_NewRef(descr);
res = self;
assert(oparg & 1);
- #line 3376 "Python/generated_cases.c.h"
+ #line 3375 "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; }
@@ -3381,11 +3380,11 @@
}
TARGET(KW_NAMES) {
- #line 2344 "Python/bytecodes.c"
+ #line 2343 "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 3389 "Python/generated_cases.c.h"
+ #line 3388 "Python/generated_cases.c.h"
DISPATCH();
}
@@ -3396,7 +3395,7 @@
PyObject *callable = stack_pointer[-(1 + oparg)];
PyObject *method = stack_pointer[-(2 + oparg)];
PyObject *res;
- #line 2380 "Python/bytecodes.c"
+ #line 2379 "Python/bytecodes.c"
int is_meth = method != NULL;
int total_args = oparg;
if (is_meth) {
@@ -3468,7 +3467,7 @@
Py_DECREF(args[i]);
}
if (res == NULL) { STACK_SHRINK(oparg); goto pop_2_error; }
- #line 3472 "Python/generated_cases.c.h"
+ #line 3471 "Python/generated_cases.c.h"
STACK_SHRINK(oparg);
STACK_SHRINK(1);
stack_pointer[-1] = res;
@@ -3480,7 +3479,7 @@
TARGET(CALL_BOUND_METHOD_EXACT_ARGS) {
PyObject *callable = stack_pointer[-(1 + oparg)];
PyObject *method = stack_pointer[-(2 + oparg)];
- #line 2458 "Python/bytecodes.c"
+ #line 2457 "Python/bytecodes.c"
DEOPT_IF(method != NULL, CALL);
DEOPT_IF(Py_TYPE(callable) != &PyMethod_Type, CALL);
STAT_INC(CALL, hit);
@@ -3490,7 +3489,7 @@
PEEK(oparg + 2) = Py_NewRef(meth); // method
Py_DECREF(callable);
GO_TO_INSTRUCTION(CALL_PY_EXACT_ARGS);
- #line 3494 "Python/generated_cases.c.h"
+ #line 3493 "Python/generated_cases.c.h"
}
TARGET(CALL_PY_EXACT_ARGS) {
@@ -3499,7 +3498,7 @@
PyObject *callable = stack_pointer[-(1 + oparg)];
PyObject *method = stack_pointer[-(2 + oparg)];
uint32_t func_version = read_u32(&next_instr[1].cache);
- #line 2470 "Python/bytecodes.c"
+ #line 2469 "Python/bytecodes.c"
assert(kwnames == NULL);
DEOPT_IF(tstate->interp->eval_frame, CALL);
int is_meth = method != NULL;
@@ -3524,7 +3523,7 @@
STACK_SHRINK(oparg + 2);
JUMPBY(INLINE_CACHE_ENTRIES_CALL);
DISPATCH_INLINED(new_frame);
- #line 3528 "Python/generated_cases.c.h"
+ #line 3527 "Python/generated_cases.c.h"
}
TARGET(CALL_PY_WITH_DEFAULTS) {
@@ -3533,7 +3532,7 @@
PyObject *method = stack_pointer[-(2 + oparg)];
uint32_t func_version = read_u32(&next_instr[1].cache);
uint16_t min_args = read_u16(&next_instr[3].cache);
- #line 2497 "Python/bytecodes.c"
+ #line 2496 "Python/bytecodes.c"
assert(kwnames == NULL);
DEOPT_IF(tstate->interp->eval_frame, CALL);
int is_meth = method != NULL;
@@ -3563,7 +3562,7 @@
STACK_SHRINK(oparg + 2);
JUMPBY(INLINE_CACHE_ENTRIES_CALL);
DISPATCH_INLINED(new_frame);
- #line 3567 "Python/generated_cases.c.h"
+ #line 3566 "Python/generated_cases.c.h"
}
TARGET(CALL_NO_KW_TYPE_1) {
@@ -3571,7 +3570,7 @@
PyObject *callable = stack_pointer[-(1 + oparg)];
PyObject *null = stack_pointer[-(2 + oparg)];
PyObject *res;
- #line 2529 "Python/bytecodes.c"
+ #line 2528 "Python/bytecodes.c"
assert(kwnames == NULL);
assert(cframe.use_tracing == 0);
assert(oparg == 1);
@@ -3582,7 +3581,7 @@
res = Py_NewRef(Py_TYPE(obj));
Py_DECREF(obj);
Py_DECREF(&PyType_Type); // I.e., callable
- #line 3586 "Python/generated_cases.c.h"
+ #line 3585 "Python/generated_cases.c.h"
STACK_SHRINK(oparg);
STACK_SHRINK(1);
stack_pointer[-1] = res;
@@ -3595,7 +3594,7 @@
PyObject *callable = stack_pointer[-(1 + oparg)];
PyObject *null = stack_pointer[-(2 + oparg)];
PyObject *res;
- #line 2542 "Python/bytecodes.c"
+ #line 2541 "Python/bytecodes.c"
assert(kwnames == NULL);
assert(cframe.use_tracing == 0);
assert(oparg == 1);
@@ -3607,7 +3606,7 @@
Py_DECREF(arg);
Py_DECREF(&PyUnicode_Type); // I.e., callable
if (res == NULL) { STACK_SHRINK(oparg); goto pop_2_error; }
- #line 3611 "Python/generated_cases.c.h"
+ #line 3610 "Python/generated_cases.c.h"
STACK_SHRINK(oparg);
STACK_SHRINK(1);
stack_pointer[-1] = res;
@@ -3621,7 +3620,7 @@
PyObject *callable = stack_pointer[-(1 + oparg)];
PyObject *null = stack_pointer[-(2 + oparg)];
PyObject *res;
- #line 2557 "Python/bytecodes.c"
+ #line 2556 "Python/bytecodes.c"
assert(kwnames == NULL);
assert(oparg == 1);
DEOPT_IF(null != NULL, CALL);
@@ -3632,7 +3631,7 @@
Py_DECREF(arg);
Py_DECREF(&PyTuple_Type); // I.e., tuple
if (res == NULL) { STACK_SHRINK(oparg); goto pop_2_error; }
- #line 3636 "Python/generated_cases.c.h"
+ #line 3635 "Python/generated_cases.c.h"
STACK_SHRINK(oparg);
STACK_SHRINK(1);
stack_pointer[-1] = res;
@@ -3646,7 +3645,7 @@
PyObject *callable = stack_pointer[-(1 + oparg)];
PyObject *method = stack_pointer[-(2 + oparg)];
PyObject *res;
- #line 2571 "Python/bytecodes.c"
+ #line 2570 "Python/bytecodes.c"
int is_meth = method != NULL;
int total_args = oparg;
if (is_meth) {
@@ -3668,7 +3667,7 @@
}
Py_DECREF(tp);
if (res == NULL) { STACK_SHRINK(oparg); goto pop_2_error; }
- #line 3672 "Python/generated_cases.c.h"
+ #line 3671 "Python/generated_cases.c.h"
STACK_SHRINK(oparg);
STACK_SHRINK(1);
stack_pointer[-1] = res;
@@ -3682,7 +3681,7 @@
PyObject *callable = stack_pointer[-(1 + oparg)];
PyObject *method = stack_pointer[-(2 + oparg)];
PyObject *res;
- #line 2596 "Python/bytecodes.c"
+ #line 2595 "Python/bytecodes.c"
assert(cframe.use_tracing == 0);
/* Builtin METH_O functions */
assert(kwnames == NULL);
@@ -3711,7 +3710,7 @@
Py_DECREF(arg);
Py_DECREF(callable);
if (res == NULL) { STACK_SHRINK(oparg); goto pop_2_error; }
- #line 3715 "Python/generated_cases.c.h"
+ #line 3714 "Python/generated_cases.c.h"
STACK_SHRINK(oparg);
STACK_SHRINK(1);
stack_pointer[-1] = res;
@@ -3725,7 +3724,7 @@
PyObject *callable = stack_pointer[-(1 + oparg)];
PyObject *method = stack_pointer[-(2 + oparg)];
PyObject *res;
- #line 2628 "Python/bytecodes.c"
+ #line 2627 "Python/bytecodes.c"
assert(cframe.use_tracing == 0);
/* Builtin METH_FASTCALL functions, without keywords */
assert(kwnames == NULL);
@@ -3758,7 +3757,7 @@
'invalid'). In those cases an exception is set, so we must
handle it.
*/
- #line 3762 "Python/generated_cases.c.h"
+ #line 3761 "Python/generated_cases.c.h"
STACK_SHRINK(oparg);
STACK_SHRINK(1);
stack_pointer[-1] = res;
@@ -3772,7 +3771,7 @@
PyObject *callable = stack_pointer[-(1 + oparg)];
PyObject *method = stack_pointer[-(2 + oparg)];
PyObject *res;
- #line 2664 "Python/bytecodes.c"
+ #line 2663 "Python/bytecodes.c"
assert(cframe.use_tracing == 0);
/* Builtin METH_FASTCALL | METH_KEYWORDS functions */
int is_meth = method != NULL;
@@ -3805,7 +3804,7 @@
}
Py_DECREF(callable);
if (res == NULL) { STACK_SHRINK(oparg); goto pop_2_error; }
- #line 3809 "Python/generated_cases.c.h"
+ #line 3808 "Python/generated_cases.c.h"
STACK_SHRINK(oparg);
STACK_SHRINK(1);
stack_pointer[-1] = res;
@@ -3819,7 +3818,7 @@
PyObject *callable = stack_pointer[-(1 + oparg)];
PyObject *method = stack_pointer[-(2 + oparg)];
PyObject *res;
- #line 2700 "Python/bytecodes.c"
+ #line 2699 "Python/bytecodes.c"
assert(cframe.use_tracing == 0);
assert(kwnames == NULL);
/* len(o) */
@@ -3845,7 +3844,7 @@
Py_DECREF(callable);
Py_DECREF(arg);
if (res == NULL) { STACK_SHRINK(oparg); goto pop_2_error; }
- #line 3849 "Python/generated_cases.c.h"
+ #line 3848 "Python/generated_cases.c.h"
STACK_SHRINK(oparg);
STACK_SHRINK(1);
stack_pointer[-1] = res;
@@ -3858,7 +3857,7 @@
PyObject *callable = stack_pointer[-(1 + oparg)];
PyObject *method = stack_pointer[-(2 + oparg)];
PyObject *res;
- #line 2728 "Python/bytecodes.c"
+ #line 2727 "Python/bytecodes.c"
assert(cframe.use_tracing == 0);
assert(kwnames == NULL);
/* isinstance(o, o2) */
@@ -3886,7 +3885,7 @@
Py_DECREF(cls);
Py_DECREF(callable);
if (res == NULL) { STACK_SHRINK(oparg); goto pop_2_error; }
- #line 3890 "Python/generated_cases.c.h"
+ #line 3889 "Python/generated_cases.c.h"
STACK_SHRINK(oparg);
STACK_SHRINK(1);
stack_pointer[-1] = res;
@@ -3898,7 +3897,7 @@
PyObject **args = (stack_pointer - oparg);
PyObject *self = stack_pointer[-(1 + oparg)];
PyObject *method = stack_pointer[-(2 + oparg)];
- #line 2759 "Python/bytecodes.c"
+ #line 2758 "Python/bytecodes.c"
assert(cframe.use_tracing == 0);
assert(kwnames == NULL);
assert(oparg == 1);
@@ -3917,14 +3916,14 @@
JUMPBY(INLINE_CACHE_ENTRIES_CALL + 1);
assert(next_instr[-1].op.code == POP_TOP);
DISPATCH();
- #line 3921 "Python/generated_cases.c.h"
+ #line 3920 "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 2780 "Python/bytecodes.c"
+ #line 2779 "Python/bytecodes.c"
assert(kwnames == NULL);
int is_meth = method != NULL;
int total_args = oparg;
@@ -3955,7 +3954,7 @@
Py_DECREF(arg);
Py_DECREF(callable);
if (res == NULL) { STACK_SHRINK(oparg); goto pop_2_error; }
- #line 3959 "Python/generated_cases.c.h"
+ #line 3958 "Python/generated_cases.c.h"
STACK_SHRINK(oparg);
STACK_SHRINK(1);
stack_pointer[-1] = res;
@@ -3968,7 +3967,7 @@
PyObject **args = (stack_pointer - oparg);
PyObject *method = stack_pointer[-(2 + oparg)];
PyObject *res;
- #line 2814 "Python/bytecodes.c"
+ #line 2813 "Python/bytecodes.c"
int is_meth = method != NULL;
int total_args = oparg;
if (is_meth) {
@@ -3997,7 +3996,7 @@
}
Py_DECREF(callable);
if (res == NULL) { STACK_SHRINK(oparg); goto pop_2_error; }
- #line 4001 "Python/generated_cases.c.h"
+ #line 4000 "Python/generated_cases.c.h"
STACK_SHRINK(oparg);
STACK_SHRINK(1);
stack_pointer[-1] = res;
@@ -4010,7 +4009,7 @@
PyObject **args = (stack_pointer - oparg);
PyObject *method = stack_pointer[-(2 + oparg)];
PyObject *res;
- #line 2846 "Python/bytecodes.c"
+ #line 2845 "Python/bytecodes.c"
assert(kwnames == NULL);
assert(oparg == 0 || oparg == 1);
int is_meth = method != NULL;
@@ -4039,7 +4038,7 @@
Py_DECREF(self);
Py_DECREF(callable);
if (res == NULL) { STACK_SHRINK(oparg); goto pop_2_error; }
- #line 4043 "Python/generated_cases.c.h"
+ #line 4042 "Python/generated_cases.c.h"
STACK_SHRINK(oparg);
STACK_SHRINK(1);
stack_pointer[-1] = res;
@@ -4052,7 +4051,7 @@
PyObject **args = (stack_pointer - oparg);
PyObject *method = stack_pointer[-(2 + oparg)];
PyObject *res;
- #line 2878 "Python/bytecodes.c"
+ #line 2877 "Python/bytecodes.c"
assert(kwnames == NULL);
int is_meth = method != NULL;
int total_args = oparg;
@@ -4080,7 +4079,7 @@
}
Py_DECREF(callable);
if (res == NULL) { STACK_SHRINK(oparg); goto pop_2_error; }
- #line 4084 "Python/generated_cases.c.h"
+ #line 4083 "Python/generated_cases.c.h"
STACK_SHRINK(oparg);
STACK_SHRINK(1);
stack_pointer[-1] = res;
@@ -4095,7 +4094,7 @@
PyObject *callargs = stack_pointer[-(1 + ((oparg & 1) ? 1 : 0))];
PyObject *func = stack_pointer[-(2 + ((oparg & 1) ? 1 : 0))];
PyObject *result;
- #line 2909 "Python/bytecodes.c"
+ #line 2908 "Python/bytecodes.c"
if (oparg & 1) {
// DICT_MERGE is called before this opcode if there are kwargs.
// It converts all dict subtypes in kwargs into regular dicts.
@@ -4114,15 +4113,15 @@
assert(PyTuple_CheckExact(callargs));
result = do_call_core(tstate, func, callargs, kwargs, cframe.use_tracing);
- #line 4118 "Python/generated_cases.c.h"
+ #line 4117 "Python/generated_cases.c.h"
Py_DECREF(func);
Py_DECREF(callargs);
Py_XDECREF(kwargs);
- #line 2928 "Python/bytecodes.c"
+ #line 2927 "Python/bytecodes.c"
assert(PEEK(3 + (oparg & 1)) == NULL);
if (result == NULL) { STACK_SHRINK(((oparg & 1) ? 1 : 0)); goto pop_3_error; }
- #line 4126 "Python/generated_cases.c.h"
+ #line 4125 "Python/generated_cases.c.h"
STACK_SHRINK(((oparg & 1) ? 1 : 0));
STACK_SHRINK(2);
stack_pointer[-1] = result;
@@ -4137,7 +4136,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 2939 "Python/bytecodes.c"
+ #line 2938 "Python/bytecodes.c"
PyFunctionObject *func_obj = (PyFunctionObject *)
PyFunction_New(codeobj, GLOBALS());
@@ -4166,14 +4165,14 @@
func_obj->func_version = ((PyCodeObject *)codeobj)->co_version;
func = (PyObject *)func_obj;
- #line 4170 "Python/generated_cases.c.h"
+ #line 4169 "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 2970 "Python/bytecodes.c"
+ #line 2969 "Python/bytecodes.c"
assert(PyFunction_Check(frame->f_funcobj));
PyFunctionObject *func = (PyFunctionObject *)frame->f_funcobj;
PyGenObject *gen = (PyGenObject *)_Py_MakeCoro(func);
@@ -4194,7 +4193,7 @@
frame = cframe.current_frame = prev;
_PyFrame_StackPush(frame, (PyObject *)gen);
goto resume_frame;
- #line 4198 "Python/generated_cases.c.h"
+ #line 4197 "Python/generated_cases.c.h"
}
TARGET(BUILD_SLICE) {
@@ -4202,15 +4201,15 @@
PyObject *stop = stack_pointer[-(1 + ((oparg == 3) ? 1 : 0))];
PyObject *start = stack_pointer[-(2 + ((oparg == 3) ? 1 : 0))];
PyObject *slice;
- #line 2993 "Python/bytecodes.c"
+ #line 2992 "Python/bytecodes.c"
slice = PySlice_New(start, stop, step);
- #line 4208 "Python/generated_cases.c.h"
+ #line 4207 "Python/generated_cases.c.h"
Py_DECREF(start);
Py_DECREF(stop);
Py_XDECREF(step);
- #line 2995 "Python/bytecodes.c"
+ #line 2994 "Python/bytecodes.c"
if (slice == NULL) { STACK_SHRINK(((oparg == 3) ? 1 : 0)); goto pop_2_error; }
- #line 4214 "Python/generated_cases.c.h"
+ #line 4213 "Python/generated_cases.c.h"
STACK_SHRINK(((oparg == 3) ? 1 : 0));
STACK_SHRINK(1);
stack_pointer[-1] = slice;
@@ -4221,7 +4220,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 2999 "Python/bytecodes.c"
+ #line 2998 "Python/bytecodes.c"
/* Handles f-string value formatting. */
PyObject *(*conv_fn)(PyObject *);
int which_conversion = oparg & FVC_MASK;
@@ -4256,7 +4255,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 4260 "Python/generated_cases.c.h"
+ #line 4259 "Python/generated_cases.c.h"
STACK_SHRINK((((oparg & FVS_MASK) == FVS_HAVE_SPEC) ? 1 : 0));
stack_pointer[-1] = result;
DISPATCH();
@@ -4265,10 +4264,10 @@
TARGET(COPY) {
PyObject *bottom = stack_pointer[-(1 + (oparg-1))];
PyObject *top;
- #line 3036 "Python/bytecodes.c"
+ #line 3035 "Python/bytecodes.c"
assert(oparg > 0);
top = Py_NewRef(bottom);
- #line 4272 "Python/generated_cases.c.h"
+ #line 4271 "Python/generated_cases.c.h"
STACK_GROW(1);
stack_pointer[-1] = top;
DISPATCH();
@@ -4280,7 +4279,7 @@
PyObject *rhs = stack_pointer[-1];
PyObject *lhs = stack_pointer[-2];
PyObject *res;
- #line 3041 "Python/bytecodes.c"
+ #line 3040 "Python/bytecodes.c"
#if ENABLE_SPECIALIZATION
_PyBinaryOpCache *cache = (_PyBinaryOpCache *)next_instr;
if (ADAPTIVE_COUNTER_IS_ZERO(cache->counter)) {
@@ -4296,12 +4295,12 @@
assert((unsigned)oparg < Py_ARRAY_LENGTH(binary_ops));
assert(binary_ops[oparg]);
res = binary_ops[oparg](lhs, rhs);
- #line 4300 "Python/generated_cases.c.h"
+ #line 4299 "Python/generated_cases.c.h"
Py_DECREF(lhs);
Py_DECREF(rhs);
- #line 3057 "Python/bytecodes.c"
+ #line 3056 "Python/bytecodes.c"
if (res == NULL) goto pop_2_error;
- #line 4305 "Python/generated_cases.c.h"
+ #line 4304 "Python/generated_cases.c.h"
STACK_SHRINK(1);
stack_pointer[-1] = res;
next_instr += 1;
@@ -4311,27 +4310,27 @@
TARGET(SWAP) {
PyObject *top = stack_pointer[-1];
PyObject *bottom = stack_pointer[-(2 + (oparg-2))];
- #line 3062 "Python/bytecodes.c"
+ #line 3061 "Python/bytecodes.c"
assert(oparg >= 2);
- #line 4317 "Python/generated_cases.c.h"
+ #line 4316 "Python/generated_cases.c.h"
stack_pointer[-1] = bottom;
stack_pointer[-(2 + (oparg-2))] = top;
DISPATCH();
}
TARGET(EXTENDED_ARG) {
- #line 3066 "Python/bytecodes.c"
+ #line 3065 "Python/bytecodes.c"
assert(oparg);
assert(cframe.use_tracing == 0);
opcode = next_instr->op.code;
oparg = oparg << 8 | next_instr->op.arg;
PRE_DISPATCH_GOTO();
DISPATCH_GOTO();
- #line 4331 "Python/generated_cases.c.h"
+ #line 4330 "Python/generated_cases.c.h"
}
TARGET(CACHE) {
- #line 3075 "Python/bytecodes.c"
+ #line 3074 "Python/bytecodes.c"
Py_UNREACHABLE();
- #line 4337 "Python/generated_cases.c.h"
+ #line 4336 "Python/generated_cases.c.h"
}
diff --git a/Python/marshal.c b/Python/marshal.c
index 94e79d4..2966139 100644
--- a/Python/marshal.c
+++ b/Python/marshal.c
@@ -11,6 +11,7 @@
#include "Python.h"
#include "pycore_call.h" // _PyObject_CallNoArgs()
#include "pycore_code.h" // _PyCode_New()
+#include "pycore_long.h" // _PyLong_DigitCount
#include "pycore_hashtable.h" // _Py_hashtable_t
#include "marshal.h" // Py_MARSHAL_VERSION
@@ -232,13 +233,13 @@ w_PyLong(const PyLongObject *ob, char flag, WFILE *p)
digit d;
W_TYPE(TYPE_LONG, p);
- if (Py_SIZE(ob) == 0) {
+ if (_PyLong_IsZero(ob)) {
w_long((long)0, p);
return;
}
/* set l to number of base PyLong_MARSHAL_BASE digits */
- n = Py_ABS(Py_SIZE(ob));
+ n = _PyLong_DigitCount(ob);
l = (n-1) * PyLong_MARSHAL_RATIO;
d = ob->long_value.ob_digit[n-1];
assert(d != 0); /* a PyLong is always normalized */
@@ -251,7 +252,7 @@ w_PyLong(const PyLongObject *ob, char flag, WFILE *p)
p->error = WFERR_UNMARSHALLABLE;
return;
}
- w_long((long)(Py_SIZE(ob) > 0 ? l : -l), p);
+ w_long((long)(_PyLong_IsNegative(ob) ? -l : l), p);
for (i=0; i < n-1; i++) {
d = ob->long_value.ob_digit[i];
@@ -839,7 +840,7 @@ r_PyLong(RFILE *p)
if (ob == NULL)
return NULL;
- Py_SET_SIZE(ob, n > 0 ? size : -size);
+ _PyLong_SetSignAndDigitCount(ob, n < 0 ? -1 : 1, size);
for (i = 0; i < size-1; i++) {
d = 0;
diff --git a/Python/specialize.c b/Python/specialize.c
index 719bd5b..2e93ab1 100644
--- a/Python/specialize.c
+++ b/Python/specialize.c
@@ -1308,7 +1308,7 @@ _Py_Specialize_BinarySubscr(
PyTypeObject *container_type = Py_TYPE(container);
if (container_type == &PyList_Type) {
if (PyLong_CheckExact(sub)) {
- if (Py_SIZE(sub) == 0 || Py_SIZE(sub) == 1) {
+ if (_PyLong_IsNonNegativeCompact((PyLongObject *)sub)) {
instr->op.code = BINARY_SUBSCR_LIST_INT;
goto success;
}
@@ -1321,7 +1321,7 @@ _Py_Specialize_BinarySubscr(
}
if (container_type == &PyTuple_Type) {
if (PyLong_CheckExact(sub)) {
- if (Py_SIZE(sub) == 0 || Py_SIZE(sub) == 1) {
+ if (_PyLong_IsNonNegativeCompact((PyLongObject *)sub)) {
instr->op.code = BINARY_SUBSCR_TUPLE_INT;
goto success;
}
@@ -1389,7 +1389,7 @@ _Py_Specialize_StoreSubscr(PyObject *container, PyObject *sub, _Py_CODEUNIT *ins
PyTypeObject *container_type = Py_TYPE(container);
if (container_type == &PyList_Type) {
if (PyLong_CheckExact(sub)) {
- if ((Py_SIZE(sub) == 0 || Py_SIZE(sub) == 1)
+ if (_PyLong_IsNonNegativeCompact((PyLongObject *)sub)
&& ((PyLongObject *)sub)->long_value.ob_digit[0] < (size_t)PyList_GET_SIZE(container))
{
instr->op.code = STORE_SUBSCR_LIST_INT;
@@ -2007,7 +2007,7 @@ _Py_Specialize_CompareAndBranch(PyObject *lhs, PyObject *rhs, _Py_CODEUNIT *inst
goto success;
}
if (PyLong_CheckExact(lhs)) {
- if (Py_ABS(Py_SIZE(lhs)) <= 1 && Py_ABS(Py_SIZE(rhs)) <= 1) {
+ if (_PyLong_IsCompact((PyLongObject *)lhs) && _PyLong_IsCompact((PyLongObject *)rhs)) {
instr->op.code = COMPARE_AND_BRANCH_INT;
goto success;
}