Skip to content

Commit 14c0b8f

Browse files
remove _PyCallMethodDescriptorO_StackRef
1 parent bc54b9e commit 14c0b8f

File tree

6 files changed

+24
-59
lines changed

6 files changed

+24
-59
lines changed

Include/internal/pycore_ceval.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -444,13 +444,6 @@ _Py_BuiltinCallFastWithKeywords_StackRefSteal(
444444
_PyStackRef *arguments,
445445
int total_args);
446446

447-
PyAPI_FUNC(PyObject *)
448-
_PyCallMethodDescriptorO_StackRef(
449-
_PyStackRef callable,
450-
PyCFunction cfunc,
451-
_PyStackRef self_stackref,
452-
_PyStackRef arg_stackref);
453-
454447
PyAPI_FUNC(PyObject *)
455448
_PyCallMethodDescriptorFast_StackRefSteal(
456449
_PyStackRef callable,

Modules/_testinternalcapi/test_cases.c.h

Lines changed: 4 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Python/bytecodes.c

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4758,12 +4758,10 @@ dummy_func(
47584758
EXIT_IF(_Py_ReachedRecursionLimit(tstate));
47594759
STAT_INC(CALL, hit);
47604760
PyCFunction cfunc = method->d_method->ml_meth;
4761-
PyObject *res_o = _PyCallMethodDescriptorO_StackRef(
4762-
callable,
4763-
cfunc,
4764-
arguments[0],
4765-
arguments[1]
4766-
);
4761+
PyObject *self = PyStackRef_AsPyObjectBorrow(arguments[0]);
4762+
PyObject *arg = PyStackRef_AsPyObjectBorrow(arguments[1]);
4763+
PyObject *res_o = _PyCFunction_TrampolineCall(cfunc, self, arg);
4764+
_Py_LeaveRecursiveCallTstate(tstate);
47674765
assert((res_o != NULL) ^ (_PyErr_Occurred(tstate) != NULL));
47684766
if (res_o == NULL) {
47694767
ERROR_NO_POP();
@@ -4780,12 +4778,10 @@ dummy_func(
47804778
EXIT_IF(_Py_ReachedRecursionLimit(tstate));
47814779
STAT_INC(CALL, hit);
47824780
volatile PyCFunction cfunc_v = (PyCFunction)cfunc;
4783-
PyObject *res_o = _PyCallMethodDescriptorO_StackRef(
4784-
callable,
4785-
cfunc_v,
4786-
args[0],
4787-
args[1]
4788-
);
4781+
PyObject *self = PyStackRef_AsPyObjectBorrow(args[0]);
4782+
PyObject *arg = PyStackRef_AsPyObjectBorrow(args[1]);
4783+
PyObject *res_o = _PyCFunction_TrampolineCall(cfunc_v, self, arg);
4784+
_Py_LeaveRecursiveCallTstate(tstate);
47894785
assert((res_o != NULL) ^ (_PyErr_Occurred(tstate) != NULL));
47904786
if (res_o == NULL) {
47914787
ERROR_NO_POP();

Python/ceval.c

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -871,22 +871,6 @@ _Py_BuiltinCallFastWithKeywords_StackRefSteal(
871871
return res;
872872
}
873873

874-
Py_NO_INLINE PyObject *
875-
_PyCallMethodDescriptorO_StackRef(
876-
_PyStackRef callable,
877-
PyCFunction cfunc,
878-
_PyStackRef self_stackref,
879-
_PyStackRef arg_stackref)
880-
{
881-
PyObject *self = PyStackRef_AsPyObjectBorrow(self_stackref);
882-
PyObject *arg = PyStackRef_AsPyObjectBorrow(arg_stackref);
883-
884-
PyObject *res = _PyCFunction_TrampolineCall(cfunc, self, arg);
885-
_Py_LeaveRecursiveCallTstate(_PyThreadState_GET());
886-
assert((res != NULL) ^ (PyErr_Occurred() != NULL));
887-
return res;
888-
}
889-
890874
PyObject *
891875
_PyCallMethodDescriptorFast_StackRefSteal(
892876
_PyStackRef callable,

Python/executor_cases.c.h

Lines changed: 8 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Python/generated_cases.c.h

Lines changed: 4 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)