[Python-checkins] GH-100987: Refactor `_PyInterpreterFrame` a bit, to assist generator improvement. (GH-100988)

markshannon webhook-mailer at python.org
Mon Feb 13 06:31:23 EST 2023


https://github.com/python/cpython/commit/d9199175c7386a95aaac91822a2197b9365eb0e8
commit: d9199175c7386a95aaac91822a2197b9365eb0e8
branch: main
author: Mark Shannon <mark at hotpy.org>
committer: markshannon <mark at hotpy.org>
date: 2023-02-13T11:31:15Z
summary:

GH-100987: Refactor `_PyInterpreterFrame` a bit, to assist generator improvement. (GH-100988)

Refactor _PyInterpreterFrame a bit, to assist generator improvement.

files:
M Include/internal/pycore_frame.h

diff --git a/Include/internal/pycore_frame.h b/Include/internal/pycore_frame.h
index f12b225ebfcc..81d16b219c30 100644
--- a/Include/internal/pycore_frame.h
+++ b/Include/internal/pycore_frame.h
@@ -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



More information about the Python-checkins mailing list