Call a method. The instance (receiver or reference) for non-static methods must be pushed by the caller. The instance (for non-static) and the arguments are popped of the stack, and the return value (if any) is pushed onto the stack.
The type needs to be one of:
- VMOpcode.INVOKESTATIC - call a static method
- VMOpcode.INVOKEVIRTUAL - call method declared in the class or super-class.
- VMOpcode.INVOKEINTERFACE - call a method declared in an interface
static methods Stack ...,value* => [numArgs number of values will be popped] ...,return_value [void methods will not push a value] non-static methods Stack ...,ref,value* => [numArgs number of values will be popped] ...,return_value [void methods will not push a value]
The type of the arguments to the methods must exactly match the declared types of the parameters to the methods. If a argument is of the incorrect type the caller must up cast it or down cast it.
@param type type of method invocation
@param declaringClass Class or interface the method is declared in. If it is a non-staticmethod call then if declaringClass is null, the declared type is taken to be the type of the reference that will be popped.
@param methodName name of the method
@param returnType class name or primitive type (including "void") of the return type of the method, can not be null.
@param numArgs number of arguments to the method (can be 0).