Inlining native functions into compiled java code
First Claim
1. A method in a data processing system for inlining native functions into compiled Java code, the method comprising;
- running a just-in-time compiler by a Java runtime environment to a standard inlining phase;
responsive to running the just-in-time compiler to the standard inlining phase, detecting a native function call at a Java callsite;
determining if the native function call is to an opaque function, wherein the call to the opaque function invokes procedures for which a just-in-time compiler cannot render an intermediate representation;
if the native function call is to an opaque function, determine whether the Java callsite was created while processing Java bytecodes;
if the Java callsite was not created while processing Java bytecode, synthesizing a Java callable native function, and replacing the native function call with a call to the synthesized native function, wherein the synthesized native function provides access to a native library containing an implementation of the opaque function;
responsive to determining that the native function call is not an opaque function, converting an intermediate representation of native function to a just-in-time compiler intermediate representation and omitting inlining of native functions called from opaque functions; and
inlining the just-in-time compiler intermediate representation into the Java callsite.
0 Assignments
0 Petitions
Accused Products
Abstract
A method, apparatus, and computer instructions are provided for inlining native functions into compiled Java code. A conversion engine is provided by the present invention for converting the intermediate representation of native functions to the just-in-time (JIT) compiler'"'"'s intermediate representation. With the converted intermediate representation, an inliner recursively inlines the converted JIT compiler'"'"'s intermediate representation into the native callsite to remove the need of invoking the native function and subsequent native calls made by the function. The inlining process continues until either a call to an opaque function is encountered or until a JIT compiler intermediate representation growth limits are reached. The inliner also replaces calls to most native functions that are non-inlineable or opaque with calls to synthesized native functions that provide access to native libraries containing implementations of the original non-inlineable calls.
-
Citations
23 Claims
-
1. A method in a data processing system for inlining native functions into compiled Java code, the method comprising;
-
running a just-in-time compiler by a Java runtime environment to a standard inlining phase; responsive to running the just-in-time compiler to the standard inlining phase, detecting a native function call at a Java callsite; determining if the native function call is to an opaque function, wherein the call to the opaque function invokes procedures for which a just-in-time compiler cannot render an intermediate representation; if the native function call is to an opaque function, determine whether the Java callsite was created while processing Java bytecodes; if the Java callsite was not created while processing Java bytecode, synthesizing a Java callable native function, and replacing the native function call with a call to the synthesized native function, wherein the synthesized native function provides access to a native library containing an implementation of the opaque function; responsive to determining that the native function call is not an opaque function, converting an intermediate representation of native function to a just-in-time compiler intermediate representation and omitting inlining of native functions called from opaque functions; and inlining the just-in-time compiler intermediate representation into the Java callsite. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12)
-
-
13. A data processing system for inlining native functions into compiled Java code, the data processing system comprising:
-
one or more processors, one or more non-transitory computer readable mediums, and one or more computer readable memories; program instructions, stored in at least one non-transitory computer readable medium, for running a just-in-time compiler by a Java runtime environment to a standard inlining phase; program instructions, stored in at least one non-transitory computer readable medium, for detecting, responsive to running the just-in-time compiler to the standard inlining phase, a native function call at a Java callsite; program instructions, stored in at least one non-transitory computer readable medium, for determining if the native function call is to an opaque function, wherein the call to the opaque function invokes procedures for which a just-in-time compiler cannot render an intermediate representation; program instructions, stored in at least one non-transitory computer readable medium, for determining, responsive to determining that the native function call is to an opaque function, whether the Java callsite was created while processing Java bytecodes; program instructions, stored in at least one non-transitory computer readable medium, for synthesizing, responsive to determining that the Java callsite was not created while processing Java bytecode, a Java callable native function, and replacing the native function call with a call to the synthesized native function, wherein the synthesized native function provides access to a native library containing an implementation of the opaque function; program instructions, stored in at least one non-transitory computer readable medium, for converting, responsive to determining that the native function call is not an opaque function, an intermediate representation of native function to a just-in-time compiler intermediate representation and omitting inlining of native functions called from opaque functions; program instructions, stored in at least one non-transitory computer readable medium, for inlining the just-in-time compiler intermediate representation into the Java callsite. - View Dependent Claims (14, 15, 16, 17, 18)
-
-
19. A computer program product in a non-transitory computer readable medium for inlining native functions into compiled Java code, the computer program product comprising:
-
first instructions, stored in the non-transitory computer readable medium, for running a just-in-time compiler by a Java runtime environment to a standard inlining phase; second instructions, stored in the non-transitory computer readable medium, for detecting, responsive to running the just-in-time compiler to the standard inlining phase, a native function call at a Java callsite; third instructions, stored in the non-transitory computer readable medium, for determining if the native function call is to an opaque function, wherein the call to the opaque function invokes procedures for which a just-in-time compiler cannot render an intermediate representation; fourth instructions, stored in the non-transitory computer readable medium, for determining, responsive to determining that the native function call is to an opaque function, whether the Java callsite was created while processing Java bytecodes; fifth instructions, stored in the non-transitory computer readable medium, for synthesizing, responsive to determining that the Java callsite was not created while processing Java bytecode, a Java callable native function, and replacing the native function call with a call to the synthesized native function, wherein the synthesized native function provides access to a native library containing an implementation of the opaque function; sixth instructions, stored in the non-transitory computer readable medium, for converting, responsive to determining that the native function call is not an opaque function, an intermediate representation of native function to a just-in-time compiler intermediate representation and omitting inlining of native functions called from opaque functions; seventh instructions, stored in the non-transitory computer readable medium, for inlining the just-in-time compiler intermediate representation into the native function. - View Dependent Claims (20, 21, 22, 23)
-
Specification