The Java programming language is an object oriented programming language that has been used by many in the computer industry, especially in applications written for use on the Internet. One perceived advantage with the Java language is the fact that the source language is implementation independent and therefore a source code Java program can run without change on a number of different hardware implementations so long as the hardware has an interpreter that correctly interprets the compiled Java program.
The fact that Java supports classes and objects is a second reason it has been well accepted. The C++ programming language was developed as an extension to the C programming language to support object oriented concepts such as inheritance and polymorphism. The Java language is similar in many ways to C++ and therefore it has been relatively easy for experienced C++ programers to write programs in Java.
Objects conform to a structure that is defined in that object's class definition. In both C++ and Java, so called class definitions define an organization scheme for methods and data for specific instances or objects of the class. See Barjne Stroustrup, The C++ Programming Language (1986) and Ken Arnold and James Gosling, The Java Programming Language (1996). The class definition not only defines what data an object has but how that data is manipulated and by what portions of the program.
Classes can inherit members from parent classes that include constants (static final fields), static fields and static methods which exist once for all instances of a class in one name space and are shared between multiple class instances. Classes can also inherit dynamic fields which exist separately for every instance of the class type and they can inherit dynamic methods which operate on specific instances of a class through a "this" pointer.
The Java programming language also supports a programming construct called an interface. The interface is similar to a class declaration in C++. The interface has declarations of abstract dynamic methods, constants, and properties which can be thought of as virtual fields. The interfaces are implemented by specific class instances. When a class implements an interface, it must contain an implementation or definition of each dynamic method declared in the interface. The class must also implement each dynamic method for other interfaces which the interface extends.
Source code written in the Java programming language is compiled by a Java compiler into a binary file referred to as a class file that contains bytecodes of data. The bytecodes have an eight bit op-codes and one or more eight or sixteen bit operands for the op-code. These bytecodes are sequentially interpreted by a software virtual machine that interprets the bytecodes and converts them to executable machine language code on the computer hardware that executes the software virtual machine. The software virtual machine interprets the compiled bytecodes in a way somewhat similar to the way a central processing unit interprets machine code instructions.
The software virtual machine must correctly interpret the compiled bytecodes in the class file in a way that is consistent with the language definition. Other than this constraint, the designer of the software virtual machine software is free to write the software in ways that enhance performance. The Java virtual machine specification is publically availiable both via the Internet and in a published text. Tim Lindholm and Frank Yellin, The Java Virtual Machine Specification (1997). One prior art software virtual machine has been implemented by Sun Microsystems Inc. of Mountain View, Calif. and has been widely distributed for use with the Java programming language.
During startup of Sun's software virtual machine certain data structures are created after the class file is loaded. In a linking step, a binary form of a class or interface type is combined into the runtime state of the software virtual machine. After the virtual machine verifies that the compiled Java code is structurally correct, the virtual Machine is prepared for execution. This preparation phase or step can include the step of precomputing data structures in the memory of the target machine to make the processing of sequentially interpreting the bytecodes of the binary representation more efficient. One useful data structure is a "method table that allows methods to be invoked on instances of a class without resort to a search of superclasses at the time the class instance is invoked." Lindholm et al, supra, at page 45.
During interpretation by the virtual machine, whenever a new class instance or object is created, memory of a sufficient quantity is allocated for that class instance with room for all the fields of that class instance and the fields of any superclasses from which the new class instance depends. In the present Sun implementation of its virtual machine, a reference to a class instance or object is a pointer to a handle that is itself a pair of pointers: one pointer points to the address of a table containing the methods of the object and a pointer to the class object that represents the type of the object and the second points to the memory allocated from the Java heap for the object data. Lindholm et al, supra, at page 69. This pointer relationship is represented in FIG. 3 which has been labeled as prior art.
U.S. Pat. No. 5,361,350 to Conner et al describes an object oriented method management system. The '350 patent describes a system for managing class method names by collecting a representation of the names and additional supporting information in a single data structure.
The present invention concerns an improved implementation of a virtual machine system such as the Java virtual machine. An object model of the invention facilitates decomposition of objects into their member components more efficiently than existing prior art virtual machines.