Compile-time folding of assumed constant values

US10936290B2 · US · B2

Patent metadata
FieldValue
Publication numberUS-10936290-B2
Application numberUS-201816204594-A
CountryUS
Kind codeB2
Filing dateNov 29, 2018
Priority dateNov 29, 2018
Publication dateMar 2, 2021
Grant dateMar 2, 2021

How to read this patent

A practical reading order for non-experts. Skip the full description unless you need deep technical detail.

  1. Title

    What the patent document calls the invention.

  2. Abstract

    A short plain-language summary of the technical disclosure.

  3. Assignees and inventors

    Who owns or filed the patent and who is credited as inventor.

  4. Key dates

    Filing, priority, publication, and grant dates set the timeline.

  5. First independent claim

    The legal scope of protection — read this for what is actually claimed.

  6. CPC / IPC classifications

    Technology tags used to group this patent with similar filings.

  7. Citations and related patents

    Prior art links and similar publications in this corpus.

Abstract

Official abstract text for this publication.

A computer-implemented method includes: selecting, by a computer device, a set of fields in a program which are marked as final fields to be treated as constants; adding, by the computer device, detection logic to the program, the detection logic including a process that detects writes to the final fields to be treated as constants; compiling, by the computer device, the program into compiled code; executing, by the computer device, the compiled code; detecting, by the computer device, a write to a first one of the final fields to be treated as constants; and transitioning, by the computer device, execution of the compiled code from the compiled code to an interpreter for processing by compensation code that operates on the first one of the final fields to be treated as constants.

First claim

Opening claim text (preview).

What is claimed is: 1. A computer-implemented method comprising: selecting, by a computer device, a set of fields in a program which are marked as final fields to be treated as constants; adding, by the computer device, detection logic to the program, the detection logic including a process that detects writes to the final fields to be treated as constants; compiling, by the computer device, the program into compiled code; executing, by the computer device, the compiled code; detecting, by the computer device, a write to a first one of the final fields to be treated as constants; and transitioning, by the computer device, execution of the compiled code from the compiled code to an interpreter for processing by compensation code that operates on the first one of the final fields to be treated as constants. 2. The computer-implemented method of claim 1 , further comprising running, by the computer device, the compensation code. 3. The computer-implemented method of claim 1 , wherein the compensation code treats as a variable the first one of the final fields to be treated as constants. 4. The computer-implemented method of claim 1 , wherein the compiling is performed by a just-in-time compiler running on the computer device. 5. The computer-implemented method of claim 1 , further comprising storing, by the computer device, in a single bit on a class, a record of the write to the first one of the final fields to be treated as constants, wherein the write to the first one of the final fields to be treated as constants is performed after the executing. 6. The computer-implemented method of claim 1 , further comprising recording, by the computer device, the first one of the final fields to be treated as constants as a field that has been modified. 7. The computer-implemented method of claim 1 , further comprising processing, by the computer device, the compiled code for processing that does not write to the final fields to be treated as constants. 8. The computer-implemented method of claim 1 , wherein the computer device includes software provided as a service in a cloud computing environment. 9. A computer program product, the computer program product comprising a computer readable storage medium having program instructions embodied therewith, the program instructions executable by a computing device to cause the computing device to: select a set of fields in a program which are marked as final fields to be treated as constants; add detection logic to the program, the detection logic including a process that detects writes to the final fields to be treated as constants, the detection logic being added to a bytecode interpreter loop and a Java Native Interface; compile the program into compiled code by a compiler; execute the compiled code; detect a write to a first one of the final fields to be treated as constants; and transition execution of the compiled code from the compiled code to an interpreter for processing by compensation code that operates on the first one of the final fields to be treated as constants, wherein the compiler uses a tree-based intermediate representation (IR), execution of the compensation code only occurs in roots of trees in the IR, and different occurrences of the execution of the compensation code are linked together in an ordered sequence which reflects an order in which the occurrences are executed. 10. The computer program product of claim 9 , further comprising program instructions executable by the computing device to cause the computing device to run the compensation code. 11. The computer program product of claim 9 , wherein the compensation code treats as a variable the first one of the final fields to be treated as constants. 12. The computer program product of claim 9 , wherein the compiling is performed by a just-in-time compiler running on the computer device. 13. The computer program product of claim 9 , further comprising program instructions executable by the computing device to record the first one of the final fields to be treated as constants as a field that has been modified. 14. The computer program product of claim 9 , further comprising program instructions executable by the computing device to process the compiled code for processing that does not write to the final fields to be treated as constants. 15. A system, comprising: a processor, a computer readable memory, and a computer readable storage medium; program instructions to select a set of fields in a program which are marked as final fields to be treated as constants; program instructions to add detection logic to the program, the detection logic including a process that detects writes to the final fields to be treated as constants; program instructions to compile the program into compiled code; program instructions to execute the compiled code; program instructions to detect a write to a first one of the final fields to be treated as constants; and program instructions to transition execution of the compiled code from the compiled code to an interpreter for processing by compensation code that operates on the first one of the final fields to be treated as constants, wherein the program instructions are stored on the computer readable storage medium for execution by the processor via the computer readable memory. 16. The system of claim 15 , further comprising program instructions to cause the processor to run the compensation code. 17. The system of claim 15 , wherein the compensation code treats as a variable the first one of the final fields to be treated as constants. 18. The system of claim 15 , wherein the compiling is performed by a just-in-time compiler running on the processor. 19. The system of claim 15 , further comprising program instructions to record the first one of the final fields to be treated as constants as a field that has been modified. 20. The system of claim 15 , further comprising program instructions to process the compiled code for processing that does not write to the final fields to be treated as constants.

Assignees

Inventors

Classifications

  • G06F8/443Primary

    Optimisation · CPC title

  • G06F9/4552Primary

    Involving translation to a different instruction set architecture, e.g. just-in-time translation in a JVM · CPC title

Patent family

Related publications grouped by family.

External sources

Frequently asked questions

Answers are generated from the same data shown on this page.

What does patent US10936290B2 cover?
A computer-implemented method includes: selecting, by a computer device, a set of fields in a program which are marked as final fields to be treated as constants; adding, by the computer device, detection logic to the program, the detection logic including a process that detects writes to the final fields to be treated as constants; compiling, by the computer device, the program into compiled c…
Who is the assignee on this patent?
IBM
What technology area does this patent fall under?
Primary CPC classification G06F8/443. Mapped technology areas include Physics.
When was this patent published?
Publication date Tue Mar 02 2021 00:00:00 GMT+0000 (Coordinated Universal Time) (B2). Legal status and post-grant events are not shown on this page.
What related patents are in patentsdb?
We list 5 related publications on this page (citations in our corpus or others sharing the same primary CPC).