mirror of
https://github.com/python/cpython.git
synced 2025-07-07 19:35:27 +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
|
@ -478,15 +478,6 @@ _PyCode_Quicken(_Py_CODEUNIT *instructions, Py_ssize_t size, PyObject *consts,
|
|||
}
|
||||
i += caches;
|
||||
}
|
||||
else if (opcode == LOAD_CONST) {
|
||||
/* We can't do this in the bytecode compiler as
|
||||
* marshalling can intern strings and make them immortal. */
|
||||
|
||||
PyObject *obj = PyTuple_GET_ITEM(consts, oparg);
|
||||
if (_Py_IsImmortal(obj)) {
|
||||
instructions[i].op.code = LOAD_CONST_IMMORTAL;
|
||||
}
|
||||
}
|
||||
if (opcode != EXTENDED_ARG) {
|
||||
oparg = 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue