aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Python/executor_cases.c.h
diff options
context:
space:
mode:
authorMark Shannon <mark@hotpy.org>2023-07-12 14:34:14 +0100
committerGitHub <noreply@github.com>2023-07-12 14:34:14 +0100
commitb03755a2347325a89a48b08fc158419000513bcb (patch)
treef60ec740d2eb0016e44bfef32f2a6cebf5f70e0e /Python/executor_cases.c.h
parente2d7366fb3df44e7434132636d49f22d6d25cc9f (diff)
downloadcpython-b03755a2347325a89a48b08fc158419000513bcb.tar.gz
cpython-b03755a2347325a89a48b08fc158419000513bcb.zip
GH-104909: Break LOAD_GLOBAL specializations in micro-ops. (GH-106677)
Diffstat (limited to 'Python/executor_cases.c.h')
-rw-r--r--Python/executor_cases.c.h314
1 files changed, 170 insertions, 144 deletions
diff --git a/Python/executor_cases.c.h b/Python/executor_cases.c.h
index 681efb97d89..94536ed8ce5 100644
--- a/Python/executor_cases.c.h
+++ b/Python/executor_cases.c.h
@@ -1154,17 +1154,43 @@
break;
}
+ case _SKIP_CACHE: {
+ break;
+ }
+
+ case _GUARD_GLOBALS_VERSION: {
+ uint16_t version = (uint16_t)operand;
+ #line 1358 "Python/bytecodes.c"
+ PyDictObject *dict = (PyDictObject *)GLOBALS();
+ DEOPT_IF(!PyDict_CheckExact(dict), LOAD_GLOBAL);
+ DEOPT_IF(dict->ma_keys->dk_version != version, LOAD_GLOBAL);
+ assert(DK_IS_UNICODE(dict->ma_keys));
+ #line 1169 "Python/executor_cases.c.h"
+ break;
+ }
+
+ case _GUARD_BUILTINS_VERSION: {
+ uint16_t version = (uint16_t)operand;
+ #line 1365 "Python/bytecodes.c"
+ PyDictObject *dict = (PyDictObject *)BUILTINS();
+ DEOPT_IF(!PyDict_CheckExact(dict), LOAD_GLOBAL);
+ DEOPT_IF(dict->ma_keys->dk_version != version, LOAD_GLOBAL);
+ assert(DK_IS_UNICODE(dict->ma_keys));
+ #line 1180 "Python/executor_cases.c.h"
+ break;
+ }
+
case DELETE_FAST: {
- #line 1385 "Python/bytecodes.c"
+ #line 1404 "Python/bytecodes.c"
PyObject *v = GETLOCAL(oparg);
if (v == NULL) goto unbound_local_error;
SETLOCAL(oparg, NULL);
- #line 1163 "Python/executor_cases.c.h"
+ #line 1189 "Python/executor_cases.c.h"
break;
}
case DELETE_DEREF: {
- #line 1402 "Python/bytecodes.c"
+ #line 1421 "Python/bytecodes.c"
PyObject *cell = GETLOCAL(oparg);
PyObject *oldobj = PyCell_GET(cell);
// Can't use ERROR_IF here.
@@ -1175,14 +1201,14 @@
}
PyCell_SET(cell, NULL);
Py_DECREF(oldobj);
- #line 1179 "Python/executor_cases.c.h"
+ #line 1205 "Python/executor_cases.c.h"
break;
}
case LOAD_FROM_DICT_OR_DEREF: {
PyObject *class_dict = stack_pointer[-1];
PyObject *value;
- #line 1415 "Python/bytecodes.c"
+ #line 1434 "Python/bytecodes.c"
PyObject *name;
assert(class_dict);
assert(oparg >= 0 && oparg < _PyFrame_GetCode(frame)->co_nlocalsplus);
@@ -1201,14 +1227,14 @@
}
Py_INCREF(value);
}
- #line 1205 "Python/executor_cases.c.h"
+ #line 1231 "Python/executor_cases.c.h"
stack_pointer[-1] = value;
break;
}
case LOAD_DEREF: {
PyObject *value;
- #line 1436 "Python/bytecodes.c"
+ #line 1455 "Python/bytecodes.c"
PyObject *cell = GETLOCAL(oparg);
value = PyCell_GET(cell);
if (value == NULL) {
@@ -1216,7 +1242,7 @@
if (true) goto error;
}
Py_INCREF(value);
- #line 1220 "Python/executor_cases.c.h"
+ #line 1246 "Python/executor_cases.c.h"
STACK_GROW(1);
stack_pointer[-1] = value;
break;
@@ -1224,18 +1250,18 @@
case STORE_DEREF: {
PyObject *v = stack_pointer[-1];
- #line 1446 "Python/bytecodes.c"
+ #line 1465 "Python/bytecodes.c"
PyObject *cell = GETLOCAL(oparg);
PyObject *oldobj = PyCell_GET(cell);
PyCell_SET(cell, v);
Py_XDECREF(oldobj);
- #line 1233 "Python/executor_cases.c.h"
+ #line 1259 "Python/executor_cases.c.h"
STACK_SHRINK(1);
break;
}
case COPY_FREE_VARS: {
- #line 1453 "Python/bytecodes.c"
+ #line 1472 "Python/bytecodes.c"
/* Copy closure variables to free variables */
PyCodeObject *co = _PyFrame_GetCode(frame);
assert(PyFunction_Check(frame->f_funcobj));
@@ -1246,22 +1272,22 @@
PyObject *o = PyTuple_GET_ITEM(closure, i);
frame->localsplus[offset + i] = Py_NewRef(o);
}
- #line 1250 "Python/executor_cases.c.h"
+ #line 1276 "Python/executor_cases.c.h"
break;
}
case BUILD_STRING: {
PyObject **pieces = (stack_pointer - oparg);
PyObject *str;
- #line 1466 "Python/bytecodes.c"
+ #line 1485 "Python/bytecodes.c"
str = _PyUnicode_JoinArray(&_Py_STR(empty), pieces, oparg);
- #line 1259 "Python/executor_cases.c.h"
+ #line 1285 "Python/executor_cases.c.h"
for (int _i = oparg; --_i >= 0;) {
Py_DECREF(pieces[_i]);
}
- #line 1468 "Python/bytecodes.c"
+ #line 1487 "Python/bytecodes.c"
if (str == NULL) { STACK_SHRINK(oparg); goto error; }
- #line 1265 "Python/executor_cases.c.h"
+ #line 1291 "Python/executor_cases.c.h"
STACK_SHRINK(oparg);
STACK_GROW(1);
stack_pointer[-1] = str;
@@ -1271,10 +1297,10 @@
case BUILD_TUPLE: {
PyObject **values = (stack_pointer - oparg);
PyObject *tup;
- #line 1472 "Python/bytecodes.c"
+ #line 1491 "Python/bytecodes.c"
tup = _PyTuple_FromArraySteal(values, oparg);
if (tup == NULL) { STACK_SHRINK(oparg); goto error; }
- #line 1278 "Python/executor_cases.c.h"
+ #line 1304 "Python/executor_cases.c.h"
STACK_SHRINK(oparg);
STACK_GROW(1);
stack_pointer[-1] = tup;
@@ -1284,10 +1310,10 @@
case BUILD_LIST: {
PyObject **values = (stack_pointer - oparg);
PyObject *list;
- #line 1477 "Python/bytecodes.c"
+ #line 1496 "Python/bytecodes.c"
list = _PyList_FromArraySteal(values, oparg);
if (list == NULL) { STACK_SHRINK(oparg); goto error; }
- #line 1291 "Python/executor_cases.c.h"
+ #line 1317 "Python/executor_cases.c.h"
STACK_SHRINK(oparg);
STACK_GROW(1);
stack_pointer[-1] = list;
@@ -1297,7 +1323,7 @@
case LIST_EXTEND: {
PyObject *iterable = stack_pointer[-1];
PyObject *list = stack_pointer[-(2 + (oparg-1))];
- #line 1482 "Python/bytecodes.c"
+ #line 1501 "Python/bytecodes.c"
PyObject *none_val = _PyList_Extend((PyListObject *)list, iterable);
if (none_val == NULL) {
if (_PyErr_ExceptionMatches(tstate, PyExc_TypeError) &&
@@ -1308,13 +1334,13 @@
"Value after * must be an iterable, not %.200s",
Py_TYPE(iterable)->tp_name);
}
- #line 1312 "Python/executor_cases.c.h"
+ #line 1338 "Python/executor_cases.c.h"
Py_DECREF(iterable);
- #line 1493 "Python/bytecodes.c"
+ #line 1512 "Python/bytecodes.c"
if (true) goto pop_1_error;
}
assert(Py_IsNone(none_val));
- #line 1318 "Python/executor_cases.c.h"
+ #line 1344 "Python/executor_cases.c.h"
Py_DECREF(iterable);
STACK_SHRINK(1);
break;
@@ -1323,13 +1349,13 @@
case SET_UPDATE: {
PyObject *iterable = stack_pointer[-1];
PyObject *set = stack_pointer[-(2 + (oparg-1))];
- #line 1500 "Python/bytecodes.c"
+ #line 1519 "Python/bytecodes.c"
int err = _PySet_Update(set, iterable);
- #line 1329 "Python/executor_cases.c.h"
+ #line 1355 "Python/executor_cases.c.h"
Py_DECREF(iterable);
- #line 1502 "Python/bytecodes.c"
+ #line 1521 "Python/bytecodes.c"
if (err < 0) goto pop_1_error;
- #line 1333 "Python/executor_cases.c.h"
+ #line 1359 "Python/executor_cases.c.h"
STACK_SHRINK(1);
break;
}
@@ -1337,7 +1363,7 @@
case BUILD_SET: {
PyObject **values = (stack_pointer - oparg);
PyObject *set;
- #line 1506 "Python/bytecodes.c"
+ #line 1525 "Python/bytecodes.c"
set = PySet_New(NULL);
if (set == NULL)
goto error;
@@ -1352,7 +1378,7 @@
Py_DECREF(set);
if (true) { STACK_SHRINK(oparg); goto error; }
}
- #line 1356 "Python/executor_cases.c.h"
+ #line 1382 "Python/executor_cases.c.h"
STACK_SHRINK(oparg);
STACK_GROW(1);
stack_pointer[-1] = set;
@@ -1362,7 +1388,7 @@
case BUILD_MAP: {
PyObject **values = (stack_pointer - oparg*2);
PyObject *map;
- #line 1523 "Python/bytecodes.c"
+ #line 1542 "Python/bytecodes.c"
map = _PyDict_FromItems(
values, 2,
values+1, 2,
@@ -1370,13 +1396,13 @@
if (map == NULL)
goto error;
- #line 1374 "Python/executor_cases.c.h"
+ #line 1400 "Python/executor_cases.c.h"
for (int _i = oparg*2; --_i >= 0;) {
Py_DECREF(values[_i]);
}
- #line 1531 "Python/bytecodes.c"
+ #line 1550 "Python/bytecodes.c"
if (map == NULL) { STACK_SHRINK(oparg*2); goto error; }
- #line 1380 "Python/executor_cases.c.h"
+ #line 1406 "Python/executor_cases.c.h"
STACK_SHRINK(oparg*2);
STACK_GROW(1);
stack_pointer[-1] = map;
@@ -1384,7 +1410,7 @@
}
case SETUP_ANNOTATIONS: {
- #line 1535 "Python/bytecodes.c"
+ #line 1554 "Python/bytecodes.c"
int err;
PyObject *ann_dict;
if (LOCALS() == NULL) {
@@ -1422,7 +1448,7 @@
Py_DECREF(ann_dict);
}
}
- #line 1426 "Python/executor_cases.c.h"
+ #line 1452 "Python/executor_cases.c.h"
break;
}
@@ -1430,7 +1456,7 @@
PyObject *keys = stack_pointer[-1];
PyObject **values = (stack_pointer - (1 + oparg));
PyObject *map;
- #line 1575 "Python/bytecodes.c"
+ #line 1594 "Python/bytecodes.c"
if (!PyTuple_CheckExact(keys) ||
PyTuple_GET_SIZE(keys) != (Py_ssize_t)oparg) {
_PyErr_SetString(tstate, PyExc_SystemError,
@@ -1440,14 +1466,14 @@
map = _PyDict_FromItems(
&PyTuple_GET_ITEM(keys, 0), 1,
values, 1, oparg);
- #line 1444 "Python/executor_cases.c.h"
+ #line 1470 "Python/executor_cases.c.h"
for (int _i = oparg; --_i >= 0;) {
Py_DECREF(values[_i]);
}
Py_DECREF(keys);
- #line 1585 "Python/bytecodes.c"
+ #line 1604 "Python/bytecodes.c"
if (map == NULL) { STACK_SHRINK(oparg); goto pop_1_error; }
- #line 1451 "Python/executor_cases.c.h"
+ #line 1477 "Python/executor_cases.c.h"
STACK_SHRINK(oparg);
stack_pointer[-1] = map;
break;
@@ -1455,7 +1481,7 @@
case DICT_UPDATE: {
PyObject *update = stack_pointer[-1];
- #line 1589 "Python/bytecodes.c"
+ #line 1608 "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)) {
@@ -1463,12 +1489,12 @@
"'%.200s' object is not a mapping",
Py_TYPE(update)->tp_name);
}
- #line 1467 "Python/executor_cases.c.h"
+ #line 1493 "Python/executor_cases.c.h"
Py_DECREF(update);
- #line 1597 "Python/bytecodes.c"
+ #line 1616 "Python/bytecodes.c"
if (true) goto pop_1_error;
}
- #line 1472 "Python/executor_cases.c.h"
+ #line 1498 "Python/executor_cases.c.h"
Py_DECREF(update);
STACK_SHRINK(1);
break;
@@ -1476,17 +1502,17 @@
case DICT_MERGE: {
PyObject *update = stack_pointer[-1];
- #line 1603 "Python/bytecodes.c"
+ #line 1622 "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 1485 "Python/executor_cases.c.h"
+ #line 1511 "Python/executor_cases.c.h"
Py_DECREF(update);
- #line 1608 "Python/bytecodes.c"
+ #line 1627 "Python/bytecodes.c"
if (true) goto pop_1_error;
}
- #line 1490 "Python/executor_cases.c.h"
+ #line 1516 "Python/executor_cases.c.h"
Py_DECREF(update);
STACK_SHRINK(1);
break;
@@ -1495,13 +1521,13 @@
case MAP_ADD: {
PyObject *value = stack_pointer[-1];
PyObject *key = stack_pointer[-2];
- #line 1614 "Python/bytecodes.c"
+ #line 1633 "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 1505 "Python/executor_cases.c.h"
+ #line 1531 "Python/executor_cases.c.h"
STACK_SHRINK(2);
break;
}
@@ -1512,20 +1538,20 @@
PyObject *global_super = stack_pointer[-3];
PyObject *res2 = NULL;
PyObject *res;
- #line 1697 "Python/bytecodes.c"
+ #line 1716 "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_CO_NAMES, oparg >> 2);
res = _PySuper_Lookup((PyTypeObject *)class, self, name, NULL);
- #line 1523 "Python/executor_cases.c.h"
+ #line 1549 "Python/executor_cases.c.h"
Py_DECREF(global_super);
Py_DECREF(class);
Py_DECREF(self);
- #line 1704 "Python/bytecodes.c"
+ #line 1723 "Python/bytecodes.c"
if (res == NULL) goto pop_3_error;
- #line 1529 "Python/executor_cases.c.h"
+ #line 1555 "Python/executor_cases.c.h"
STACK_SHRINK(2);
STACK_GROW(((oparg & 1) ? 1 : 0));
stack_pointer[-1] = res;
@@ -1539,7 +1565,7 @@
PyObject *global_super = stack_pointer[-3];
PyObject *res2;
PyObject *res;
- #line 1708 "Python/bytecodes.c"
+ #line 1727 "Python/bytecodes.c"
assert(oparg & 1);
DEOPT_IF(global_super != (PyObject *)&PySuper_Type, LOAD_SUPER_ATTR);
DEOPT_IF(!PyType_Check(class), LOAD_SUPER_ATTR);
@@ -1562,7 +1588,7 @@
res = res2;
res2 = NULL;
}
- #line 1566 "Python/executor_cases.c.h"
+ #line 1592 "Python/executor_cases.c.h"
STACK_SHRINK(1);
stack_pointer[-1] = res;
stack_pointer[-2] = res2;
@@ -1574,7 +1600,7 @@
PyObject *owner = stack_pointer[-1];
PyObject *res2 = NULL;
PyObject *res;
- #line 1749 "Python/bytecodes.c"
+ #line 1768 "Python/bytecodes.c"
#if ENABLE_SPECIALIZATION
_PyAttrCache *cache = (_PyAttrCache *)next_instr;
if (ADAPTIVE_COUNTER_IS_ZERO(cache->counter)) {
@@ -1608,9 +1634,9 @@
NULL | meth | arg1 | ... | argN
*/
- #line 1612 "Python/executor_cases.c.h"
+ #line 1638 "Python/executor_cases.c.h"
Py_DECREF(owner);
- #line 1783 "Python/bytecodes.c"
+ #line 1802 "Python/bytecodes.c"
if (meth == NULL) goto pop_1_error;
res2 = NULL;
res = meth;
@@ -1619,12 +1645,12 @@
else {
/* Classic, pushes one value. */
res = PyObject_GetAttr(owner, name);
- #line 1623 "Python/executor_cases.c.h"
+ #line 1649 "Python/executor_cases.c.h"
Py_DECREF(owner);
- #line 1792 "Python/bytecodes.c"
+ #line 1811 "Python/bytecodes.c"
if (res == NULL) goto pop_1_error;
}
- #line 1628 "Python/executor_cases.c.h"
+ #line 1654 "Python/executor_cases.c.h"
STACK_GROW(((oparg & 1) ? 1 : 0));
stack_pointer[-1] = res;
if (oparg & 1) { stack_pointer[-(1 + ((oparg & 1) ? 1 : 0))] = res2; }
@@ -1636,7 +1662,7 @@
PyObject *right = stack_pointer[-1];
PyObject *left = stack_pointer[-2];
PyObject *res;
- #line 2025 "Python/bytecodes.c"
+ #line 2044 "Python/bytecodes.c"
#if ENABLE_SPECIALIZATION
_PyCompareOpCache *cache = (_PyCompareOpCache *)next_instr;
if (ADAPTIVE_COUNTER_IS_ZERO(cache->counter)) {
@@ -1649,10 +1675,10 @@
#endif /* ENABLE_SPECIALIZATION */
assert((oparg >> 5) <= Py_GE);
res = PyObject_RichCompare(left, right, oparg >> 5);
- #line 1653 "Python/executor_cases.c.h"
+ #line 1679 "Python/executor_cases.c.h"
Py_DECREF(left);
Py_DECREF(right);
- #line 2038 "Python/bytecodes.c"
+ #line 2057 "Python/bytecodes.c"
if (res == NULL) goto pop_2_error;
if (oparg & 16) {
int res_bool = PyObject_IsTrue(res);
@@ -1660,7 +1686,7 @@
if (res_bool < 0) goto pop_2_error;
res = res_bool ? Py_True : Py_False;
}
- #line 1664 "Python/executor_cases.c.h"
+ #line 1690 "Python/executor_cases.c.h"
STACK_SHRINK(1);
stack_pointer[-1] = res;
break;
@@ -1670,7 +1696,7 @@
PyObject *right = stack_pointer[-1];
PyObject *left = stack_pointer[-2];
PyObject *res;
- #line 2048 "Python/bytecodes.c"
+ #line 2067 "Python/bytecodes.c"
DEOPT_IF(!PyFloat_CheckExact(left), COMPARE_OP);
DEOPT_IF(!PyFloat_CheckExact(right), COMPARE_OP);
STAT_INC(COMPARE_OP, hit);
@@ -1682,7 +1708,7 @@
_Py_DECREF_SPECIALIZED(right, _PyFloat_ExactDealloc);
res = (sign_ish & oparg) ? Py_True : Py_False;
// It's always a bool, so we don't care about oparg & 16.
- #line 1686 "Python/executor_cases.c.h"
+ #line 1712 "Python/executor_cases.c.h"
STACK_SHRINK(1);
stack_pointer[-1] = res;
break;
@@ -1692,7 +1718,7 @@
PyObject *right = stack_pointer[-1];
PyObject *left = stack_pointer[-2];
PyObject *res;
- #line 2063 "Python/bytecodes.c"
+ #line 2082 "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);
@@ -1708,7 +1734,7 @@
_Py_DECREF_SPECIALIZED(right, (destructor)PyObject_Free);
res = (sign_ish & oparg) ? Py_True : Py_False;
// It's always a bool, so we don't care about oparg & 16.
- #line 1712 "Python/executor_cases.c.h"
+ #line 1738 "Python/executor_cases.c.h"
STACK_SHRINK(1);
stack_pointer[-1] = res;
break;
@@ -1718,7 +1744,7 @@
PyObject *right = stack_pointer[-1];
PyObject *left = stack_pointer[-2];
PyObject *res;
- #line 2082 "Python/bytecodes.c"
+ #line 2101 "Python/bytecodes.c"
DEOPT_IF(!PyUnicode_CheckExact(left), COMPARE_OP);
DEOPT_IF(!PyUnicode_CheckExact(right), COMPARE_OP);
STAT_INC(COMPARE_OP, hit);
@@ -1731,7 +1757,7 @@
assert(COMPARISON_NOT_EQUALS + 1 == COMPARISON_EQUALS);
res = ((COMPARISON_NOT_EQUALS + eq) & oparg) ? Py_True : Py_False;
// It's always a bool, so we don't care about oparg & 16.
- #line 1735 "Python/executor_cases.c.h"
+ #line 1761 "Python/executor_cases.c.h"
STACK_SHRINK(1);
stack_pointer[-1] = res;
break;
@@ -1741,14 +1767,14 @@
PyObject *right = stack_pointer[-1];
PyObject *left = stack_pointer[-2];
PyObject *b;
- #line 2097 "Python/bytecodes.c"
+ #line 2116 "Python/bytecodes.c"
int res = Py_Is(left, right) ^ oparg;
- #line 1747 "Python/executor_cases.c.h"
+ #line 1773 "Python/executor_cases.c.h"
Py_DECREF(left);
Py_DECREF(right);
- #line 2099 "Python/bytecodes.c"
+ #line 2118 "Python/bytecodes.c"
b = res ? Py_True : Py_False;
- #line 1752 "Python/executor_cases.c.h"
+ #line 1778 "Python/executor_cases.c.h"
STACK_SHRINK(1);
stack_pointer[-1] = b;
break;
@@ -1758,15 +1784,15 @@
PyObject *right = stack_pointer[-1];
PyObject *left = stack_pointer[-2];
PyObject *b;
- #line 2103 "Python/bytecodes.c"
+ #line 2122 "Python/bytecodes.c"
int res = PySequence_Contains(right, left);
- #line 1764 "Python/executor_cases.c.h"
+ #line 1790 "Python/executor_cases.c.h"
Py_DECREF(left);
Py_DECREF(right);
- #line 2105 "Python/bytecodes.c"
+ #line 2124 "Python/bytecodes.c"
if (res < 0) goto pop_2_error;
b = (res ^ oparg) ? Py_True : Py_False;
- #line 1770 "Python/executor_cases.c.h"
+ #line 1796 "Python/executor_cases.c.h"
STACK_SHRINK(1);
stack_pointer[-1] = b;
break;
@@ -1777,12 +1803,12 @@
PyObject *exc_value = stack_pointer[-2];
PyObject *rest;
PyObject *match;
- #line 2110 "Python/bytecodes.c"
+ #line 2129 "Python/bytecodes.c"
if (check_except_star_type_valid(tstate, match_type) < 0) {
- #line 1783 "Python/executor_cases.c.h"
+ #line 1809 "Python/executor_cases.c.h"
Py_DECREF(exc_value);
Py_DECREF(match_type);
- #line 2112 "Python/bytecodes.c"
+ #line 2131 "Python/bytecodes.c"
if (true) goto pop_2_error;
}
@@ -1790,10 +1816,10 @@
rest = NULL;
int res = exception_group_match(exc_value, match_type,
&match, &rest);
- #line 1794 "Python/executor_cases.c.h"
+ #line 1820 "Python/executor_cases.c.h"
Py_DECREF(exc_value);
Py_DECREF(match_type);
- #line 2120 "Python/bytecodes.c"
+ #line 2139 "Python/bytecodes.c"
if (res < 0) goto pop_2_error;
assert((match == NULL) == (rest == NULL));
@@ -1802,7 +1828,7 @@
if (!Py_IsNone(match)) {
PyErr_SetHandledException(match);
}
- #line 1806 "Python/executor_cases.c.h"
+ #line 1832 "Python/executor_cases.c.h"
stack_pointer[-1] = match;
stack_pointer[-2] = rest;
break;
@@ -1812,21 +1838,21 @@
PyObject *right = stack_pointer[-1];
PyObject *left = stack_pointer[-2];
PyObject *b;
- #line 2131 "Python/bytecodes.c"
+ #line 2150 "Python/bytecodes.c"
assert(PyExceptionInstance_Check(left));
if (check_except_type_valid(tstate, right) < 0) {
- #line 1819 "Python/executor_cases.c.h"
+ #line 1845 "Python/executor_cases.c.h"
Py_DECREF(right);
- #line 2134 "Python/bytecodes.c"
+ #line 2153 "Python/bytecodes.c"
if (true) goto pop_1_error;
}
int res = PyErr_GivenExceptionMatches(left, right);
- #line 1826 "Python/executor_cases.c.h"
+ #line 1852 "Python/executor_cases.c.h"
Py_DECREF(right);
- #line 2139 "Python/bytecodes.c"
+ #line 2158 "Python/bytecodes.c"
b = res ? Py_True : Py_False;
- #line 1830 "Python/executor_cases.c.h"
+ #line 1856 "Python/executor_cases.c.h"
stack_pointer[-1] = b;
break;
}
@@ -1834,17 +1860,17 @@
case IS_NONE: {
PyObject *value = stack_pointer[-1];
PyObject *b;
- #line 2218 "Python/bytecodes.c"
+ #line 2237 "Python/bytecodes.c"
if (Py_IsNone(value)) {
b = Py_True;
}
else {
b = Py_False;
- #line 1844 "Python/executor_cases.c.h"
+ #line 1870 "Python/executor_cases.c.h"
Py_DECREF(value);
- #line 2224 "Python/bytecodes.c"
+ #line 2243 "Python/bytecodes.c"
}
- #line 1848 "Python/executor_cases.c.h"
+ #line 1874 "Python/executor_cases.c.h"
stack_pointer[-1] = b;
break;
}
@@ -1852,13 +1878,13 @@
case GET_LEN: {
PyObject *obj = stack_pointer[-1];
PyObject *len_o;
- #line 2241 "Python/bytecodes.c"
+ #line 2260 "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 1862 "Python/executor_cases.c.h"
+ #line 1888 "Python/executor_cases.c.h"
STACK_GROW(1);
stack_pointer[-1] = len_o;
break;
@@ -1869,16 +1895,16 @@
PyObject *type = stack_pointer[-2];
PyObject *subject = stack_pointer[-3];
PyObject *attrs;
- #line 2249 "Python/bytecodes.c"
+ #line 2268 "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 1878 "Python/executor_cases.c.h"
+ #line 1904 "Python/executor_cases.c.h"
Py_DECREF(subject);
Py_DECREF(type);
Py_DECREF(names);
- #line 2254 "Python/bytecodes.c"
+ #line 2273 "Python/bytecodes.c"
if (attrs) {
assert(PyTuple_CheckExact(attrs)); // Success!
}
@@ -1886,7 +1912,7 @@
if (_PyErr_Occurred(tstate)) goto pop_3_error;
attrs = Py_None; // Failure!
}
- #line 1890 "Python/executor_cases.c.h"
+ #line 1916 "Python/executor_cases.c.h"
STACK_SHRINK(2);
stack_pointer[-1] = attrs;
break;
@@ -1895,10 +1921,10 @@
case MATCH_MAPPING: {
PyObject *subject = stack_pointer[-1];
PyObject *res;
- #line 2264 "Python/bytecodes.c"
+ #line 2283 "Python/bytecodes.c"
int match = Py_TYPE(subject)->tp_flags & Py_TPFLAGS_MAPPING;
res = match ? Py_True : Py_False;
- #line 1902 "Python/executor_cases.c.h"
+ #line 1928 "Python/executor_cases.c.h"
STACK_GROW(1);
stack_pointer[-1] = res;
break;
@@ -1907,10 +1933,10 @@
case MATCH_SEQUENCE: {
PyObject *subject = stack_pointer[-1];
PyObject *res;
- #line 2269 "Python/bytecodes.c"
+ #line 2288 "Python/bytecodes.c"
int match = Py_TYPE(subject)->tp_flags & Py_TPFLAGS_SEQUENCE;
res = match ? Py_True : Py_False;
- #line 1914 "Python/executor_cases.c.h"
+ #line 1940 "Python/executor_cases.c.h"
STACK_GROW(1);
stack_pointer[-1] = res;
break;
@@ -1920,11 +1946,11 @@
PyObject *keys = stack_pointer[-1];
PyObject *subject = stack_pointer[-2];
PyObject *values_or_none;
- #line 2274 "Python/bytecodes.c"
+ #line 2293 "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 1928 "Python/executor_cases.c.h"
+ #line 1954 "Python/executor_cases.c.h"
STACK_GROW(1);
stack_pointer[-1] = values_or_none;
break;
@@ -1933,14 +1959,14 @@
case GET_ITER: {
PyObject *iterable = stack_pointer[-1];
PyObject *iter;
- #line 2280 "Python/bytecodes.c"
+ #line 2299 "Python/bytecodes.c"
/* before: [obj]; after [getiter(obj)] */
iter = PyObject_GetIter(iterable);
- #line 1940 "Python/executor_cases.c.h"
+ #line 1966 "Python/executor_cases.c.h"
Py_DECREF(iterable);
- #line 2283 "Python/bytecodes.c"
+ #line 2302 "Python/bytecodes.c"
if (iter == NULL) goto pop_1_error;
- #line 1944 "Python/executor_cases.c.h"
+ #line 1970 "Python/executor_cases.c.h"
stack_pointer[-1] = iter;
break;
}
@@ -1948,7 +1974,7 @@
case GET_YIELD_FROM_ITER: {
PyObject *iterable = stack_pointer[-1];
PyObject *iter;
- #line 2287 "Python/bytecodes.c"
+ #line 2306 "Python/bytecodes.c"
/* before: [obj]; after [getiter(obj)] */
if (PyCoro_CheckExact(iterable)) {
/* `iterable` is a coroutine */
@@ -1971,11 +1997,11 @@
if (iter == NULL) {
goto error;
}
- #line 1975 "Python/executor_cases.c.h"
+ #line 2001 "Python/executor_cases.c.h"
Py_DECREF(iterable);
- #line 2310 "Python/bytecodes.c"
+ #line 2329 "Python/bytecodes.c"
}
- #line 1979 "Python/executor_cases.c.h"
+ #line 2005 "Python/executor_cases.c.h"
stack_pointer[-1] = iter;
break;
}
@@ -1985,7 +2011,7 @@
PyObject *lasti = stack_pointer[-3];
PyObject *exit_func = stack_pointer[-4];
PyObject *res;
- #line 2542 "Python/bytecodes.c"
+ #line 2561 "Python/bytecodes.c"
/* At the top of the stack are 4 values:
- val: TOP = exc_info()
- unused: SECOND = previous exception
@@ -2006,7 +2032,7 @@
res = PyObject_Vectorcall(exit_func, stack + 1,
3 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL);
if (res == NULL) goto error;
- #line 2010 "Python/executor_cases.c.h"
+ #line 2036 "Python/executor_cases.c.h"
STACK_GROW(1);
stack_pointer[-1] = res;
break;
@@ -2015,7 +2041,7 @@
case PUSH_EXC_INFO: {
PyObject *new_exc = stack_pointer[-1];
PyObject *prev_exc;
- #line 2581 "Python/bytecodes.c"
+ #line 2600 "Python/bytecodes.c"
_PyErr_StackItem *exc_info = tstate->exc_info;
if (exc_info->exc_value != NULL) {
prev_exc = exc_info->exc_value;
@@ -2025,7 +2051,7 @@
}
assert(PyExceptionInstance_Check(new_exc));
exc_info->exc_value = Py_NewRef(new_exc);
- #line 2029 "Python/executor_cases.c.h"
+ #line 2055 "Python/executor_cases.c.h"
STACK_GROW(1);
stack_pointer[-1] = new_exc;
stack_pointer[-2] = prev_exc;
@@ -2034,7 +2060,7 @@
case EXIT_INIT_CHECK: {
PyObject *should_be_none = stack_pointer[-1];
- #line 2980 "Python/bytecodes.c"
+ #line 2999 "Python/bytecodes.c"
assert(STACK_LEVEL() == 2);
if (should_be_none != Py_None) {
PyErr_Format(PyExc_TypeError,
@@ -2042,7 +2068,7 @@
Py_TYPE(should_be_none)->tp_name);
goto error;
}
- #line 2046 "Python/executor_cases.c.h"
+ #line 2072 "Python/executor_cases.c.h"
STACK_SHRINK(1);
break;
}
@@ -2050,7 +2076,7 @@
case MAKE_FUNCTION: {
PyObject *codeobj = stack_pointer[-1];
PyObject *func;
- #line 3394 "Python/bytecodes.c"
+ #line 3413 "Python/bytecodes.c"
PyFunctionObject *func_obj = (PyFunctionObject *)
PyFunction_New(codeobj, GLOBALS());
@@ -2062,7 +2088,7 @@
func_obj->func_version = ((PyCodeObject *)codeobj)->co_version;
func = (PyObject *)func_obj;
- #line 2066 "Python/executor_cases.c.h"
+ #line 2092 "Python/executor_cases.c.h"
stack_pointer[-1] = func;
break;
}
@@ -2070,7 +2096,7 @@
case SET_FUNCTION_ATTRIBUTE: {
PyObject *func = stack_pointer[-1];
PyObject *attr = stack_pointer[-2];
- #line 3408 "Python/bytecodes.c"
+ #line 3427 "Python/bytecodes.c"
assert(PyFunction_Check(func));
PyFunctionObject *func_obj = (PyFunctionObject *)func;
switch(oparg) {
@@ -2095,7 +2121,7 @@
default:
Py_UNREACHABLE();
}
- #line 2099 "Python/executor_cases.c.h"
+ #line 2125 "Python/executor_cases.c.h"
STACK_SHRINK(1);
stack_pointer[-1] = func;
break;
@@ -2106,15 +2132,15 @@
PyObject *stop = stack_pointer[-(1 + ((oparg == 3) ? 1 : 0))];
PyObject *start = stack_pointer[-(2 + ((oparg == 3) ? 1 : 0))];
PyObject *slice;
- #line 3458 "Python/bytecodes.c"
+ #line 3477 "Python/bytecodes.c"
slice = PySlice_New(start, stop, step);
- #line 2112 "Python/executor_cases.c.h"
+ #line 2138 "Python/executor_cases.c.h"
Py_DECREF(start);
Py_DECREF(stop);
Py_XDECREF(step);
- #line 3460 "Python/bytecodes.c"
+ #line 3479 "Python/bytecodes.c"
if (slice == NULL) { STACK_SHRINK(((oparg == 3) ? 1 : 0)); goto pop_2_error; }
- #line 2118 "Python/executor_cases.c.h"
+ #line 2144 "Python/executor_cases.c.h"
STACK_SHRINK(((oparg == 3) ? 1 : 0));
STACK_SHRINK(1);
stack_pointer[-1] = slice;
@@ -2124,14 +2150,14 @@
case CONVERT_VALUE: {
PyObject *value = stack_pointer[-1];
PyObject *result;
- #line 3464 "Python/bytecodes.c"
+ #line 3483 "Python/bytecodes.c"
convertion_func_ptr conv_fn;
assert(oparg >= FVC_STR && oparg <= FVC_ASCII);
conv_fn = CONVERSION_FUNCTIONS[oparg];
result = conv_fn(value);
Py_DECREF(value);
if (result == NULL) goto pop_1_error;
- #line 2135 "Python/executor_cases.c.h"
+ #line 2161 "Python/executor_cases.c.h"
stack_pointer[-1] = result;
break;
}
@@ -2139,7 +2165,7 @@
case FORMAT_SIMPLE: {
PyObject *value = stack_pointer[-1];
PyObject *res;
- #line 3473 "Python/bytecodes.c"
+ #line 3492 "Python/bytecodes.c"
/* If value is a unicode object, then we know the result
* of format(value) is value itself. */
if (!PyUnicode_CheckExact(value)) {
@@ -2150,7 +2176,7 @@
else {
res = value;
}
- #line 2154 "Python/executor_cases.c.h"
+ #line 2180 "Python/executor_cases.c.h"
stack_pointer[-1] = res;
break;
}
@@ -2159,12 +2185,12 @@
PyObject *fmt_spec = stack_pointer[-1];
PyObject *value = stack_pointer[-2];
PyObject *res;
- #line 3486 "Python/bytecodes.c"
+ #line 3505 "Python/bytecodes.c"
res = PyObject_Format(value, fmt_spec);
Py_DECREF(value);
Py_DECREF(fmt_spec);
if (res == NULL) goto pop_2_error;
- #line 2168 "Python/executor_cases.c.h"
+ #line 2194 "Python/executor_cases.c.h"
STACK_SHRINK(1);
stack_pointer[-1] = res;
break;
@@ -2173,10 +2199,10 @@
case COPY: {
PyObject *bottom = stack_pointer[-(1 + (oparg-1))];
PyObject *top;
- #line 3493 "Python/bytecodes.c"
+ #line 3512 "Python/bytecodes.c"
assert(oparg > 0);
top = Py_NewRef(bottom);
- #line 2180 "Python/executor_cases.c.h"
+ #line 2206 "Python/executor_cases.c.h"
STACK_GROW(1);
stack_pointer[-1] = top;
break;
@@ -2187,7 +2213,7 @@
PyObject *rhs = stack_pointer[-1];
PyObject *lhs = stack_pointer[-2];
PyObject *res;
- #line 3498 "Python/bytecodes.c"
+ #line 3517 "Python/bytecodes.c"
#if ENABLE_SPECIALIZATION
_PyBinaryOpCache *cache = (_PyBinaryOpCache *)next_instr;
if (ADAPTIVE_COUNTER_IS_ZERO(cache->counter)) {
@@ -2202,12 +2228,12 @@
assert((unsigned)oparg < Py_ARRAY_LENGTH(binary_ops));
assert(binary_ops[oparg]);
res = binary_ops[oparg](lhs, rhs);
- #line 2206 "Python/executor_cases.c.h"
+ #line 2232 "Python/executor_cases.c.h"
Py_DECREF(lhs);
Py_DECREF(rhs);
- #line 3513 "Python/bytecodes.c"
+ #line 3532 "Python/bytecodes.c"
if (res == NULL) goto pop_2_error;
- #line 2211 "Python/executor_cases.c.h"
+ #line 2237 "Python/executor_cases.c.h"
STACK_SHRINK(1);
stack_pointer[-1] = res;
break;
@@ -2216,9 +2242,9 @@
case SWAP: {
PyObject *top = stack_pointer[-1];
PyObject *bottom = stack_pointer[-(2 + (oparg-2))];
- #line 3518 "Python/bytecodes.c"
+ #line 3537 "Python/bytecodes.c"
assert(oparg >= 2);
- #line 2222 "Python/executor_cases.c.h"
+ #line 2248 "Python/executor_cases.c.h"
stack_pointer[-1] = bottom;
stack_pointer[-(2 + (oparg-2))] = top;
break;