Method and apparatus for efficient invocation of Java methods from native codes
First Claim
Patent Images
1. 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.
1 Assignment
0 Petitions
Accused Products
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.
-
Citations
58 Claims
-
1. 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. - View Dependent Claims (2, 3, 4, 5)
using a method block, known to the native code, to invoke the interpretable method in the interpreter; and
invoking the interpreted method using an invoker identified in the method block.
-
-
3. The process of claim 1 further comprising:
creating a bytecode to indicate a return to native code.
-
4. The method of claim 1, wherein the parameters are copied from a native stack to a Java stack in which the frame is located.
-
5. The method of claim 1, wherein the parameter information describes the parameters as ones requiring processing in addition to being copied to the frame.
-
6. 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. - View Dependent Claims (7, 8, 9, 10, 11, 12)
-
-
13. 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.
-
-
14. 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. - View Dependent Claims (15, 16, 17, 18, 19, 20, 21)
locating a method block for the java method using an identification of the java method.
-
-
18. The process of claim 17, wherein the identification includes a method name, a signature, and an object reference or class reference.
-
19. The process of claim 14, wherein the selected parameter is a float.
-
20. The process of claim 14, wherein the selected parameter is a double.
-
21. The process of claim 14, wherein the selected parameter is a long.
-
22. 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.
-
-
23. 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.
-
-
24. 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. - View Dependent Claims (25, 26, 27)
-
-
28. 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. - View Dependent Claims (29, 30)
using means for using a known method block to invoke the interpretable method in the interpreter; and
invoking means for invoking the interpreted method using an invoker identified in the known method block.
-
-
30. The data processing system of claim 28 further comprising:
creating means for creating a bytecode to indicate a return to the method written in native code.
-
31. 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. - View Dependent Claims (32, 33, 34, 35)
-
-
36. 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.
-
-
37. 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.
-
-
38. 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. - View Dependent Claims (39, 40, 41, 42, 43, 44, 45)
locating means for locating a method block for the java method using an identification of the java method.
-
-
42. The data processing system of claim 41, wherein the identification includes a method name, a signature, and an object reference or class reference.
-
43. The data processing system of claim 38, wherein the selected parameter is a float.
-
44. The data processing system of claim 38, wherein the selected parameter is a double.
-
45. The data processing system of claim 38, wherein the selected parameter is a long.
-
46. 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.
-
-
47. 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.
-
-
48. 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. - View Dependent Claims (49, 50)
-
-
51. 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.
-
-
52. 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.
-
-
53. 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.
-
-
54. 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.
-
-
55. 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.
-
-
56. 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.
-
-
57. 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.
-
-
58. 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.
-
Specification