mirror of
https://github.com/python/cpython.git
synced 2025-07-08 03:45:36 +00:00
GH-128685: Specialize (rather than quicken) LOAD_CONST into LOAD_CONST_[IM]MORTAL (GH-128708)
This commit is contained in:
parent
29fe8072cf
commit
ddd959987c
14 changed files with 121 additions and 65 deletions
|
@ -479,6 +479,13 @@ dummy_func(void) {
|
|||
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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue