summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJelle Zijlstra <jelle.zijlstra@gmail.com>2023-09-12 13:59:09 (GMT)
committerGitHub <noreply@github.com>2023-09-12 13:59:09 (GMT)
commitacde502e8a692a322ea43c69059c01cc8f6d5bad (patch)
tree8d34387011c656de22e6f8c052ae9031fb558fb2
parentc76f4b97dcede6790a0e43d7d36179a298bbf0a6 (diff)
downloadcpython-acde502e8a692a322ea43c69059c01cc8f6d5bad.zip
cpython-acde502e8a692a322ea43c69059c01cc8f6d5bad.tar.gz
cpython-acde502e8a692a322ea43c69059c01cc8f6d5bad.tar.bz2
[3.12] gh-109118: Fix runtime crash when NameError happens in PEP 695 function (GH-109123) (#109173)
* gh-109118: Fix runtime crash when NameError happens in PEP 695 function (#109123) (cherry picked from commit 17f994174de9211b2baaff217eeb1033343230fc) * [3.12] gh-109118: Fix runtime crash when NameError happens in PEP 695 function (GH-109123). (cherry picked from commit 17f994174de9211b2baaff217eeb1033343230fc) Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
-rw-r--r--Lib/test/test_type_params.py40
-rw-r--r--Misc/NEWS.d/next/Core and Builtins/2023-09-07-18-24-42.gh-issue-109118.yPXRAe.rst2
-rw-r--r--Python/bytecodes.c74
-rw-r--r--Python/generated_cases.c.h803
-rw-r--r--Python/opcode_metadata.h12
5 files changed, 501 insertions, 430 deletions
diff --git a/Lib/test/test_type_params.py b/Lib/test/test_type_params.py
index 0045057..f93d088 100644
--- a/Lib/test/test_type_params.py
+++ b/Lib/test/test_type_params.py
@@ -956,3 +956,43 @@ class TypeParamsWeakRefTest(unittest.TestCase):
for case in cases:
with self.subTest(case=case):
weakref.ref(case)
+
+
+class TypeParamsRuntimeTest(unittest.TestCase):
+ def test_name_error(self):
+ # gh-109118: This crashed the interpreter due to a refcounting bug
+ code = """
+ class name_2[name_5]:
+ class name_4[name_5](name_0):
+ pass
+ """
+ with self.assertRaises(NameError):
+ run_code(code)
+
+ # Crashed with a slightly different stack trace
+ code = """
+ class name_2[name_5]:
+ class name_4[name_5: name_5](name_0):
+ pass
+ """
+ with self.assertRaises(NameError):
+ run_code(code)
+
+ def test_broken_class_namespace(self):
+ code = """
+ class WeirdMapping(dict):
+ def __missing__(self, key):
+ if key == "T":
+ raise RuntimeError
+ raise KeyError(key)
+
+ class Meta(type):
+ def __prepare__(name, bases):
+ return WeirdMapping()
+
+ class MyClass[V](metaclass=Meta):
+ class Inner[U](T):
+ pass
+ """
+ with self.assertRaises(RuntimeError):
+ run_code(code)
diff --git a/Misc/NEWS.d/next/Core and Builtins/2023-09-07-18-24-42.gh-issue-109118.yPXRAe.rst b/Misc/NEWS.d/next/Core and Builtins/2023-09-07-18-24-42.gh-issue-109118.yPXRAe.rst
new file mode 100644
index 0000000..f14fce4
--- /dev/null
+++ b/Misc/NEWS.d/next/Core and Builtins/2023-09-07-18-24-42.gh-issue-109118.yPXRAe.rst
@@ -0,0 +1,2 @@
+Fix interpreter crash when a NameError is raised inside the type parameters
+of a generic class.
diff --git a/Python/bytecodes.c b/Python/bytecodes.c
index 5e80e06..dfebaaa 100644
--- a/Python/bytecodes.c
+++ b/Python/bytecodes.c
@@ -1165,7 +1165,7 @@ dummy_func(
}
}
- op(_LOAD_LOCALS, ( -- locals)) {
+ inst(LOAD_LOCALS, ( -- locals)) {
locals = LOCALS();
if (locals == NULL) {
_PyErr_SetString(tstate, PyExc_SystemError,
@@ -1175,9 +1175,7 @@ dummy_func(
Py_INCREF(locals);
}
- macro(LOAD_LOCALS) = _LOAD_LOCALS;
-
- op(_LOAD_FROM_DICT_OR_GLOBALS, (mod_or_class_dict -- v)) {
+ inst(LOAD_FROM_DICT_OR_GLOBALS, (mod_or_class_dict -- v)) {
PyObject *name = GETITEM(frame->f_code->co_names, oparg);
if (PyDict_CheckExact(mod_or_class_dict)) {
v = PyDict_GetItemWithError(mod_or_class_dict, name);
@@ -1185,7 +1183,6 @@ dummy_func(
Py_INCREF(v);
}
else if (_PyErr_Occurred(tstate)) {
- Py_DECREF(mod_or_class_dict);
goto error;
}
}
@@ -1193,13 +1190,11 @@ dummy_func(
v = PyObject_GetItem(mod_or_class_dict, name);
if (v == NULL) {
if (!_PyErr_ExceptionMatches(tstate, PyExc_KeyError)) {
- Py_DECREF(mod_or_class_dict);
goto error;
}
_PyErr_Clear(tstate);
}
}
- Py_DECREF(mod_or_class_dict);
if (v == NULL) {
v = PyDict_GetItemWithError(GLOBALS(), name);
if (v != NULL) {
@@ -1234,11 +1229,70 @@ dummy_func(
}
}
}
+ DECREF_INPUTS();
}
- macro(LOAD_NAME) = _LOAD_LOCALS + _LOAD_FROM_DICT_OR_GLOBALS;
-
- macro(LOAD_FROM_DICT_OR_GLOBALS) = _LOAD_FROM_DICT_OR_GLOBALS;
+ inst(LOAD_NAME, (-- v)) {
+ PyObject *mod_or_class_dict = LOCALS();
+ if (mod_or_class_dict == NULL) {
+ _PyErr_SetString(tstate, PyExc_SystemError,
+ "no locals found");
+ ERROR_IF(true, error);
+ }
+ PyObject *name = GETITEM(frame->f_code->co_names, oparg);
+ if (PyDict_CheckExact(mod_or_class_dict)) {
+ v = PyDict_GetItemWithError(mod_or_class_dict, name);
+ if (v != NULL) {
+ Py_INCREF(v);
+ }
+ else if (_PyErr_Occurred(tstate)) {
+ goto error;
+ }
+ }
+ else {
+ v = PyObject_GetItem(mod_or_class_dict, name);
+ if (v == NULL) {
+ if (!_PyErr_ExceptionMatches(tstate, PyExc_KeyError)) {
+ goto error;
+ }
+ _PyErr_Clear(tstate);
+ }
+ }
+ if (v == NULL) {
+ v = PyDict_GetItemWithError(GLOBALS(), name);
+ if (v != NULL) {
+ Py_INCREF(v);
+ }
+ else if (_PyErr_Occurred(tstate)) {
+ goto error;
+ }
+ else {
+ if (PyDict_CheckExact(BUILTINS())) {
+ v = PyDict_GetItemWithError(BUILTINS(), name);
+ if (v == NULL) {
+ if (!_PyErr_Occurred(tstate)) {
+ format_exc_check_arg(
+ tstate, PyExc_NameError,
+ NAME_ERROR_MSG, name);
+ }
+ goto error;
+ }
+ Py_INCREF(v);
+ }
+ else {
+ v = PyObject_GetItem(BUILTINS(), name);
+ if (v == NULL) {
+ if (_PyErr_ExceptionMatches(tstate, PyExc_KeyError)) {
+ format_exc_check_arg(
+ tstate, PyExc_NameError,
+ NAME_ERROR_MSG, name);
+ }
+ goto error;
+ }
+ }
+ }
+ }
+ }
family(load_global, INLINE_CACHE_ENTRIES_LOAD_GLOBAL) = {
LOAD_GLOBAL,
diff --git a/Python/generated_cases.c.h b/Python/generated_cases.c.h
index a3c0495..e4cff7b 100644
--- a/Python/generated_cases.c.h
+++ b/Python/generated_cases.c.h
@@ -1619,174 +1619,149 @@
}
TARGET(LOAD_LOCALS) {
- PyObject *_tmp_1;
- {
- PyObject *locals;
- #line 1169 "Python/bytecodes.c"
- locals = LOCALS();
- if (locals == NULL) {
- _PyErr_SetString(tstate, PyExc_SystemError,
- "no locals found");
- if (true) goto error;
- }
- Py_INCREF(locals);
- #line 1634 "Python/generated_cases.c.h"
- _tmp_1 = locals;
+ PyObject *locals;
+ #line 1169 "Python/bytecodes.c"
+ locals = LOCALS();
+ if (locals == NULL) {
+ _PyErr_SetString(tstate, PyExc_SystemError,
+ "no locals found");
+ if (true) goto error;
}
+ Py_INCREF(locals);
+ #line 1632 "Python/generated_cases.c.h"
STACK_GROW(1);
- stack_pointer[-1] = _tmp_1;
+ stack_pointer[-1] = locals;
DISPATCH();
}
- TARGET(LOAD_NAME) {
- PyObject *_tmp_1;
- {
- PyObject *locals;
- #line 1169 "Python/bytecodes.c"
- locals = LOCALS();
- if (locals == NULL) {
- _PyErr_SetString(tstate, PyExc_SystemError,
- "no locals found");
- if (true) goto error;
+ TARGET(LOAD_FROM_DICT_OR_GLOBALS) {
+ PyObject *mod_or_class_dict = stack_pointer[-1];
+ PyObject *v;
+ #line 1179 "Python/bytecodes.c"
+ PyObject *name = GETITEM(frame->f_code->co_names, oparg);
+ if (PyDict_CheckExact(mod_or_class_dict)) {
+ v = PyDict_GetItemWithError(mod_or_class_dict, name);
+ if (v != NULL) {
+ Py_INCREF(v);
+ }
+ else if (_PyErr_Occurred(tstate)) {
+ goto error;
}
- Py_INCREF(locals);
- #line 1654 "Python/generated_cases.c.h"
- _tmp_1 = locals;
}
- {
- PyObject *mod_or_class_dict = _tmp_1;
- PyObject *v;
- #line 1181 "Python/bytecodes.c"
- PyObject *name = GETITEM(frame->f_code->co_names, oparg);
- if (PyDict_CheckExact(mod_or_class_dict)) {
- v = PyDict_GetItemWithError(mod_or_class_dict, name);
- if (v != NULL) {
- Py_INCREF(v);
- }
- else if (_PyErr_Occurred(tstate)) {
- Py_DECREF(mod_or_class_dict);
+ else {
+ v = PyObject_GetItem(mod_or_class_dict, name);
+ if (v == NULL) {
+ if (!_PyErr_ExceptionMatches(tstate, PyExc_KeyError)) {
goto error;
}
+ _PyErr_Clear(tstate);
+ }
+ }
+ if (v == NULL) {
+ v = PyDict_GetItemWithError(GLOBALS(), name);
+ if (v != NULL) {
+ Py_INCREF(v);
+ }
+ else if (_PyErr_Occurred(tstate)) {
+ goto error;
}
else {
- v = PyObject_GetItem(mod_or_class_dict, name);
- if (v == NULL) {
- if (!_PyErr_ExceptionMatches(tstate, PyExc_KeyError)) {
- Py_DECREF(mod_or_class_dict);
+ if (PyDict_CheckExact(BUILTINS())) {
+ v = PyDict_GetItemWithError(BUILTINS(), name);
+ if (v == NULL) {
+ if (!_PyErr_Occurred(tstate)) {
+ format_exc_check_arg(
+ tstate, PyExc_NameError,
+ NAME_ERROR_MSG, name);
+ }
goto error;
}
- _PyErr_Clear(tstate);
- }
- }
- Py_DECREF(mod_or_class_dict);
- if (v == NULL) {
- v = PyDict_GetItemWithError(GLOBALS(), name);
- if (v != NULL) {
Py_INCREF(v);
}
- else if (_PyErr_Occurred(tstate)) {
- goto error;
- }
else {
- if (PyDict_CheckExact(BUILTINS())) {
- v = PyDict_GetItemWithError(BUILTINS(), name);
- if (v == NULL) {
- if (!_PyErr_Occurred(tstate)) {
- format_exc_check_arg(
+ v = PyObject_GetItem(BUILTINS(), name);
+ if (v == NULL) {
+ if (_PyErr_ExceptionMatches(tstate, PyExc_KeyError)) {
+ format_exc_check_arg(
tstate, PyExc_NameError,
NAME_ERROR_MSG, name);
- }
- goto error;
- }
- Py_INCREF(v);
- }
- else {
- v = PyObject_GetItem(BUILTINS(), name);
- if (v == NULL) {
- if (_PyErr_ExceptionMatches(tstate, PyExc_KeyError)) {
- format_exc_check_arg(
- tstate, PyExc_NameError,
- NAME_ERROR_MSG, name);
- }
- goto error;
}
+ goto error;
}
}
}
- #line 1717 "Python/generated_cases.c.h"
- _tmp_1 = v;
}
- STACK_GROW(1);
- stack_pointer[-1] = _tmp_1;
+ #line 1695 "Python/generated_cases.c.h"
+ Py_DECREF(mod_or_class_dict);
+ stack_pointer[-1] = v;
DISPATCH();
}
- TARGET(LOAD_FROM_DICT_OR_GLOBALS) {
- PyObject *_tmp_1 = stack_pointer[-1];
- {
- PyObject *mod_or_class_dict = _tmp_1;
- PyObject *v;
- #line 1181 "Python/bytecodes.c"
- PyObject *name = GETITEM(frame->f_code->co_names, oparg);
- if (PyDict_CheckExact(mod_or_class_dict)) {
- v = PyDict_GetItemWithError(mod_or_class_dict, name);
- if (v != NULL) {
- Py_INCREF(v);
- }
- else if (_PyErr_Occurred(tstate)) {
- Py_DECREF(mod_or_class_dict);
+ TARGET(LOAD_NAME) {
+ PyObject *v;
+ #line 1236 "Python/bytecodes.c"
+ PyObject *mod_or_class_dict = LOCALS();
+ if (mod_or_class_dict == NULL) {
+ _PyErr_SetString(tstate, PyExc_SystemError,
+ "no locals found");
+ if (true) goto error;
+ }
+ PyObject *name = GETITEM(frame->f_code->co_names, oparg);
+ if (PyDict_CheckExact(mod_or_class_dict)) {
+ v = PyDict_GetItemWithError(mod_or_class_dict, name);
+ if (v != NULL) {
+ Py_INCREF(v);
+ }
+ else if (_PyErr_Occurred(tstate)) {
+ goto error;
+ }
+ }
+ else {
+ v = PyObject_GetItem(mod_or_class_dict, name);
+ if (v == NULL) {
+ if (!_PyErr_ExceptionMatches(tstate, PyExc_KeyError)) {
goto error;
}
+ _PyErr_Clear(tstate);
+ }
+ }
+ if (v == NULL) {
+ v = PyDict_GetItemWithError(GLOBALS(), name);
+ if (v != NULL) {
+ Py_INCREF(v);
+ }
+ else if (_PyErr_Occurred(tstate)) {
+ goto error;
}
else {
- v = PyObject_GetItem(mod_or_class_dict, name);
- if (v == NULL) {
- if (!_PyErr_ExceptionMatches(tstate, PyExc_KeyError)) {
- Py_DECREF(mod_or_class_dict);
+ if (PyDict_CheckExact(BUILTINS())) {
+ v = PyDict_GetItemWithError(BUILTINS(), name);
+ if (v == NULL) {
+ if (!_PyErr_Occurred(tstate)) {
+ format_exc_check_arg(
+ tstate, PyExc_NameError,
+ NAME_ERROR_MSG, name);
+ }
goto error;
}
- _PyErr_Clear(tstate);
- }
- }
- Py_DECREF(mod_or_class_dict);
- if (v == NULL) {
- v = PyDict_GetItemWithError(GLOBALS(), name);
- if (v != NULL) {
Py_INCREF(v);
}
- else if (_PyErr_Occurred(tstate)) {
- goto error;
- }
else {
- if (PyDict_CheckExact(BUILTINS())) {
- v = PyDict_GetItemWithError(BUILTINS(), name);
- if (v == NULL) {
- if (!_PyErr_Occurred(tstate)) {
- format_exc_check_arg(
+ v = PyObject_GetItem(BUILTINS(), name);
+ if (v == NULL) {
+ if (_PyErr_ExceptionMatches(tstate, PyExc_KeyError)) {
+ format_exc_check_arg(
tstate, PyExc_NameError,
NAME_ERROR_MSG, name);
- }
- goto error;
- }
- Py_INCREF(v);
- }
- else {
- v = PyObject_GetItem(BUILTINS(), name);
- if (v == NULL) {
- if (_PyErr_ExceptionMatches(tstate, PyExc_KeyError)) {
- format_exc_check_arg(
- tstate, PyExc_NameError,
- NAME_ERROR_MSG, name);
- }
- goto error;
}
+ goto error;
}
}
}
- #line 1787 "Python/generated_cases.c.h"
- _tmp_1 = v;
}
- stack_pointer[-1] = _tmp_1;
+ #line 1763 "Python/generated_cases.c.h"
+ STACK_GROW(1);
+ stack_pointer[-1] = v;
DISPATCH();
}
@@ -1795,7 +1770,7 @@
static_assert(INLINE_CACHE_ENTRIES_LOAD_GLOBAL == 4, "incorrect cache size");
PyObject *null = NULL;
PyObject *v;
- #line 1250 "Python/bytecodes.c"
+ #line 1304 "Python/bytecodes.c"
#if ENABLE_SPECIALIZATION
_PyLoadGlobalCache *cache = (_PyLoadGlobalCache *)next_instr;
if (ADAPTIVE_COUNTER_IS_ZERO(cache->counter)) {
@@ -1847,7 +1822,7 @@
}
}
null = NULL;
- #line 1851 "Python/generated_cases.c.h"
+ #line 1826 "Python/generated_cases.c.h"
STACK_GROW(1);
STACK_GROW(((oparg & 1) ? 1 : 0));
stack_pointer[-1] = v;
@@ -1861,7 +1836,7 @@
PyObject *res;
uint16_t index = read_u16(&next_instr[1].cache);
uint16_t version = read_u16(&next_instr[2].cache);
- #line 1304 "Python/bytecodes.c"
+ #line 1358 "Python/bytecodes.c"
DEOPT_IF(!PyDict_CheckExact(GLOBALS()), LOAD_GLOBAL);
PyDictObject *dict = (PyDictObject *)GLOBALS();
DEOPT_IF(dict->ma_keys->dk_version != version, LOAD_GLOBAL);
@@ -1872,7 +1847,7 @@
Py_INCREF(res);
STAT_INC(LOAD_GLOBAL, hit);
null = NULL;
- #line 1876 "Python/generated_cases.c.h"
+ #line 1851 "Python/generated_cases.c.h"
STACK_GROW(1);
STACK_GROW(((oparg & 1) ? 1 : 0));
stack_pointer[-1] = res;
@@ -1887,7 +1862,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 1317 "Python/bytecodes.c"
+ #line 1371 "Python/bytecodes.c"
DEOPT_IF(!PyDict_CheckExact(GLOBALS()), LOAD_GLOBAL);
DEOPT_IF(!PyDict_CheckExact(BUILTINS()), LOAD_GLOBAL);
PyDictObject *mdict = (PyDictObject *)GLOBALS();
@@ -1902,7 +1877,7 @@
Py_INCREF(res);
STAT_INC(LOAD_GLOBAL, hit);
null = NULL;
- #line 1906 "Python/generated_cases.c.h"
+ #line 1881 "Python/generated_cases.c.h"
STACK_GROW(1);
STACK_GROW(((oparg & 1) ? 1 : 0));
stack_pointer[-1] = res;
@@ -1912,16 +1887,16 @@
}
TARGET(DELETE_FAST) {
- #line 1334 "Python/bytecodes.c"
+ #line 1388 "Python/bytecodes.c"
PyObject *v = GETLOCAL(oparg);
if (v == NULL) goto unbound_local_error;
SETLOCAL(oparg, NULL);
- #line 1920 "Python/generated_cases.c.h"
+ #line 1895 "Python/generated_cases.c.h"
DISPATCH();
}
TARGET(MAKE_CELL) {
- #line 1340 "Python/bytecodes.c"
+ #line 1394 "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);
@@ -1930,12 +1905,12 @@
goto resume_with_error;
}
SETLOCAL(oparg, cell);
- #line 1934 "Python/generated_cases.c.h"
+ #line 1909 "Python/generated_cases.c.h"
DISPATCH();
}
TARGET(DELETE_DEREF) {
- #line 1351 "Python/bytecodes.c"
+ #line 1405 "Python/bytecodes.c"
PyObject *cell = GETLOCAL(oparg);
PyObject *oldobj = PyCell_GET(cell);
// Can't use ERROR_IF here.
@@ -1946,14 +1921,14 @@
}
PyCell_SET(cell, NULL);
Py_DECREF(oldobj);
- #line 1950 "Python/generated_cases.c.h"
+ #line 1925 "Python/generated_cases.c.h"
DISPATCH();
}
TARGET(LOAD_FROM_DICT_OR_DEREF) {
PyObject *class_dict = stack_pointer[-1];
PyObject *value;
- #line 1364 "Python/bytecodes.c"
+ #line 1418 "Python/bytecodes.c"
PyObject *name;
assert(class_dict);
assert(oparg >= 0 && oparg < frame->f_code->co_nlocalsplus);
@@ -1988,14 +1963,14 @@
}
Py_INCREF(value);
}
- #line 1992 "Python/generated_cases.c.h"
+ #line 1967 "Python/generated_cases.c.h"
stack_pointer[-1] = value;
DISPATCH();
}
TARGET(LOAD_DEREF) {
PyObject *value;
- #line 1401 "Python/bytecodes.c"
+ #line 1455 "Python/bytecodes.c"
PyObject *cell = GETLOCAL(oparg);
value = PyCell_GET(cell);
if (value == NULL) {
@@ -2003,7 +1978,7 @@
if (true) goto error;
}
Py_INCREF(value);
- #line 2007 "Python/generated_cases.c.h"
+ #line 1982 "Python/generated_cases.c.h"
STACK_GROW(1);
stack_pointer[-1] = value;
DISPATCH();
@@ -2011,18 +1986,18 @@
TARGET(STORE_DEREF) {
PyObject *v = stack_pointer[-1];
- #line 1411 "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 2020 "Python/generated_cases.c.h"
+ #line 1995 "Python/generated_cases.c.h"
STACK_SHRINK(1);
DISPATCH();
}
TARGET(COPY_FREE_VARS) {
- #line 1418 "Python/bytecodes.c"
+ #line 1472 "Python/bytecodes.c"
/* Copy closure variables to free variables */
PyCodeObject *co = frame->f_code;
assert(PyFunction_Check(frame->f_funcobj));
@@ -2033,22 +2008,22 @@
PyObject *o = PyTuple_GET_ITEM(closure, i);
frame->localsplus[offset + i] = Py_NewRef(o);
}
- #line 2037 "Python/generated_cases.c.h"
+ #line 2012 "Python/generated_cases.c.h"
DISPATCH();
}
TARGET(BUILD_STRING) {
PyObject **pieces = (stack_pointer - oparg);
PyObject *str;
- #line 1431 "Python/bytecodes.c"
+ #line 1485 "Python/bytecodes.c"
str = _PyUnicode_JoinArray(&_Py_STR(empty), pieces, oparg);
- #line 2046 "Python/generated_cases.c.h"
+ #line 2021 "Python/generated_cases.c.h"
for (int _i = oparg; --_i >= 0;) {
Py_DECREF(pieces[_i]);
}
- #line 1433 "Python/bytecodes.c"
+ #line 1487 "Python/bytecodes.c"
if (str == NULL) { STACK_SHRINK(oparg); goto error; }
- #line 2052 "Python/generated_cases.c.h"
+ #line 2027 "Python/generated_cases.c.h"
STACK_SHRINK(oparg);
STACK_GROW(1);
stack_pointer[-1] = str;
@@ -2058,10 +2033,10 @@
TARGET(BUILD_TUPLE) {
PyObject **values = (stack_pointer - oparg);
PyObject *tup;
- #line 1437 "Python/bytecodes.c"
+ #line 1491 "Python/bytecodes.c"
tup = _PyTuple_FromArraySteal(values, oparg);
if (tup == NULL) { STACK_SHRINK(oparg); goto error; }
- #line 2065 "Python/generated_cases.c.h"
+ #line 2040 "Python/generated_cases.c.h"
STACK_SHRINK(oparg);
STACK_GROW(1);
stack_pointer[-1] = tup;
@@ -2071,10 +2046,10 @@
TARGET(BUILD_LIST) {
PyObject **values = (stack_pointer - oparg);
PyObject *list;
- #line 1442 "Python/bytecodes.c"
+ #line 1496 "Python/bytecodes.c"
list = _PyList_FromArraySteal(values, oparg);
if (list == NULL) { STACK_SHRINK(oparg); goto error; }
- #line 2078 "Python/generated_cases.c.h"
+ #line 2053 "Python/generated_cases.c.h"
STACK_SHRINK(oparg);
STACK_GROW(1);
stack_pointer[-1] = list;
@@ -2084,7 +2059,7 @@
TARGET(LIST_EXTEND) {
PyObject *iterable = stack_pointer[-1];
PyObject *list = stack_pointer[-(2 + (oparg-1))];
- #line 1447 "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) &&
@@ -2095,13 +2070,13 @@
"Value after * must be an iterable, not %.200s",
Py_TYPE(iterable)->tp_name);
}
- #line 2099 "Python/generated_cases.c.h"
+ #line 2074 "Python/generated_cases.c.h"
Py_DECREF(iterable);
- #line 1458 "Python/bytecodes.c"
+ #line 1512 "Python/bytecodes.c"
if (true) goto pop_1_error;
}
assert(Py_IsNone(none_val));
- #line 2105 "Python/generated_cases.c.h"
+ #line 2080 "Python/generated_cases.c.h"
Py_DECREF(iterable);
STACK_SHRINK(1);
DISPATCH();
@@ -2110,13 +2085,13 @@
TARGET(SET_UPDATE) {
PyObject *iterable = stack_pointer[-1];
PyObject *set = stack_pointer[-(2 + (oparg-1))];
- #line 1465 "Python/bytecodes.c"
+ #line 1519 "Python/bytecodes.c"
int err = _PySet_Update(set, iterable);
- #line 2116 "Python/generated_cases.c.h"
+ #line 2091 "Python/generated_cases.c.h"
Py_DECREF(iterable);
- #line 1467 "Python/bytecodes.c"
+ #line 1521 "Python/bytecodes.c"
if (err < 0) goto pop_1_error;
- #line 2120 "Python/generated_cases.c.h"
+ #line 2095 "Python/generated_cases.c.h"
STACK_SHRINK(1);
DISPATCH();
}
@@ -2124,7 +2099,7 @@
TARGET(BUILD_SET) {
PyObject **values = (stack_pointer - oparg);
PyObject *set;
- #line 1471 "Python/bytecodes.c"
+ #line 1525 "Python/bytecodes.c"
set = PySet_New(NULL);
if (set == NULL)
goto error;
@@ -2139,7 +2114,7 @@
Py_DECREF(set);
if (true) { STACK_SHRINK(oparg); goto error; }
}
- #line 2143 "Python/generated_cases.c.h"
+ #line 2118 "Python/generated_cases.c.h"
STACK_SHRINK(oparg);
STACK_GROW(1);
stack_pointer[-1] = set;
@@ -2149,7 +2124,7 @@
TARGET(BUILD_MAP) {
PyObject **values = (stack_pointer - oparg*2);
PyObject *map;
- #line 1488 "Python/bytecodes.c"
+ #line 1542 "Python/bytecodes.c"
map = _PyDict_FromItems(
values, 2,
values+1, 2,
@@ -2157,13 +2132,13 @@
if (map == NULL)
goto error;
- #line 2161 "Python/generated_cases.c.h"
+ #line 2136 "Python/generated_cases.c.h"
for (int _i = oparg*2; --_i >= 0;) {
Py_DECREF(values[_i]);
}
- #line 1496 "Python/bytecodes.c"
+ #line 1550 "Python/bytecodes.c"
if (map == NULL) { STACK_SHRINK(oparg*2); goto error; }
- #line 2167 "Python/generated_cases.c.h"
+ #line 2142 "Python/generated_cases.c.h"
STACK_SHRINK(oparg*2);
STACK_GROW(1);
stack_pointer[-1] = map;
@@ -2171,7 +2146,7 @@
}
TARGET(SETUP_ANNOTATIONS) {
- #line 1500 "Python/bytecodes.c"
+ #line 1554 "Python/bytecodes.c"
int err;
PyObject *ann_dict;
if (LOCALS() == NULL) {
@@ -2211,7 +2186,7 @@
Py_DECREF(ann_dict);
}
}
- #line 2215 "Python/generated_cases.c.h"
+ #line 2190 "Python/generated_cases.c.h"
DISPATCH();
}
@@ -2219,7 +2194,7 @@
PyObject *keys = stack_pointer[-1];
PyObject **values = (stack_pointer - (1 + oparg));
PyObject *map;
- #line 1542 "Python/bytecodes.c"
+ #line 1596 "Python/bytecodes.c"
if (!PyTuple_CheckExact(keys) ||
PyTuple_GET_SIZE(keys) != (Py_ssize_t)oparg) {
_PyErr_SetString(tstate, PyExc_SystemError,
@@ -2229,14 +2204,14 @@
map = _PyDict_FromItems(
&PyTuple_GET_ITEM(keys, 0), 1,
values, 1, oparg);
- #line 2233 "Python/generated_cases.c.h"
+ #line 2208 "Python/generated_cases.c.h"
for (int _i = oparg; --_i >= 0;) {
Py_DECREF(values[_i]);
}
Py_DECREF(keys);
- #line 1552 "Python/bytecodes.c"
+ #line 1606 "Python/bytecodes.c"
if (map == NULL) { STACK_SHRINK(oparg); goto pop_1_error; }
- #line 2240 "Python/generated_cases.c.h"
+ #line 2215 "Python/generated_cases.c.h"
STACK_SHRINK(oparg);
stack_pointer[-1] = map;
DISPATCH();
@@ -2244,7 +2219,7 @@
TARGET(DICT_UPDATE) {
PyObject *update = stack_pointer[-1];
- #line 1556 "Python/bytecodes.c"
+ #line 1610 "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)) {
@@ -2252,12 +2227,12 @@
"'%.200s' object is not a mapping",
Py_TYPE(update)->tp_name);
}
- #line 2256 "Python/generated_cases.c.h"
+ #line 2231 "Python/generated_cases.c.h"
Py_DECREF(update);
- #line 1564 "Python/bytecodes.c"
+ #line 1618 "Python/bytecodes.c"
if (true) goto pop_1_error;
}
- #line 2261 "Python/generated_cases.c.h"
+ #line 2236 "Python/generated_cases.c.h"
Py_DECREF(update);
STACK_SHRINK(1);
DISPATCH();
@@ -2265,17 +2240,17 @@
TARGET(DICT_MERGE) {
PyObject *update = stack_pointer[-1];
- #line 1570 "Python/bytecodes.c"
+ #line 1624 "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 2274 "Python/generated_cases.c.h"
+ #line 2249 "Python/generated_cases.c.h"
Py_DECREF(update);
- #line 1575 "Python/bytecodes.c"
+ #line 1629 "Python/bytecodes.c"
if (true) goto pop_1_error;
}
- #line 2279 "Python/generated_cases.c.h"
+ #line 2254 "Python/generated_cases.c.h"
Py_DECREF(update);
STACK_SHRINK(1);
PREDICT(CALL_FUNCTION_EX);
@@ -2285,26 +2260,26 @@
TARGET(MAP_ADD) {
PyObject *value = stack_pointer[-1];
PyObject *key = stack_pointer[-2];
- #line 1582 "Python/bytecodes.c"
+ #line 1636 "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 2295 "Python/generated_cases.c.h"
+ #line 2270 "Python/generated_cases.c.h"
STACK_SHRINK(2);
PREDICT(JUMP_BACKWARD);
DISPATCH();
}
TARGET(INSTRUMENTED_LOAD_SUPER_ATTR) {
- #line 1591 "Python/bytecodes.c"
+ #line 1645 "Python/bytecodes.c"
_PySuperAttrCache *cache = (_PySuperAttrCache *)next_instr;
// cancel out the decrement that will happen in LOAD_SUPER_ATTR; we
// don't want to specialize instrumented instructions
INCREMENT_ADAPTIVE_COUNTER(cache->counter);
GO_TO_INSTRUCTION(LOAD_SUPER_ATTR);
- #line 2308 "Python/generated_cases.c.h"
+ #line 2283 "Python/generated_cases.c.h"
}
TARGET(LOAD_SUPER_ATTR) {
@@ -2315,7 +2290,7 @@
PyObject *global_super = stack_pointer[-3];
PyObject *res2 = NULL;
PyObject *res;
- #line 1605 "Python/bytecodes.c"
+ #line 1659 "Python/bytecodes.c"
PyObject *name = GETITEM(frame->f_code->co_names, oparg >> 2);
int load_method = oparg & 1;
#if ENABLE_SPECIALIZATION
@@ -2357,16 +2332,16 @@
}
}
}
- #line 2361 "Python/generated_cases.c.h"
+ #line 2336 "Python/generated_cases.c.h"
Py_DECREF(global_super);
Py_DECREF(class);
Py_DECREF(self);
- #line 1647 "Python/bytecodes.c"
+ #line 1701 "Python/bytecodes.c"
if (super == NULL) goto pop_3_error;
res = PyObject_GetAttr(super, name);
Py_DECREF(super);
if (res == NULL) goto pop_3_error;
- #line 2370 "Python/generated_cases.c.h"
+ #line 2345 "Python/generated_cases.c.h"
STACK_SHRINK(2);
STACK_GROW(((oparg & 1) ? 1 : 0));
stack_pointer[-1] = res;
@@ -2381,20 +2356,20 @@
PyObject *global_super = stack_pointer[-3];
PyObject *res2 = NULL;
PyObject *res;
- #line 1654 "Python/bytecodes.c"
+ #line 1708 "Python/bytecodes.c"
assert(!(oparg & 1));
DEOPT_IF(global_super != (PyObject *)&PySuper_Type, LOAD_SUPER_ATTR);
DEOPT_IF(!PyType_Check(class), LOAD_SUPER_ATTR);
STAT_INC(LOAD_SUPER_ATTR, hit);
PyObject *name = GETITEM(frame->f_code->co_names, oparg >> 2);
res = _PySuper_Lookup((PyTypeObject *)class, self, name, NULL);
- #line 2392 "Python/generated_cases.c.h"
+ #line 2367 "Python/generated_cases.c.h"
Py_DECREF(global_super);
Py_DECREF(class);
Py_DECREF(self);
- #line 1661 "Python/bytecodes.c"
+ #line 1715 "Python/bytecodes.c"
if (res == NULL) goto pop_3_error;
- #line 2398 "Python/generated_cases.c.h"
+ #line 2373 "Python/generated_cases.c.h"
STACK_SHRINK(2);
STACK_GROW(((oparg & 1) ? 1 : 0));
stack_pointer[-1] = res;
@@ -2409,7 +2384,7 @@
PyObject *global_super = stack_pointer[-3];
PyObject *res2;
PyObject *res;
- #line 1665 "Python/bytecodes.c"
+ #line 1719 "Python/bytecodes.c"
assert(oparg & 1);
DEOPT_IF(global_super != (PyObject *)&PySuper_Type, LOAD_SUPER_ATTR);
DEOPT_IF(!PyType_Check(class), LOAD_SUPER_ATTR);
@@ -2432,7 +2407,7 @@
res = res2;
res2 = NULL;
}
- #line 2436 "Python/generated_cases.c.h"
+ #line 2411 "Python/generated_cases.c.h"
STACK_SHRINK(1);
stack_pointer[-1] = res;
stack_pointer[-2] = res2;
@@ -2446,7 +2421,7 @@
PyObject *owner = stack_pointer[-1];
PyObject *res2 = NULL;
PyObject *res;
- #line 1704 "Python/bytecodes.c"
+ #line 1758 "Python/bytecodes.c"
#if ENABLE_SPECIALIZATION
_PyAttrCache *cache = (_PyAttrCache *)next_instr;
if (ADAPTIVE_COUNTER_IS_ZERO(cache->counter)) {
@@ -2480,9 +2455,9 @@
NULL | meth | arg1 | ... | argN
*/
- #line 2484 "Python/generated_cases.c.h"
+ #line 2459 "Python/generated_cases.c.h"
Py_DECREF(owner);
- #line 1738 "Python/bytecodes.c"
+ #line 1792 "Python/bytecodes.c"
if (meth == NULL) goto pop_1_error;
res2 = NULL;
res = meth;
@@ -2491,12 +2466,12 @@
else {
/* Classic, pushes one value. */
res = PyObject_GetAttr(owner, name);
- #line 2495 "Python/generated_cases.c.h"
+ #line 2470 "Python/generated_cases.c.h"
Py_DECREF(owner);
- #line 1747 "Python/bytecodes.c"
+ #line 1801 "Python/bytecodes.c"
if (res == NULL) goto pop_1_error;
}
- #line 2500 "Python/generated_cases.c.h"
+ #line 2475 "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; }
@@ -2510,7 +2485,7 @@
PyObject *res;
uint32_t type_version = read_u32(&next_instr[1].cache);
uint16_t index = read_u16(&next_instr[3].cache);
- #line 1752 "Python/bytecodes.c"
+ #line 1806 "Python/bytecodes.c"
PyTypeObject *tp = Py_TYPE(owner);
assert(type_version != 0);
DEOPT_IF(tp->tp_version_tag != type_version, LOAD_ATTR);
@@ -2523,7 +2498,7 @@
STAT_INC(LOAD_ATTR, hit);
Py_INCREF(res);
res2 = NULL;
- #line 2527 "Python/generated_cases.c.h"
+ #line 2502 "Python/generated_cases.c.h"
Py_DECREF(owner);
STACK_GROW(((oparg & 1) ? 1 : 0));
stack_pointer[-1] = res;
@@ -2538,7 +2513,7 @@
PyObject *res;
uint32_t type_version = read_u32(&next_instr[1].cache);
uint16_t index = read_u16(&next_instr[3].cache);
- #line 1768 "Python/bytecodes.c"
+ #line 1822 "Python/bytecodes.c"
DEOPT_IF(!PyModule_CheckExact(owner), LOAD_ATTR);
PyDictObject *dict = (PyDictObject *)((PyModuleObject *)owner)->md_dict;
assert(dict != NULL);
@@ -2551,7 +2526,7 @@
STAT_INC(LOAD_ATTR, hit);
Py_INCREF(res);
res2 = NULL;
- #line 2555 "Python/generated_cases.c.h"
+ #line 2530 "Python/generated_cases.c.h"
Py_DECREF(owner);
STACK_GROW(((oparg & 1) ? 1 : 0));
stack_pointer[-1] = res;
@@ -2566,7 +2541,7 @@
PyObject *res;
uint32_t type_version = read_u32(&next_instr[1].cache);
uint16_t index = read_u16(&next_instr[3].cache);
- #line 1784 "Python/bytecodes.c"
+ #line 1838 "Python/bytecodes.c"
PyTypeObject *tp = Py_TYPE(owner);
assert(type_version != 0);
DEOPT_IF(tp->tp_version_tag != type_version, LOAD_ATTR);
@@ -2593,7 +2568,7 @@
STAT_INC(LOAD_ATTR, hit);
Py_INCREF(res);
res2 = NULL;
- #line 2597 "Python/generated_cases.c.h"
+ #line 2572 "Python/generated_cases.c.h"
Py_DECREF(owner);
STACK_GROW(((oparg & 1) ? 1 : 0));
stack_pointer[-1] = res;
@@ -2608,7 +2583,7 @@
PyObject *res;
uint32_t type_version = read_u32(&next_instr[1].cache);
uint16_t index = read_u16(&next_instr[3].cache);
- #line 1814 "Python/bytecodes.c"
+ #line 1868 "Python/bytecodes.c"
PyTypeObject *tp = Py_TYPE(owner);
assert(type_version != 0);
DEOPT_IF(tp->tp_version_tag != type_version, LOAD_ATTR);
@@ -2618,7 +2593,7 @@
STAT_INC(LOAD_ATTR, hit);
Py_INCREF(res);
res2 = NULL;
- #line 2622 "Python/generated_cases.c.h"
+ #line 2597 "Python/generated_cases.c.h"
Py_DECREF(owner);
STACK_GROW(((oparg & 1) ? 1 : 0));
stack_pointer[-1] = res;
@@ -2633,7 +2608,7 @@
PyObject *res;
uint32_t type_version = read_u32(&next_instr[1].cache);
PyObject *descr = read_obj(&next_instr[5].cache);
- #line 1827 "Python/bytecodes.c"
+ #line 1881 "Python/bytecodes.c"
DEOPT_IF(!PyType_Check(cls), LOAD_ATTR);
DEOPT_IF(((PyTypeObject *)cls)->tp_version_tag != type_version,
@@ -2645,7 +2620,7 @@
res = descr;
assert(res != NULL);
Py_INCREF(res);
- #line 2649 "Python/generated_cases.c.h"
+ #line 2624 "Python/generated_cases.c.h"
Py_DECREF(cls);
STACK_GROW(((oparg & 1) ? 1 : 0));
stack_pointer[-1] = res;
@@ -2659,7 +2634,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 1842 "Python/bytecodes.c"
+ #line 1896 "Python/bytecodes.c"
DEOPT_IF(tstate->interp->eval_frame, LOAD_ATTR);
PyTypeObject *cls = Py_TYPE(owner);
@@ -2683,7 +2658,7 @@
JUMPBY(INLINE_CACHE_ENTRIES_LOAD_ATTR);
frame->return_offset = 0;
DISPATCH_INLINED(new_frame);
- #line 2687 "Python/generated_cases.c.h"
+ #line 2662 "Python/generated_cases.c.h"
}
TARGET(LOAD_ATTR_GETATTRIBUTE_OVERRIDDEN) {
@@ -2691,7 +2666,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 1868 "Python/bytecodes.c"
+ #line 1922 "Python/bytecodes.c"
DEOPT_IF(tstate->interp->eval_frame, LOAD_ATTR);
PyTypeObject *cls = Py_TYPE(owner);
DEOPT_IF(cls->tp_version_tag != type_version, LOAD_ATTR);
@@ -2717,7 +2692,7 @@
JUMPBY(INLINE_CACHE_ENTRIES_LOAD_ATTR);
frame->return_offset = 0;
DISPATCH_INLINED(new_frame);
- #line 2721 "Python/generated_cases.c.h"
+ #line 2696 "Python/generated_cases.c.h"
}
TARGET(STORE_ATTR_INSTANCE_VALUE) {
@@ -2725,7 +2700,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 1896 "Python/bytecodes.c"
+ #line 1950 "Python/bytecodes.c"
PyTypeObject *tp = Py_TYPE(owner);
assert(type_version != 0);
DEOPT_IF(tp->tp_version_tag != type_version, STORE_ATTR);
@@ -2743,7 +2718,7 @@
Py_DECREF(old_value);
}
Py_DECREF(owner);
- #line 2747 "Python/generated_cases.c.h"
+ #line 2722 "Python/generated_cases.c.h"
STACK_SHRINK(2);
next_instr += 4;
DISPATCH();
@@ -2754,7 +2729,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 1916 "Python/bytecodes.c"
+ #line 1970 "Python/bytecodes.c"
PyTypeObject *tp = Py_TYPE(owner);
assert(type_version != 0);
DEOPT_IF(tp->tp_version_tag != type_version, STORE_ATTR);
@@ -2793,7 +2768,7 @@
/* PEP 509 */
dict->ma_version_tag = new_version;
Py_DECREF(owner);
- #line 2797 "Python/generated_cases.c.h"
+ #line 2772 "Python/generated_cases.c.h"
STACK_SHRINK(2);
next_instr += 4;
DISPATCH();
@@ -2804,7 +2779,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 1957 "Python/bytecodes.c"
+ #line 2011 "Python/bytecodes.c"
PyTypeObject *tp = Py_TYPE(owner);
assert(type_version != 0);
DEOPT_IF(tp->tp_version_tag != type_version, STORE_ATTR);
@@ -2814,7 +2789,7 @@
*(PyObject **)addr = value;
Py_XDECREF(old_value);
Py_DECREF(owner);
- #line 2818 "Python/generated_cases.c.h"
+ #line 2793 "Python/generated_cases.c.h"
STACK_SHRINK(2);
next_instr += 4;
DISPATCH();
@@ -2826,7 +2801,7 @@
PyObject *right = stack_pointer[-1];
PyObject *left = stack_pointer[-2];
PyObject *res;
- #line 1976 "Python/bytecodes.c"
+ #line 2030 "Python/bytecodes.c"
#if ENABLE_SPECIALIZATION
_PyCompareOpCache *cache = (_PyCompareOpCache *)next_instr;
if (ADAPTIVE_COUNTER_IS_ZERO(cache->counter)) {
@@ -2839,12 +2814,12 @@
#endif /* ENABLE_SPECIALIZATION */
assert((oparg >> 4) <= Py_GE);
res = PyObject_RichCompare(left, right, oparg>>4);
- #line 2843 "Python/generated_cases.c.h"
+ #line 2818 "Python/generated_cases.c.h"
Py_DECREF(left);
Py_DECREF(right);
- #line 1989 "Python/bytecodes.c"
+ #line 2043 "Python/bytecodes.c"
if (res == NULL) goto pop_2_error;
- #line 2848 "Python/generated_cases.c.h"
+ #line 2823 "Python/generated_cases.c.h"
STACK_SHRINK(1);
stack_pointer[-1] = res;
next_instr += 1;
@@ -2855,7 +2830,7 @@
PyObject *right = stack_pointer[-1];
PyObject *left = stack_pointer[-2];
PyObject *res;
- #line 1993 "Python/bytecodes.c"
+ #line 2047 "Python/bytecodes.c"
DEOPT_IF(!PyFloat_CheckExact(left), COMPARE_OP);
DEOPT_IF(!PyFloat_CheckExact(right), COMPARE_OP);
STAT_INC(COMPARE_OP, hit);
@@ -2866,7 +2841,7 @@
_Py_DECREF_SPECIALIZED(left, _PyFloat_ExactDealloc);
_Py_DECREF_SPECIALIZED(right, _PyFloat_ExactDealloc);
res = (sign_ish & oparg) ? Py_True : Py_False;
- #line 2870 "Python/generated_cases.c.h"
+ #line 2845 "Python/generated_cases.c.h"
STACK_SHRINK(1);
stack_pointer[-1] = res;
next_instr += 1;
@@ -2877,7 +2852,7 @@
PyObject *right = stack_pointer[-1];
PyObject *left = stack_pointer[-2];
PyObject *res;
- #line 2007 "Python/bytecodes.c"
+ #line 2061 "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);
@@ -2892,7 +2867,7 @@
_Py_DECREF_SPECIALIZED(left, (destructor)PyObject_Free);
_Py_DECREF_SPECIALIZED(right, (destructor)PyObject_Free);
res = (sign_ish & oparg) ? Py_True : Py_False;
- #line 2896 "Python/generated_cases.c.h"
+ #line 2871 "Python/generated_cases.c.h"
STACK_SHRINK(1);
stack_pointer[-1] = res;
next_instr += 1;
@@ -2903,7 +2878,7 @@
PyObject *right = stack_pointer[-1];
PyObject *left = stack_pointer[-2];
PyObject *res;
- #line 2025 "Python/bytecodes.c"
+ #line 2079 "Python/bytecodes.c"
DEOPT_IF(!PyUnicode_CheckExact(left), COMPARE_OP);
DEOPT_IF(!PyUnicode_CheckExact(right), COMPARE_OP);
STAT_INC(COMPARE_OP, hit);
@@ -2915,7 +2890,7 @@
assert((oparg & 0xf) == COMPARISON_NOT_EQUALS || (oparg & 0xf) == COMPARISON_EQUALS);
assert(COMPARISON_NOT_EQUALS + 1 == COMPARISON_EQUALS);
res = ((COMPARISON_NOT_EQUALS + eq) & oparg) ? Py_True : Py_False;
- #line 2919 "Python/generated_cases.c.h"
+ #line 2894 "Python/generated_cases.c.h"
STACK_SHRINK(1);
stack_pointer[-1] = res;
next_instr += 1;
@@ -2926,14 +2901,14 @@
PyObject *right = stack_pointer[-1];
PyObject *left = stack_pointer[-2];
PyObject *b;
- #line 2039 "Python/bytecodes.c"
+ #line 2093 "Python/bytecodes.c"
int res = Py_Is(left, right) ^ oparg;
- #line 2932 "Python/generated_cases.c.h"
+ #line 2907 "Python/generated_cases.c.h"
Py_DECREF(left);
Py_DECREF(right);
- #line 2041 "Python/bytecodes.c"
+ #line 2095 "Python/bytecodes.c"
b = res ? Py_True : Py_False;
- #line 2937 "Python/generated_cases.c.h"
+ #line 2912 "Python/generated_cases.c.h"
STACK_SHRINK(1);
stack_pointer[-1] = b;
DISPATCH();
@@ -2943,15 +2918,15 @@
PyObject *right = stack_pointer[-1];
PyObject *left = stack_pointer[-2];
PyObject *b;
- #line 2045 "Python/bytecodes.c"
+ #line 2099 "Python/bytecodes.c"
int res = PySequence_Contains(right, left);
- #line 2949 "Python/generated_cases.c.h"
+ #line 2924 "Python/generated_cases.c.h"
Py_DECREF(left);
Py_DECREF(right);
- #line 2047 "Python/bytecodes.c"
+ #line 2101 "Python/bytecodes.c"
if (res < 0) goto pop_2_error;
b = (res ^ oparg) ? Py_True : Py_False;
- #line 2955 "Python/generated_cases.c.h"
+ #line 2930 "Python/generated_cases.c.h"
STACK_SHRINK(1);
stack_pointer[-1] = b;
DISPATCH();
@@ -2962,12 +2937,12 @@
PyObject *exc_value = stack_pointer[-2];
PyObject *rest;
PyObject *match;
- #line 2052 "Python/bytecodes.c"
+ #line 2106 "Python/bytecodes.c"
if (check_except_star_type_valid(tstate, match_type) < 0) {
- #line 2968 "Python/generated_cases.c.h"
+ #line 2943 "Python/generated_cases.c.h"
Py_DECREF(exc_value);
Py_DECREF(match_type);
- #line 2054 "Python/bytecodes.c"
+ #line 2108 "Python/bytecodes.c"
if (true) goto pop_2_error;
}
@@ -2975,10 +2950,10 @@
rest = NULL;
int res = exception_group_match(exc_value, match_type,
&match, &rest);
- #line 2979 "Python/generated_cases.c.h"
+ #line 2954 "Python/generated_cases.c.h"
Py_DECREF(exc_value);
Py_DECREF(match_type);
- #line 2062 "Python/bytecodes.c"
+ #line 2116 "Python/bytecodes.c"
if (res < 0) goto pop_2_error;
assert((match == NULL) == (rest == NULL));
@@ -2987,7 +2962,7 @@
if (!Py_IsNone(match)) {
PyErr_SetHandledException(match);
}
- #line 2991 "Python/generated_cases.c.h"
+ #line 2966 "Python/generated_cases.c.h"
stack_pointer[-1] = match;
stack_pointer[-2] = rest;
DISPATCH();
@@ -2997,21 +2972,21 @@
PyObject *right = stack_pointer[-1];
PyObject *left = stack_pointer[-2];
PyObject *b;
- #line 2073 "Python/bytecodes.c"
+ #line 2127 "Python/bytecodes.c"
assert(PyExceptionInstance_Check(left));
if (check_except_type_valid(tstate, right) < 0) {
- #line 3004 "Python/generated_cases.c.h"
+ #line 2979 "Python/generated_cases.c.h"
Py_DECREF(right);
- #line 2076 "Python/bytecodes.c"
+ #line 2130 "Python/bytecodes.c"
if (true) goto pop_1_error;
}
int res = PyErr_GivenExceptionMatches(left, right);
- #line 3011 "Python/generated_cases.c.h"
+ #line 2986 "Python/generated_cases.c.h"
Py_DECREF(right);
- #line 2081 "Python/bytecodes.c"
+ #line 2135 "Python/bytecodes.c"
b = res ? Py_True : Py_False;
- #line 3015 "Python/generated_cases.c.h"
+ #line 2990 "Python/generated_cases.c.h"
stack_pointer[-1] = b;
DISPATCH();
}
@@ -3020,15 +2995,15 @@
PyObject *fromlist = stack_pointer[-1];
PyObject *level = stack_pointer[-2];
PyObject *res;
- #line 2085 "Python/bytecodes.c"
+ #line 2139 "Python/bytecodes.c"
PyObject *name = GETITEM(frame->f_code->co_names, oparg);
res = import_name(tstate, frame, name, fromlist, level);
- #line 3027 "Python/generated_cases.c.h"
+ #line 3002 "Python/generated_cases.c.h"
Py_DECREF(level);
Py_DECREF(fromlist);
- #line 2088 "Python/bytecodes.c"
+ #line 2142 "Python/bytecodes.c"
if (res == NULL) goto pop_2_error;
- #line 3032 "Python/generated_cases.c.h"
+ #line 3007 "Python/generated_cases.c.h"
STACK_SHRINK(1);
stack_pointer[-1] = res;
DISPATCH();
@@ -3037,29 +3012,29 @@
TARGET(IMPORT_FROM) {
PyObject *from = stack_pointer[-1];
PyObject *res;
- #line 2092 "Python/bytecodes.c"
+ #line 2146 "Python/bytecodes.c"
PyObject *name = GETITEM(frame->f_code->co_names, oparg);
res = import_from(tstate, from, name);
if (res == NULL) goto error;
- #line 3045 "Python/generated_cases.c.h"
+ #line 3020 "Python/generated_cases.c.h"
STACK_GROW(1);
stack_pointer[-1] = res;
DISPATCH();
}
TARGET(JUMP_FORWARD) {
- #line 2098 "Python/bytecodes.c"
+ #line 2152 "Python/bytecodes.c"
JUMPBY(oparg);
- #line 3054 "Python/generated_cases.c.h"
+ #line 3029 "Python/generated_cases.c.h"
DISPATCH();
}
TARGET(JUMP_BACKWARD) {
PREDICTED(JUMP_BACKWARD);
- #line 2102 "Python/bytecodes.c"
+ #line 2156 "Python/bytecodes.c"
assert(oparg < INSTR_OFFSET());
JUMPBY(-oparg);
- #line 3063 "Python/generated_cases.c.h"
+ #line 3038 "Python/generated_cases.c.h"
CHECK_EVAL_BREAKER();
DISPATCH();
}
@@ -3067,15 +3042,15 @@
TARGET(POP_JUMP_IF_FALSE) {
PREDICTED(POP_JUMP_IF_FALSE);
PyObject *cond = stack_pointer[-1];
- #line 2108 "Python/bytecodes.c"
+ #line 2162 "Python/bytecodes.c"
if (Py_IsFalse(cond)) {
JUMPBY(oparg);
}
else if (!Py_IsTrue(cond)) {
int err = PyObject_IsTrue(cond);
- #line 3077 "Python/generated_cases.c.h"
+ #line 3052 "Python/generated_cases.c.h"
Py_DECREF(cond);
- #line 2114 "Python/bytecodes.c"
+ #line 2168 "Python/bytecodes.c"
if (err == 0) {
JUMPBY(oparg);
}
@@ -3083,22 +3058,22 @@
if (err < 0) goto pop_1_error;
}
}
- #line 3087 "Python/generated_cases.c.h"
+ #line 3062 "Python/generated_cases.c.h"
STACK_SHRINK(1);
DISPATCH();
}
TARGET(POP_JUMP_IF_TRUE) {
PyObject *cond = stack_pointer[-1];
- #line 2124 "Python/bytecodes.c"
+ #line 2178 "Python/bytecodes.c"
if (Py_IsTrue(cond)) {
JUMPBY(oparg);
}
else if (!Py_IsFalse(cond)) {
int err = PyObject_IsTrue(cond);
- #line 3100 "Python/generated_cases.c.h"
+ #line 3075 "Python/generated_cases.c.h"
Py_DECREF(cond);
- #line 2130 "Python/bytecodes.c"
+ #line 2184 "Python/bytecodes.c"
if (err > 0) {
JUMPBY(oparg);
}
@@ -3106,63 +3081,63 @@
if (err < 0) goto pop_1_error;
}
}
- #line 3110 "Python/generated_cases.c.h"
+ #line 3085 "Python/generated_cases.c.h"
STACK_SHRINK(1);
DISPATCH();
}
TARGET(POP_JUMP_IF_NOT_NONE) {
PyObject *value = stack_pointer[-1];
- #line 2140 "Python/bytecodes.c"
+ #line 2194 "Python/bytecodes.c"
if (!Py_IsNone(value)) {
- #line 3119 "Python/generated_cases.c.h"
+ #line 3094 "Python/generated_cases.c.h"
Py_DECREF(value);
- #line 2142 "Python/bytecodes.c"
+ #line 2196 "Python/bytecodes.c"
JUMPBY(oparg);
}
- #line 3124 "Python/generated_cases.c.h"
+ #line 3099 "Python/generated_cases.c.h"
STACK_SHRINK(1);
DISPATCH();
}
TARGET(POP_JUMP_IF_NONE) {
PyObject *value = stack_pointer[-1];
- #line 2147 "Python/bytecodes.c"
+ #line 2201 "Python/bytecodes.c"
if (Py_IsNone(value)) {
JUMPBY(oparg);
}
else {
- #line 3136 "Python/generated_cases.c.h"
+ #line 3111 "Python/generated_cases.c.h"
Py_DECREF(value);
- #line 2152 "Python/bytecodes.c"
+ #line 2206 "Python/bytecodes.c"
}
- #line 3140 "Python/generated_cases.c.h"
+ #line 3115 "Python/generated_cases.c.h"
STACK_SHRINK(1);
DISPATCH();
}
TARGET(JUMP_BACKWARD_NO_INTERRUPT) {
- #line 2156 "Python/bytecodes.c"
+ #line 2210 "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 3153 "Python/generated_cases.c.h"
+ #line 3128 "Python/generated_cases.c.h"
DISPATCH();
}
TARGET(GET_LEN) {
PyObject *obj = stack_pointer[-1];
PyObject *len_o;
- #line 2165 "Python/bytecodes.c"
+ #line 2219 "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 3166 "Python/generated_cases.c.h"
+ #line 3141 "Python/generated_cases.c.h"
STACK_GROW(1);
stack_pointer[-1] = len_o;
DISPATCH();
@@ -3173,16 +3148,16 @@
PyObject *type = stack_pointer[-2];
PyObject *subject = stack_pointer[-3];
PyObject *attrs;
- #line 2173 "Python/bytecodes.c"
+ #line 2227 "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 3182 "Python/generated_cases.c.h"
+ #line 3157 "Python/generated_cases.c.h"
Py_DECREF(subject);
Py_DECREF(type);
Py_DECREF(names);
- #line 2178 "Python/bytecodes.c"
+ #line 2232 "Python/bytecodes.c"
if (attrs) {
assert(PyTuple_CheckExact(attrs)); // Success!
}
@@ -3190,7 +3165,7 @@
if (_PyErr_Occurred(tstate)) goto pop_3_error;
attrs = Py_None; // Failure!
}
- #line 3194 "Python/generated_cases.c.h"
+ #line 3169 "Python/generated_cases.c.h"
STACK_SHRINK(2);
stack_pointer[-1] = attrs;
DISPATCH();
@@ -3199,10 +3174,10 @@
TARGET(MATCH_MAPPING) {
PyObject *subject = stack_pointer[-1];
PyObject *res;
- #line 2188 "Python/bytecodes.c"
+ #line 2242 "Python/bytecodes.c"
int match = Py_TYPE(subject)->tp_flags & Py_TPFLAGS_MAPPING;
res = match ? Py_True : Py_False;
- #line 3206 "Python/generated_cases.c.h"
+ #line 3181 "Python/generated_cases.c.h"
STACK_GROW(1);
stack_pointer[-1] = res;
PREDICT(POP_JUMP_IF_FALSE);
@@ -3212,10 +3187,10 @@
TARGET(MATCH_SEQUENCE) {
PyObject *subject = stack_pointer[-1];
PyObject *res;
- #line 2194 "Python/bytecodes.c"
+ #line 2248 "Python/bytecodes.c"
int match = Py_TYPE(subject)->tp_flags & Py_TPFLAGS_SEQUENCE;
res = match ? Py_True : Py_False;
- #line 3219 "Python/generated_cases.c.h"
+ #line 3194 "Python/generated_cases.c.h"
STACK_GROW(1);
stack_pointer[-1] = res;
PREDICT(POP_JUMP_IF_FALSE);
@@ -3226,11 +3201,11 @@
PyObject *keys = stack_pointer[-1];
PyObject *subject = stack_pointer[-2];
PyObject *values_or_none;
- #line 2200 "Python/bytecodes.c"
+ #line 2254 "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 3234 "Python/generated_cases.c.h"
+ #line 3209 "Python/generated_cases.c.h"
STACK_GROW(1);
stack_pointer[-1] = values_or_none;
DISPATCH();
@@ -3239,14 +3214,14 @@
TARGET(GET_ITER) {
PyObject *iterable = stack_pointer[-1];
PyObject *iter;
- #line 2206 "Python/bytecodes.c"
+ #line 2260 "Python/bytecodes.c"
/* before: [obj]; after [getiter(obj)] */
iter = PyObject_GetIter(iterable);
- #line 3246 "Python/generated_cases.c.h"
+ #line 3221 "Python/generated_cases.c.h"
Py_DECREF(iterable);
- #line 2209 "Python/bytecodes.c"
+ #line 2263 "Python/bytecodes.c"
if (iter == NULL) goto pop_1_error;
- #line 3250 "Python/generated_cases.c.h"
+ #line 3225 "Python/generated_cases.c.h"
stack_pointer[-1] = iter;
DISPATCH();
}
@@ -3254,7 +3229,7 @@
TARGET(GET_YIELD_FROM_ITER) {
PyObject *iterable = stack_pointer[-1];
PyObject *iter;
- #line 2213 "Python/bytecodes.c"
+ #line 2267 "Python/bytecodes.c"
/* before: [obj]; after [getiter(obj)] */
if (PyCoro_CheckExact(iterable)) {
/* `iterable` is a coroutine */
@@ -3277,11 +3252,11 @@
if (iter == NULL) {
goto error;
}
- #line 3281 "Python/generated_cases.c.h"
+ #line 3256 "Python/generated_cases.c.h"
Py_DECREF(iterable);
- #line 2236 "Python/bytecodes.c"
+ #line 2290 "Python/bytecodes.c"
}
- #line 3285 "Python/generated_cases.c.h"
+ #line 3260 "Python/generated_cases.c.h"
stack_pointer[-1] = iter;
PREDICT(LOAD_CONST);
DISPATCH();
@@ -3292,7 +3267,7 @@
static_assert(INLINE_CACHE_ENTRIES_FOR_ITER == 1, "incorrect cache size");
PyObject *iter = stack_pointer[-1];
PyObject *next;
- #line 2255 "Python/bytecodes.c"
+ #line 2309 "Python/bytecodes.c"
#if ENABLE_SPECIALIZATION
_PyForIterCache *cache = (_PyForIterCache *)next_instr;
if (ADAPTIVE_COUNTER_IS_ZERO(cache->counter)) {
@@ -3323,7 +3298,7 @@
DISPATCH();
}
// Common case: no jump, leave it to the code generator
- #line 3327 "Python/generated_cases.c.h"
+ #line 3302 "Python/generated_cases.c.h"
STACK_GROW(1);
stack_pointer[-1] = next;
next_instr += 1;
@@ -3331,7 +3306,7 @@
}
TARGET(INSTRUMENTED_FOR_ITER) {
- #line 2288 "Python/bytecodes.c"
+ #line 2342 "Python/bytecodes.c"
_Py_CODEUNIT *here = next_instr-1;
_Py_CODEUNIT *target;
PyObject *iter = TOP();
@@ -3357,14 +3332,14 @@
target = next_instr + INLINE_CACHE_ENTRIES_FOR_ITER + oparg + 1;
}
INSTRUMENTED_JUMP(here, target, PY_MONITORING_EVENT_BRANCH);
- #line 3361 "Python/generated_cases.c.h"
+ #line 3336 "Python/generated_cases.c.h"
DISPATCH();
}
TARGET(FOR_ITER_LIST) {
PyObject *iter = stack_pointer[-1];
PyObject *next;
- #line 2316 "Python/bytecodes.c"
+ #line 2370 "Python/bytecodes.c"
DEOPT_IF(Py_TYPE(iter) != &PyListIter_Type, FOR_ITER);
_PyListIterObject *it = (_PyListIterObject *)iter;
STAT_INC(FOR_ITER, hit);
@@ -3384,7 +3359,7 @@
DISPATCH();
end_for_iter_list:
// Common case: no jump, leave it to the code generator
- #line 3388 "Python/generated_cases.c.h"
+ #line 3363 "Python/generated_cases.c.h"
STACK_GROW(1);
stack_pointer[-1] = next;
next_instr += 1;
@@ -3394,7 +3369,7 @@
TARGET(FOR_ITER_TUPLE) {
PyObject *iter = stack_pointer[-1];
PyObject *next;
- #line 2338 "Python/bytecodes.c"
+ #line 2392 "Python/bytecodes.c"
_PyTupleIterObject *it = (_PyTupleIterObject *)iter;
DEOPT_IF(Py_TYPE(it) != &PyTupleIter_Type, FOR_ITER);
STAT_INC(FOR_ITER, hit);
@@ -3414,7 +3389,7 @@
DISPATCH();
end_for_iter_tuple:
// Common case: no jump, leave it to the code generator
- #line 3418 "Python/generated_cases.c.h"
+ #line 3393 "Python/generated_cases.c.h"
STACK_GROW(1);
stack_pointer[-1] = next;
next_instr += 1;
@@ -3424,7 +3399,7 @@
TARGET(FOR_ITER_RANGE) {
PyObject *iter = stack_pointer[-1];
PyObject *next;
- #line 2360 "Python/bytecodes.c"
+ #line 2414 "Python/bytecodes.c"
_PyRangeIterObject *r = (_PyRangeIterObject *)iter;
DEOPT_IF(Py_TYPE(r) != &PyRangeIter_Type, FOR_ITER);
STAT_INC(FOR_ITER, hit);
@@ -3442,7 +3417,7 @@
if (next == NULL) {
goto error;
}
- #line 3446 "Python/generated_cases.c.h"
+ #line 3421 "Python/generated_cases.c.h"
STACK_GROW(1);
stack_pointer[-1] = next;
next_instr += 1;
@@ -3451,7 +3426,7 @@
TARGET(FOR_ITER_GEN) {
PyObject *iter = stack_pointer[-1];
- #line 2380 "Python/bytecodes.c"
+ #line 2434 "Python/bytecodes.c"
DEOPT_IF(tstate->interp->eval_frame, FOR_ITER);
PyGenObject *gen = (PyGenObject *)iter;
DEOPT_IF(Py_TYPE(gen) != &PyGen_Type, FOR_ITER);
@@ -3467,14 +3442,14 @@
assert(next_instr[oparg].op.code == END_FOR ||
next_instr[oparg].op.code == INSTRUMENTED_END_FOR);
DISPATCH_INLINED(gen_frame);
- #line 3471 "Python/generated_cases.c.h"
+ #line 3446 "Python/generated_cases.c.h"
}
TARGET(BEFORE_ASYNC_WITH) {
PyObject *mgr = stack_pointer[-1];
PyObject *exit;
PyObject *res;
- #line 2398 "Python/bytecodes.c"
+ #line 2452 "Python/bytecodes.c"
PyObject *enter = _PyObject_LookupSpecial(mgr, &_Py_ID(__aenter__));
if (enter == NULL) {
if (!_PyErr_Occurred(tstate)) {
@@ -3497,16 +3472,16 @@
Py_DECREF(enter);
goto error;
}
- #line 3501 "Python/generated_cases.c.h"
+ #line 3476 "Python/generated_cases.c.h"
Py_DECREF(mgr);
- #line 2421 "Python/bytecodes.c"
+ #line 2475 "Python/bytecodes.c"
res = _PyObject_CallNoArgs(enter);
Py_DECREF(enter);
if (res == NULL) {
Py_DECREF(exit);
if (true) goto pop_1_error;
}
- #line 3510 "Python/generated_cases.c.h"
+ #line 3485 "Python/generated_cases.c.h"
STACK_GROW(1);
stack_pointer[-1] = res;
stack_pointer[-2] = exit;
@@ -3518,7 +3493,7 @@
PyObject *mgr = stack_pointer[-1];
PyObject *exit;
PyObject *res;
- #line 2431 "Python/bytecodes.c"
+ #line 2485 "Python/bytecodes.c"
/* pop the context manager, push its __exit__ and the
* value returned from calling its __enter__
*/
@@ -3544,16 +3519,16 @@
Py_DECREF(enter);
goto error;
}
- #line 3548 "Python/generated_cases.c.h"
+ #line 3523 "Python/generated_cases.c.h"
Py_DECREF(mgr);
- #line 2457 "Python/bytecodes.c"
+ #line 2511 "Python/bytecodes.c"
res = _PyObject_CallNoArgs(enter);
Py_DECREF(enter);
if (res == NULL) {
Py_DECREF(exit);
if (true) goto pop_1_error;
}
- #line 3557 "Python/generated_cases.c.h"
+ #line 3532 "Python/generated_cases.c.h"
STACK_GROW(1);
stack_pointer[-1] = res;
stack_pointer[-2] = exit;
@@ -3565,7 +3540,7 @@
PyObject *lasti = stack_pointer[-3];
PyObject *exit_func = stack_pointer[-4];
PyObject *res;
- #line 2466 "Python/bytecodes.c"
+ #line 2520 "Python/bytecodes.c"
/* At the top of the stack are 4 values:
- val: TOP = exc_info()
- unused: SECOND = previous exception
@@ -3591,7 +3566,7 @@
res = PyObject_Vectorcall(exit_func, stack + 1,
3 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL);
if (res == NULL) goto error;
- #line 3595 "Python/generated_cases.c.h"
+ #line 3570 "Python/generated_cases.c.h"
STACK_GROW(1);
stack_pointer[-1] = res;
DISPATCH();
@@ -3600,7 +3575,7 @@
TARGET(PUSH_EXC_INFO) {
PyObject *new_exc = stack_pointer[-1];
PyObject *prev_exc;
- #line 2494 "Python/bytecodes.c"
+ #line 2548 "Python/bytecodes.c"
_PyErr_StackItem *exc_info = tstate->exc_info;
if (exc_info->exc_value != NULL) {
prev_exc = exc_info->exc_value;
@@ -3610,7 +3585,7 @@
}
assert(PyExceptionInstance_Check(new_exc));
exc_info->exc_value = Py_NewRef(new_exc);
- #line 3614 "Python/generated_cases.c.h"
+ #line 3589 "Python/generated_cases.c.h"
STACK_GROW(1);
stack_pointer[-1] = new_exc;
stack_pointer[-2] = prev_exc;
@@ -3624,7 +3599,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 2506 "Python/bytecodes.c"
+ #line 2560 "Python/bytecodes.c"
/* Cached method object */
PyTypeObject *self_cls = Py_TYPE(self);
assert(type_version != 0);
@@ -3641,7 +3616,7 @@
assert(_PyType_HasFeature(Py_TYPE(res2), Py_TPFLAGS_METHOD_DESCRIPTOR));
res = self;
assert(oparg & 1);
- #line 3645 "Python/generated_cases.c.h"
+ #line 3620 "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; }
@@ -3655,7 +3630,7 @@
PyObject *res;
uint32_t type_version = read_u32(&next_instr[1].cache);
PyObject *descr = read_obj(&next_instr[5].cache);
- #line 2525 "Python/bytecodes.c"
+ #line 2579 "Python/bytecodes.c"
PyTypeObject *self_cls = Py_TYPE(self);
DEOPT_IF(self_cls->tp_version_tag != type_version, LOAD_ATTR);
assert(self_cls->tp_dictoffset == 0);
@@ -3665,7 +3640,7 @@
res2 = Py_NewRef(descr);
res = self;
assert(oparg & 1);
- #line 3669 "Python/generated_cases.c.h"
+ #line 3644 "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; }
@@ -3679,7 +3654,7 @@
PyObject *res;
uint32_t type_version = read_u32(&next_instr[1].cache);
PyObject *descr = read_obj(&next_instr[5].cache);
- #line 2537 "Python/bytecodes.c"
+ #line 2591 "Python/bytecodes.c"
PyTypeObject *self_cls = Py_TYPE(self);
DEOPT_IF(self_cls->tp_version_tag != type_version, LOAD_ATTR);
Py_ssize_t dictoffset = self_cls->tp_dictoffset;
@@ -3693,7 +3668,7 @@
res2 = Py_NewRef(descr);
res = self;
assert(oparg & 1);
- #line 3697 "Python/generated_cases.c.h"
+ #line 3672 "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; }
@@ -3702,16 +3677,16 @@
}
TARGET(KW_NAMES) {
- #line 2553 "Python/bytecodes.c"
+ #line 2607 "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 3710 "Python/generated_cases.c.h"
+ #line 3685 "Python/generated_cases.c.h"
DISPATCH();
}
TARGET(INSTRUMENTED_CALL) {
- #line 2559 "Python/bytecodes.c"
+ #line 2613 "Python/bytecodes.c"
int is_meth = PEEK(oparg+2) != NULL;
int total_args = oparg + is_meth;
PyObject *function = PEEK(total_args + 1);
@@ -3724,7 +3699,7 @@
_PyCallCache *cache = (_PyCallCache *)next_instr;
INCREMENT_ADAPTIVE_COUNTER(cache->counter);
GO_TO_INSTRUCTION(CALL);
- #line 3728 "Python/generated_cases.c.h"
+ #line 3703 "Python/generated_cases.c.h"
}
TARGET(CALL) {
@@ -3734,7 +3709,7 @@
PyObject *callable = stack_pointer[-(1 + oparg)];
PyObject *method = stack_pointer[-(2 + oparg)];
PyObject *res;
- #line 2604 "Python/bytecodes.c"
+ #line 2658 "Python/bytecodes.c"
int is_meth = method != NULL;
int total_args = oparg;
if (is_meth) {
@@ -3816,7 +3791,7 @@
Py_DECREF(args[i]);
}
if (res == NULL) { STACK_SHRINK(oparg); goto pop_2_error; }
- #line 3820 "Python/generated_cases.c.h"
+ #line 3795 "Python/generated_cases.c.h"
STACK_SHRINK(oparg);
STACK_SHRINK(1);
stack_pointer[-1] = res;
@@ -3828,7 +3803,7 @@
TARGET(CALL_BOUND_METHOD_EXACT_ARGS) {
PyObject *callable = stack_pointer[-(1 + oparg)];
PyObject *method = stack_pointer[-(2 + oparg)];
- #line 2692 "Python/bytecodes.c"
+ #line 2746 "Python/bytecodes.c"
DEOPT_IF(method != NULL, CALL);
DEOPT_IF(Py_TYPE(callable) != &PyMethod_Type, CALL);
STAT_INC(CALL, hit);
@@ -3838,7 +3813,7 @@
PEEK(oparg + 2) = Py_NewRef(meth); // method
Py_DECREF(callable);
GO_TO_INSTRUCTION(CALL_PY_EXACT_ARGS);
- #line 3842 "Python/generated_cases.c.h"
+ #line 3817 "Python/generated_cases.c.h"
}
TARGET(CALL_PY_EXACT_ARGS) {
@@ -3847,7 +3822,7 @@
PyObject *callable = stack_pointer[-(1 + oparg)];
PyObject *method = stack_pointer[-(2 + oparg)];
uint32_t func_version = read_u32(&next_instr[1].cache);
- #line 2704 "Python/bytecodes.c"
+ #line 2758 "Python/bytecodes.c"
assert(kwnames == NULL);
DEOPT_IF(tstate->interp->eval_frame, CALL);
int is_meth = method != NULL;
@@ -3873,7 +3848,7 @@
JUMPBY(INLINE_CACHE_ENTRIES_CALL);
frame->return_offset = 0;
DISPATCH_INLINED(new_frame);
- #line 3877 "Python/generated_cases.c.h"
+ #line 3852 "Python/generated_cases.c.h"
}
TARGET(CALL_PY_WITH_DEFAULTS) {
@@ -3881,7 +3856,7 @@
PyObject *callable = stack_pointer[-(1 + oparg)];
PyObject *method = stack_pointer[-(2 + oparg)];
uint32_t func_version = read_u32(&next_instr[1].cache);
- #line 2732 "Python/bytecodes.c"
+ #line 2786 "Python/bytecodes.c"
assert(kwnames == NULL);
DEOPT_IF(tstate->interp->eval_frame, CALL);
int is_meth = method != NULL;
@@ -3917,7 +3892,7 @@
JUMPBY(INLINE_CACHE_ENTRIES_CALL);
frame->return_offset = 0;
DISPATCH_INLINED(new_frame);
- #line 3921 "Python/generated_cases.c.h"
+ #line 3896 "Python/generated_cases.c.h"
}
TARGET(CALL_NO_KW_TYPE_1) {
@@ -3925,7 +3900,7 @@
PyObject *callable = stack_pointer[-(1 + oparg)];
PyObject *null = stack_pointer[-(2 + oparg)];
PyObject *res;
- #line 2770 "Python/bytecodes.c"
+ #line 2824 "Python/bytecodes.c"
assert(kwnames == NULL);
assert(oparg == 1);
DEOPT_IF(null != NULL, CALL);
@@ -3935,7 +3910,7 @@
res = Py_NewRef(Py_TYPE(obj));
Py_DECREF(obj);
Py_DECREF(&PyType_Type); // I.e., callable
- #line 3939 "Python/generated_cases.c.h"
+ #line 3914 "Python/generated_cases.c.h"
STACK_SHRINK(oparg);
STACK_SHRINK(1);
stack_pointer[-1] = res;
@@ -3948,7 +3923,7 @@
PyObject *callable = stack_pointer[-(1 + oparg)];
PyObject *null = stack_pointer[-(2 + oparg)];
PyObject *res;
- #line 2782 "Python/bytecodes.c"
+ #line 2836 "Python/bytecodes.c"
assert(kwnames == NULL);
assert(oparg == 1);
DEOPT_IF(null != NULL, CALL);
@@ -3959,7 +3934,7 @@
Py_DECREF(arg);
Py_DECREF(&PyUnicode_Type); // I.e., callable
if (res == NULL) { STACK_SHRINK(oparg); goto pop_2_error; }
- #line 3963 "Python/generated_cases.c.h"
+ #line 3938 "Python/generated_cases.c.h"
STACK_SHRINK(oparg);
STACK_SHRINK(1);
stack_pointer[-1] = res;
@@ -3973,7 +3948,7 @@
PyObject *callable = stack_pointer[-(1 + oparg)];
PyObject *null = stack_pointer[-(2 + oparg)];
PyObject *res;
- #line 2796 "Python/bytecodes.c"
+ #line 2850 "Python/bytecodes.c"
assert(kwnames == NULL);
assert(oparg == 1);
DEOPT_IF(null != NULL, CALL);
@@ -3984,7 +3959,7 @@
Py_DECREF(arg);
Py_DECREF(&PyTuple_Type); // I.e., tuple
if (res == NULL) { STACK_SHRINK(oparg); goto pop_2_error; }
- #line 3988 "Python/generated_cases.c.h"
+ #line 3963 "Python/generated_cases.c.h"
STACK_SHRINK(oparg);
STACK_SHRINK(1);
stack_pointer[-1] = res;
@@ -3998,7 +3973,7 @@
PyObject *callable = stack_pointer[-(1 + oparg)];
PyObject *method = stack_pointer[-(2 + oparg)];
PyObject *res;
- #line 2810 "Python/bytecodes.c"
+ #line 2864 "Python/bytecodes.c"
int is_meth = method != NULL;
int total_args = oparg;
if (is_meth) {
@@ -4020,7 +3995,7 @@
}
Py_DECREF(tp);
if (res == NULL) { STACK_SHRINK(oparg); goto pop_2_error; }
- #line 4024 "Python/generated_cases.c.h"
+ #line 3999 "Python/generated_cases.c.h"
STACK_SHRINK(oparg);
STACK_SHRINK(1);
stack_pointer[-1] = res;
@@ -4034,7 +4009,7 @@
PyObject *callable = stack_pointer[-(1 + oparg)];
PyObject *method = stack_pointer[-(2 + oparg)];
PyObject *res;
- #line 2835 "Python/bytecodes.c"
+ #line 2889 "Python/bytecodes.c"
/* Builtin METH_O functions */
assert(kwnames == NULL);
int is_meth = method != NULL;
@@ -4062,7 +4037,7 @@
Py_DECREF(arg);
Py_DECREF(callable);
if (res == NULL) { STACK_SHRINK(oparg); goto pop_2_error; }
- #line 4066 "Python/generated_cases.c.h"
+ #line 4041 "Python/generated_cases.c.h"
STACK_SHRINK(oparg);
STACK_SHRINK(1);
stack_pointer[-1] = res;
@@ -4076,7 +4051,7 @@
PyObject *callable = stack_pointer[-(1 + oparg)];
PyObject *method = stack_pointer[-(2 + oparg)];
PyObject *res;
- #line 2866 "Python/bytecodes.c"
+ #line 2920 "Python/bytecodes.c"
/* Builtin METH_FASTCALL functions, without keywords */
assert(kwnames == NULL);
int is_meth = method != NULL;
@@ -4108,7 +4083,7 @@
'invalid'). In those cases an exception is set, so we must
handle it.
*/
- #line 4112 "Python/generated_cases.c.h"
+ #line 4087 "Python/generated_cases.c.h"
STACK_SHRINK(oparg);
STACK_SHRINK(1);
stack_pointer[-1] = res;
@@ -4122,7 +4097,7 @@
PyObject *callable = stack_pointer[-(1 + oparg)];
PyObject *method = stack_pointer[-(2 + oparg)];
PyObject *res;
- #line 2901 "Python/bytecodes.c"
+ #line 2955 "Python/bytecodes.c"
/* Builtin METH_FASTCALL | METH_KEYWORDS functions */
int is_meth = method != NULL;
int total_args = oparg;
@@ -4154,7 +4129,7 @@
}
Py_DECREF(callable);
if (res == NULL) { STACK_SHRINK(oparg); goto pop_2_error; }
- #line 4158 "Python/generated_cases.c.h"
+ #line 4133 "Python/generated_cases.c.h"
STACK_SHRINK(oparg);
STACK_SHRINK(1);
stack_pointer[-1] = res;
@@ -4168,7 +4143,7 @@
PyObject *callable = stack_pointer[-(1 + oparg)];
PyObject *method = stack_pointer[-(2 + oparg)];
PyObject *res;
- #line 2936 "Python/bytecodes.c"
+ #line 2990 "Python/bytecodes.c"
assert(kwnames == NULL);
/* len(o) */
int is_meth = method != NULL;
@@ -4193,7 +4168,7 @@
Py_DECREF(callable);
Py_DECREF(arg);
if (res == NULL) { STACK_SHRINK(oparg); goto pop_2_error; }
- #line 4197 "Python/generated_cases.c.h"
+ #line 4172 "Python/generated_cases.c.h"
STACK_SHRINK(oparg);
STACK_SHRINK(1);
stack_pointer[-1] = res;
@@ -4206,7 +4181,7 @@
PyObject *callable = stack_pointer[-(1 + oparg)];
PyObject *method = stack_pointer[-(2 + oparg)];
PyObject *res;
- #line 2963 "Python/bytecodes.c"
+ #line 3017 "Python/bytecodes.c"
assert(kwnames == NULL);
/* isinstance(o, o2) */
int is_meth = method != NULL;
@@ -4233,7 +4208,7 @@
Py_DECREF(cls);
Py_DECREF(callable);
if (res == NULL) { STACK_SHRINK(oparg); goto pop_2_error; }
- #line 4237 "Python/generated_cases.c.h"
+ #line 4212 "Python/generated_cases.c.h"
STACK_SHRINK(oparg);
STACK_SHRINK(1);
stack_pointer[-1] = res;
@@ -4245,7 +4220,7 @@
PyObject **args = (stack_pointer - oparg);
PyObject *self = stack_pointer[-(1 + oparg)];
PyObject *method = stack_pointer[-(2 + oparg)];
- #line 2993 "Python/bytecodes.c"
+ #line 3047 "Python/bytecodes.c"
assert(kwnames == NULL);
assert(oparg == 1);
PyInterpreterState *interp = _PyInterpreterState_GET();
@@ -4263,14 +4238,14 @@
JUMPBY(INLINE_CACHE_ENTRIES_CALL + 1);
assert(next_instr[-1].op.code == POP_TOP);
DISPATCH();
- #line 4267 "Python/generated_cases.c.h"
+ #line 4242 "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 3013 "Python/bytecodes.c"
+ #line 3067 "Python/bytecodes.c"
assert(kwnames == NULL);
int is_meth = method != NULL;
int total_args = oparg;
@@ -4301,7 +4276,7 @@
Py_DECREF(arg);
Py_DECREF(callable);
if (res == NULL) { STACK_SHRINK(oparg); goto pop_2_error; }
- #line 4305 "Python/generated_cases.c.h"
+ #line 4280 "Python/generated_cases.c.h"
STACK_SHRINK(oparg);
STACK_SHRINK(1);
stack_pointer[-1] = res;
@@ -4314,7 +4289,7 @@
PyObject **args = (stack_pointer - oparg);
PyObject *method = stack_pointer[-(2 + oparg)];
PyObject *res;
- #line 3047 "Python/bytecodes.c"
+ #line 3101 "Python/bytecodes.c"
int is_meth = method != NULL;
int total_args = oparg;
if (is_meth) {
@@ -4343,7 +4318,7 @@
}
Py_DECREF(callable);
if (res == NULL) { STACK_SHRINK(oparg); goto pop_2_error; }
- #line 4347 "Python/generated_cases.c.h"
+ #line 4322 "Python/generated_cases.c.h"
STACK_SHRINK(oparg);
STACK_SHRINK(1);
stack_pointer[-1] = res;
@@ -4356,7 +4331,7 @@
PyObject **args = (stack_pointer - oparg);
PyObject *method = stack_pointer[-(2 + oparg)];
PyObject *res;
- #line 3079 "Python/bytecodes.c"
+ #line 3133 "Python/bytecodes.c"
assert(kwnames == NULL);
assert(oparg == 0 || oparg == 1);
int is_meth = method != NULL;
@@ -4385,7 +4360,7 @@
Py_DECREF(self);
Py_DECREF(callable);
if (res == NULL) { STACK_SHRINK(oparg); goto pop_2_error; }
- #line 4389 "Python/generated_cases.c.h"
+ #line 4364 "Python/generated_cases.c.h"
STACK_SHRINK(oparg);
STACK_SHRINK(1);
stack_pointer[-1] = res;
@@ -4398,7 +4373,7 @@
PyObject **args = (stack_pointer - oparg);
PyObject *method = stack_pointer[-(2 + oparg)];
PyObject *res;
- #line 3111 "Python/bytecodes.c"
+ #line 3165 "Python/bytecodes.c"
assert(kwnames == NULL);
int is_meth = method != NULL;
int total_args = oparg;
@@ -4426,7 +4401,7 @@
}
Py_DECREF(callable);
if (res == NULL) { STACK_SHRINK(oparg); goto pop_2_error; }
- #line 4430 "Python/generated_cases.c.h"
+ #line 4405 "Python/generated_cases.c.h"
STACK_SHRINK(oparg);
STACK_SHRINK(1);
stack_pointer[-1] = res;
@@ -4436,9 +4411,9 @@
}
TARGET(INSTRUMENTED_CALL_FUNCTION_EX) {
- #line 3142 "Python/bytecodes.c"
+ #line 3196 "Python/bytecodes.c"
GO_TO_INSTRUCTION(CALL_FUNCTION_EX);
- #line 4442 "Python/generated_cases.c.h"
+ #line 4417 "Python/generated_cases.c.h"
}
TARGET(CALL_FUNCTION_EX) {
@@ -4447,7 +4422,7 @@
PyObject *callargs = stack_pointer[-(1 + ((oparg & 1) ? 1 : 0))];
PyObject *func = stack_pointer[-(2 + ((oparg & 1) ? 1 : 0))];
PyObject *result;
- #line 3146 "Python/bytecodes.c"
+ #line 3200 "Python/bytecodes.c"
// DICT_MERGE is called before this opcode if there are kwargs.
// It converts all dict subtypes in kwargs into regular dicts.
assert(kwargs == NULL || PyDict_CheckExact(kwargs));
@@ -4509,14 +4484,14 @@
}
result = PyObject_Call(func, callargs, kwargs);
}
- #line 4513 "Python/generated_cases.c.h"
+ #line 4488 "Python/generated_cases.c.h"
Py_DECREF(func);
Py_DECREF(callargs);
Py_XDECREF(kwargs);
- #line 3208 "Python/bytecodes.c"
+ #line 3262 "Python/bytecodes.c"
assert(PEEK(3 + (oparg & 1)) == NULL);
if (result == NULL) { STACK_SHRINK(((oparg & 1) ? 1 : 0)); goto pop_3_error; }
- #line 4520 "Python/generated_cases.c.h"
+ #line 4495 "Python/generated_cases.c.h"
STACK_SHRINK(((oparg & 1) ? 1 : 0));
STACK_SHRINK(2);
stack_pointer[-1] = result;
@@ -4531,7 +4506,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 3218 "Python/bytecodes.c"
+ #line 3272 "Python/bytecodes.c"
PyFunctionObject *func_obj = (PyFunctionObject *)
PyFunction_New(codeobj, GLOBALS());
@@ -4560,14 +4535,14 @@
func_obj->func_version = ((PyCodeObject *)codeobj)->co_version;
func = (PyObject *)func_obj;
- #line 4564 "Python/generated_cases.c.h"
+ #line 4539 "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 3249 "Python/bytecodes.c"
+ #line 3303 "Python/bytecodes.c"
assert(PyFunction_Check(frame->f_funcobj));
PyFunctionObject *func = (PyFunctionObject *)frame->f_funcobj;
PyGenObject *gen = (PyGenObject *)_Py_MakeCoro(func);
@@ -4588,7 +4563,7 @@
frame = cframe.current_frame = prev;
_PyFrame_StackPush(frame, (PyObject *)gen);
goto resume_frame;
- #line 4592 "Python/generated_cases.c.h"
+ #line 4567 "Python/generated_cases.c.h"
}
TARGET(BUILD_SLICE) {
@@ -4596,15 +4571,15 @@
PyObject *stop = stack_pointer[-(1 + ((oparg == 3) ? 1 : 0))];
PyObject *start = stack_pointer[-(2 + ((oparg == 3) ? 1 : 0))];
PyObject *slice;
- #line 3272 "Python/bytecodes.c"
+ #line 3326 "Python/bytecodes.c"
slice = PySlice_New(start, stop, step);
- #line 4602 "Python/generated_cases.c.h"
+ #line 4577 "Python/generated_cases.c.h"
Py_DECREF(start);
Py_DECREF(stop);
Py_XDECREF(step);
- #line 3274 "Python/bytecodes.c"
+ #line 3328 "Python/bytecodes.c"
if (slice == NULL) { STACK_SHRINK(((oparg == 3) ? 1 : 0)); goto pop_2_error; }
- #line 4608 "Python/generated_cases.c.h"
+ #line 4583 "Python/generated_cases.c.h"
STACK_SHRINK(((oparg == 3) ? 1 : 0));
STACK_SHRINK(1);
stack_pointer[-1] = slice;
@@ -4615,7 +4590,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 3278 "Python/bytecodes.c"
+ #line 3332 "Python/bytecodes.c"
/* Handles f-string value formatting. */
PyObject *(*conv_fn)(PyObject *);
int which_conversion = oparg & FVC_MASK;
@@ -4650,7 +4625,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 4654 "Python/generated_cases.c.h"
+ #line 4629 "Python/generated_cases.c.h"
STACK_SHRINK((((oparg & FVS_MASK) == FVS_HAVE_SPEC) ? 1 : 0));
stack_pointer[-1] = result;
DISPATCH();
@@ -4659,10 +4634,10 @@
TARGET(COPY) {
PyObject *bottom = stack_pointer[-(1 + (oparg-1))];
PyObject *top;
- #line 3315 "Python/bytecodes.c"
+ #line 3369 "Python/bytecodes.c"
assert(oparg > 0);
top = Py_NewRef(bottom);
- #line 4666 "Python/generated_cases.c.h"
+ #line 4641 "Python/generated_cases.c.h"
STACK_GROW(1);
stack_pointer[-1] = top;
DISPATCH();
@@ -4674,7 +4649,7 @@
PyObject *rhs = stack_pointer[-1];
PyObject *lhs = stack_pointer[-2];
PyObject *res;
- #line 3320 "Python/bytecodes.c"
+ #line 3374 "Python/bytecodes.c"
#if ENABLE_SPECIALIZATION
_PyBinaryOpCache *cache = (_PyBinaryOpCache *)next_instr;
if (ADAPTIVE_COUNTER_IS_ZERO(cache->counter)) {
@@ -4689,12 +4664,12 @@
assert((unsigned)oparg < Py_ARRAY_LENGTH(binary_ops));
assert(binary_ops[oparg]);
res = binary_ops[oparg](lhs, rhs);
- #line 4693 "Python/generated_cases.c.h"
+ #line 4668 "Python/generated_cases.c.h"
Py_DECREF(lhs);
Py_DECREF(rhs);
- #line 3335 "Python/bytecodes.c"
+ #line 3389 "Python/bytecodes.c"
if (res == NULL) goto pop_2_error;
- #line 4698 "Python/generated_cases.c.h"
+ #line 4673 "Python/generated_cases.c.h"
STACK_SHRINK(1);
stack_pointer[-1] = res;
next_instr += 1;
@@ -4704,16 +4679,16 @@
TARGET(SWAP) {
PyObject *top = stack_pointer[-1];
PyObject *bottom = stack_pointer[-(2 + (oparg-2))];
- #line 3340 "Python/bytecodes.c"
+ #line 3394 "Python/bytecodes.c"
assert(oparg >= 2);
- #line 4710 "Python/generated_cases.c.h"
+ #line 4685 "Python/generated_cases.c.h"
stack_pointer[-1] = bottom;
stack_pointer[-(2 + (oparg-2))] = top;
DISPATCH();
}
TARGET(INSTRUMENTED_INSTRUCTION) {
- #line 3344 "Python/bytecodes.c"
+ #line 3398 "Python/bytecodes.c"
int next_opcode = _Py_call_instrumentation_instruction(
tstate, frame, next_instr-1);
if (next_opcode < 0) goto error;
@@ -4725,26 +4700,26 @@
assert(next_opcode > 0 && next_opcode < 256);
opcode = next_opcode;
DISPATCH_GOTO();
- #line 4729 "Python/generated_cases.c.h"
+ #line 4704 "Python/generated_cases.c.h"
}
TARGET(INSTRUMENTED_JUMP_FORWARD) {
- #line 3358 "Python/bytecodes.c"
+ #line 3412 "Python/bytecodes.c"
INSTRUMENTED_JUMP(next_instr-1, next_instr+oparg, PY_MONITORING_EVENT_JUMP);
- #line 4735 "Python/generated_cases.c.h"
+ #line 4710 "Python/generated_cases.c.h"
DISPATCH();
}
TARGET(INSTRUMENTED_JUMP_BACKWARD) {
- #line 3362 "Python/bytecodes.c"
+ #line 3416 "Python/bytecodes.c"
INSTRUMENTED_JUMP(next_instr-1, next_instr-oparg, PY_MONITORING_EVENT_JUMP);
- #line 4742 "Python/generated_cases.c.h"
+ #line 4717 "Python/generated_cases.c.h"
CHECK_EVAL_BREAKER();
DISPATCH();
}
TARGET(INSTRUMENTED_POP_JUMP_IF_TRUE) {
- #line 3367 "Python/bytecodes.c"
+ #line 3421 "Python/bytecodes.c"
PyObject *cond = POP();
int err = PyObject_IsTrue(cond);
Py_DECREF(cond);
@@ -4753,12 +4728,12 @@
assert(err == 0 || err == 1);
int offset = err*oparg;
INSTRUMENTED_JUMP(here, next_instr + offset, PY_MONITORING_EVENT_BRANCH);
- #line 4757 "Python/generated_cases.c.h"
+ #line 4732 "Python/generated_cases.c.h"
DISPATCH();
}
TARGET(INSTRUMENTED_POP_JUMP_IF_FALSE) {
- #line 3378 "Python/bytecodes.c"
+ #line 3432 "Python/bytecodes.c"
PyObject *cond = POP();
int err = PyObject_IsTrue(cond);
Py_DECREF(cond);
@@ -4767,12 +4742,12 @@
assert(err == 0 || err == 1);
int offset = (1-err)*oparg;
INSTRUMENTED_JUMP(here, next_instr + offset, PY_MONITORING_EVENT_BRANCH);
- #line 4771 "Python/generated_cases.c.h"
+ #line 4746 "Python/generated_cases.c.h"
DISPATCH();
}
TARGET(INSTRUMENTED_POP_JUMP_IF_NONE) {
- #line 3389 "Python/bytecodes.c"
+ #line 3443 "Python/bytecodes.c"
PyObject *value = POP();
_Py_CODEUNIT *here = next_instr-1;
int offset;
@@ -4784,12 +4759,12 @@
offset = 0;
}
INSTRUMENTED_JUMP(here, next_instr + offset, PY_MONITORING_EVENT_BRANCH);
- #line 4788 "Python/generated_cases.c.h"
+ #line 4763 "Python/generated_cases.c.h"
DISPATCH();
}
TARGET(INSTRUMENTED_POP_JUMP_IF_NOT_NONE) {
- #line 3403 "Python/bytecodes.c"
+ #line 3457 "Python/bytecodes.c"
PyObject *value = POP();
_Py_CODEUNIT *here = next_instr-1;
int offset;
@@ -4801,30 +4776,30 @@
offset = oparg;
}
INSTRUMENTED_JUMP(here, next_instr + offset, PY_MONITORING_EVENT_BRANCH);
- #line 4805 "Python/generated_cases.c.h"
+ #line 4780 "Python/generated_cases.c.h"
DISPATCH();
}
TARGET(EXTENDED_ARG) {
- #line 3417 "Python/bytecodes.c"
+ #line 3471 "Python/bytecodes.c"
assert(oparg);
opcode = next_instr->op.code;
oparg = oparg << 8 | next_instr->op.arg;
PRE_DISPATCH_GOTO();
DISPATCH_GOTO();
- #line 4816 "Python/generated_cases.c.h"
+ #line 4791 "Python/generated_cases.c.h"
}
TARGET(CACHE) {
- #line 3425 "Python/bytecodes.c"
+ #line 3479 "Python/bytecodes.c"
assert(0 && "Executing a cache.");
Py_UNREACHABLE();
- #line 4823 "Python/generated_cases.c.h"
+ #line 4798 "Python/generated_cases.c.h"
}
TARGET(RESERVED) {
- #line 3430 "Python/bytecodes.c"
+ #line 3484 "Python/bytecodes.c"
assert(0 && "Executing RESERVED instruction.");
Py_UNREACHABLE();
- #line 4830 "Python/generated_cases.c.h"
+ #line 4805 "Python/generated_cases.c.h"
}
diff --git a/Python/opcode_metadata.h b/Python/opcode_metadata.h
index 53fbaa3..f9b1c92 100644
--- a/Python/opcode_metadata.h
+++ b/Python/opcode_metadata.h
@@ -163,10 +163,10 @@ _PyOpcode_num_popped(int opcode, int oparg, bool jump) {
return 0;
case LOAD_LOCALS:
return 0;
- case LOAD_NAME:
- return 0+1;
case LOAD_FROM_DICT_OR_GLOBALS:
return 1;
+ case LOAD_NAME:
+ return 0;
case LOAD_GLOBAL:
return 0;
case LOAD_GLOBAL_MODULE:
@@ -559,10 +559,10 @@ _PyOpcode_num_pushed(int opcode, int oparg, bool jump) {
return 0;
case LOAD_LOCALS:
return 1;
- case LOAD_NAME:
- return 1+1;
case LOAD_FROM_DICT_OR_GLOBALS:
return 1;
+ case LOAD_NAME:
+ return 1;
case LOAD_GLOBAL:
return ((oparg & 1) ? 1 : 0) + 1;
case LOAD_GLOBAL_MODULE:
@@ -881,9 +881,9 @@ const struct opcode_metadata _PyOpcode_opcode_metadata[256] = {
[DELETE_ATTR] = { true, INSTR_FMT_IB },
[STORE_GLOBAL] = { true, INSTR_FMT_IB },
[DELETE_GLOBAL] = { true, INSTR_FMT_IB },
- [LOAD_LOCALS] = { true, INSTR_FMT_IB },
- [LOAD_NAME] = { true, INSTR_FMT_IB },
+ [LOAD_LOCALS] = { true, INSTR_FMT_IX },
[LOAD_FROM_DICT_OR_GLOBALS] = { true, INSTR_FMT_IB },
+ [LOAD_NAME] = { true, INSTR_FMT_IB },
[LOAD_GLOBAL] = { true, INSTR_FMT_IBC000 },
[LOAD_GLOBAL_MODULE] = { true, INSTR_FMT_IBC000 },
[LOAD_GLOBAL_BUILTIN] = { true, INSTR_FMT_IBC000 },