gh-131798: optimize through keyword and bound method calls in the JIT (GH-148466)

Co-authored-by: Ken Jin <kenjin4096@gmail.com>
This commit is contained in:
Kumar Aditya 2026-04-13 18:44:48 +05:30 committed by GitHub
parent 10d275fdf8
commit 88e378cc1c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 1174 additions and 1001 deletions

View file

@ -5249,6 +5249,7 @@ dummy_func(
}
macro(CALL_KW_PY) =
_RECORD_CALLABLE_KW +
unused/1 + // Skip over the counter
_CHECK_PEP_523 +
_CHECK_FUNCTION_VERSION_KW +
@ -5279,6 +5280,7 @@ dummy_func(
}
macro(CALL_KW_BOUND_METHOD) =
_RECORD_CALLABLE_KW +
unused/1 + // Skip over the counter
_CHECK_PEP_523 +
_CHECK_METHOD_VERSION_KW +
@ -6157,6 +6159,10 @@ dummy_func(
RECORD_VALUE(PyStackRef_AsPyObjectBorrow(func));
}
tier2 op(_RECORD_CALLABLE_KW, (func, self, args[oparg], kwnames -- func, self, args[oparg], kwnames)) {
RECORD_VALUE(PyStackRef_AsPyObjectBorrow(func));
}
tier2 op(_RECORD_BOUND_METHOD, (callable, self, args[oparg] -- callable, self, args[oparg])) {
PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable);
if (Py_TYPE(callable_o) == &PyMethod_Type) {