mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
Move big block of macros out of function to improve readability. (GH-25020)
This commit is contained in:
parent
b045cdaf34
commit
d41bdddbed
1 changed files with 40 additions and 38 deletions
|
@ -1231,40 +1231,6 @@ eval_frame_handle_pending(PyThreadState *tstate)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
PyObject* _Py_HOT_FUNCTION
|
|
||||||
_PyEval_EvalFrameDefault(PyThreadState *tstate, PyFrameObject *f, int throwflag)
|
|
||||||
{
|
|
||||||
_Py_EnsureTstateNotNULL(tstate);
|
|
||||||
|
|
||||||
#ifdef DXPAIRS
|
|
||||||
int lastopcode = 0;
|
|
||||||
#endif
|
|
||||||
PyObject **stack_pointer; /* Next free slot in value stack */
|
|
||||||
const _Py_CODEUNIT *next_instr;
|
|
||||||
int opcode; /* Current opcode */
|
|
||||||
int oparg; /* Current opcode argument, if any */
|
|
||||||
PyObject **fastlocals, **freevars;
|
|
||||||
PyObject *retval = NULL; /* Return value */
|
|
||||||
struct _ceval_state * const ceval2 = &tstate->interp->ceval;
|
|
||||||
_Py_atomic_int * const eval_breaker = &ceval2->eval_breaker;
|
|
||||||
PyCodeObject *co;
|
|
||||||
|
|
||||||
/* when tracing we set things up so that
|
|
||||||
|
|
||||||
not (instr_lb <= current_bytecode_offset < instr_ub)
|
|
||||||
|
|
||||||
is true when the line being executed has changed. The
|
|
||||||
initial values are such as to make this false the first
|
|
||||||
time it is tested. */
|
|
||||||
|
|
||||||
const _Py_CODEUNIT *first_instr;
|
|
||||||
PyObject *names;
|
|
||||||
PyObject *consts;
|
|
||||||
_PyOpcache *co_opcache;
|
|
||||||
|
|
||||||
#ifdef LLTRACE
|
|
||||||
_Py_IDENTIFIER(__ltrace__);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Computed GOTOs, or
|
/* Computed GOTOs, or
|
||||||
the-optimization-commonly-but-improperly-known-as-"threaded code"
|
the-optimization-commonly-but-improperly-known-as-"threaded code"
|
||||||
|
@ -1323,9 +1289,6 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, PyFrameObject *f, int throwflag)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if USE_COMPUTED_GOTOS
|
#if USE_COMPUTED_GOTOS
|
||||||
/* Import the static jump table */
|
|
||||||
#include "opcode_targets.h"
|
|
||||||
|
|
||||||
#define TARGET(op) \
|
#define TARGET(op) \
|
||||||
op: \
|
op: \
|
||||||
TARGET_##op
|
TARGET_##op
|
||||||
|
@ -1619,7 +1582,46 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, PyFrameObject *f, int throwflag)
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Start of code */
|
|
||||||
|
PyObject* _Py_HOT_FUNCTION
|
||||||
|
_PyEval_EvalFrameDefault(PyThreadState *tstate, PyFrameObject *f, int throwflag)
|
||||||
|
{
|
||||||
|
_Py_EnsureTstateNotNULL(tstate);
|
||||||
|
|
||||||
|
#if USE_COMPUTED_GOTOS
|
||||||
|
/* Import the static jump table */
|
||||||
|
#include "opcode_targets.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef DXPAIRS
|
||||||
|
int lastopcode = 0;
|
||||||
|
#endif
|
||||||
|
PyObject **stack_pointer; /* Next free slot in value stack */
|
||||||
|
const _Py_CODEUNIT *next_instr;
|
||||||
|
int opcode; /* Current opcode */
|
||||||
|
int oparg; /* Current opcode argument, if any */
|
||||||
|
PyObject **fastlocals, **freevars;
|
||||||
|
PyObject *retval = NULL; /* Return value */
|
||||||
|
struct _ceval_state * const ceval2 = &tstate->interp->ceval;
|
||||||
|
_Py_atomic_int * const eval_breaker = &ceval2->eval_breaker;
|
||||||
|
PyCodeObject *co;
|
||||||
|
|
||||||
|
/* when tracing we set things up so that
|
||||||
|
|
||||||
|
not (instr_lb <= current_bytecode_offset < instr_ub)
|
||||||
|
|
||||||
|
is true when the line being executed has changed. The
|
||||||
|
initial values are such as to make this false the first
|
||||||
|
time it is tested. */
|
||||||
|
|
||||||
|
const _Py_CODEUNIT *first_instr;
|
||||||
|
PyObject *names;
|
||||||
|
PyObject *consts;
|
||||||
|
_PyOpcache *co_opcache;
|
||||||
|
|
||||||
|
#ifdef LLTRACE
|
||||||
|
_Py_IDENTIFIER(__ltrace__);
|
||||||
|
#endif
|
||||||
|
|
||||||
if (_Py_EnterRecursiveCall(tstate, "")) {
|
if (_Py_EnterRecursiveCall(tstate, "")) {
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue