mirror of
https://github.com/python/cpython.git
synced 2025-12-31 04:23:37 +00:00
GH-134584: Remove redundant refcount from _STORE_ATTR_SLOT (#142729)
This commit is contained in:
parent
f277781bba
commit
bef63d2fb8
9 changed files with 70 additions and 17 deletions
14
Python/executor_cases.c.h
generated
14
Python/executor_cases.c.h
generated
|
|
@ -8786,11 +8786,12 @@
|
|||
break;
|
||||
}
|
||||
|
||||
case _STORE_ATTR_SLOT_r20: {
|
||||
case _STORE_ATTR_SLOT_r21: {
|
||||
CHECK_CURRENT_CACHED_VALUES(2);
|
||||
assert(WITHIN_STACK_BOUNDS_IGNORING_CACHE());
|
||||
_PyStackRef owner;
|
||||
_PyStackRef value;
|
||||
_PyStackRef o;
|
||||
_PyStackRef _stack_item_0 = _tos_cache0;
|
||||
_PyStackRef _stack_item_1 = _tos_cache1;
|
||||
owner = _stack_item_1;
|
||||
|
|
@ -8809,14 +8810,19 @@
|
|||
PyObject *old_value = *(PyObject **)addr;
|
||||
FT_ATOMIC_STORE_PTR_RELEASE(*(PyObject **)addr, PyStackRef_AsPyObjectSteal(value));
|
||||
UNLOCK_OBJECT(owner_o);
|
||||
o = owner;
|
||||
stack_pointer[0] = o;
|
||||
stack_pointer += 1;
|
||||
ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
|
||||
_PyFrame_SetStackPointer(frame, stack_pointer);
|
||||
PyStackRef_CLOSE(owner);
|
||||
Py_XDECREF(old_value);
|
||||
stack_pointer = _PyFrame_GetStackPointer(frame);
|
||||
_tos_cache0 = PyStackRef_ZERO_BITS;
|
||||
_tos_cache0 = o;
|
||||
_tos_cache1 = PyStackRef_ZERO_BITS;
|
||||
_tos_cache2 = PyStackRef_ZERO_BITS;
|
||||
SET_CURRENT_CACHED_VALUES(0);
|
||||
SET_CURRENT_CACHED_VALUES(1);
|
||||
stack_pointer += -1;
|
||||
ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
|
||||
assert(WITHIN_STACK_BOUNDS_IGNORING_CACHE());
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue