From 514f76bbac386c320a9f3a70797241c612544391 Mon Sep 17 00:00:00 2001 From: Mark Shannon Date: Thu, 8 Jul 2021 13:33:13 +0100 Subject: bpo-44581: Don't execute quickened instructions if tracing is on (GH-27064) --- Python/ceval.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Python/ceval.c b/Python/ceval.c index 194572a..611a39d 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -1623,7 +1623,7 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, PyFrameObject *f, int throwflag) JUMPTO(f->f_lasti); stack_pointer = f->f_valuestack+f->f_stackdepth; f->f_stackdepth = -1; - NEXTOPARG(); + TRACING_NEXTOPARG(); } } @@ -2853,6 +2853,7 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, PyFrameObject *f, int throwflag) } case TARGET(LOAD_GLOBAL_ADAPTIVE): { + assert(cframe.use_tracing == 0); SpecializedCacheEntry *cache = GET_CACHE(); if (cache->adaptive.counter == 0) { PyObject *name = GETITEM(names, cache->adaptive.original_oparg); @@ -2871,6 +2872,7 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, PyFrameObject *f, int throwflag) } case TARGET(LOAD_GLOBAL_MODULE): { + assert(cframe.use_tracing == 0); DEOPT_IF(!PyDict_CheckExact(GLOBALS()), LOAD_GLOBAL); PyDictObject *dict = (PyDictObject *)GLOBALS(); SpecializedCacheEntry *caches = GET_CACHE(); @@ -2888,6 +2890,7 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, PyFrameObject *f, int throwflag) } case TARGET(LOAD_GLOBAL_BUILTIN): { + assert(cframe.use_tracing == 0); DEOPT_IF(!PyDict_CheckExact(GLOBALS()), LOAD_GLOBAL); DEOPT_IF(!PyDict_CheckExact(BUILTINS()), LOAD_GLOBAL); PyDictObject *mdict = (PyDictObject *)GLOBALS(); @@ -3286,6 +3289,7 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, PyFrameObject *f, int throwflag) } case TARGET(LOAD_ATTR_ADAPTIVE): { + assert(cframe.use_tracing == 0); SpecializedCacheEntry *cache = GET_CACHE(); if (cache->adaptive.counter == 0) { PyObject *owner = TOP(); @@ -3305,6 +3309,7 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, PyFrameObject *f, int throwflag) } case TARGET(LOAD_ATTR_SPLIT_KEYS): { + assert(cframe.use_tracing == 0); PyObject *owner = TOP(); PyObject *res; PyTypeObject *tp = Py_TYPE(owner); @@ -3329,6 +3334,7 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, PyFrameObject *f, int throwflag) } case TARGET(LOAD_ATTR_MODULE): { + assert(cframe.use_tracing == 0); PyObject *owner = TOP(); PyObject *res; SpecializedCacheEntry *caches = GET_CACHE(); @@ -3352,6 +3358,7 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, PyFrameObject *f, int throwflag) } case TARGET(LOAD_ATTR_WITH_HINT): { + assert(cframe.use_tracing == 0); PyObject *owner = TOP(); PyObject *res; PyTypeObject *tp = Py_TYPE(owner); @@ -3380,6 +3387,7 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, PyFrameObject *f, int throwflag) } case TARGET(LOAD_ATTR_SLOT): { + assert(cframe.use_tracing == 0); PyObject *owner = TOP(); PyObject *res; PyTypeObject *tp = Py_TYPE(owner); -- cgit v0.12