diff options
author | Eric Snow <ericsnowcurrently@gmail.com> | 2019-03-09 00:25:54 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-03-09 00:25:54 (GMT) |
commit | 7bda9de5504382931822baecba7f85028031c2cd (patch) | |
tree | 01675dcb9aa24ba569ab5d4863b8c55f3be32f87 /Python/ceval.c | |
parent | d5a70c6b0355f247931f6be80b78a0ff1869c56f (diff) | |
download | cpython-7bda9de5504382931822baecba7f85028031c2cd.zip cpython-7bda9de5504382931822baecba7f85028031c2cd.tar.gz cpython-7bda9de5504382931822baecba7f85028031c2cd.tar.bz2 |
Simplify DISPATCH by hoisting eval_breaker ahead of time. (gh-12243)
Diffstat (limited to 'Python/ceval.c')
-rw-r--r-- | Python/ceval.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Python/ceval.c b/Python/ceval.c index b311248..ab6a5e0 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -602,6 +602,7 @@ _PyEval_EvalFrameDefault(PyFrameObject *f, int throwflag) PyObject **fastlocals, **freevars; PyObject *retval = NULL; /* Return value */ PyThreadState *tstate = _PyThreadState_GET(); + _Py_atomic_int *eval_breaker = &_PyRuntime.ceval.eval_breaker; PyCodeObject *co; /* when tracing we set things up so that @@ -687,7 +688,7 @@ _PyEval_EvalFrameDefault(PyFrameObject *f, int throwflag) #define DISPATCH() \ { \ - if (!_Py_atomic_load_relaxed(&_PyRuntime.ceval.eval_breaker)) { \ + if (!_Py_atomic_load_relaxed(eval_breaker)) { \ FAST_DISPATCH(); \ } \ continue; \ @@ -989,7 +990,7 @@ main_loop: async I/O handler); see Py_AddPendingCall() and Py_MakePendingCalls() above. */ - if (_Py_atomic_load_relaxed(&_PyRuntime.ceval.eval_breaker)) { + if (_Py_atomic_load_relaxed(eval_breaker)) { opcode = _Py_OPCODE(*next_instr); if (opcode == SETUP_FINALLY || opcode == SETUP_WITH || |