Skip to content

Commit 9078a02

Browse files
Simplify DISPATCH by hoisting eval_breaker ahead of time.
1 parent 3b0abb0 commit 9078a02

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Python/ceval.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -637,6 +637,7 @@ _PyEval_EvalFrameDefault(PyFrameObject *f, int throwflag)
637637
PyObject **fastlocals, **freevars;
638638
PyObject *retval = NULL; /* Return value */
639639
PyThreadState *tstate = _PyThreadState_GET();
640+
_Py_atomic_int *eval_breaker = &tstate->interp->ceval.eval_breaker;
640641
PyCodeObject *co;
641642

642643
/* when tracing we set things up so that
@@ -722,7 +723,7 @@ _PyEval_EvalFrameDefault(PyFrameObject *f, int throwflag)
722723

723724
#define DISPATCH() \
724725
{ \
725-
if (!_Py_atomic_load_relaxed(&tstate->interp->ceval.eval_breaker)) { \
726+
if (!_Py_atomic_load_relaxed(eval_breaker)) { \
726727
FAST_DISPATCH(); \
727728
} \
728729
continue; \
@@ -1024,7 +1025,7 @@ _PyEval_EvalFrameDefault(PyFrameObject *f, int throwflag)
10241025
async I/O handler); see Py_AddPendingCall() and
10251026
Py_MakePendingCalls() above. */
10261027

1027-
if (_Py_atomic_load_relaxed(&(tstate->interp->ceval.eval_breaker))) {
1028+
if (_Py_atomic_load_relaxed(eval_breaker)) {
10281029
opcode = _Py_OPCODE(*next_instr);
10291030
if (opcode == SETUP_FINALLY ||
10301031
opcode == SETUP_WITH ||

0 commit comments

Comments
 (0)