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

@ -958,9 +958,11 @@ class PyFramePtr:
if self.is_optimized_out():
return
obj_ptr_ptr = gdb.lookup_type("PyObject").pointer().pointer()
base = self._gdbval.cast(obj_ptr_ptr)
localsplus = base - self._f_nlocalsplus()
localsplus = self._gdbval["localsplus"].cast(obj_ptr_ptr)
for i in safe_range(self.co_nlocals):
pyop_value = PyObjectPtr.from_pyobject_ptr(localsplus[i])
if pyop_value.is_null():