@@ -638,11 +638,17 @@ Py_MakePendingCalls(void)
638
638
int _Py_CheckRecursionLimit = Py_DEFAULT_RECURSION_LIMIT ;
639
639
640
640
void
641
- _PyEval_Initialize (struct _ceval_runtime_state * state )
641
+ _PyEval_InitRuntimeState (struct _ceval_runtime_state * ceval )
642
642
{
643
- state -> recursion_limit = Py_DEFAULT_RECURSION_LIMIT ;
643
+ ceval -> recursion_limit = Py_DEFAULT_RECURSION_LIMIT ;
644
644
_Py_CheckRecursionLimit = Py_DEFAULT_RECURSION_LIMIT ;
645
- _gil_initialize (& state -> gil );
645
+ _gil_initialize (& ceval -> gil );
646
+ }
647
+
648
+ void
649
+ _PyEval_InitState (struct _ceval_state * ceval )
650
+ {
651
+ /* PyInterpreterState_New() initializes ceval to zero */
646
652
}
647
653
648
654
int
@@ -657,7 +663,7 @@ Py_SetRecursionLimit(int new_limit)
657
663
{
658
664
struct _ceval_runtime_state * ceval = & _PyRuntime .ceval ;
659
665
ceval -> recursion_limit = new_limit ;
660
- _Py_CheckRecursionLimit = ceval -> recursion_limit ;
666
+ _Py_CheckRecursionLimit = new_limit ;
661
667
}
662
668
663
669
/* The function _Py_EnterRecursiveCall() only calls _Py_CheckRecursiveCall()
@@ -753,6 +759,7 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, PyFrameObject *f, int throwflag)
753
759
PyObject * retval = NULL ; /* Return value */
754
760
_PyRuntimeState * const runtime = & _PyRuntime ;
755
761
struct _ceval_runtime_state * const ceval = & runtime -> ceval ;
762
+ struct _ceval_state * const ceval2 = & tstate -> interp -> ceval ;
756
763
_Py_atomic_int * const eval_breaker = & ceval -> eval_breaker ;
757
764
PyCodeObject * co ;
758
765
@@ -841,7 +848,7 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, PyFrameObject *f, int throwflag)
841
848
#ifdef LLTRACE
842
849
#define FAST_DISPATCH () \
843
850
{ \
844
- if (!lltrace && !_Py_TracingPossible(ceval ) && !PyDTrace_LINE_ENABLED()) { \
851
+ if (!lltrace && !_Py_TracingPossible(ceval2 ) && !PyDTrace_LINE_ENABLED()) { \
845
852
f->f_lasti = INSTR_OFFSET(); \
846
853
NEXTOPARG(); \
847
854
goto *opcode_targets[opcode]; \
@@ -851,7 +858,7 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, PyFrameObject *f, int throwflag)
851
858
#else
852
859
#define FAST_DISPATCH () \
853
860
{ \
854
- if (!_Py_TracingPossible(ceval ) && !PyDTrace_LINE_ENABLED()) { \
861
+ if (!_Py_TracingPossible(ceval2 ) && !PyDTrace_LINE_ENABLED()) { \
855
862
f->f_lasti = INSTR_OFFSET(); \
856
863
NEXTOPARG(); \
857
864
goto *opcode_targets[opcode]; \
@@ -1268,7 +1275,7 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, PyFrameObject *f, int throwflag)
1268
1275
1269
1276
/* line-by-line tracing support */
1270
1277
1271
- if (_Py_TracingPossible (ceval ) &&
1278
+ if (_Py_TracingPossible (ceval2 ) &&
1272
1279
tstate -> c_tracefunc != NULL && !tstate -> tracing ) {
1273
1280
int err ;
1274
1281
/* see maybe_call_line_trace
@@ -3647,7 +3654,7 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, PyFrameObject *f, int throwflag)
3647
3654
PUSH (val );
3648
3655
PUSH (exc );
3649
3656
JUMPTO (handler );
3650
- if (_Py_TracingPossible (ceval )) {
3657
+ if (_Py_TracingPossible (ceval2 )) {
3651
3658
int needs_new_execution_window = (f -> f_lasti < instr_lb || f -> f_lasti >= instr_ub );
3652
3659
int needs_line_update = (f -> f_lasti == instr_lb || f -> f_lasti < instr_prev );
3653
3660
/* Make sure that we trace line after exception if we are in a new execution
@@ -4639,7 +4646,7 @@ _PyEval_SetTrace(PyThreadState *tstate, Py_tracefunc func, PyObject *arg)
4639
4646
return -1 ;
4640
4647
}
4641
4648
4642
- struct _ceval_runtime_state * ceval = & tstate -> interp -> runtime -> ceval ;
4649
+ struct _ceval_state * ceval = & tstate -> interp -> ceval ;
4643
4650
PyObject * traceobj = tstate -> c_traceobj ;
4644
4651
ceval -> tracing_possible += (func != NULL ) - (tstate -> c_tracefunc != NULL );
4645
4652
0 commit comments