diff options
author | Mark Shannon <mark@hotpy.org> | 2024-05-06 21:21:06 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-06 21:21:06 (GMT) |
commit | 616b745b89a52a1d27123107718f85e65918afdc (patch) | |
tree | 3e0c5691ed679c3d0008f87da0e8661077934a6e /Include | |
parent | 00d913c6718aa365027c6dcf850e8f40731e54fc (diff) | |
download | cpython-616b745b89a52a1d27123107718f85e65918afdc.zip cpython-616b745b89a52a1d27123107718f85e65918afdc.tar.gz cpython-616b745b89a52a1d27123107718f85e65918afdc.tar.bz2 |
GH-115709: Invalidate executors when a local variable is changed via frame.f_locals (#118639)
Also fix unrelated assert in debug Tier2/JIT builds.
Diffstat (limited to 'Include')
-rw-r--r-- | Include/cpython/optimizer.h | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/Include/cpython/optimizer.h b/Include/cpython/optimizer.h index 744a272..5f218d7 100644 --- a/Include/cpython/optimizer.h +++ b/Include/cpython/optimizer.h @@ -141,9 +141,6 @@ void _Py_ExecutorDetach(_PyExecutorObject *); void _Py_BloomFilter_Init(_PyBloomFilter *); void _Py_BloomFilter_Add(_PyBloomFilter *bloom, void *obj); PyAPI_FUNC(void) _Py_Executor_DependsOn(_PyExecutorObject *executor, void *obj); -PyAPI_FUNC(void) _Py_Executors_InvalidateDependency(PyInterpreterState *interp, void *obj, int is_invalidation); -PyAPI_FUNC(void) _Py_Executors_InvalidateAll(PyInterpreterState *interp, int is_invalidation); - /* For testing */ PyAPI_FUNC(PyObject *)PyUnstable_Optimizer_NewCounter(void); PyAPI_FUNC(PyObject *)PyUnstable_Optimizer_NewUOpOptimizer(void); @@ -151,6 +148,15 @@ PyAPI_FUNC(PyObject *)PyUnstable_Optimizer_NewUOpOptimizer(void); #define _Py_MAX_ALLOWED_BUILTINS_MODIFICATIONS 3 #define _Py_MAX_ALLOWED_GLOBALS_MODIFICATIONS 6 +#ifdef _Py_TIER2 +PyAPI_FUNC(void) _Py_Executors_InvalidateDependency(PyInterpreterState *interp, void *obj, int is_invalidation); +PyAPI_FUNC(void) _Py_Executors_InvalidateAll(PyInterpreterState *interp, int is_invalidation); +#else +# define _Py_Executors_InvalidateDependency(A, B, C) ((void)0) +# define _Py_Executors_InvalidateAll(A, B) ((void)0) +#endif + + #ifdef __cplusplus } #endif |