Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we need this, this is internal.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mentally went back and forth on this. It's true that guideline is that "strictly internal changes with no user-visible effects" do not warrant an entry. My reasoning for inclusion was that a 3.9% speedup in a core code path is indeed significant enough to external, end-users that this change warrants an entry. It also seems to be how this sort of change in ceval.c. has been handled in the past. However, I’ll gladly defer to the guidance of the core developers who review the PR.

Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Add ``PY_VECTORCALL_ARGUMENTS_OFFSET`` to ``_Py_CallBuiltinClass_StackRefSteal`` to
avoid redundant allocations
2 changes: 1 addition & 1 deletion Python/ceval.c
Original file line number Diff line number Diff line change
Expand Up @@ -1273,7 +1273,7 @@ _Py_CallBuiltinClass_StackRefSteal(
goto cleanup;
}
PyTypeObject *tp = (PyTypeObject *)PyStackRef_AsPyObjectBorrow(callable);
res = tp->tp_vectorcall((PyObject *)tp, args_o, total_args, NULL);
res = tp->tp_vectorcall((PyObject *)tp, args_o, total_args | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL);
STACKREFS_TO_PYOBJECTS_CLEANUP(args_o);
assert((res != NULL) ^ (PyErr_Occurred() != NULL));
cleanup:
Expand Down
Loading