mirror of
https://github.com/python/cpython.git
synced 2025-12-31 04:23:37 +00:00
gh-134584: Eliminate redundant refcounting from _STORE_ATTR_INSTANCE_VALUE (GH-142759)
Signed-off-by: Manjusaka <me@manjusaka.me>
This commit is contained in:
parent
0ac4e6c6cd
commit
059316ade6
10 changed files with 67 additions and 16 deletions
14
Python/executor_cases.c.h
generated
14
Python/executor_cases.c.h
generated
|
|
@ -8728,11 +8728,12 @@
|
|||
break;
|
||||
}
|
||||
|
||||
case _STORE_ATTR_INSTANCE_VALUE_r20: {
|
||||
case _STORE_ATTR_INSTANCE_VALUE_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;
|
||||
|
|
@ -8750,14 +8751,19 @@
|
|||
_PyDictValues_AddToInsertionOrder(values, index);
|
||||
}
|
||||
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