We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c62e632 commit 9f43a6bCopy full SHA for 9f43a6b
3 files changed
Python/optimizer_analysis.c
@@ -342,10 +342,10 @@ optimize_to_bool(
342
if (truthiness >= 0) {
343
PyObject *load = truthiness ? Py_True : Py_False;
344
if (insert_mode) {
345
- ADD_OP(_INSERT_1_LOAD_CONST_INLINE_BORROW, 0, (uintptr_t)load);
+ ADD_OP(_INSERT_1_LOAD_CONST_INLINE_BORROW, 0, PyStackRef_TagBorrow(load));
346
} else {
347
ADD_OP(_POP_TOP, 0, 0);
348
- ADD_OP(_LOAD_CONST_INLINE_BORROW, 0, (uintptr_t)load);
+ ADD_OP(_LOAD_CONST_INLINE_BORROW, 0, PyStackRef_TagBorrow(load));
349
}
350
*result_ptr = sym_new_const(ctx, load);
351
return 1;
@@ -402,11 +402,11 @@ lookup_attr(JitOptContext *ctx, _PyBloomFilter *dependencies, _PyUOpInstruction
402
if (pop) {
403
404
ADD_OP(immortal ? _LOAD_CONST_INLINE_BORROW : _LOAD_CONST_INLINE,
405
- 0, (uintptr_t)lookup);
+ 0, immortal ? PyStackRef_TagBorrow(lookup) : (uintptr_t)lookup);
406
407
else {
408
ADD_OP(immortal ? _INSERT_1_LOAD_CONST_INLINE_BORROW : _INSERT_1_LOAD_CONST_INLINE,
409
410
411
PyType_Watch(TYPE_WATCHER_ID, (PyObject *)type);
412
_Py_BloomFilter_Add(dependencies, type);
Python/optimizer_cases.c.h
Tools/cases_generator/optimizer_generator.py
@@ -241,20 +241,20 @@ def replace_opcode_if_evaluates_pure(
241
# (a -- res), usually for unary ops
242
0: [("_POP_TOP", "0, 0"),
243
("_LOAD_CONST_INLINE_BORROW",
244
- "0, (uintptr_t)result")],
+ "0, PyStackRef_TagBorrow(result)")],
245
# (left -- res, left)
246
# usually for unary ops with passthrough references
247
1: [("_INSERT_1_LOAD_CONST_INLINE_BORROW",
248
249
},
250
2: {
251
# (a, b -- res), usually for binary ops
252
0: [("_POP_TWO_LOAD_CONST_INLINE_BORROW",
253
254
# (left, right -- res, left, right)
255
# usually for binary ops with passthrough references
256
2: [("_INSERT_2_LOAD_CONST_INLINE_BORROW",
257
258
259
260
0 commit comments