Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make the correct call specialization fail kind show up #99770

Closed
penguin-wwy opened this issue Nov 25, 2022 · 1 comment
Closed

Make the correct call specialization fail kind show up #99770

penguin-wwy opened this issue Nov 25, 2022 · 1 comment
Labels
type-bug An unexpected behavior, bug, or error

Comments

@penguin-wwy
Copy link
Contributor

penguin-wwy commented Nov 25, 2022

The SPEC_FAIL_KIND is not displayed correctly due to not being adequately maintained.
e.g

cpython/Python/specialize.c

Lines 1471 to 1482 in b1dcdef

#ifdef Py_STATS
static int
builtin_call_fail_kind(int ml_flags)
{
switch (ml_flags & (METH_VARARGS | METH_FASTCALL | METH_NOARGS | METH_O |
METH_KEYWORDS | METH_METHOD)) {
case METH_VARARGS:
return SPEC_FAIL_CALL_PYCFUNCTION;
case METH_VARARGS | METH_KEYWORDS:
return SPEC_FAIL_CALL_PYCFUNCTION_WITH_KEYWORDS;
case METH_FASTCALL | METH_KEYWORDS:
return SPEC_FAIL_CALL_PYCFUNCTION_FAST_WITH_KEYWORDS;

According to the context, METH_FASTCALL | METH_KEYWORDS flag does not cause specialization failure.
However, the method descr fail kind will also be shown as SPEC_FAIL_CALL_PYCFUNCTION, because builtin_call_fail_kind function is called incorrectly in the specialize_method_descriptor function.

I'd like to submit a PR to fix them and make them display correctly.

Linked PRs

@penguin-wwy
Copy link
Contributor Author

penguin-wwy commented Nov 25, 2022

@markshannon Can you please review this issue? Other instruction specializations also seem to have incorrect display fail_kind.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

1 participant