Method and apparatus for efficient invocation of Java...

Data processing: software development – installation – and managem – Software program development tool – Translation of code

Reexamination Certificate

Rate now

  [ 0.00 ] – not rated yet Voters 0   Comments 0

Details

Reexamination Certificate

active

06481006

ABSTRACT:

BACKGROUND OF THE INVENTION
1. Technical Field
The present invention relates generally to an improved data processing system, and in particular to a method and apparatus for executing instructions in a data processing system. Still more particularly, the present invention relates to a method and apparatus for invoking Java methods from native code.
2. Description of Related Art
Java is an object oriented programming language and environment focusing on defining data as objects and the methods that may be applied to those objects. “Java” is a trademark of Sun Microsystems, Inc. Java supports only a single inheritance, meaning that each class can inherit from only one other class at any given time. Java also allows for the creation of totally abstract classes known as interfaces, which allow the defining of methods that may be shared with several classes without regard for how other classes are handling the methods. Java provides a mechanism to distribute software to different computing platforms.
Java is able to support applications for many types of data processing systems, which may contain a variety of central processing units and operating system architectures. The Java Virtual Machine (JVM) is a virtual computer component that resides only in memory. The JVM allows Java programs to be executed on different platforms as opposed to only the one platform for which the code was compiled. Java programs are compiled for the JVM. In this manner, Java is able to support applications for many types of data processing systems, which may contain a variety of central processing units and operating systems architectures. To enable a Java application to execute on different types of data processing systems, a compiler typically generates an architecture-neutral file format. The compiled code is executable on many processors, given the presence of the Java runtime system. The Java compiler generates bytecode instructions that are non-specific to particular computer architectures. A bytecode is a machine independent code generated by the Java compiler and executed by a Java interpreter. A Java interpreter is a module in the JVM that alternatively decodes and executes a bytecode or bytecodes. These bytecode instructions are designed to be easy to interpret on any machine and easily translated on the fly into native machine code.
A development environment, such as the Java Development Kit (JDK) available from Sun Microsystems, Inc., may be used to build Java bytecode from Java language source code and libraries. This Java bytecode may be stored as a Java application or applet on a Web Server, where it can be downloaded over a network to a user's machine and executed on a local JVM.
When extra speed in executing a Java program is needed, a Just In Time (JIT) compiler may be used to translate bytecodes for a method or class into native machine instructions before executing them. Typically, this compilation only occurs once per method. Some JIT compilers may compile entire classes, rather than one method at a time.
Java methods are commonly invoked from native code and the presently available methods for invoking Java methods from native code are extremely inefficient. For each such invocation, control is passed to the JVM which, after various housekeeping steps, creates a temporary Java method consisting of an invoke of the target method and a return. The requisite constant pool is also created and typically contains 4 entries: a CONSTANT_MethodRef which points to a CONSTANT_NameAndType which in turn points to two CONSTANT_Utf
8
strings which identify the target method name and signature. The JVM also creates a javaframe on the javastack, copying parameters for the target Java method from the native stack to the javastack under control of the method signature. The javaframe is then marked to indicate that a return to native code is required when the target Java method completes. Control is then passed to the interpreter to execute the temporary method just created. When the invoke bytecode is interpreted, it goes through the process of “quickification” which involves the costly constant pool resolution of the Methodref operand and the modification of the invoke bytecode. The new “quickified” bytecode is then interpreted which finally causes the original target method to be invoked. When the target Java method completes, by executing one of the standard return bytecodes, the interpreter must inspect the javaframe to determine whether the method is returning to Java code or to native code. Performing all the above steps takes considerable time and slows down the invocation of Java methods when called from native code. Additionally there is a slight performance penalty paid on all Java method invocations in that the interpretation of the return bytecodes must include the step of checking for return to native code.
Therefore, it would be advantageous to have an improved method and apparatus for invoking Java methods from native code.
SUMMARY OF THE INVENTION
The present invention provides a method and apparatus in a data processing system for invoking a Java method from native code. A method is examined prior to first execution of the method to identify the presence of selected parameters from a set of parameters for the method. A bitmask is created to describe the selected parameters. The set of parameters is copied to a frame using the mask. Further, a new return bytecode is used to handle a return to a native calling method. Method block location is handled using identifying information about the method.


REFERENCES:
patent: 6009517 (1999-12-01), Bak et al.
patent: 6066181 (2000-05-01), DeMaster
patent: 6081665 (2000-06-01), Nilsen et al.
patent: 6167567 (2000-12-01), Chiles et al.
patent: 6226789 (2001-05-01), Tye et al.
patent: 6269373 (2001-07-01), Apte et al.
Buhler et al. The Java Can API-A Java Gateway to Fieldbus Communication. IEEE. 2000. pp. 37-43.

LandOfFree

Say what you really think

Search LandOfFree.com for the USA inventors and patents. Rate them and share your experience with other people.

Rating

Method and apparatus for efficient invocation of Java... does not yet have a rating. At this time, there are no reviews or comments for this patent.

If you have personal experience with Method and apparatus for efficient invocation of Java..., we encourage you to share that experience with our LandOfFree.com community. Your opinion is very important and Method and apparatus for efficient invocation of Java... will most certainly appreciate the feedback.

Rate now

     

Profile ID: LFUS-PAI-O-2969416

  Search
All data on this website is collected from public sources. Our data reflects the most accurate information available at the time of publication.