Mechanism for increasing the performance of multiple language programs by inserting called language ir into the calling language
US-2017046137-A1 · Feb 16, 2017 · US
US12061885B2 · US · B2
| Field | Value |
|---|---|
| Publication number | US-12061885-B2 |
| Application number | US-202117484504-A |
| Country | US |
| Kind code | B2 |
| Filing date | Sep 24, 2021 |
| Priority date | Mar 25, 2019 |
| Publication date | Aug 13, 2024 |
| Grant date | Aug 13, 2024 |
A practical reading order for non-experts. Skip the full description unless you need deep technical detail.
What the patent document calls the invention.
A short plain-language summary of the technical disclosure.
Who owns or filed the patent and who is credited as inventor.
Filing, priority, publication, and grant dates set the timeline.
The legal scope of protection — read this for what is actually claimed.
Technology tags used to group this patent with similar filings.
Prior art links and similar publications in this corpus.
Official abstract text for this publication.
A compilation method includes obtaining a source program code. The source program code includes a first function in a first language code and a second function in a second language code. The first language code is a native language. The second language code is a non-native language. The method also includes generating a third language code based on the source program code. The third language code includes a third function, a fourth function and a fifth function. The third function is generated based on the first function. The fourth function is generated based on the second function. The fifth function is generated based on the first function and the second function. Executing the third function invokes the fourth function via the fifth function.
Opening claim text (preview).
What is claimed is: 1. A compilation method, wherein the method comprises: obtaining a source program code, wherein the source program code comprises a first function in a first language code and a second function in a second language code, the first language code is a native language, and the second language code is a non-native language; and generating a third language code based on the source program code, wherein the third language code comprises a third function, a fourth function and a fifth function, the third function is generated based on the first function, the fourth function is generated based on the second function, and the fifth function is generated based on the first function and the second function, wherein executing the third function invokes the fourth function via the fifth function, and wherein the third language code further comprises a field information of a class, a function information of the class, and an inheritance relationship of the class that are in the second language code. 2. The method according to claim 1 , wherein generating the third language code based on the source program code comprises: determining that an exception occurs in the first function; and based on the determination that the exception occurs in the first function, generating the fifth function comprising an exception handling function. 3. The method according to claim 1 , wherein generating the third language code based on the source program code further comprises: determining that the first function accesses an object in the second language code; and based on a determination that the third language code is generated based on the source program code, generating an object reference table of the object in the second language code. 4. The method according to claim 1 , wherein the second language code is a Java language code and generating the third language code based on the source program code further comprises: based on a determination that the first function accesses a Java native interface (JNI) pointer in the second language code, adding the JNI pointer to a parameter of the fifth function. 5. The method according to claim 1 , wherein the second language code is a Java language code and generating the third language code based on the source program code further comprises: based on a determination that the first function accesses one or more of a Java object or a Java class object in the second language code, adding one or more of the Java object or the Java class object to a parameter of the fifth function. 6. The method according to claim 1 , wherein when the third language code is generated based on the source program code, generating the fifth function comprises: determining a signature of the second function in the second language code based on the inheritance relationship of the class and the function information of the class, wherein the signature is used to indicate a name of the second function in the second language code and the class in which the second function is located in the second language; and generating the fifth function based on the signature. 7. The method according to claim 1 , wherein generating the third language code based on the source program code further comprises: generating a sixth function based on the inheritance relationship of the class and the field information of the class, wherein the sixth function is used to access a field in the second language code. 8. An apparatus for compilation, comprising: a processor; and a memory having instructions stored thereon that, when executed by the processor, causes the apparatus to: obtain a source program code, wherein the source program code comprises a first function in a first language code and a second function in a second language code, the first language code is a native language, and the second language code is a non-native language; and generate a third language code based on the source program code, wherein the third language code comprises a third function, a fourth function and a fifth function, the third function is generated based on the first function, the fourth function is generated based on the second function, and the fifth function is generated based on the first function and the second function, wherein executing the third function invokes the fourth function via the fifth function, and wherein the third language code further comprises a field information of a class, a function information of the class, and an inheritance relationship of the class that are in the second language code. 9. The apparatus according to claim 8 , wherein the apparatus is further caused to: based on a determination that an exception occurs in the first function, generate the fifth function comprising an exception handling function. 10. The apparatus according to claim 8 , wherein the apparatus is further caused to: based on a determination that the third language code is generated based on the source program code, generate an object reference table of the object in the second language code. 11. The apparatus according to claim 8 , wherein the apparatus is further caused to: based on a determination that the first function accesses a Java native interface (JNI) pointer in the second language code, add the JNI pointer to a parameter of the fifth function. 12. The apparatus according to claim 8 , wherein the apparatus is further caused to: based on a determination that the first function accesses at least one of a Java object or a Java class object in the second language code, add the Java object or the Java class object to a parameter of the fifth function. 13. The apparatus according to claim 8 , wherein the apparatus is further caused to: determine a signature of the second function in the second language code based on the inheritance relationship of the class and a function information of the class, wherein the signature is used to indicate a name of the second function in the second language code and the class in which the second function is located in the second language; and generate the fifth function based on the signature. 14. The apparatus according to claim 8 , wherein the apparatus is further caused to: generate a sixth function based on an inheritance relationship of a class and a field information of the class, wherein the sixth function is used to access a field in the second language code. 15. A non-transitory computer-readable medium having instructions stored thereon that, when executed by a processor, cause a terminal to: obtain a source program code, wherein the source program code comprises a first function in a first language code and a second function in a second language code, the first language code is a native language, and the second language code is a non-native language; and generate a third language code based on the source program code, wherein the third language code comprises a third function, a fourth function and a fifth function, the third function is generated based on the first function, the fourth function is generated based on the second function, the fifth function is generated based on the first function and the second function, wherein executing the third function invokes the fourth function via the fifth function, and wherein the third language code further comprises a field information of a class, a function information of the class, and an inheritance relationship of the class that are in the second language code. 16. The non-transitory computer readable medium according to claim 15 , wherein the terminal is caused to generate the third lang
Involving translation to a different instruction set architecture, e.g. just-in-time translation in a JVM · CPC title
Pointers; Aliasing · CPC title
Object-oriented languages · CPC title
Encoding · CPC title
Target code generation · CPC title
Related publications grouped by family.
Answers are generated from the same data shown on this page.