mirror of
https://github.com/python/cpython.git
synced 2026-04-20 02:40:59 +00:00
gh-131798: split _CALL_BUILTIN_CLASS to smaller uops (#148094)
This commit is contained in:
parent
e007631e99
commit
8f17140fc1
10 changed files with 1299 additions and 1217 deletions
|
|
@ -4570,17 +4570,20 @@ dummy_func(
|
|||
DEAD(should_be_none);
|
||||
}
|
||||
|
||||
op(_CALL_BUILTIN_CLASS, (callable, self_or_null, args[oparg] -- res)) {
|
||||
op(_GUARD_CALLABLE_BUILTIN_CLASS, (callable, unused, unused[oparg] -- callable, unused, unused[oparg])) {
|
||||
PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable);
|
||||
EXIT_IF(!PyType_Check(callable_o));
|
||||
PyTypeObject *tp = (PyTypeObject *)callable_o;
|
||||
EXIT_IF(tp->tp_vectorcall == NULL);
|
||||
}
|
||||
|
||||
op(_CALL_BUILTIN_CLASS, (callable, self_or_null, args[oparg] -- res)) {
|
||||
int total_args = oparg;
|
||||
_PyStackRef *arguments = args;
|
||||
if (!PyStackRef_IsNull(self_or_null)) {
|
||||
arguments--;
|
||||
total_args++;
|
||||
}
|
||||
EXIT_IF(tp->tp_vectorcall == NULL);
|
||||
STAT_INC(CALL, hit);
|
||||
PyObject *res_o = _Py_CallBuiltinClass_StackRefSteal(
|
||||
callable,
|
||||
|
|
@ -4597,6 +4600,7 @@ dummy_func(
|
|||
_RECORD_CALLABLE +
|
||||
unused/1 +
|
||||
unused/2 +
|
||||
_GUARD_CALLABLE_BUILTIN_CLASS +
|
||||
_CALL_BUILTIN_CLASS +
|
||||
_CHECK_PERIODIC_AT_END;
|
||||
|
||||
|
|
@ -4618,8 +4622,6 @@ dummy_func(
|
|||
if (!PyStackRef_IsNull(self_or_null)) {
|
||||
args--;
|
||||
}
|
||||
// CPython promises to check all non-vectorcall function calls.
|
||||
EXIT_IF(_Py_ReachedRecursionLimit(tstate));
|
||||
STAT_INC(CALL, hit);
|
||||
PyCFunction cfunc = PyCFunction_GET_FUNCTION(callable_o);
|
||||
_PyStackRef arg = args[0];
|
||||
|
|
@ -4640,6 +4642,7 @@ dummy_func(
|
|||
unused/1 +
|
||||
unused/2 +
|
||||
_GUARD_CALLABLE_BUILTIN_O +
|
||||
_CHECK_RECURSION_LIMIT +
|
||||
_CALL_BUILTIN_O +
|
||||
POP_TOP +
|
||||
POP_TOP +
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue