GH-134282: Always borrow references LOAD_CONST (GH-134284)

This commit is contained in:
Mark Shannon 2025-05-20 11:24:11 -04:00 committed by GitHub
parent f695eca60c
commit 6dcb0fdfe0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
17 changed files with 87 additions and 327 deletions

View file

@ -66,21 +66,7 @@
break;
}
/* _LOAD_CONST is not a viable micro-op for tier 2 */
case _LOAD_CONST_MORTAL: {
JitOptSymbol *value;
PyObject *val = PyTuple_GET_ITEM(co->co_consts, this_instr->oparg);
int opcode = _Py_IsImmortal(val) ? _LOAD_CONST_INLINE_BORROW : _LOAD_CONST_INLINE;
REPLACE_OP(this_instr, opcode, 0, (uintptr_t)val);
value = sym_new_const(ctx, val);
stack_pointer[0] = value;
stack_pointer += 1;
assert(WITHIN_STACK_BOUNDS());
break;
}
case _LOAD_CONST_IMMORTAL: {
case _LOAD_CONST: {
JitOptSymbol *value;
PyObject *val = PyTuple_GET_ITEM(co->co_consts, this_instr->oparg);
REPLACE_OP(this_instr, _LOAD_CONST_INLINE_BORROW, 0, (uintptr_t)val);