bpo-44990: Change layout of evaluation frames. "Layout B" (GH-27933)

Places the locals between the specials and stack. This is the more "natural" layout for a C struct, makes the code simpler and gives a slight speedup (~1%)
This commit is contained in:
Mark Shannon 2021-08-25 13:44:20 +01:00 committed by GitHub
parent 214c2e5d91
commit f9242d50b1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 114 additions and 100 deletions

View file

@ -8874,7 +8874,7 @@ super_init_without_args(PyFrameObject *f, PyCodeObject *co,
return -1;
}
assert(f->f_frame->nlocalsplus > 0);
assert(f->f_frame->f_code->co_nlocalsplus > 0);
PyObject *firstarg = _PyFrame_GetLocalsArray(f->f_frame)[0];
// The first argument might be a cell.
if (firstarg != NULL && (_PyLocals_GetKind(co->co_localspluskinds, 0) & CO_FAST_CELL)) {