mirror of
https://github.com/python/cpython.git
synced 2026-02-23 15:42:04 +00:00
gh-134584: Eliminate redundant refcounting from _STORE_SUBSCR_DICT (GH-142712)
Co-authored-by: Ken Jin <kenjin4096@gmail.com>
This commit is contained in:
parent
872ab51f32
commit
abaaeee6a0
9 changed files with 74 additions and 23 deletions
19
Python/generated_cases.c.h
generated
19
Python/generated_cases.c.h
generated
|
|
@ -10987,6 +10987,7 @@
|
|||
_PyStackRef value;
|
||||
_PyStackRef dict_st;
|
||||
_PyStackRef sub;
|
||||
_PyStackRef st;
|
||||
// _GUARD_NOS_DICT
|
||||
{
|
||||
nos = stack_pointer[-2];
|
||||
|
|
@ -11011,14 +11012,24 @@
|
|||
PyStackRef_AsPyObjectSteal(sub),
|
||||
PyStackRef_AsPyObjectSteal(value));
|
||||
stack_pointer = _PyFrame_GetStackPointer(frame);
|
||||
if (err) {
|
||||
stack_pointer += -3;
|
||||
ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
|
||||
_PyFrame_SetStackPointer(frame, stack_pointer);
|
||||
PyStackRef_CLOSE(dict_st);
|
||||
stack_pointer = _PyFrame_GetStackPointer(frame);
|
||||
JUMP_TO_LABEL(error);
|
||||
}
|
||||
st = dict_st;
|
||||
}
|
||||
// _POP_TOP
|
||||
{
|
||||
value = st;
|
||||
stack_pointer += -3;
|
||||
ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
|
||||
_PyFrame_SetStackPointer(frame, stack_pointer);
|
||||
PyStackRef_CLOSE(dict_st);
|
||||
PyStackRef_XCLOSE(value);
|
||||
stack_pointer = _PyFrame_GetStackPointer(frame);
|
||||
if (err) {
|
||||
JUMP_TO_LABEL(error);
|
||||
}
|
||||
}
|
||||
DISPATCH();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue