Method and apparatus to selectively control processing of a method in a java virtual machine
AssigneeInternational Business Machines Corporation
InventorsBruce Anthony Beadle, Michael Wayne Brown, Michael Anthony Paolini, Douglas Scott Rothert
Life of this patent
Estimating the term…
Abstract
A method and apparatus for executing bytecodes. Bytecodes are received for execution and a determination is made as to whether the bytecodes should be compiled. The bytecodes are sent to a just in time compiler responsive to a determination that the method should be compiled. The bytecodes form a method, and the method is sent to an interpreter, responsive to an absence of a determination that the method should be compiled.
Claims18
A process in a data processing system for executing bytecodes comprising:
- receiving bytecodes for execution;
- responsive to a determination that the bytecodes should be compiled, sending the bytecodes to a just in time compiler;
- responsive to an absence of a determination that the bytecodes should be compiled, sending the bytecodes to an interpreter;
- comparing the bytecodes to information about a plurality of sets of bytecodes;
- and
- determining whether the bytecodes should be compiled based on the information about the plurality of sets of bytecodes.
A process in a data processing system for just in time compilation of a method in a Java virtual machine by a just in time compiler, the process comprising:
- monitoring for a call to the just in time compiler to execute a method;
- responsive to detecting the call, intercepting the call;
- determining whether the method should be just in time compiled in response to intercepting the call;
- responsive to a determination that the method should be just in time compiled, sending the method to the just in time compiler;
- and
- responsive to an absence of a determination that the method should be just in time compiled, halting execution of the method.
A method in a computer for executing instructions for a virtual machine running on the computer, the method comprising:
- receiving an instruction for execution, wherein the instruction is nonspecific to the computer;
- determining whether the instruction should be compiled into native code specific for the computer;
- responsive to a determination that the instruction should be just in time compiled, sending the instructions to a compiler designed to generate native code specific for the computer;
- and
- responsive to an absence of a determination that the instruction should be just in time compiled, sending the instruction to an interpreter.
A method in a computer for accessing a stack used by a virtual machine and a compiler, the method comprising the computer implemented steps of:
- intercepting a call passing the stack from the virtual machine to the compiler, wherein the call includes information used to access the stack;
- and
- using information to access the stack.
A virtual machine for use in a computer, the virtual machine comprising:
- a class loader, wherein the class loader loads a method for execution, wherein the method includes first instructions which are nonspecific to the computer;
- a compiler, wherein the compiler generates second instructions executable by the computer;
- an interpreter, wherein the interpreter performs each of the first instructions;
- an interface, wherein the interface includes a plurality of modes of operations including:
- a first mode of operation in which the interface receives the first instructions from the class loader destined for the compiler;
- a second mode of operation, responsive to receiving the first instructions, in which the interface determines whether to send the first instructions to the compiler;
- a third mode of operation, responsive to a determination that the first instructions are to be sent to the compiler, in which the interface sends the first instructions to the compiler;
- and
- a fourth mode of operation, responsive to an absence of a determination that the instructions are to be sent to the compiler, in which the interface sends the instructions to the interpreter;
- and
- a data structure, wherein the data structure contains information about methods, wherein the interface in the second mode of operation queries the data structure for information used to determine whether to send the first instructions to the compiler.
A data processing system for executing bytecodes comprising:
- receiving means for receiving bytecodes for execution;
- sending means, responsive to a determination that the bytecodes should be compiled, for sending the bytecodes to a just in time compiler;
- comparing means for comparing the method to information about a plurality of sets of bytecodes;
- determining means for determining whether the bytecodes should be compiled based on the information about the plurality of sets of bytecodes;
- and
- sending means, responsive to an absence of a determination that the bytecodes should be compiled, for sending the bytecodes to an interpreter.
A data processing system for just in time compilation of a data processing system in a Java virtual machine by a just in time compiler, the data processing system comprising:
- monitoring means for monitoring a call to the just in time compiler to executed a method;
- intercepting means, responsive to detecting the call, for intercepting the call;
- determining means for determining whether the method should be just in time compiled in response to intercepting the call;
- sending means, responsive to a determination that the method should be just in time compiled, for sending the method to the just in time compiler;
- and
- halting means, responsive to an absence of a determination that the method should be just in time compiled, for halting execution of the method.
A data processing system in a computer for executing instructions for a virtual machine running on the computer, the data processing system comprising:
- receiving means for receiving an instruction for execution, wherein the instruction is nonspecific to the computer;
- sending means, responsive to a determination that the method should be just in time compiled, for sending the instructions to a compiler designed to generate native code specific for the computer;
- comparing means for comparing the method to information about a plurality of methods;
- determining means for determining whether the method should be compiled based on the information about the plurality of methods;
- and
- sending means, responsive to an absence of a determination that the method should be compiled, for sending the instructions to an interpreter.
A computer program product in a data processing system for executing bytecodes comprising:
- first instructions for receiving bytecodes for execution;
- second instructions, responsive to a determination that the bytecodes should be compiled, for sending the bytecodes to a just in time compiler;
- third instructions for comparing the bytecodes to information about a plurality of sets of bytecodes;
- fourth instructions for determining whether the bytecodes should be compiled based on the information about the plurality of sets of bytecodes;
- and
- fifth instructions responsive to an absence of a determination that the bytecodes should be compiled, for sending the bytecodes to an interpreter.
A computer program product in a data processing system for just in time compilation of a computer program product in a Java virtual machine by a just in time compiler, the computer program product comprising:
- first instructions for monitoring a call to the just in time compiler to execute a method;
- second instructions for responsive to detecting the call, intercepting the call;
- third instructions, responsive to a determination that the method should be just in time compiled, for sending the method to the just in time compiler;
- fourth instructions for comparing the method to information about a plurality of methods;
- fifth instructions for determining whether the method should be just in time compiled based on the information about the plurality of methods;
- and
- sixth instructions responsive to an absence of a determination that the method should be just in time compiled, for sending the method to an interpreter.
Dependencies are inferred from the claim text.