Improved techniques for invocations of native methods in Java computing
environments are disclosed. The techniques can be implemented in Java computing
environments to facilitate efficient use of methods (functions or subroutines)
written in programming languages other than Java (e.g., C, C++, etc.). As such,
the techniques are highly suitable for use by virtual machines operating with relatively
less memory and/or computing power (e.g., embedded systems). A lightweight native
method invocation interface can be implemented to provide direct access to Java
parameters on the execution stack. In addition, the lightweight native method invocation
can include macro instructions that operate efficiently to convert the Java parameters
into native parameters. Thus, the lightweight native method invocation can significantly
reduce the overhead associated with conventional Java native method invocation
techniques. As a result, performance of virtual machines, especially those operating
with relatively less memory and/or computing power, can be improved.