aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Include/internal
diff options
context:
space:
mode:
Diffstat (limited to 'Include/internal')
-rw-r--r--Include/internal/pycore_code.h41
-rw-r--r--Include/internal/pycore_crossinterp.h8
-rw-r--r--Include/internal/pycore_function.h7
-rw-r--r--Include/internal/pycore_global_objects_fini_generated.h6
-rw-r--r--Include/internal/pycore_global_strings.h6
-rw-r--r--Include/internal/pycore_importdl.h2
-rw-r--r--Include/internal/pycore_interpframe.h4
-rw-r--r--Include/internal/pycore_long.h5
-rw-r--r--Include/internal/pycore_opcode_metadata.h6
-rw-r--r--Include/internal/pycore_opcode_utils.h2
-rw-r--r--Include/internal/pycore_pythonrun.h1
-rw-r--r--Include/internal/pycore_runtime_init_generated.h6
-rw-r--r--Include/internal/pycore_stackref.h17
-rw-r--r--Include/internal/pycore_unicodeobject_generated.h24
-rw-r--r--Include/internal/pycore_uop_ids.h392
-rw-r--r--Include/internal/pycore_uop_metadata.h12
16 files changed, 286 insertions, 253 deletions
diff --git a/Include/internal/pycore_code.h b/Include/internal/pycore_code.h
index b135e30b7ad..37a747aa4e3 100644
--- a/Include/internal/pycore_code.h
+++ b/Include/internal/pycore_code.h
@@ -614,6 +614,47 @@ PyAPI_FUNC(int) _PyCode_SetUnboundVarCounts(
PyObject *globalsns,
PyObject *builtinsns);
+
+/* "Stateless" code is a function or code object which does not rely on
+ * external state or internal state. It may rely on arguments and
+ * builtins, but not globals or a closure. Thus it does not rely
+ * on __globals__ or __closure__, and a stateless function
+ * is equivalent to its code object.
+ *
+ * Stateless code also does not keep any persistent state
+ * of its own, so it can't have any executors, monitoring,
+ * instrumentation, or "extras" (i.e. co_extra).
+ *
+ * Stateless code may create nested functions, including closures.
+ * However, nested functions must themselves be stateless, except they
+ * *can* close on the enclosing locals.
+ *
+ * Stateless code may return any value, including nested functions and closures.
+ *
+ * Stateless code that takes no arguments and doesn't return anything
+ * may be treated like a script.
+ *
+ * We consider stateless code to be "portable" if it does not return
+ * any object that holds a reference to any of the code's locals. Thus
+ * generators and coroutines are not portable. Likewise a function
+ * that returns a closure is not portable. The concept of
+ * portability is useful in cases where the code is run
+ * in a different execution context than where
+ * the return value will be used. */
+
+PyAPI_FUNC(int) _PyCode_CheckNoInternalState(PyCodeObject *, const char **);
+PyAPI_FUNC(int) _PyCode_CheckNoExternalState(
+ PyCodeObject *,
+ _PyCode_var_counts_t *,
+ const char **);
+PyAPI_FUNC(int) _PyCode_VerifyStateless(
+ PyThreadState *,
+ PyCodeObject *,
+ PyObject *globalnames,
+ PyObject *globalsns,
+ PyObject *builtinsns);
+
+PyAPI_FUNC(int) _PyCode_CheckPureFunction(PyCodeObject *, const char **);
PyAPI_FUNC(int) _PyCode_ReturnsOnlyNone(PyCodeObject *);
diff --git a/Include/internal/pycore_crossinterp.h b/Include/internal/pycore_crossinterp.h
index 9de61ef5412..9c9b2c2f9c5 100644
--- a/Include/internal/pycore_crossinterp.h
+++ b/Include/internal/pycore_crossinterp.h
@@ -191,6 +191,14 @@ PyAPI_FUNC(int) _PyCode_GetXIData(
PyThreadState *,
PyObject *,
_PyXIData_t *);
+PyAPI_FUNC(int) _PyCode_GetScriptXIData(
+ PyThreadState *,
+ PyObject *,
+ _PyXIData_t *);
+PyAPI_FUNC(int) _PyCode_GetPureScriptXIData(
+ PyThreadState *,
+ PyObject *,
+ _PyXIData_t *);
/* using cross-interpreter data */
diff --git a/Include/internal/pycore_function.h b/Include/internal/pycore_function.h
index 209252b2ddc..a30d52d49bd 100644
--- a/Include/internal/pycore_function.h
+++ b/Include/internal/pycore_function.h
@@ -35,6 +35,13 @@ PyFunctionObject *_PyFunction_LookupByVersion(uint32_t version, PyObject **p_cod
extern PyObject *_Py_set_function_type_params(
PyThreadState* unused, PyObject *func, PyObject *type_params);
+
+/* See pycore_code.h for explanation about what "stateless" means. */
+
+PyAPI_FUNC(int)
+_PyFunction_VerifyStateless(PyThreadState *, PyObject *);
+
+
#ifdef __cplusplus
}
#endif
diff --git a/Include/internal/pycore_global_objects_fini_generated.h b/Include/internal/pycore_global_objects_fini_generated.h
index 9bde4faaf5a..54931e8504e 100644
--- a/Include/internal/pycore_global_objects_fini_generated.h
+++ b/Include/internal/pycore_global_objects_fini_generated.h
@@ -792,7 +792,6 @@ _PyStaticObjects_CheckRefcnt(PyInterpreterState *interp) {
_PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(add_done_callback));
_PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(after_in_child));
_PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(after_in_parent));
- _PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(aggregate_class));
_PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(alias));
_PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(align));
_PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(all));
@@ -809,7 +808,6 @@ _PyStaticObjects_CheckRefcnt(PyInterpreterState *interp) {
_PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(ast));
_PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(athrow));
_PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(attribute));
- _PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(authorizer_callback));
_PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(autocommit));
_PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(backtick));
_PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(base));
@@ -1108,7 +1106,6 @@ _PyStaticObjects_CheckRefcnt(PyInterpreterState *interp) {
_PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(msg));
_PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(mutex));
_PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(mycmp));
- _PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(n_arg));
_PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(n_fields));
_PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(n_sequence_fields));
_PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(n_unnamed_fields));
@@ -1116,7 +1113,6 @@ _PyStaticObjects_CheckRefcnt(PyInterpreterState *interp) {
_PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(name_from));
_PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(namespace_separator));
_PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(namespaces));
- _PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(narg));
_PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(ndigits));
_PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(nested));
_PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(new_file_name));
@@ -1174,7 +1170,6 @@ _PyStaticObjects_CheckRefcnt(PyInterpreterState *interp) {
_PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(print_file_and_line));
_PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(priority));
_PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(progress));
- _PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(progress_handler));
_PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(progress_routine));
_PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(proto));
_PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(protocol));
@@ -1280,7 +1275,6 @@ _PyStaticObjects_CheckRefcnt(PyInterpreterState *interp) {
_PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(timetuple));
_PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(timeunit));
_PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(top));
- _PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(trace_callback));
_PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(traceback));
_PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(trailers));
_PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(translate));
diff --git a/Include/internal/pycore_global_strings.h b/Include/internal/pycore_global_strings.h
index 3a83fd6b604..a665195c899 100644
--- a/Include/internal/pycore_global_strings.h
+++ b/Include/internal/pycore_global_strings.h
@@ -283,7 +283,6 @@ struct _Py_global_strings {
STRUCT_FOR_ID(add_done_callback)
STRUCT_FOR_ID(after_in_child)
STRUCT_FOR_ID(after_in_parent)
- STRUCT_FOR_ID(aggregate_class)
STRUCT_FOR_ID(alias)
STRUCT_FOR_ID(align)
STRUCT_FOR_ID(all)
@@ -300,7 +299,6 @@ struct _Py_global_strings {
STRUCT_FOR_ID(ast)
STRUCT_FOR_ID(athrow)
STRUCT_FOR_ID(attribute)
- STRUCT_FOR_ID(authorizer_callback)
STRUCT_FOR_ID(autocommit)
STRUCT_FOR_ID(backtick)
STRUCT_FOR_ID(base)
@@ -599,7 +597,6 @@ struct _Py_global_strings {
STRUCT_FOR_ID(msg)
STRUCT_FOR_ID(mutex)
STRUCT_FOR_ID(mycmp)
- STRUCT_FOR_ID(n_arg)
STRUCT_FOR_ID(n_fields)
STRUCT_FOR_ID(n_sequence_fields)
STRUCT_FOR_ID(n_unnamed_fields)
@@ -607,7 +604,6 @@ struct _Py_global_strings {
STRUCT_FOR_ID(name_from)
STRUCT_FOR_ID(namespace_separator)
STRUCT_FOR_ID(namespaces)
- STRUCT_FOR_ID(narg)
STRUCT_FOR_ID(ndigits)
STRUCT_FOR_ID(nested)
STRUCT_FOR_ID(new_file_name)
@@ -665,7 +661,6 @@ struct _Py_global_strings {
STRUCT_FOR_ID(print_file_and_line)
STRUCT_FOR_ID(priority)
STRUCT_FOR_ID(progress)
- STRUCT_FOR_ID(progress_handler)
STRUCT_FOR_ID(progress_routine)
STRUCT_FOR_ID(proto)
STRUCT_FOR_ID(protocol)
@@ -771,7 +766,6 @@ struct _Py_global_strings {
STRUCT_FOR_ID(timetuple)
STRUCT_FOR_ID(timeunit)
STRUCT_FOR_ID(top)
- STRUCT_FOR_ID(trace_callback)
STRUCT_FOR_ID(traceback)
STRUCT_FOR_ID(trailers)
STRUCT_FOR_ID(translate)
diff --git a/Include/internal/pycore_importdl.h b/Include/internal/pycore_importdl.h
index 525a16f6b97..3ba9229cc21 100644
--- a/Include/internal/pycore_importdl.h
+++ b/Include/internal/pycore_importdl.h
@@ -107,7 +107,7 @@ extern int _PyImport_RunModInitFunc(
#include <windows.h>
typedef FARPROC dl_funcptr;
-#ifdef _DEBUG
+#ifdef Py_DEBUG
# define PYD_DEBUG_SUFFIX "_d"
#else
# define PYD_DEBUG_SUFFIX ""
diff --git a/Include/internal/pycore_interpframe.h b/Include/internal/pycore_interpframe.h
index d3fd218b27e..2ee3696317c 100644
--- a/Include/internal/pycore_interpframe.h
+++ b/Include/internal/pycore_interpframe.h
@@ -48,13 +48,13 @@ static inline _PyStackRef *_PyFrame_Stackbase(_PyInterpreterFrame *f) {
}
static inline _PyStackRef _PyFrame_StackPeek(_PyInterpreterFrame *f) {
- assert(f->stackpointer > f->localsplus + _PyFrame_GetCode(f)->co_nlocalsplus);
+ assert(f->stackpointer > _PyFrame_Stackbase(f));
assert(!PyStackRef_IsNull(f->stackpointer[-1]));
return f->stackpointer[-1];
}
static inline _PyStackRef _PyFrame_StackPop(_PyInterpreterFrame *f) {
- assert(f->stackpointer > f->localsplus + _PyFrame_GetCode(f)->co_nlocalsplus);
+ assert(f->stackpointer > _PyFrame_Stackbase(f));
f->stackpointer--;
return *f->stackpointer;
}
diff --git a/Include/internal/pycore_long.h b/Include/internal/pycore_long.h
index ed6c4353167..3196d1b8208 100644
--- a/Include/internal/pycore_long.h
+++ b/Include/internal/pycore_long.h
@@ -158,6 +158,11 @@ PyAPI_FUNC(int) _PyLong_UnsignedLongLong_Converter(PyObject *, void *);
// Export for '_testclinic' shared extension (Argument Clinic code)
PyAPI_FUNC(int) _PyLong_Size_t_Converter(PyObject *, void *);
+PyAPI_FUNC(int) _PyLong_UInt8_Converter(PyObject *, void *);
+PyAPI_FUNC(int) _PyLong_UInt16_Converter(PyObject *, void *);
+PyAPI_FUNC(int) _PyLong_UInt32_Converter(PyObject *, void *);
+PyAPI_FUNC(int) _PyLong_UInt64_Converter(PyObject *, void *);
+
/* Long value tag bits:
* 0-1: Sign bits value = (1-sign), ie. negative=2, positive=0, zero=1.
* 2: Set to 1 for the small ints
diff --git a/Include/internal/pycore_opcode_metadata.h b/Include/internal/pycore_opcode_metadata.h
index 0e34074f160..e55e26783a6 100644
--- a/Include/internal/pycore_opcode_metadata.h
+++ b/Include/internal/pycore_opcode_metadata.h
@@ -113,7 +113,7 @@ int _PyOpcode_num_popped(int opcode, int oparg) {
case CALL_INTRINSIC_2:
return 2;
case CALL_ISINSTANCE:
- return 2 + oparg;
+ return 4;
case CALL_KW:
return 3 + oparg;
case CALL_KW_BOUND_METHOD:
@@ -1115,7 +1115,7 @@ const struct opcode_metadata _PyOpcode_opcode_metadata[267] = {
[CALL_FUNCTION_EX] = { true, INSTR_FMT_IX, HAS_EVAL_BREAK_FLAG | HAS_ERROR_FLAG | HAS_ERROR_NO_POP_FLAG | HAS_ESCAPES_FLAG },
[CALL_INTRINSIC_1] = { true, INSTR_FMT_IB, HAS_ARG_FLAG | HAS_ERROR_FLAG | HAS_ESCAPES_FLAG },
[CALL_INTRINSIC_2] = { true, INSTR_FMT_IB, HAS_ARG_FLAG | HAS_ERROR_FLAG | HAS_ESCAPES_FLAG },
- [CALL_ISINSTANCE] = { true, INSTR_FMT_IBC00, HAS_ARG_FLAG | HAS_DEOPT_FLAG | HAS_ERROR_FLAG | HAS_ERROR_NO_POP_FLAG | HAS_ESCAPES_FLAG },
+ [CALL_ISINSTANCE] = { true, INSTR_FMT_IXC00, HAS_DEOPT_FLAG | HAS_ERROR_FLAG | HAS_ERROR_NO_POP_FLAG | HAS_ESCAPES_FLAG },
[CALL_KW] = { true, INSTR_FMT_IBC00, HAS_ARG_FLAG | HAS_ERROR_FLAG | HAS_ERROR_NO_POP_FLAG | HAS_ESCAPES_FLAG },
[CALL_KW_BOUND_METHOD] = { true, INSTR_FMT_IBC00, HAS_ARG_FLAG | HAS_DEOPT_FLAG | HAS_EXIT_FLAG | HAS_ERROR_FLAG | HAS_ESCAPES_FLAG },
[CALL_KW_NON_PY] = { true, INSTR_FMT_IBC00, HAS_ARG_FLAG | HAS_EVAL_BREAK_FLAG | HAS_EXIT_FLAG | HAS_ERROR_FLAG | HAS_ESCAPES_FLAG },
@@ -1363,7 +1363,7 @@ _PyOpcode_macro_expansion[256] = {
[CALL_BUILTIN_O] = { .nuops = 2, .uops = { { _CALL_BUILTIN_O, OPARG_SIMPLE, 3 }, { _CHECK_PERIODIC, OPARG_SIMPLE, 3 } } },
[CALL_INTRINSIC_1] = { .nuops = 1, .uops = { { _CALL_INTRINSIC_1, OPARG_SIMPLE, 0 } } },
[CALL_INTRINSIC_2] = { .nuops = 1, .uops = { { _CALL_INTRINSIC_2, OPARG_SIMPLE, 0 } } },
- [CALL_ISINSTANCE] = { .nuops = 1, .uops = { { _CALL_ISINSTANCE, OPARG_SIMPLE, 3 } } },
+ [CALL_ISINSTANCE] = { .nuops = 3, .uops = { { _GUARD_THIRD_NULL, OPARG_SIMPLE, 3 }, { _GUARD_CALLABLE_ISINSTANCE, OPARG_SIMPLE, 3 }, { _CALL_ISINSTANCE, OPARG_SIMPLE, 3 } } },
[CALL_KW_BOUND_METHOD] = { .nuops = 6, .uops = { { _CHECK_PEP_523, OPARG_SIMPLE, 1 }, { _CHECK_METHOD_VERSION_KW, 2, 1 }, { _EXPAND_METHOD_KW, OPARG_SIMPLE, 3 }, { _PY_FRAME_KW, OPARG_SIMPLE, 3 }, { _SAVE_RETURN_OFFSET, OPARG_SAVE_RETURN_OFFSET, 3 }, { _PUSH_FRAME, OPARG_SIMPLE, 3 } } },
[CALL_KW_NON_PY] = { .nuops = 3, .uops = { { _CHECK_IS_NOT_PY_CALLABLE_KW, OPARG_SIMPLE, 3 }, { _CALL_KW_NON_PY, OPARG_SIMPLE, 3 }, { _CHECK_PERIODIC, OPARG_SIMPLE, 3 } } },
[CALL_KW_PY] = { .nuops = 5, .uops = { { _CHECK_PEP_523, OPARG_SIMPLE, 1 }, { _CHECK_FUNCTION_VERSION_KW, 2, 1 }, { _PY_FRAME_KW, OPARG_SIMPLE, 3 }, { _SAVE_RETURN_OFFSET, OPARG_SAVE_RETURN_OFFSET, 3 }, { _PUSH_FRAME, OPARG_SIMPLE, 3 } } },
diff --git a/Include/internal/pycore_opcode_utils.h b/Include/internal/pycore_opcode_utils.h
index 62af06dc01c..79a1a242556 100644
--- a/Include/internal/pycore_opcode_utils.h
+++ b/Include/internal/pycore_opcode_utils.h
@@ -56,6 +56,8 @@ extern "C" {
#define IS_RETURN_OPCODE(opcode) \
(opcode == RETURN_VALUE)
+#define IS_RAISE_OPCODE(opcode) \
+ (opcode == RAISE_VARARGS || opcode == RERAISE)
/* Flags used in the oparg for MAKE_FUNCTION */
diff --git a/Include/internal/pycore_pythonrun.h b/Include/internal/pycore_pythonrun.h
index 0bfc5704dc4..7daed1326af 100644
--- a/Include/internal/pycore_pythonrun.h
+++ b/Include/internal/pycore_pythonrun.h
@@ -25,6 +25,7 @@ extern int _PyRun_InteractiveLoopObject(
PyObject *filename,
PyCompilerFlags *flags);
+extern int _PyObject_SupportedAsScript(PyObject *);
extern const char* _Py_SourceAsString(
PyObject *cmd,
const char *funcname,
diff --git a/Include/internal/pycore_runtime_init_generated.h b/Include/internal/pycore_runtime_init_generated.h
index 4a34ffa559e..01289f6118d 100644
--- a/Include/internal/pycore_runtime_init_generated.h
+++ b/Include/internal/pycore_runtime_init_generated.h
@@ -790,7 +790,6 @@ extern "C" {
INIT_ID(add_done_callback), \
INIT_ID(after_in_child), \
INIT_ID(after_in_parent), \
- INIT_ID(aggregate_class), \
INIT_ID(alias), \
INIT_ID(align), \
INIT_ID(all), \
@@ -807,7 +806,6 @@ extern "C" {
INIT_ID(ast), \
INIT_ID(athrow), \
INIT_ID(attribute), \
- INIT_ID(authorizer_callback), \
INIT_ID(autocommit), \
INIT_ID(backtick), \
INIT_ID(base), \
@@ -1106,7 +1104,6 @@ extern "C" {
INIT_ID(msg), \
INIT_ID(mutex), \
INIT_ID(mycmp), \
- INIT_ID(n_arg), \
INIT_ID(n_fields), \
INIT_ID(n_sequence_fields), \
INIT_ID(n_unnamed_fields), \
@@ -1114,7 +1111,6 @@ extern "C" {
INIT_ID(name_from), \
INIT_ID(namespace_separator), \
INIT_ID(namespaces), \
- INIT_ID(narg), \
INIT_ID(ndigits), \
INIT_ID(nested), \
INIT_ID(new_file_name), \
@@ -1172,7 +1168,6 @@ extern "C" {
INIT_ID(print_file_and_line), \
INIT_ID(priority), \
INIT_ID(progress), \
- INIT_ID(progress_handler), \
INIT_ID(progress_routine), \
INIT_ID(proto), \
INIT_ID(protocol), \
@@ -1278,7 +1273,6 @@ extern "C" {
INIT_ID(timetuple), \
INIT_ID(timeunit), \
INIT_ID(top), \
- INIT_ID(trace_callback), \
INIT_ID(traceback), \
INIT_ID(trailers), \
INIT_ID(translate), \
diff --git a/Include/internal/pycore_stackref.h b/Include/internal/pycore_stackref.h
index a2acf311ff4..dc5e56102fa 100644
--- a/Include/internal/pycore_stackref.h
+++ b/Include/internal/pycore_stackref.h
@@ -95,10 +95,16 @@ PyStackRef_IsNone(_PyStackRef ref)
return _Py_stackref_get_object(ref) == Py_None;
}
+static inline bool
+PyStackRef_IsTaggedInt(_PyStackRef ref)
+{
+ return (ref.index & 1) == 1;
+}
+
static inline PyObject *
_PyStackRef_AsPyObjectBorrow(_PyStackRef ref, const char *filename, int linenumber)
{
- assert((ref.index & 1) == 0);
+ assert(!PyStackRef_IsTaggedInt(ref));
_Py_stackref_record_borrow(ref, filename, linenumber);
return _Py_stackref_get_object(ref);
}
@@ -135,12 +141,6 @@ _PyStackRef_FromPyObjectImmortal(PyObject *obj, const char *filename, int linenu
}
#define PyStackRef_FromPyObjectImmortal(obj) _PyStackRef_FromPyObjectImmortal(_PyObject_CAST(obj), __FILE__, __LINE__)
-static inline bool
-PyStackRef_IsTaggedInt(_PyStackRef ref)
-{
- return (ref.index & 1) == 1;
-}
-
static inline void
_PyStackRef_CLOSE(_PyStackRef ref, const char *filename, int linenumber)
{
@@ -256,7 +256,7 @@ PyStackRef_TagInt(intptr_t i)
static inline intptr_t
PyStackRef_UntagInt(_PyStackRef i)
{
- assert((i.bits & Py_INT_TAG) == Py_INT_TAG);
+ assert(PyStackRef_IsTaggedInt(i));
intptr_t val = (intptr_t)i.bits;
return Py_ARITHMETIC_RIGHT_SHIFT(intptr_t, val, 2);
}
@@ -286,6 +286,7 @@ static const _PyStackRef PyStackRef_NULL = { .bits = Py_TAG_DEFERRED};
static inline PyObject *
PyStackRef_AsPyObjectBorrow(_PyStackRef stackref)
{
+ assert(!PyStackRef_IsTaggedInt(stackref));
PyObject *cleared = ((PyObject *)((stackref).bits & (~Py_TAG_BITS)));
return cleared;
}
diff --git a/Include/internal/pycore_unicodeobject_generated.h b/Include/internal/pycore_unicodeobject_generated.h
index fefacef77c8..8ec1ac1e56d 100644
--- a/Include/internal/pycore_unicodeobject_generated.h
+++ b/Include/internal/pycore_unicodeobject_generated.h
@@ -920,10 +920,6 @@ _PyUnicode_InitStaticStrings(PyInterpreterState *interp) {
_PyUnicode_InternStatic(interp, &string);
assert(_PyUnicode_CheckConsistency(string, 1));
assert(PyUnicode_GET_LENGTH(string) != 1);
- string = &_Py_ID(aggregate_class);
- _PyUnicode_InternStatic(interp, &string);
- assert(_PyUnicode_CheckConsistency(string, 1));
- assert(PyUnicode_GET_LENGTH(string) != 1);
string = &_Py_ID(alias);
_PyUnicode_InternStatic(interp, &string);
assert(_PyUnicode_CheckConsistency(string, 1));
@@ -988,10 +984,6 @@ _PyUnicode_InitStaticStrings(PyInterpreterState *interp) {
_PyUnicode_InternStatic(interp, &string);
assert(_PyUnicode_CheckConsistency(string, 1));
assert(PyUnicode_GET_LENGTH(string) != 1);
- string = &_Py_ID(authorizer_callback);
- _PyUnicode_InternStatic(interp, &string);
- assert(_PyUnicode_CheckConsistency(string, 1));
- assert(PyUnicode_GET_LENGTH(string) != 1);
string = &_Py_ID(autocommit);
_PyUnicode_InternStatic(interp, &string);
assert(_PyUnicode_CheckConsistency(string, 1));
@@ -2184,10 +2176,6 @@ _PyUnicode_InitStaticStrings(PyInterpreterState *interp) {
_PyUnicode_InternStatic(interp, &string);
assert(_PyUnicode_CheckConsistency(string, 1));
assert(PyUnicode_GET_LENGTH(string) != 1);
- string = &_Py_ID(n_arg);
- _PyUnicode_InternStatic(interp, &string);
- assert(_PyUnicode_CheckConsistency(string, 1));
- assert(PyUnicode_GET_LENGTH(string) != 1);
string = &_Py_ID(n_fields);
_PyUnicode_InternStatic(interp, &string);
assert(_PyUnicode_CheckConsistency(string, 1));
@@ -2216,10 +2204,6 @@ _PyUnicode_InitStaticStrings(PyInterpreterState *interp) {
_PyUnicode_InternStatic(interp, &string);
assert(_PyUnicode_CheckConsistency(string, 1));
assert(PyUnicode_GET_LENGTH(string) != 1);
- string = &_Py_ID(narg);
- _PyUnicode_InternStatic(interp, &string);
- assert(_PyUnicode_CheckConsistency(string, 1));
- assert(PyUnicode_GET_LENGTH(string) != 1);
string = &_Py_ID(ndigits);
_PyUnicode_InternStatic(interp, &string);
assert(_PyUnicode_CheckConsistency(string, 1));
@@ -2448,10 +2432,6 @@ _PyUnicode_InitStaticStrings(PyInterpreterState *interp) {
_PyUnicode_InternStatic(interp, &string);
assert(_PyUnicode_CheckConsistency(string, 1));
assert(PyUnicode_GET_LENGTH(string) != 1);
- string = &_Py_ID(progress_handler);
- _PyUnicode_InternStatic(interp, &string);
- assert(_PyUnicode_CheckConsistency(string, 1));
- assert(PyUnicode_GET_LENGTH(string) != 1);
string = &_Py_ID(progress_routine);
_PyUnicode_InternStatic(interp, &string);
assert(_PyUnicode_CheckConsistency(string, 1));
@@ -2872,10 +2852,6 @@ _PyUnicode_InitStaticStrings(PyInterpreterState *interp) {
_PyUnicode_InternStatic(interp, &string);
assert(_PyUnicode_CheckConsistency(string, 1));
assert(PyUnicode_GET_LENGTH(string) != 1);
- string = &_Py_ID(trace_callback);
- _PyUnicode_InternStatic(interp, &string);
- assert(_PyUnicode_CheckConsistency(string, 1));
- assert(PyUnicode_GET_LENGTH(string) != 1);
string = &_Py_ID(traceback);
_PyUnicode_InternStatic(interp, &string);
assert(_PyUnicode_CheckConsistency(string, 1));
diff --git a/Include/internal/pycore_uop_ids.h b/Include/internal/pycore_uop_ids.h
index d3d2b716e2c..71a288a3a39 100644
--- a/Include/internal/pycore_uop_ids.h
+++ b/Include/internal/pycore_uop_ids.h
@@ -43,125 +43,127 @@ extern "C" {
#define _CALL_BUILTIN_O 323
#define _CALL_INTRINSIC_1 CALL_INTRINSIC_1
#define _CALL_INTRINSIC_2 CALL_INTRINSIC_2
-#define _CALL_ISINSTANCE CALL_ISINSTANCE
-#define _CALL_KW_NON_PY 324
-#define _CALL_LEN 325
+#define _CALL_ISINSTANCE 324
+#define _CALL_KW_NON_PY 325
+#define _CALL_LEN 326
#define _CALL_LIST_APPEND CALL_LIST_APPEND
-#define _CALL_METHOD_DESCRIPTOR_FAST 326
-#define _CALL_METHOD_DESCRIPTOR_FAST_WITH_KEYWORDS 327
-#define _CALL_METHOD_DESCRIPTOR_NOARGS 328
-#define _CALL_METHOD_DESCRIPTOR_O 329
-#define _CALL_NON_PY_GENERAL 330
-#define _CALL_STR_1 331
-#define _CALL_TUPLE_1 332
-#define _CALL_TYPE_1 333
-#define _CHECK_AND_ALLOCATE_OBJECT 334
-#define _CHECK_ATTR_CLASS 335
-#define _CHECK_ATTR_METHOD_LAZY_DICT 336
-#define _CHECK_CALL_BOUND_METHOD_EXACT_ARGS 337
+#define _CALL_METHOD_DESCRIPTOR_FAST 327
+#define _CALL_METHOD_DESCRIPTOR_FAST_WITH_KEYWORDS 328
+#define _CALL_METHOD_DESCRIPTOR_NOARGS 329
+#define _CALL_METHOD_DESCRIPTOR_O 330
+#define _CALL_NON_PY_GENERAL 331
+#define _CALL_STR_1 332
+#define _CALL_TUPLE_1 333
+#define _CALL_TYPE_1 334
+#define _CHECK_AND_ALLOCATE_OBJECT 335
+#define _CHECK_ATTR_CLASS 336
+#define _CHECK_ATTR_METHOD_LAZY_DICT 337
+#define _CHECK_CALL_BOUND_METHOD_EXACT_ARGS 338
#define _CHECK_EG_MATCH CHECK_EG_MATCH
#define _CHECK_EXC_MATCH CHECK_EXC_MATCH
-#define _CHECK_FUNCTION 338
-#define _CHECK_FUNCTION_EXACT_ARGS 339
-#define _CHECK_FUNCTION_VERSION 340
-#define _CHECK_FUNCTION_VERSION_INLINE 341
-#define _CHECK_FUNCTION_VERSION_KW 342
-#define _CHECK_IS_NOT_PY_CALLABLE 343
-#define _CHECK_IS_NOT_PY_CALLABLE_KW 344
-#define _CHECK_MANAGED_OBJECT_HAS_VALUES 345
-#define _CHECK_METHOD_VERSION 346
-#define _CHECK_METHOD_VERSION_KW 347
-#define _CHECK_PEP_523 348
-#define _CHECK_PERIODIC 349
-#define _CHECK_PERIODIC_IF_NOT_YIELD_FROM 350
-#define _CHECK_RECURSION_REMAINING 351
-#define _CHECK_STACK_SPACE 352
-#define _CHECK_STACK_SPACE_OPERAND 353
-#define _CHECK_VALIDITY 354
-#define _COMPARE_OP 355
-#define _COMPARE_OP_FLOAT 356
-#define _COMPARE_OP_INT 357
-#define _COMPARE_OP_STR 358
-#define _CONTAINS_OP 359
-#define _CONTAINS_OP_DICT 360
-#define _CONTAINS_OP_SET 361
+#define _CHECK_FUNCTION 339
+#define _CHECK_FUNCTION_EXACT_ARGS 340
+#define _CHECK_FUNCTION_VERSION 341
+#define _CHECK_FUNCTION_VERSION_INLINE 342
+#define _CHECK_FUNCTION_VERSION_KW 343
+#define _CHECK_IS_NOT_PY_CALLABLE 344
+#define _CHECK_IS_NOT_PY_CALLABLE_KW 345
+#define _CHECK_MANAGED_OBJECT_HAS_VALUES 346
+#define _CHECK_METHOD_VERSION 347
+#define _CHECK_METHOD_VERSION_KW 348
+#define _CHECK_PEP_523 349
+#define _CHECK_PERIODIC 350
+#define _CHECK_PERIODIC_IF_NOT_YIELD_FROM 351
+#define _CHECK_RECURSION_REMAINING 352
+#define _CHECK_STACK_SPACE 353
+#define _CHECK_STACK_SPACE_OPERAND 354
+#define _CHECK_VALIDITY 355
+#define _COMPARE_OP 356
+#define _COMPARE_OP_FLOAT 357
+#define _COMPARE_OP_INT 358
+#define _COMPARE_OP_STR 359
+#define _CONTAINS_OP 360
+#define _CONTAINS_OP_DICT 361
+#define _CONTAINS_OP_SET 362
#define _CONVERT_VALUE CONVERT_VALUE
#define _COPY COPY
#define _COPY_FREE_VARS COPY_FREE_VARS
-#define _CREATE_INIT_FRAME 362
+#define _CREATE_INIT_FRAME 363
#define _DELETE_ATTR DELETE_ATTR
#define _DELETE_DEREF DELETE_DEREF
#define _DELETE_FAST DELETE_FAST
#define _DELETE_GLOBAL DELETE_GLOBAL
#define _DELETE_NAME DELETE_NAME
#define _DELETE_SUBSCR DELETE_SUBSCR
-#define _DEOPT 363
+#define _DEOPT 364
#define _DICT_MERGE DICT_MERGE
#define _DICT_UPDATE DICT_UPDATE
-#define _DO_CALL 364
-#define _DO_CALL_FUNCTION_EX 365
-#define _DO_CALL_KW 366
+#define _DO_CALL 365
+#define _DO_CALL_FUNCTION_EX 366
+#define _DO_CALL_KW 367
#define _END_FOR END_FOR
#define _END_SEND END_SEND
-#define _ERROR_POP_N 367
+#define _ERROR_POP_N 368
#define _EXIT_INIT_CHECK EXIT_INIT_CHECK
-#define _EXPAND_METHOD 368
-#define _EXPAND_METHOD_KW 369
-#define _FATAL_ERROR 370
+#define _EXPAND_METHOD 369
+#define _EXPAND_METHOD_KW 370
+#define _FATAL_ERROR 371
#define _FORMAT_SIMPLE FORMAT_SIMPLE
#define _FORMAT_WITH_SPEC FORMAT_WITH_SPEC
-#define _FOR_ITER 371
-#define _FOR_ITER_GEN_FRAME 372
-#define _FOR_ITER_TIER_TWO 373
+#define _FOR_ITER 372
+#define _FOR_ITER_GEN_FRAME 373
+#define _FOR_ITER_TIER_TWO 374
#define _GET_AITER GET_AITER
#define _GET_ANEXT GET_ANEXT
#define _GET_AWAITABLE GET_AWAITABLE
#define _GET_ITER GET_ITER
#define _GET_LEN GET_LEN
#define _GET_YIELD_FROM_ITER GET_YIELD_FROM_ITER
-#define _GUARD_BINARY_OP_EXTEND 374
-#define _GUARD_CALLABLE_LEN 375
-#define _GUARD_CALLABLE_STR_1 376
-#define _GUARD_CALLABLE_TUPLE_1 377
-#define _GUARD_CALLABLE_TYPE_1 378
-#define _GUARD_DORV_NO_DICT 379
-#define _GUARD_DORV_VALUES_INST_ATTR_FROM_DICT 380
-#define _GUARD_GLOBALS_VERSION 381
-#define _GUARD_IS_FALSE_POP 382
-#define _GUARD_IS_NONE_POP 383
-#define _GUARD_IS_NOT_NONE_POP 384
-#define _GUARD_IS_TRUE_POP 385
-#define _GUARD_KEYS_VERSION 386
-#define _GUARD_NOS_DICT 387
-#define _GUARD_NOS_FLOAT 388
-#define _GUARD_NOS_INT 389
-#define _GUARD_NOS_LIST 390
-#define _GUARD_NOS_NULL 391
-#define _GUARD_NOS_TUPLE 392
-#define _GUARD_NOS_UNICODE 393
-#define _GUARD_NOT_EXHAUSTED_LIST 394
-#define _GUARD_NOT_EXHAUSTED_RANGE 395
-#define _GUARD_NOT_EXHAUSTED_TUPLE 396
-#define _GUARD_TOS_ANY_SET 397
-#define _GUARD_TOS_DICT 398
-#define _GUARD_TOS_FLOAT 399
-#define _GUARD_TOS_INT 400
-#define _GUARD_TOS_LIST 401
-#define _GUARD_TOS_SLICE 402
-#define _GUARD_TOS_TUPLE 403
-#define _GUARD_TOS_UNICODE 404
-#define _GUARD_TYPE_VERSION 405
-#define _GUARD_TYPE_VERSION_AND_LOCK 406
+#define _GUARD_BINARY_OP_EXTEND 375
+#define _GUARD_CALLABLE_ISINSTANCE 376
+#define _GUARD_CALLABLE_LEN 377
+#define _GUARD_CALLABLE_STR_1 378
+#define _GUARD_CALLABLE_TUPLE_1 379
+#define _GUARD_CALLABLE_TYPE_1 380
+#define _GUARD_DORV_NO_DICT 381
+#define _GUARD_DORV_VALUES_INST_ATTR_FROM_DICT 382
+#define _GUARD_GLOBALS_VERSION 383
+#define _GUARD_IS_FALSE_POP 384
+#define _GUARD_IS_NONE_POP 385
+#define _GUARD_IS_NOT_NONE_POP 386
+#define _GUARD_IS_TRUE_POP 387
+#define _GUARD_KEYS_VERSION 388
+#define _GUARD_NOS_DICT 389
+#define _GUARD_NOS_FLOAT 390
+#define _GUARD_NOS_INT 391
+#define _GUARD_NOS_LIST 392
+#define _GUARD_NOS_NULL 393
+#define _GUARD_NOS_TUPLE 394
+#define _GUARD_NOS_UNICODE 395
+#define _GUARD_NOT_EXHAUSTED_LIST 396
+#define _GUARD_NOT_EXHAUSTED_RANGE 397
+#define _GUARD_NOT_EXHAUSTED_TUPLE 398
+#define _GUARD_THIRD_NULL 399
+#define _GUARD_TOS_ANY_SET 400
+#define _GUARD_TOS_DICT 401
+#define _GUARD_TOS_FLOAT 402
+#define _GUARD_TOS_INT 403
+#define _GUARD_TOS_LIST 404
+#define _GUARD_TOS_SLICE 405
+#define _GUARD_TOS_TUPLE 406
+#define _GUARD_TOS_UNICODE 407
+#define _GUARD_TYPE_VERSION 408
+#define _GUARD_TYPE_VERSION_AND_LOCK 409
#define _IMPORT_FROM IMPORT_FROM
#define _IMPORT_NAME IMPORT_NAME
-#define _INIT_CALL_BOUND_METHOD_EXACT_ARGS 407
-#define _INIT_CALL_PY_EXACT_ARGS 408
-#define _INIT_CALL_PY_EXACT_ARGS_0 409
-#define _INIT_CALL_PY_EXACT_ARGS_1 410
-#define _INIT_CALL_PY_EXACT_ARGS_2 411
-#define _INIT_CALL_PY_EXACT_ARGS_3 412
-#define _INIT_CALL_PY_EXACT_ARGS_4 413
-#define _INSERT_NULL 414
+#define _INIT_CALL_BOUND_METHOD_EXACT_ARGS 410
+#define _INIT_CALL_PY_EXACT_ARGS 411
+#define _INIT_CALL_PY_EXACT_ARGS_0 412
+#define _INIT_CALL_PY_EXACT_ARGS_1 413
+#define _INIT_CALL_PY_EXACT_ARGS_2 414
+#define _INIT_CALL_PY_EXACT_ARGS_3 415
+#define _INIT_CALL_PY_EXACT_ARGS_4 416
+#define _INSERT_NULL 417
#define _INSTRUMENTED_FOR_ITER INSTRUMENTED_FOR_ITER
#define _INSTRUMENTED_INSTRUCTION INSTRUMENTED_INSTRUCTION
#define _INSTRUMENTED_JUMP_FORWARD INSTRUMENTED_JUMP_FORWARD
@@ -171,163 +173,163 @@ extern "C" {
#define _INSTRUMENTED_POP_JUMP_IF_NONE INSTRUMENTED_POP_JUMP_IF_NONE
#define _INSTRUMENTED_POP_JUMP_IF_NOT_NONE INSTRUMENTED_POP_JUMP_IF_NOT_NONE
#define _INSTRUMENTED_POP_JUMP_IF_TRUE INSTRUMENTED_POP_JUMP_IF_TRUE
-#define _IS_NONE 415
+#define _IS_NONE 418
#define _IS_OP IS_OP
-#define _ITER_CHECK_LIST 416
-#define _ITER_CHECK_RANGE 417
-#define _ITER_CHECK_TUPLE 418
-#define _ITER_JUMP_LIST 419
-#define _ITER_JUMP_RANGE 420
-#define _ITER_JUMP_TUPLE 421
-#define _ITER_NEXT_LIST 422
-#define _ITER_NEXT_LIST_TIER_TWO 423
-#define _ITER_NEXT_RANGE 424
-#define _ITER_NEXT_TUPLE 425
-#define _JUMP_TO_TOP 426
+#define _ITER_CHECK_LIST 419
+#define _ITER_CHECK_RANGE 420
+#define _ITER_CHECK_TUPLE 421
+#define _ITER_JUMP_LIST 422
+#define _ITER_JUMP_RANGE 423
+#define _ITER_JUMP_TUPLE 424
+#define _ITER_NEXT_LIST 425
+#define _ITER_NEXT_LIST_TIER_TWO 426
+#define _ITER_NEXT_RANGE 427
+#define _ITER_NEXT_TUPLE 428
+#define _JUMP_TO_TOP 429
#define _LIST_APPEND LIST_APPEND
#define _LIST_EXTEND LIST_EXTEND
-#define _LOAD_ATTR 427
-#define _LOAD_ATTR_CLASS 428
+#define _LOAD_ATTR 430
+#define _LOAD_ATTR_CLASS 431
#define _LOAD_ATTR_GETATTRIBUTE_OVERRIDDEN LOAD_ATTR_GETATTRIBUTE_OVERRIDDEN
-#define _LOAD_ATTR_INSTANCE_VALUE 429
-#define _LOAD_ATTR_METHOD_LAZY_DICT 430
-#define _LOAD_ATTR_METHOD_NO_DICT 431
-#define _LOAD_ATTR_METHOD_WITH_VALUES 432
-#define _LOAD_ATTR_MODULE 433
-#define _LOAD_ATTR_NONDESCRIPTOR_NO_DICT 434
-#define _LOAD_ATTR_NONDESCRIPTOR_WITH_VALUES 435
-#define _LOAD_ATTR_PROPERTY_FRAME 436
-#define _LOAD_ATTR_SLOT 437
-#define _LOAD_ATTR_WITH_HINT 438
+#define _LOAD_ATTR_INSTANCE_VALUE 432
+#define _LOAD_ATTR_METHOD_LAZY_DICT 433
+#define _LOAD_ATTR_METHOD_NO_DICT 434
+#define _LOAD_ATTR_METHOD_WITH_VALUES 435
+#define _LOAD_ATTR_MODULE 436
+#define _LOAD_ATTR_NONDESCRIPTOR_NO_DICT 437
+#define _LOAD_ATTR_NONDESCRIPTOR_WITH_VALUES 438
+#define _LOAD_ATTR_PROPERTY_FRAME 439
+#define _LOAD_ATTR_SLOT 440
+#define _LOAD_ATTR_WITH_HINT 441
#define _LOAD_BUILD_CLASS LOAD_BUILD_CLASS
-#define _LOAD_BYTECODE 439
+#define _LOAD_BYTECODE 442
#define _LOAD_COMMON_CONSTANT LOAD_COMMON_CONSTANT
#define _LOAD_CONST LOAD_CONST
#define _LOAD_CONST_IMMORTAL LOAD_CONST_IMMORTAL
-#define _LOAD_CONST_INLINE 440
-#define _LOAD_CONST_INLINE_BORROW 441
+#define _LOAD_CONST_INLINE 443
+#define _LOAD_CONST_INLINE_BORROW 444
#define _LOAD_CONST_MORTAL LOAD_CONST_MORTAL
#define _LOAD_DEREF LOAD_DEREF
-#define _LOAD_FAST 442
-#define _LOAD_FAST_0 443
-#define _LOAD_FAST_1 444
-#define _LOAD_FAST_2 445
-#define _LOAD_FAST_3 446
-#define _LOAD_FAST_4 447
-#define _LOAD_FAST_5 448
-#define _LOAD_FAST_6 449
-#define _LOAD_FAST_7 450
+#define _LOAD_FAST 445
+#define _LOAD_FAST_0 446
+#define _LOAD_FAST_1 447
+#define _LOAD_FAST_2 448
+#define _LOAD_FAST_3 449
+#define _LOAD_FAST_4 450
+#define _LOAD_FAST_5 451
+#define _LOAD_FAST_6 452
+#define _LOAD_FAST_7 453
#define _LOAD_FAST_AND_CLEAR LOAD_FAST_AND_CLEAR
-#define _LOAD_FAST_BORROW 451
-#define _LOAD_FAST_BORROW_0 452
-#define _LOAD_FAST_BORROW_1 453
-#define _LOAD_FAST_BORROW_2 454
-#define _LOAD_FAST_BORROW_3 455
-#define _LOAD_FAST_BORROW_4 456
-#define _LOAD_FAST_BORROW_5 457
-#define _LOAD_FAST_BORROW_6 458
-#define _LOAD_FAST_BORROW_7 459
+#define _LOAD_FAST_BORROW 454
+#define _LOAD_FAST_BORROW_0 455
+#define _LOAD_FAST_BORROW_1 456
+#define _LOAD_FAST_BORROW_2 457
+#define _LOAD_FAST_BORROW_3 458
+#define _LOAD_FAST_BORROW_4 459
+#define _LOAD_FAST_BORROW_5 460
+#define _LOAD_FAST_BORROW_6 461
+#define _LOAD_FAST_BORROW_7 462
#define _LOAD_FAST_BORROW_LOAD_FAST_BORROW LOAD_FAST_BORROW_LOAD_FAST_BORROW
#define _LOAD_FAST_CHECK LOAD_FAST_CHECK
#define _LOAD_FAST_LOAD_FAST LOAD_FAST_LOAD_FAST
#define _LOAD_FROM_DICT_OR_DEREF LOAD_FROM_DICT_OR_DEREF
#define _LOAD_FROM_DICT_OR_GLOBALS LOAD_FROM_DICT_OR_GLOBALS
-#define _LOAD_GLOBAL 460
-#define _LOAD_GLOBAL_BUILTINS 461
-#define _LOAD_GLOBAL_MODULE 462
+#define _LOAD_GLOBAL 463
+#define _LOAD_GLOBAL_BUILTINS 464
+#define _LOAD_GLOBAL_MODULE 465
#define _LOAD_LOCALS LOAD_LOCALS
#define _LOAD_NAME LOAD_NAME
-#define _LOAD_SMALL_INT 463
-#define _LOAD_SMALL_INT_0 464
-#define _LOAD_SMALL_INT_1 465
-#define _LOAD_SMALL_INT_2 466
-#define _LOAD_SMALL_INT_3 467
-#define _LOAD_SPECIAL 468
+#define _LOAD_SMALL_INT 466
+#define _LOAD_SMALL_INT_0 467
+#define _LOAD_SMALL_INT_1 468
+#define _LOAD_SMALL_INT_2 469
+#define _LOAD_SMALL_INT_3 470
+#define _LOAD_SPECIAL 471
#define _LOAD_SUPER_ATTR_ATTR LOAD_SUPER_ATTR_ATTR
#define _LOAD_SUPER_ATTR_METHOD LOAD_SUPER_ATTR_METHOD
-#define _MAKE_CALLARGS_A_TUPLE 469
+#define _MAKE_CALLARGS_A_TUPLE 472
#define _MAKE_CELL MAKE_CELL
#define _MAKE_FUNCTION MAKE_FUNCTION
-#define _MAKE_WARM 470
+#define _MAKE_WARM 473
#define _MAP_ADD MAP_ADD
#define _MATCH_CLASS MATCH_CLASS
#define _MATCH_KEYS MATCH_KEYS
#define _MATCH_MAPPING MATCH_MAPPING
#define _MATCH_SEQUENCE MATCH_SEQUENCE
-#define _MAYBE_EXPAND_METHOD 471
-#define _MAYBE_EXPAND_METHOD_KW 472
-#define _MONITOR_CALL 473
-#define _MONITOR_CALL_KW 474
-#define _MONITOR_JUMP_BACKWARD 475
-#define _MONITOR_RESUME 476
+#define _MAYBE_EXPAND_METHOD 474
+#define _MAYBE_EXPAND_METHOD_KW 475
+#define _MONITOR_CALL 476
+#define _MONITOR_CALL_KW 477
+#define _MONITOR_JUMP_BACKWARD 478
+#define _MONITOR_RESUME 479
#define _NOP NOP
#define _POP_EXCEPT POP_EXCEPT
-#define _POP_JUMP_IF_FALSE 477
-#define _POP_JUMP_IF_TRUE 478
+#define _POP_JUMP_IF_FALSE 480
+#define _POP_JUMP_IF_TRUE 481
#define _POP_TOP POP_TOP
-#define _POP_TOP_LOAD_CONST_INLINE 479
-#define _POP_TOP_LOAD_CONST_INLINE_BORROW 480
-#define _POP_TWO_LOAD_CONST_INLINE_BORROW 481
+#define _POP_TOP_LOAD_CONST_INLINE 482
+#define _POP_TOP_LOAD_CONST_INLINE_BORROW 483
+#define _POP_TWO_LOAD_CONST_INLINE_BORROW 484
#define _PUSH_EXC_INFO PUSH_EXC_INFO
-#define _PUSH_FRAME 482
+#define _PUSH_FRAME 485
#define _PUSH_NULL PUSH_NULL
-#define _PUSH_NULL_CONDITIONAL 483
-#define _PY_FRAME_GENERAL 484
-#define _PY_FRAME_KW 485
-#define _QUICKEN_RESUME 486
-#define _REPLACE_WITH_TRUE 487
+#define _PUSH_NULL_CONDITIONAL 486
+#define _PY_FRAME_GENERAL 487
+#define _PY_FRAME_KW 488
+#define _QUICKEN_RESUME 489
+#define _REPLACE_WITH_TRUE 490
#define _RESUME_CHECK RESUME_CHECK
#define _RETURN_GENERATOR RETURN_GENERATOR
#define _RETURN_VALUE RETURN_VALUE
-#define _SAVE_RETURN_OFFSET 488
-#define _SEND 489
-#define _SEND_GEN_FRAME 490
+#define _SAVE_RETURN_OFFSET 491
+#define _SEND 492
+#define _SEND_GEN_FRAME 493
#define _SETUP_ANNOTATIONS SETUP_ANNOTATIONS
#define _SET_ADD SET_ADD
#define _SET_FUNCTION_ATTRIBUTE SET_FUNCTION_ATTRIBUTE
#define _SET_UPDATE SET_UPDATE
-#define _START_EXECUTOR 491
-#define _STORE_ATTR 492
-#define _STORE_ATTR_INSTANCE_VALUE 493
-#define _STORE_ATTR_SLOT 494
-#define _STORE_ATTR_WITH_HINT 495
+#define _START_EXECUTOR 494
+#define _STORE_ATTR 495
+#define _STORE_ATTR_INSTANCE_VALUE 496
+#define _STORE_ATTR_SLOT 497
+#define _STORE_ATTR_WITH_HINT 498
#define _STORE_DEREF STORE_DEREF
-#define _STORE_FAST 496
-#define _STORE_FAST_0 497
-#define _STORE_FAST_1 498
-#define _STORE_FAST_2 499
-#define _STORE_FAST_3 500
-#define _STORE_FAST_4 501
-#define _STORE_FAST_5 502
-#define _STORE_FAST_6 503
-#define _STORE_FAST_7 504
+#define _STORE_FAST 499
+#define _STORE_FAST_0 500
+#define _STORE_FAST_1 501
+#define _STORE_FAST_2 502
+#define _STORE_FAST_3 503
+#define _STORE_FAST_4 504
+#define _STORE_FAST_5 505
+#define _STORE_FAST_6 506
+#define _STORE_FAST_7 507
#define _STORE_FAST_LOAD_FAST STORE_FAST_LOAD_FAST
#define _STORE_FAST_STORE_FAST STORE_FAST_STORE_FAST
#define _STORE_GLOBAL STORE_GLOBAL
#define _STORE_NAME STORE_NAME
-#define _STORE_SLICE 505
-#define _STORE_SUBSCR 506
-#define _STORE_SUBSCR_DICT 507
-#define _STORE_SUBSCR_LIST_INT 508
+#define _STORE_SLICE 508
+#define _STORE_SUBSCR 509
+#define _STORE_SUBSCR_DICT 510
+#define _STORE_SUBSCR_LIST_INT 511
#define _SWAP SWAP
-#define _TIER2_RESUME_CHECK 509
-#define _TO_BOOL 510
+#define _TIER2_RESUME_CHECK 512
+#define _TO_BOOL 513
#define _TO_BOOL_BOOL TO_BOOL_BOOL
#define _TO_BOOL_INT TO_BOOL_INT
-#define _TO_BOOL_LIST 511
+#define _TO_BOOL_LIST 514
#define _TO_BOOL_NONE TO_BOOL_NONE
-#define _TO_BOOL_STR 512
+#define _TO_BOOL_STR 515
#define _UNARY_INVERT UNARY_INVERT
#define _UNARY_NEGATIVE UNARY_NEGATIVE
#define _UNARY_NOT UNARY_NOT
#define _UNPACK_EX UNPACK_EX
-#define _UNPACK_SEQUENCE 513
-#define _UNPACK_SEQUENCE_LIST 514
-#define _UNPACK_SEQUENCE_TUPLE 515
-#define _UNPACK_SEQUENCE_TWO_TUPLE 516
+#define _UNPACK_SEQUENCE 516
+#define _UNPACK_SEQUENCE_LIST 517
+#define _UNPACK_SEQUENCE_TUPLE 518
+#define _UNPACK_SEQUENCE_TWO_TUPLE 519
#define _WITH_EXCEPT_START WITH_EXCEPT_START
#define _YIELD_VALUE YIELD_VALUE
-#define MAX_UOP_ID 516
+#define MAX_UOP_ID 519
#ifdef __cplusplus
}
diff --git a/Include/internal/pycore_uop_metadata.h b/Include/internal/pycore_uop_metadata.h
index 912b1e56692..88a2e538447 100644
--- a/Include/internal/pycore_uop_metadata.h
+++ b/Include/internal/pycore_uop_metadata.h
@@ -247,6 +247,7 @@ const uint16_t _PyUop_Flags[MAX_UOP_ID+1] = {
[_INIT_CALL_PY_EXACT_ARGS] = HAS_ARG_FLAG | HAS_PURE_FLAG,
[_PUSH_FRAME] = 0,
[_GUARD_NOS_NULL] = HAS_DEOPT_FLAG,
+ [_GUARD_THIRD_NULL] = HAS_DEOPT_FLAG,
[_GUARD_CALLABLE_TYPE_1] = HAS_DEOPT_FLAG,
[_CALL_TYPE_1] = HAS_ARG_FLAG | HAS_ESCAPES_FLAG,
[_GUARD_CALLABLE_STR_1] = HAS_DEOPT_FLAG,
@@ -262,7 +263,8 @@ const uint16_t _PyUop_Flags[MAX_UOP_ID+1] = {
[_CALL_BUILTIN_FAST_WITH_KEYWORDS] = HAS_ARG_FLAG | HAS_DEOPT_FLAG | HAS_ERROR_FLAG | HAS_ESCAPES_FLAG,
[_GUARD_CALLABLE_LEN] = HAS_DEOPT_FLAG,
[_CALL_LEN] = HAS_ERROR_FLAG | HAS_ERROR_NO_POP_FLAG | HAS_ESCAPES_FLAG,
- [_CALL_ISINSTANCE] = HAS_ARG_FLAG | HAS_DEOPT_FLAG | HAS_ERROR_FLAG | HAS_ERROR_NO_POP_FLAG | HAS_ESCAPES_FLAG,
+ [_GUARD_CALLABLE_ISINSTANCE] = HAS_DEOPT_FLAG,
+ [_CALL_ISINSTANCE] = HAS_ERROR_FLAG | HAS_ERROR_NO_POP_FLAG | HAS_ESCAPES_FLAG,
[_CALL_LIST_APPEND] = HAS_ARG_FLAG | HAS_DEOPT_FLAG | HAS_ERROR_FLAG | HAS_ESCAPES_FLAG,
[_CALL_METHOD_DESCRIPTOR_O] = HAS_ARG_FLAG | HAS_EXIT_FLAG | HAS_ERROR_FLAG | HAS_ESCAPES_FLAG,
[_CALL_METHOD_DESCRIPTOR_FAST_WITH_KEYWORDS] = HAS_ARG_FLAG | HAS_EXIT_FLAG | HAS_ERROR_FLAG | HAS_ESCAPES_FLAG,
@@ -425,6 +427,7 @@ const char *const _PyOpcode_uop_name[MAX_UOP_ID+1] = {
[_GET_LEN] = "_GET_LEN",
[_GET_YIELD_FROM_ITER] = "_GET_YIELD_FROM_ITER",
[_GUARD_BINARY_OP_EXTEND] = "_GUARD_BINARY_OP_EXTEND",
+ [_GUARD_CALLABLE_ISINSTANCE] = "_GUARD_CALLABLE_ISINSTANCE",
[_GUARD_CALLABLE_LEN] = "_GUARD_CALLABLE_LEN",
[_GUARD_CALLABLE_STR_1] = "_GUARD_CALLABLE_STR_1",
[_GUARD_CALLABLE_TUPLE_1] = "_GUARD_CALLABLE_TUPLE_1",
@@ -447,6 +450,7 @@ const char *const _PyOpcode_uop_name[MAX_UOP_ID+1] = {
[_GUARD_NOT_EXHAUSTED_LIST] = "_GUARD_NOT_EXHAUSTED_LIST",
[_GUARD_NOT_EXHAUSTED_RANGE] = "_GUARD_NOT_EXHAUSTED_RANGE",
[_GUARD_NOT_EXHAUSTED_TUPLE] = "_GUARD_NOT_EXHAUSTED_TUPLE",
+ [_GUARD_THIRD_NULL] = "_GUARD_THIRD_NULL",
[_GUARD_TOS_ANY_SET] = "_GUARD_TOS_ANY_SET",
[_GUARD_TOS_DICT] = "_GUARD_TOS_DICT",
[_GUARD_TOS_FLOAT] = "_GUARD_TOS_FLOAT",
@@ -1068,6 +1072,8 @@ int _PyUop_num_popped(int opcode, int oparg)
return 1;
case _GUARD_NOS_NULL:
return 0;
+ case _GUARD_THIRD_NULL:
+ return 0;
case _GUARD_CALLABLE_TYPE_1:
return 0;
case _CALL_TYPE_1:
@@ -1098,8 +1104,10 @@ int _PyUop_num_popped(int opcode, int oparg)
return 0;
case _CALL_LEN:
return 3;
+ case _GUARD_CALLABLE_ISINSTANCE:
+ return 0;
case _CALL_ISINSTANCE:
- return 2 + oparg;
+ return 4;
case _CALL_LIST_APPEND:
return 3;
case _CALL_METHOD_DESCRIPTOR_O: