Skip to content

Commit 91e6eae

Browse files
committed
Address review comments
1 parent afb911b commit 91e6eae

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

Include/internal/pycore_optimizer.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -273,12 +273,14 @@ PyJitRef_IsBorrowed(JitOptRef ref)
273273
}
274274

275275
struct _Py_UOpsAbstractFrame {
276+
bool builtins_watched;
277+
// Has the globals dict of this frame been watched?
278+
bool globals_watched;
279+
// The version number of the globals dicts, once checked. 0 if unchecked.
280+
uint32_t globals_checked_version;
276281
// Max stacklen
277282
int stack_len;
278283
int locals_len;
279-
uint32_t globals_checked_version;
280-
bool builtins_watched;
281-
bool globals_watched;
282284
PyFunctionObject *func;
283285

284286
JitOptRef *stack_pointer;

Python/optimizer_bytecodes.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1254,8 +1254,7 @@ dummy_func(void) {
12541254
ctx->frame->globals_checked_version = version;
12551255
}
12561256

1257-
op(_LOAD_GLOBAL_BUILTINS, (version/1, index/1 -- res))
1258-
{
1257+
op(_LOAD_GLOBAL_BUILTINS, (version/1, index/1 -- res)) {
12591258
(void)version;
12601259
(void)index;
12611260
PyObject *cnst = NULL;
@@ -1278,15 +1277,14 @@ dummy_func(void) {
12781277
}
12791278
}
12801279
if (cnst == NULL) {
1281-
res = sym_new_unknown(ctx);
1280+
res = sym_new_not_null(ctx);
12821281
}
12831282
else {
12841283
res = sym_new_const(ctx, cnst);
12851284
}
12861285
}
12871286

1288-
op(_LOAD_GLOBAL_MODULE, (version/1, unused/1, index/1 -- res))
1289-
{
1287+
op(_LOAD_GLOBAL_MODULE, (version/1, unused/1, index/1 -- res)) {
12901288
(void)index;
12911289
PyObject *cnst = NULL;
12921290
if (ctx->frame->func != NULL) {
@@ -1314,7 +1312,7 @@ dummy_func(void) {
13141312
}
13151313
}
13161314
if (cnst == NULL) {
1317-
res = sym_new_unknown(ctx);
1315+
res = sym_new_not_null(ctx);
13181316
}
13191317
else {
13201318
res = sym_new_const(ctx, cnst);

Python/optimizer_cases.c.h

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)