Application program interface for transforming heterogeneous programs
AssigneeMicrosoft Corporation
InventorsAndrew J. Edwards, Ken B. Pierce, Amitabh Srivastava
Life of this patent
Estimating the term…
Abstract
An application program interface (API) into an hierarchical intermediate representation (IR) of a heterogeneous program enables the navigation and modification of the IR at all levels of the hierarchy. Additional functions provide information about the IR that can be employed by a user in understanding the logic flow of the program and by an output translator to convert the IR into blocks of platform-specific instructions for a new version of the heterogeneous program. The API functions are also utilized by pre-defined program tools to instrument and optimize the IR, and thus the heterogeneous program created from the IR.
Claims32
An application program interface embodied on a computer-readable medium for execution on a computer in conjunction with an intermediate representation of a heterogeneous program, the application program interface comprising:
- a navigation function that returns an element in the intermediate representation to a caller of the application program interface;
- a query function that returns information about the element in the intermediate representation returned by the navigation function to the caller;
- and
- a modification function that modifies the element in the intermediate representation as directed by the caller, wherein the intermediate representation comprises a plurality of platform-neutral elements, wherein the plurality of platform-neutral elements comprise (a) one or more platform-neutral elements derived from a first code written for a first computer architecture, and (b) one or more platform-neutral elements derived from a second code written for a second computer architecture, wherein the first computer architecture is different from the second computer architecture.
A computerized system comprising:
- a processing unit;
- a system memory coupled to the processing unit through a system bus;
- a computer-readable medium coupled to the processing unit through a system bus;
- an intermediate representation for a heterogeneous program in the system memory;
- a transformation process executing in the processing unit;
- and
- an application program interface executed from the computer-readable medium by the processing unit, wherein the transformation process calls the application program interface to cause the processing unit to modify one or more elements in the intermediate representation, wherein the intermediate representation comprises a plurality of platform-neutral elements, wherein the plurality of platform-neutral elements comprise (a) one or more platform-neutral elements derived from a first code written for a first computer architecture, and (b) one or more platform-neutral elements derived from a second code written for a second computer architecture, wherein the first computer architecture is different from the second computer architecture.
A computer-readable medium having computer-executable instructions stored thereon to provide an interface to one or more elements within a hierarchy of an intermediate representation of a heterogeneous program comprising:
- an instruction application interface exposed by an instruction element in the hierarchy for navigating, querying, modifying, and translating an instruction in the intermediate representation;
- a block application interface exposed by a block element in the hierarchy for navigating, querying, and modifying a block in the intermediate representation;
- a procedure application interface exposed by a procedure element in the hierarchy for navigating, querying, and modifying a procedure in the intermediate representation;
- and
- a component application interface exposed by a component element in the hierarchy for navigating, querying, and modifying a component in the intermediate representation, wherein the intermediate representation comprises a plurality of platform-neutral elements, wherein the plurality of platform-neutral elements comprise:
- (a) one or more platform-neutral elements derived from a first code written for a first computer architecture, and (b) one or more platform-neutral elements derived from a second code written for a second computer architecture, wherein the first computer architecture is different from the second computer architecture.
A computerized method of interfacing a user process to an intermediate representation of a heterogeneous program with the intermediate representation arranged as a hierarchy of classes, the method comprising:
- issuing, by the user process, an initial navigation call for a class within the hierarchy, wherein the initial navigation call specifies an absolute location within the hierarchy for an element in the class;
- creating, by an interface process, an iterator for the class in response to receiving the initial navigation call;
- returning, by the interface process, the element of the class located in the hierarchy at the absolute location, wherein the element is designated as a current element for the class;
- issuing, by the user process, a modification call for the class, wherein the modification call specifies a change to the intermediate representation relative to the current element of the class;
- and
- changing, by the interface process, the intermediate representation in response to receiving the modification call, wherein the intermediate representation comprises a plurality of platform-neutral elements, wherein the plurality of platform-neutral elements comprise (a) one or more platform-neutral elements derived from a first code written for a first computer architecture, and (b) one or more platform-neutral elements derived from a second code written for a second computer architecture, wherein the first computer architecture is different from the second computer architecture.
An application program interface embodied on a computer-readable medium for execution on a computer in conjunction with an intermediate representation of a heterogeneous program, the application program interface comprising:
- a navigation function;
- a query function;
- and
- a modification function;
- wherein the navigation function is capable of returning a first element, a last element, a previous element, or a next element relative to a current element, within the intermediate representation, to a caller of the application program interface, wherein the intermediate representation comprises a plurality of platform-neutral elements, wherein the plurality of platform-neutral elements comprise (a) one or more platform-neutral elements derived from a first code written for a first computer architecture, and (b) one or more platform-neutral elements derived from a second code written for a second computer architecture, wherein the first computer architecture is different from the second computer architecture.
An application program interface embodied on a computer-readable medium for execution on a computer in conjunction with an intermediate representation of a heterogeneous program, the application program interface comprising:
- a navigation function that returns an element in the intermediate representation to a caller of the application program interface;
- a query function that returns information about the element in the intermediate representation returned by the navigation function to the caller;
- a modification function that modifies the element in the intermediate representation as directed by the caller;
- and
- an output translation function that translates the element returned by the navigation function into a corresponding element for a specific computer architecture and returns the corresponding element to the caller, wherein the output translation function determines the specific computer architecture based on a flag set by the caller.
A computerized system comprising:
- a processing unit;
- a system memory coupled to the processing unit through a system bus;
- a computer-readable medium coupled to the processing unit through a system bus;
- an intermediate representation for a heterogeneous program in the system memory;
- a transformation process executed by the processing unit;
- and
- an application program interface executed from the computer-readable medium by the processing unit, wherein the transformation process calls the application program interface to cause the processing unit to translate one or more elements in the intermediate representation into a corresponding one or more elements for a specified computer architecture, and wherein the transformation process calls the application program interface to cause the processing unit to set a flag in the intermediate representation that specifies the computer architecture.
Dependencies are inferred from the claim text.