mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
bpo-46841: Quicken code in-place (GH-31888)
* Moves the bytecode to the end of the corresponding PyCodeObject, and quickens it in-place. * Removes the almost-always-unused co_varnames, co_freevars, and co_cellvars member caches * _PyOpcode_Deopt is a new mapping from all opcodes to their un-quickened forms. * _PyOpcode_InlineCacheEntries is renamed to _PyOpcode_Caches * _Py_IncrementCountAndMaybeQuicken is renamed to _PyCode_Warmup * _Py_Quicken is renamed to _PyCode_Quicken * _co_quickened is renamed to _co_code_adaptive (and is now a read-only memoryview). * Do not emit unused nonzero opargs anymore in the compiler.
This commit is contained in:
parent
08eb754d84
commit
2bde6827ea
18 changed files with 832 additions and 688 deletions
10
Objects/clinic/codeobject.c.h
generated
10
Objects/clinic/codeobject.c.h
generated
|
@ -203,12 +203,12 @@ code_replace(PyCodeObject *self, PyObject *const *args, Py_ssize_t nargs, PyObje
|
|||
int co_stacksize = self->co_stacksize;
|
||||
int co_flags = self->co_flags;
|
||||
int co_firstlineno = self->co_firstlineno;
|
||||
PyBytesObject *co_code = (PyBytesObject *)self->co_code;
|
||||
PyBytesObject *co_code = NULL;
|
||||
PyObject *co_consts = self->co_consts;
|
||||
PyObject *co_names = self->co_names;
|
||||
PyObject *co_varnames = self->co_varnames;
|
||||
PyObject *co_freevars = self->co_freevars;
|
||||
PyObject *co_cellvars = self->co_cellvars;
|
||||
PyObject *co_varnames = NULL;
|
||||
PyObject *co_freevars = NULL;
|
||||
PyObject *co_cellvars = NULL;
|
||||
PyObject *co_filename = self->co_filename;
|
||||
PyObject *co_name = self->co_name;
|
||||
PyObject *co_qualname = self->co_qualname;
|
||||
|
@ -456,4 +456,4 @@ code__varname_from_oparg(PyCodeObject *self, PyObject *const *args, Py_ssize_t n
|
|||
exit:
|
||||
return return_value;
|
||||
}
|
||||
/*[clinic end generated code: output=9e8c4a19474ec520 input=a9049054013a1b77]*/
|
||||
/*[clinic end generated code: output=b1b83a70ffc5b7cd input=a9049054013a1b77]*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue