summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorEric Snow <ericsnowcurrently@gmail.com>2019-03-01 20:15:45 (GMT)
committerGitHub <noreply@github.com>2019-03-01 20:15:45 (GMT)
commitbda918bf65a88560ec453aaba0758a9c0d49b449 (patch)
tree592c17a6c4c8e6745f5b15a89e0f8eeee66381b4 /Python
parentb05b711a2cef6c6c381e01069dedac372e0b9fb2 (diff)
downloadcpython-bda918bf65a88560ec453aaba0758a9c0d49b449.zip
cpython-bda918bf65a88560ec453aaba0758a9c0d49b449.tar.gz
cpython-bda918bf65a88560ec453aaba0758a9c0d49b449.tar.bz2
bpo-33608: Simplify ceval's DISPATCH by hoisting eval_breaker ahead of time. (gh-12062)
This includes fixes to various _Py_atomic_* macros.
Diffstat (limited to 'Python')
-rw-r--r--Python/ceval.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/Python/ceval.c b/Python/ceval.c
index 68c1617..be75ade 100644
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -637,6 +637,7 @@ _PyEval_EvalFrameDefault(PyFrameObject *f, int throwflag)
PyObject **fastlocals, **freevars;
PyObject *retval = NULL; /* Return value */
PyThreadState *tstate = _PyThreadState_GET();
+ _Py_atomic_int *eval_breaker = &tstate->interp->ceval.eval_breaker;
PyCodeObject *co;
/* when tracing we set things up so that
@@ -722,7 +723,7 @@ _PyEval_EvalFrameDefault(PyFrameObject *f, int throwflag)
#define DISPATCH() \
{ \
- if (!_Py_atomic_load_relaxed(&tstate->interp->ceval.eval_breaker)) { \
+ if (!_Py_atomic_load_relaxed(eval_breaker)) { \
FAST_DISPATCH(); \
} \
continue; \
@@ -1024,7 +1025,7 @@ main_loop:
async I/O handler); see Py_AddPendingCall() and
Py_MakePendingCalls() above. */
- if (_Py_atomic_load_relaxed(&(tstate->interp->ceval.eval_breaker))) {
+ if (_Py_atomic_load_relaxed(eval_breaker)) {
opcode = _Py_OPCODE(*next_instr);
if (opcode == SETUP_FINALLY ||
opcode == SETUP_WITH ||