summaryrefslogtreecommitdiffstats
path: root/Python/sysmodule.c
diff options
context:
space:
mode:
authorMark Shannon <mark@hotpy.org>2021-06-07 17:38:06 (GMT)
committerGitHub <noreply@github.com>2021-06-07 17:38:06 (GMT)
commit001eb520b5757294dc455c900d94b7b153de6cdd (patch)
treec9d3a3d36e860a9a0591ce6d7d758201e72c2230 /Python/sysmodule.c
parent89e50ab36fac6a0e7f1998501f36fcd2872a6604 (diff)
downloadcpython-001eb520b5757294dc455c900d94b7b153de6cdd.zip
cpython-001eb520b5757294dc455c900d94b7b153de6cdd.tar.gz
cpython-001eb520b5757294dc455c900d94b7b153de6cdd.tar.bz2
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.
Diffstat (limited to 'Python/sysmodule.c')
-rw-r--r--Python/sysmodule.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/Python/sysmodule.c b/Python/sysmodule.c
index f1f4492..b71a096 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,9 +1764,21 @@ 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
Return the number of memory blocks currently allocated.
@@ -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