bpo-46841: Use inline caching for calls (GH-31709)

This commit is contained in:
Brandt Bucher 2022-03-07 11:45:00 -08:00 committed by GitHub
parent 105b9ac001
commit f193631387
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 494 additions and 735 deletions

View file

@ -1571,10 +1571,7 @@ code_sizeof(PyCodeObject *co, PyObject *Py_UNUSED(args))
}
if (co->co_quickened != NULL) {
Py_ssize_t count = co->co_quickened[0].entry.zero.cache_count;
count += (PyBytes_GET_SIZE(co->co_code)+sizeof(SpecializedCacheEntry)-1)/
sizeof(SpecializedCacheEntry);
res += count * sizeof(SpecializedCacheEntry);
res += PyBytes_GET_SIZE(co->co_code);
}
return PyLong_FromSsize_t(res);