mirror of
https://github.com/python/cpython.git
synced 2026-01-06 23:42:34 +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
16
Python/optimizer_cases.c.h
generated
16
Python/optimizer_cases.c.h
generated
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue