Skip to content

Commit 3b83257

Browse files
authored
GH-138378: Move globals-to-consts pass into main optimizer pass (GH-138379)
1 parent d22b250 commit 3b83257

File tree

12 files changed

+486
-490
lines changed

12 files changed

+486
-490
lines changed

Include/internal/pycore_optimizer.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,9 +250,13 @@ PyJitRef_IsBorrowed(JitOptRef ref)
250250
}
251251

252252
struct _Py_UOpsAbstractFrame {
253+
bool globals_watched;
254+
// The version number of the globals dicts, once checked. 0 if unchecked.
255+
uint32_t globals_checked_version;
253256
// Max stacklen
254257
int stack_len;
255258
int locals_len;
259+
PyFunctionObject *func;
256260

257261
JitOptRef *stack_pointer;
258262
JitOptRef *stack;
@@ -271,6 +275,8 @@ typedef struct _JitOptContext {
271275
char done;
272276
char out_of_space;
273277
bool contradiction;
278+
// Has the builtins dict been watched?
279+
bool builtins_watched;
274280
// The current "executing" frame.
275281
_Py_UOpsAbstractFrame *frame;
276282
_Py_UOpsAbstractFrame frames[MAX_ABSTRACT_FRAME_DEPTH];

0 commit comments

Comments
 (0)