Transforming code to expose glacial constants to a compiler
Abstract
Techniques for causing a compiler to organize code pertaining to data that is not constant, but that is unlikely to change except in relatively infrequent situations, in an improved manner. A class containing data that may have more than one value, but which will have a particular value in the typical case, is now split into two parts, a first class which uses the more-likely data value as a constant, and a second class (designed as a subclass of the first class) that uses the data value as a variable capable of having either the more-likely value or other, less-likely values. The compiler generates assembly code comprising instructions pertaining to the more-likely data value, and also generates assembly code capable of processing the less-likely data values. This latter code, however, is initially unreachable. The compiler-generated assembly code will be programmatically patched, at run time, if any of the less-likely data values occur, thereby dynamically making the code reachable. Once the initially-unreachable code becomes reachable, it will be used thereafter (regardless of the setting of the data value).
Interactive Citation Constellation Global Citation Ranking
Interactive SVG Citation Constellation renders in Rust/WebAssembly. Prior art cited: 16 · Forward citations: 13.
Claims (1 — 1 Independent, 0 Dependent)
- Claim 1Independent Claim
A method of processing code that uses glacial constants, comprising: providing, for a first code component that uses a glacial constant, two code components as replacements for the first code component, wherein: the first code component is written in a particular programming language; the two code components comprise a base code component wherein the glacial constant is used as a constant value and an overriding code component wherein the glacial constant is used as a variable value, the overriding code component overriding at least a portion of code in the base code component; and the base co
Technical Overview & Description
Full multi-page specification text is archived at the issuing office. Read complete official specification ↗
Cited By — Indexed Forward Citations (13 of 13 total)
References Cited — Backward Prior Art (16)
Non-Patent Literature (5)
- Autrey and Wolfe, "Initial Results for Glacial Variables Analysis", 1998, International Journal of Parallel Programming, vol. 26, No. 1, pp. 43-64.
- Calder et al. "Value Profiling and Optimization", 1999, Journal of Instruction-Level Parallelism, pp. 1-37.
- David Evans, "Lecture 12: Subtyping and Inheritance", University of Virginia, Oct. 2003; retrieved from "http://www.cs.virginia.edu/cs201j/lectures/lecture12.ppt/" on Oct. 8, 2007.
- Frank Tip and Peter F. Sweeney, "Class Hierarchy Specialization", 1997 ACM, pp. 271-281.
- Peter F. Sweeney and Frank Tip, "Extracting Library-Based Object-Oriented Applications", 2000 ACM, pp. 98-107.