]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
GH-100987: Refactor `_PyInterpreterFrame` a bit, to assist generator improvement...
authorMark Shannon <mark@hotpy.org>
Mon, 13 Feb 2023 11:31:15 +0000 (11:31 +0000)
committerGitHub <noreply@github.com>
Mon, 13 Feb 2023 11:31:15 +0000 (11:31 +0000)
Refactor _PyInterpreterFrame a bit, to assist generator improvement.

Include/internal/pycore_frame.h

index f12b225ebfccf24d3676cae3885c66428fd2e854..81d16b219c305bbb972c62a4bc58890f579fed28 100644 (file)
@@ -47,15 +47,13 @@ enum _frameowner {
 };
 
 typedef struct _PyInterpreterFrame {
-    /* "Specials" section */
+    PyCodeObject *f_code; /* Strong reference */
+    struct _PyInterpreterFrame *previous;
     PyObject *f_funcobj; /* Strong reference. Only valid if not on C stack */
     PyObject *f_globals; /* Borrowed reference. Only valid if not on C stack */
     PyObject *f_builtins; /* Borrowed reference. Only valid if not on C stack */
     PyObject *f_locals; /* Strong reference, may be NULL. Only valid if not on C stack */
-    PyCodeObject *f_code; /* Strong reference */
     PyFrameObject *frame_obj; /* Strong reference, may be NULL. Only valid if not on C stack */
-    /* Linkage section */
-    struct _PyInterpreterFrame *previous;
     // NOTE: This is not necessarily the last instruction started in the given
     // frame. Rather, it is the code unit *prior to* the *next* instruction. For
     // example, it may be an inline CACHE entry, an instruction we just jumped