diff options
author | Brandt Bucher <brandtbucher@microsoft.com> | 2022-03-07 19:45:00 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-07 19:45:00 (GMT) |
commit | f193631387bfee99a812e39b05d5b7e6384b57f5 (patch) | |
tree | 31f161bd1e2f6469f32be8333705c82992486485 /Python/pylifecycle.c | |
parent | 105b9ac00174d7bcc653f9e9dc5052215e197c77 (diff) | |
download | cpython-f193631387bfee99a812e39b05d5b7e6384b57f5.zip cpython-f193631387bfee99a812e39b05d5b7e6384b57f5.tar.gz cpython-f193631387bfee99a812e39b05d5b7e6384b57f5.tar.bz2 |
bpo-46841: Use inline caching for calls (GH-31709)
Diffstat (limited to 'Python/pylifecycle.c')
-rw-r--r-- | Python/pylifecycle.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Python/pylifecycle.c b/Python/pylifecycle.c index 9228778..8abd536 100644 --- a/Python/pylifecycle.c +++ b/Python/pylifecycle.c @@ -774,6 +774,16 @@ pycore_init_builtins(PyThreadState *tstate) Py_INCREF(builtins_dict); interp->builtins = builtins_dict; + PyObject *isinstance = PyDict_GetItem(builtins_dict, &_Py_ID(isinstance)); + assert(isinstance); + interp->callable_cache.isinstance = isinstance; + PyObject *len = PyDict_GetItem(builtins_dict, &_Py_ID(len)); + assert(len); + interp->callable_cache.len = len; + PyObject *list_append = _PyType_Lookup(&PyList_Type, &_Py_ID(append)); + assert(list_append); + interp->callable_cache.list_append = list_append; + if (_PyBuiltins_AddExceptions(bimod) < 0) { return _PyStatus_ERR("failed to add exceptions to builtins"); } |