Then the class of the object referred to by objectref is retrieved. Once the method has been located, invokeinterface calls the method. First, if the method is marked as synchronized , the monitor associated with objectref is entered. Next, a new stack frame is established on the callstack. Then the arguments for the method are placed in the local variable slots of the new stack frame structure.
Execution continues at the first instruction in the bytecode of the new method.
Methods marked as native are handled slightly differently. For native methods, the runtime system locates the platform-specific code for the method, loading it and linking it into the JVM if necessary. Then the native method code is executed with the arguments that were popped from the operand stack. The exact mechanism used to invoke native methods is implementation-specific. If the invoked method was marked as synchronized , the monitor associated with objectref is exited.