mirror of
https://github.com/python/cpython.git
synced 2025-07-07 19:35:27 +00:00
GH-134282: Always borrow references LOAD_CONST (GH-134284)
This commit is contained in:
parent
f695eca60c
commit
6dcb0fdfe0
17 changed files with 87 additions and 327 deletions
|
@ -510,20 +510,6 @@ dummy_func(void) {
|
|||
}
|
||||
|
||||
op(_LOAD_CONST, (-- 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);
|
||||
}
|
||||
|
||||
op(_LOAD_CONST_MORTAL, (-- 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);
|
||||
}
|
||||
|
||||
op(_LOAD_CONST_IMMORTAL, (-- value)) {
|
||||
PyObject *val = PyTuple_GET_ITEM(co->co_consts, this_instr->oparg);
|
||||
REPLACE_OP(this_instr, _LOAD_CONST_INLINE_BORROW, 0, (uintptr_t)val);
|
||||
value = sym_new_const(ctx, val);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue