From 001eb520b5757294dc455c900d94b7b153de6cdd Mon Sep 17 00:00:00 2001 From: Mark Shannon Date: Mon, 7 Jun 2021 18:38:06 +0100 Subject: bpo-44187: Quickening infrastructure (GH-26264) * Add co_firstinstr field to code object. * Implement barebones quickening. * Use non-quickened bytecode when tracing. * Add NEWS item * Add new file to Windows build. * Don't specialize instructions with EXTENDED_ARG. --- Python/sysmodule.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'Python/sysmodule.c') diff --git a/Python/sysmodule.c b/Python/sysmodule.c index f1f4492f83..b71a096eaa 100644 --- a/Python/sysmodule.c +++ b/Python/sysmodule.c @@ -18,6 +18,7 @@ Data members: #include "pycore_ceval.h" // _Py_RecursionLimitLowerWaterMark() #include "pycore_initconfig.h" // _PyStatus_EXCEPTION() #include "pycore_object.h" // _PyObject_IS_GC() +#include "pycore_code.h" // _Py_QuickenedCount #include "pycore_pathconfig.h" // _PyPathConfig_ComputeSysPath0() #include "pycore_pyerrors.h" // _PyErr_Fetch() #include "pycore_pylifecycle.h" // _PyErr_WriteUnraisableDefaultHook() @@ -1763,8 +1764,20 @@ sys_gettotalrefcount_impl(PyObject *module) { return _Py_GetRefTotal(); } + #endif /* Py_REF_DEBUG */ +/*[clinic input] +sys._getquickenedcount -> Py_ssize_t +[clinic start generated code]*/ + +static Py_ssize_t +sys__getquickenedcount_impl(PyObject *module) +/*[clinic end generated code: output=1ab259e7f91248a2 input=249d448159eca912]*/ +{ + return _Py_QuickenedCount; +} + /*[clinic input] sys.getallocatedblocks -> Py_ssize_t @@ -1995,6 +2008,7 @@ static PyMethodDef sys_methods[] = { #endif SYS_GETFILESYSTEMENCODING_METHODDEF SYS_GETFILESYSTEMENCODEERRORS_METHODDEF + SYS__GETQUICKENEDCOUNT_METHODDEF #ifdef Py_TRACE_REFS {"getobjects", _Py_GetObjects, METH_VARARGS}, #endif -- cgit v1.2.1