GH-106701: Move _PyUopExecute to Python/executor.c (GH-106924)

This commit is contained in:
Brandt Bucher 2023-07-20 13:37:19 -07:00 committed by GitHub
parent 9c81fc2dbe
commit 8f4de57699
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 276 additions and 247 deletions

View file

@ -1,4 +1,4 @@
// Macros and other things needed by ceval.c and bytecodes.c
// Macros and other things needed by ceval.c, executor.c, and bytecodes.c
/* Computed GOTOs, or
the-optimization-commonly-but-improperly-known-as-"threaded code"
@ -304,6 +304,11 @@ GETITEM(PyObject *v, Py_ssize_t i) {
(COUNTER) += (1 << ADAPTIVE_BACKOFF_BITS); \
} while (0);
#define UNBOUNDLOCAL_ERROR_MSG \
"cannot access local variable '%s' where it is not associated with a value"
#define UNBOUNDFREE_ERROR_MSG \
"cannot access free variable '%s' where it is not associated with a value" \
" in enclosing scope"
#define NAME_ERROR_MSG "name '%.200s' is not defined"
#define KWNAMES_LEN() \
@ -352,3 +357,10 @@ static const convertion_func_ptr CONVERSION_FUNCTIONS[4] = {
};
#define ASSERT_KWNAMES_IS_NULL() assert(kwnames == NULL)
// GH-89279: Force inlining by using a macro.
#if defined(_MSC_VER) && SIZEOF_INT == 4
#define _Py_atomic_load_relaxed_int32(ATOMIC_VAL) (assert(sizeof((ATOMIC_VAL)->_value) == 4), *((volatile int*)&((ATOMIC_VAL)->_value)))
#else
#define _Py_atomic_load_relaxed_int32(ATOMIC_VAL) _Py_atomic_load_relaxed(ATOMIC_VAL)
#endif