gh-134584: Eliminate redundant refcounting from _CALL_TYPE_1 (GH-135818)

This commit is contained in:
Tomas R. 2025-12-23 18:01:10 +01:00 committed by GitHub
parent c8b80f5e23
commit 25c294b6ea
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 1047 additions and 819 deletions

View file

@ -4144,6 +4144,8 @@
_PyStackRef callable;
_PyStackRef arg;
_PyStackRef res;
_PyStackRef a;
_PyStackRef value;
/* Skip 1 cache entry */
/* Skip 2 cache entries */
// _GUARD_NOS_NULL
@ -4170,15 +4172,18 @@
arg = stack_pointer[-1];
PyObject *arg_o = PyStackRef_AsPyObjectBorrow(arg);
assert(oparg == 1);
(void)callable;
(void)null;
STAT_INC(CALL, hit);
a = arg;
res = PyStackRef_FromPyObjectNew(Py_TYPE(arg_o));
}
// _POP_TOP
{
value = a;
stack_pointer[-3] = res;
stack_pointer += -2;
ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
_PyFrame_SetStackPointer(frame, stack_pointer);
PyStackRef_CLOSE(arg);
PyStackRef_XCLOSE(value);
stack_pointer = _PyFrame_GetStackPointer(frame);
}
DISPATCH();