Intermediate Language Representation and Modification
First Claim
1. A computer-implemented method for modifying execution of a computer program function having a plurality of instructions, comprising:
- a) in response to detecting an invocation of the computer program function, generating a directed graph representing the computer program function, the directed graph including a plurality of instruction nodes, each instruction node representing a corresponding instruction of the plurality of instructions;
b) inserting, into the directed graph, one or more back edges that point from an instruction node representing a target of a branch instruction to an instruction node representing the branch instruction;
c) manipulating the directed graph by employing the one or more back edges to perform at least one of adding or removing at least one additional instruction node to the directed graph; and
d) translating the directed graph to an intermediate language representation of the computer program function.
2 Assignments
0 Petitions
Accused Products
Abstract
A system and method for facilitating analysis and modification of a computer program. A directed graph is generated from an intermediate language representation of a computer program function, with a node representing each instruction. Meta-edges or meta-nodes are inserted into the directed graph to facilitate location of instruction nodes. One type of meta-edge is a back edge that identifies branch instruction nodes. Some meta-nodes may identify instructions of a specific type. Some meta-nodes may identify exception blocks and corresponding handlers. Analysis of a program function may include insertion of new instructions prior to execution of the function.
-
Citations
20 Claims
-
1. A computer-implemented method for modifying execution of a computer program function having a plurality of instructions, comprising:
-
a) in response to detecting an invocation of the computer program function, generating a directed graph representing the computer program function, the directed graph including a plurality of instruction nodes, each instruction node representing a corresponding instruction of the plurality of instructions; b) inserting, into the directed graph, one or more back edges that point from an instruction node representing a target of a branch instruction to an instruction node representing the branch instruction; c) manipulating the directed graph by employing the one or more back edges to perform at least one of adding or removing at least one additional instruction node to the directed graph; and d) translating the directed graph to an intermediate language representation of the computer program function. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8)
-
-
9. A computer-readable storage medium comprising computer program instructions for enabling execution of a computer program function having a plurality of instructions including at least one branch instruction and at least one exception handler, the program instructions executable by a processor to perform actions including:
-
a) in response to detecting an invocation of the computer program function, generating a data structure representing the computer program function, the data structure including at least one directed graph, each of the plurality of instructions represented by a corresponding instruction node of the at least one directed graph; b) inserting, into the at least one directed graph, a back edge corresponding to each target of each branch instruction, the back edge indicating an instruction node representing the branch instruction corresponding to the target; c) employing the back edge to insert at least one instruction node into the at least one directed graph; d) inserting, into the at least one directed graph, at least one instruction type meta-node, each instruction type meta-node having one or more edges to a corresponding one or more instruction nodes of the at least one directed graph, the one or more instruction nodes representative of a type of instruction corresponding to the instruction type meta-node; e) employing the one or more edges of the at least one instruction type meta-node to insert at least one other instruction node into the at least one directed graph; and f) translating the data structure to an intermediate language representation of the computer program function. - View Dependent Claims (10, 11, 12, 13)
-
-
14. A computer-based system for translating and executing a computer program, comprising:
-
a) means for, in response to invocation of a computer program function, generating a directed graph representing the computer program function, the directed graph including at least one instruction type meta-node pointing to at least one node representing an instruction of a designated type; b) means for modifying the directed graph to insert one or more nodes representative of one or more program instructions for performing analysis of the computer program function; c) means for translating the directed graph to an executable representation of the computer program function; and d) means for facilitating execution of the executable representation of the computer program function. - View Dependent Claims (15, 16, 17, 18, 19, 20)
-
Specification