Method and apparatus for efficient invocation of Java methods from native codes
AssigneeInternational Business Machines Corporation
InventorsGeoffrey Owen Blandy, Bentley John Hargrave
Life of this patent
Estimating the term…
Abstract
A method and apparatus in a data processing system for executing a Java method from native code. A method is examined prior to first execution of the method to identify a 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.
Claims58
A process for invoking an interpretable method from a method written in native code comprising:
- collecting parameter information for the interpretable method at class load time of the method for use when called by the method written in native code;
- and
- copying parameters, using the collected parameter information, to a frame used by an interpreter to interpret the interpretable method when the interpretable method is invoked by the method written in native code to create an interpreted method.
A process in a data processing system for executing a interpretable method from a native method, the process comprising the data processing system implemented steps of:
- examining a method prior to a first execution of the interpretable method to identify a presence of a selected parameter from a set of parameters for the interpretable method;
- creating a bitmask to describe the selected parameter;
- and
- copying the set of parameters to a frame using the bitmask.
A process in a data processing system for executing a interpretable method from a native method, the process comprising the data processing system implemented steps of:
- examining a method prior to a first execution of the method to identify a presence of a selected parameter from a set of parameters for the method;
- creating a bitmask to describe the selected parameter, wherein the bitmask contains bits and wherein the plurality of bits are grouped into pairs in which a first bit in a pair indicates whether a parameter associated with the pair is the selected parameter and
- a second in the pair indicates how the selected parameter is to be processed;
- and
- copying the set of parameters to a frame using the bitmask.
A process in a data processing system for invoking a plurality of instructions non-specific to the data processing system from a native method specific to the data processing system, the process comprising the data processing system implemented steps of:
- examining the plurality of instructions nonspecific to the data processing system prior to a first execution of the instructions to identify a presence of a selected parameter from a set of parameters for the plurality of instructions;
- creating a bitmask to describe the selected parameter;
- and
- coping the set of parameters using the bitmask.
A process in a data processing system for invoking a plurality of instructions non-specific to the data processing system from a native method specific to the data processing system, the process comprising the data processing system implemented steps of:
- examining the plurality of instructions nonspecific to the data processing system prior to a first execution of the instructions to identify a presence of a selected parameter from a set of parameters for the plurality of instructions;
- creating a bitmask to describe the selected parameter, wherein the bitmask contains bits and wherein the plurality of bits are grouped into pairs in which a first bit in a pair indicates whether a parameter associated with the pair is the selected parameter and a second in the pair indicates how the selected parameter is to be processed;
- and
- copying the set of parameters using the bitmask.
A process in a data processing system for invoking a plurality of instructions non-specific to the data processing system from a native method specific to the data processing system, the process comprising the data processing system implemented steps of:
- examining the plurality of instructions nonspecific to the data processing system prior to a first execution of the instructions to identify a presence of a selected parameter from a set of parameters for the plurality of instructions;
- creating a bitmask to describe the selected parameter, wherein the bitmask contains bits and wherein the plurality of bits are grouped into pairs in which a first bit in a pair indicates whether a parameter associated with the pair is the selected parameter and a second in the pair indicates how the selected parameter is to be processed and wherein a bit value of a logic one in the first bit indicated a presence of the selected parameter;
- and
- copying the set of parameters using the bitmask.
A process in a data processing system for returning from code nonspecific to the data processing system to native code, the process comprising the data processing system implemented steps of:
- receiving a call from a native caller to execute a interpretable method;
- responsive to receiving the call, creating a pointer to a selected return bytecode;
- and
- responsive to encountering a return in the java method, executing the selected return bytecode, wherein the selected return bytecode moves any return value present as a result of execution of the interpretable method into a location for use by the native caller and returns control to the native caller.
A data processing system for invoking an interpretable method from a method written in native code comprising:
- collecting means for collecting parameters for the interpretable method at class load time of the method written in native code;
- and
- using means for using the collected parameters to load a frame used by an interpreter to interpret the interpretable method when the interpretable method is invoked by the method written in native code to create an interpreted method.
A data processing system for executing a interpretable method from a native method, the data processing system comprising:
- examining means for examining a method prior to first execution of the interpretable method to identify a presence of a selected parameter from a set of parameters for the interpretable method;
- creating means for creating a bitmask to describe the selected parameter;
- and
- copying means for copying the set of parameters to a frame using the bitmask.
A data processing system for executing a interpretable method from a native method, the data processing system comprising:
- examining means for examining a method prior to first execution of the method to identify a presence of a selected parameter from a set of parameters for the method;
- creating means for creating a bitmask to describe the selected parameter, wherein the bitmask contains bits and wherein the plurality of bits are grouped into pairs in which a first bit in a pair indicates whether a parameter associated with the pair is the selected parameter and a second in the pair indicates how the selected parameter is to be processed;
- and
- copying means for copying the set of parameters to a frame using the bitmask.
A data processing system for executing a interpretable method from a native method, the data processing system comprising:
- examining means for examining a method prior to first execution of the method to identify a presence of a selected parameter from a set of parameters for the method;
- creating means for creating a bitmask to describe the selected parameter, wherein the bitmask contains bits and wherein the plurality of bits are grouped into pairs in which a first bit in a pair indicates whether a parameter associated with the pair is the selected parameter and a second in the pair indicates how the selected parameter is to be processed and wherein a bit value of a logic one in the first bit indicated a presence of the selected parameter;
- and
- copying means for copying the set of parameters to a frame using the bitmask.
A data processing system for invoking a plurality of instructions non-specific to the data processing system from a native method specific to the data processing system, the data processing system comprising:
- examining means for examining the plurality of instructions nonspecific to the data processing system prior to a first execution of the instructions to identify a presence of a selected parameter from a set of parameters for the plurality of instructions;
- creating means for creating a bitmask to describe the selected parameter;
- and
- copying means for copying the set of parameters using the bitmask.
A data processing system for invoking a plurality of instructions non-specific to the data processing system from a native method specific to the data processing system, the data processing system comprising:
- examining means for examining the plurality of instructions nonspecific to the data processing system prior to a first execution of the instructions to identify a presence of a selected parameter from a set of parameters for the plurality of instructions;
- creating means for creating a bitmask to describe the selected parameter, wherein the bitmask contains bits and wherein the plurality of bits are grouped into pairs in which a first bit in a pair indicates whether a parameter associated with the pair is the selected parameter and a second in the pair indicates how the selected parameter is to be processed;
- and
- copying means for copying the set of parameters using the bitmask.
A data processing system for invoking a plurality of instructions non-specific to the data processing system from a native method specific to the data processing system, the data processing system comprising:
- examining means for examining the plurality of instructions nonspecific to the data processing system prior to a first execution of the instructions to identify a presence of a selected parameter from a set of parameters for the plurality of instructions;
- creating means for creating a bitmask to describe the selected parameter, wherein the bitmask contains bits and wherein the plurality of bits are grouped into pairs in which a first bit in a pair indicates whether a parameter associated with the pair is the selected parameter and a second in the pair indicates how the selected parameter is to be processed and wherein a bit value of a logic one in the first bit indicated a presence of the selected parameter;
- and
- copying means for copying the set of parameters using the bitmask.
A data processing system for returning from code nonspecific to the data processing system to native code, the data processing system comprising:
- receiving means for receiving a call from a native caller to execute a interpretable method;
- creating means, responsive to receiving the call, for creating a pointer to a selected return bytecode;
- and
- executing means, responsive to encountering a return in the interpretable method, for executing the selected return bytecode, wherein the selected return bytecode moves any return value present as a result of execution of the interpretable method into a location for use by the native caller and returns control to the native caller.
A computer program product in a computer readable medium for invoking an interpretable method from a method written in native code comprising:
- first instructions for collecting parameters for the interpretable method at class load time of the method written in native code;
- and
- second instructions for using the collected parameters to load a frame used by an interpreter to interpret the interpretable method when the interpretable method is invoked by the method written in native code to create an interpreted method.
A computer program product in a computer readable medium for executing a interpretable method from a native method, the computer program product comprising:
- first instructions for examining a method prior to a first execution of the interpretable method to identify a presence of a selected parameter from a set of parameters for the interpretable method;
- second instructions for creating a bitmask to describe the selected parameter;
- and
- third instructions for copying the set of parameters to a frame using the bitmask.
A computer program product in a computer readable medium for invoking a plurality of instructions non-specific to the data processing system from a native method specific to the data processing system, the computer program product comprising:
- first instructions for examining the plurality of instructions nonspecific to the data processing system prior to a first execution of the instructions to identify a presence of a selected parameter from a set of parameters for the plurality of instructions;
- second instructions for creating a bitmask to describe the selected parameter;
- and
- third instructions for copying the set of parameters using the bitmask.
A computer program product in a computer readable medium for returning from code nonspecific to a data processing system to native code, the computer program product comprising:
- first instructions for receiving a call from a native caller to execute a interpretable method;
- second instructions, responsive to receiving the call, for creating a pointer to a selected return bytecode;
- and
- third instructions, responsive to encountering a return in the interpretable method, for executing the selected return bytecode, wherein the selected return bytecode moves any return value present as a result of execution of the interpretable method into a location for use by the native caller and returns control to the native caller.
A data processing system for invoking an interpretable method from a method written in native code, the data processing system comprising:
- a bus system;
- a communications unit connected to the bus system;
- a memory connected to the bus system, wherein the memory includes a set of instructions;
- and
- a processing unit connected to the bus system, wherein the processing unit executes the set of instructions to collect parameter information for the interpretable method at class load time of the method for use when called by the method written in native code;
- and copy parameters, using the collected parameter information, to a frame used by an interpreter to interpret the interpretable method when the interpretable method is invoked by the method written in native code to create an interpreted method.
A data processing system for executing a interpretable method from a native method, the data processing system comprising:
- a bus system;
- a communications unit connected to the bus system;
- a memory connected to the bus system, wherein the memory includes a set of instructions;
- and
- a processing unit connected to the bus system, wherein the processing unit executes the set of instructions to examine a method prior to a first execution of the interpretable method to identify a presence of a selected parameter from a set of parameters for the interpretable method;
- create a bitmask to describe the selected parameter;
- and
- copy the set of parameters to a frame using the bitmask.
A data processing system for invoking a plurality of instructions nonspecific to the data processing system from a native method specific to the data processing system, the data processing system comprising:
- a bus system;
- a communications unit connected to the bus system;
- a memory connected to the bus system, wherein the memory includes a set of instructions;
- and
- a processing unit connected to the bus system, wherein the processing unit executes the set of instructions to examine the plurality of instructions nonspecific to the data processing system prior to a first execution of the instructions to identify a presence of a selected parameter from a set of parameters for the plurality of instructions;
- create a bitmask to describe the selected parameter;
- and copy the set of parameters using the bitmask.
A data processing system for returning from code nonspecific to the data processing system to native code, the data processing system comprising:
- a bus system;
- a communications unit connected to the bus system;
- a memory connected to the bus system, wherein the memory includes a set of instructions;
- and
- a processing unit connected to the bus system, wherein the processing unit executes the set of instructions to receive a call from a native caller to execute a interpretable method;
- create a pointer to a selected return bytecode in response to receiving the call;
- and execute the selected return .bytecode in which the selected return bytecode moves any return value present as a result of execution of the interpretable method into a location for use by the native caller and returns control to the native caller in response to encountering a return in the interpretable method.
Dependencies are inferred from the claim text.