mirror of
https://github.com/python/cpython.git
synced 2026-04-14 07:41:00 +00:00
gh-134584: Eliminate redundant refcounting from _LOAD_ATTR_SLOT (GH-143320)
Signed-off-by: Manjusaka <me@manjusaka.me> Co-authored-by: Ken Jin <kenjin4096@gmail.com>
This commit is contained in:
parent
1fb8e0eb51
commit
d00d39f58e
10 changed files with 442 additions and 331 deletions
|
|
@ -2485,7 +2485,7 @@ dummy_func(
|
|||
unused/5 +
|
||||
_PUSH_NULL_CONDITIONAL;
|
||||
|
||||
op(_LOAD_ATTR_SLOT, (index/1, owner -- attr)) {
|
||||
op(_LOAD_ATTR_SLOT, (index/1, owner -- attr, o)) {
|
||||
PyObject *owner_o = PyStackRef_AsPyObjectBorrow(owner);
|
||||
|
||||
PyObject **addr = (PyObject **)((char *)owner_o + index);
|
||||
|
|
@ -2498,13 +2498,15 @@ dummy_func(
|
|||
attr = PyStackRef_FromPyObjectNew(attr_o);
|
||||
#endif
|
||||
STAT_INC(LOAD_ATTR, hit);
|
||||
DECREF_INPUTS();
|
||||
o = owner;
|
||||
DEAD(owner);
|
||||
}
|
||||
|
||||
macro(LOAD_ATTR_SLOT) =
|
||||
unused/1 +
|
||||
_GUARD_TYPE_VERSION +
|
||||
_LOAD_ATTR_SLOT + // NOTE: This action may also deopt
|
||||
POP_TOP +
|
||||
unused/5 +
|
||||
_PUSH_NULL_CONDITIONAL;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue