gh-131798: split _CALL_BUILTIN_CLASS to smaller uops (#148094)

This commit is contained in:
Kumar Aditya 2026-04-10 22:58:20 +05:30 committed by GitHub
parent e007631e99
commit 8f17140fc1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 1299 additions and 1217 deletions

View file

@ -1284,6 +1284,19 @@ dummy_func(void) {
none = sym_new_const(ctx, Py_None);
}
op(_GUARD_CALLABLE_BUILTIN_CLASS, (callable, unused, unused[oparg] -- callable, unused, unused[oparg])) {
PyObject *callable_o = sym_get_const(ctx, callable);
if (callable_o && sym_matches_type(callable, &PyType_Type)) {
PyTypeObject *tp = (PyTypeObject *)callable_o;
if (tp->tp_vectorcall != NULL) {
ADD_OP(_NOP, 0, 0);
}
}
else {
sym_set_type(callable, &PyType_Type);
}
}
op(_GUARD_CALLABLE_BUILTIN_O, (callable, self_or_null, args[oparg] -- callable, self_or_null, args[oparg])) {
PyObject *callable_o = sym_get_const(ctx, callable);
if (callable_o && sym_matches_type(callable, &PyCFunction_Type) &&