diff --git a/include/pocketpy/pocketpy.h b/include/pocketpy/pocketpy.h index c96f05b9..1f3a241a 100644 --- a/include/pocketpy/pocketpy.h +++ b/include/pocketpy/pocketpy.h @@ -339,11 +339,6 @@ bool py_isidentical(py_Ref, py_Ref); /// The result will be set to `py_retval()`. /// The stack remains unchanged after the operation. bool py_call(py_Ref f, int argc, py_Ref argv) PY_RAISE; -/// Call a non-magic method. -/// It prepares the stack and then performs a `vectorcall(argc+1, 0, false)`. -/// The result will be set to `py_retval()`. -/// The stack remains unchanged after the operation. -bool py_callmethod(py_Ref self, py_Name name, int argc, py_Ref argv) PY_RAISE; bool py_str(py_Ref val) PY_RAISE; bool py_repr(py_Ref val) PY_RAISE; diff --git a/src/interpreter/ceval.c b/src/interpreter/ceval.c index 3d2b4264..bf868087 100644 --- a/src/interpreter/ceval.c +++ b/src/interpreter/ceval.c @@ -476,7 +476,10 @@ FrameResult VM__run_top_frame(VM* self) { py_push(py_retval()); // empty set py_Name id_add = py_name("add"); for(int i = 0; i < byte.arg; i++) { - if(!py_callmethod(TOP(), id_add, 1, begin + i)) goto __ERROR; + py_push(TOP()); + py_pushmethod(id_add); + py_push(begin + i); + if(!py_vectorcall(1, 0)) goto __ERROR; } py_TValue tmp = *TOP(); SP() = begin; diff --git a/src/public/internal.c b/src/public/internal.c index 90e33005..f6796907 100644 --- a/src/public/internal.c +++ b/src/public/internal.c @@ -115,8 +115,6 @@ bool py_call(py_Ref f, int argc, py_Ref argv) { } } -bool py_callmethod(py_Ref self, py_Name name, int argc, py_Ref argv) { return -1; } - bool py_vectorcall(uint16_t argc, uint16_t kwargc) { VM* vm = pk_current_vm; return VM__vectorcall(vm, argc, kwargc, false) != RES_ERROR;