diff options
author | Brandt Bucher <brandtbucher@microsoft.com> | 2023-07-20 20:37:19 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-20 20:37:19 (GMT) |
commit | 8f4de57699446f2e0964dffc6639f8156e56c4b3 (patch) | |
tree | fcf911d2f675037129618355ebf036618aa20bc7 /Python/ceval_macros.h | |
parent | 9c81fc2dbee3ac8a2f30ad24b0876d80628a94ac (diff) | |
download | cpython-8f4de57699446f2e0964dffc6639f8156e56c4b3.zip cpython-8f4de57699446f2e0964dffc6639f8156e56c4b3.tar.gz cpython-8f4de57699446f2e0964dffc6639f8156e56c4b3.tar.bz2 |
GH-106701: Move _PyUopExecute to Python/executor.c (GH-106924)
Diffstat (limited to 'Python/ceval_macros.h')
-rw-r--r-- | Python/ceval_macros.h | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/Python/ceval_macros.h b/Python/ceval_macros.h index c2c3233..8dc8b75 100644 --- a/Python/ceval_macros.h +++ b/Python/ceval_macros.h @@ -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 |