mirror of
https://github.com/python/cpython.git
synced 2025-12-31 04:23:37 +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
|
|
@ -4040,18 +4040,17 @@ dummy_func(
|
|||
DEOPT_IF(callable_o != (PyObject *)&PyUnicode_Type);
|
||||
}
|
||||
|
||||
op(_CALL_STR_1, (callable, null, arg -- res)) {
|
||||
op(_CALL_STR_1, (callable, null, arg -- res, a)) {
|
||||
PyObject *arg_o = PyStackRef_AsPyObjectBorrow(arg);
|
||||
|
||||
assert(oparg == 1);
|
||||
STAT_INC(CALL, hit);
|
||||
PyObject *res_o = PyObject_Str(arg_o);
|
||||
DEAD(null);
|
||||
DEAD(callable);
|
||||
(void)callable; // Silence compiler warnings about unused variables
|
||||
(void)null;
|
||||
PyStackRef_CLOSE(arg);
|
||||
ERROR_IF(res_o == NULL);
|
||||
if (res_o == NULL) {
|
||||
ERROR_NO_POP();
|
||||
}
|
||||
a = arg;
|
||||
INPUTS_DEAD();
|
||||
res = PyStackRef_FromPyObjectSteal(res_o);
|
||||
}
|
||||
|
||||
|
|
@ -4061,6 +4060,7 @@ dummy_func(
|
|||
_GUARD_NOS_NULL +
|
||||
_GUARD_CALLABLE_STR_1 +
|
||||
_CALL_STR_1 +
|
||||
POP_TOP +
|
||||
_CHECK_PERIODIC_AT_END;
|
||||
|
||||
op(_GUARD_CALLABLE_TUPLE_1, (callable, unused, unused -- callable, unused, unused)) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue