Skip to content

Commit 8b0342d

Browse files
not a fix
1 parent b343a84 commit 8b0342d

File tree

2 files changed

+13
-19
lines changed

2 files changed

+13
-19
lines changed

Python/optimizer_bytecodes.c

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -88,23 +88,18 @@ dummy_func(void) {
8888
op(_LOAD_FAST, (-- value)) {
8989
value = GETLOCAL(oparg);
9090
PyObject *const_val = sym_get_const(ctx, value);
91-
PyCodeObject *co = get_current_code_object(ctx);
92-
// We don't reason about free variables yet, so we need to forbid
93-
// anything with those.
94-
if (const_val != NULL && co->co_nfreevars == 0) {
91+
if (const_val != NULL) {
9592
// It's safe to always borrow here, for
96-
// the same reason as _LOAD_CONST.
93+
// the same reason as _LOAD_CONST..
94+
value = PyJitRef_Borrow(value);
9795
REPLACE_OP(this_instr, _LOAD_CONST_INLINE_BORROW, 0, (uintptr_t)const_val);
9896
}
9997
}
10098

10199
op(_LOAD_FAST_BORROW, (-- value)) {
102100
value = PyJitRef_Borrow(GETLOCAL(oparg));
103101
PyObject *const_val = sym_get_const(ctx, value);
104-
PyCodeObject *co = get_current_code_object(ctx);
105-
// We don't reason about free variables yet, so we need to forbid
106-
// anything with those.
107-
if (const_val != NULL && co->co_nfreevars == 0) {
102+
if (const_val != NULL) {
108103
// It's safe to always borrow here, because
109104
// _LOAD_FAST_BORROW guarantees it.
110105
REPLACE_OP(this_instr, _LOAD_CONST_INLINE_BORROW, 0, (uintptr_t)const_val);
@@ -128,7 +123,7 @@ dummy_func(void) {
128123
}
129124

130125
op(_STORE_FAST, (value --)) {
131-
GETLOCAL(oparg) = value;
126+
GETLOCAL(oparg) = PyJitRef_StripReferenceInfo(value);
132127
}
133128

134129
op(_STORE_SUBSCR_LIST_INT, (value, list_st, sub_st -- ls, ss)) {

Python/optimizer_cases.c.h

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

0 commit comments

Comments
 (0)