mirror of
https://github.com/python/cpython.git
synced 2025-12-31 12:33:28 +00:00
gh-134584: Eliminate redundant refcounting from _CALL_STR_1 (GH-136070)
Signed-off-by: Manjusaka <me@manjusaka.me>
This commit is contained in:
parent
d3ef5ba34d
commit
a154c9ed4e
10 changed files with 58 additions and 43 deletions
23
Python/generated_cases.c.h
generated
23
Python/generated_cases.c.h
generated
|
|
@ -3968,6 +3968,8 @@
|
|||
_PyStackRef callable;
|
||||
_PyStackRef arg;
|
||||
_PyStackRef res;
|
||||
_PyStackRef a;
|
||||
_PyStackRef value;
|
||||
/* Skip 1 cache entry */
|
||||
/* Skip 2 cache entries */
|
||||
// _GUARD_NOS_NULL
|
||||
|
|
@ -3998,23 +4000,24 @@
|
|||
_PyFrame_SetStackPointer(frame, stack_pointer);
|
||||
PyObject *res_o = PyObject_Str(arg_o);
|
||||
stack_pointer = _PyFrame_GetStackPointer(frame);
|
||||
(void)callable;
|
||||
(void)null;
|
||||
stack_pointer += -3;
|
||||
ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
|
||||
_PyFrame_SetStackPointer(frame, stack_pointer);
|
||||
PyStackRef_CLOSE(arg);
|
||||
stack_pointer = _PyFrame_GetStackPointer(frame);
|
||||
if (res_o == NULL) {
|
||||
JUMP_TO_LABEL(error);
|
||||
}
|
||||
a = arg;
|
||||
res = PyStackRef_FromPyObjectSteal(res_o);
|
||||
}
|
||||
// _POP_TOP
|
||||
{
|
||||
value = a;
|
||||
stack_pointer[-3] = res;
|
||||
stack_pointer += -2;
|
||||
ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
|
||||
_PyFrame_SetStackPointer(frame, stack_pointer);
|
||||
PyStackRef_XCLOSE(value);
|
||||
stack_pointer = _PyFrame_GetStackPointer(frame);
|
||||
}
|
||||
// _CHECK_PERIODIC_AT_END
|
||||
{
|
||||
stack_pointer[0] = res;
|
||||
stack_pointer += 1;
|
||||
ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
|
||||
_PyFrame_SetStackPointer(frame, stack_pointer);
|
||||
int err = check_periodics(tstate);
|
||||
stack_pointer = _PyFrame_GetStackPointer(frame);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue