IR code instrumentation
First Claim
Patent Images
1. A method of instrumenting a computer program, comprising:
- (a) examining an initial intermediate representation of the program, wherein the initial intermediate representation is independent of source language for the program;
(b) selecting portions of the initial intermediate representation for instrumentation;
(c) instrumenting the portions; and
(d) creating an intermediate representation tree of nodes corresponding to intermediate representation operations and operands of the initial intermediate representation, the nodes being interconnected according to a logical relationship between the operators and the operands, wherein instrumenting the portions includes modifying the intermediate representation tree;
wherein said creating an intermediate represenation further imcluding;
interconnecting the nodes so that children nodes of an operator are operands thereof; and
placing the children nodes on a local stack and then popping the children nodes off the local stack to connect the children nodes to parents thereof.
6 Assignments
0 Petitions
Accused Products
Abstract
Instrumenting a computer program includes examining an initial intermediate representation of the program, selecting portions of the initial intermediate representation for instrumentation, and instrumenting the portions. Selecting the portions may include choosing portions of the initial intermediate representation corresponding to pointer arithmetic operations, operations that reads memory locations, operations that change memory locations, and/or operations that causes program variables to become defined or undefined within the program. Instrumenting the portions may include adding run time code that provides a user with an indication when a run time error occurs.
-
Citations
39 Claims
-
1. A method of instrumenting a computer program, comprising:
-
(a) examining an initial intermediate representation of the program, wherein the initial intermediate representation is independent of source language for the program;
(b) selecting portions of the initial intermediate representation for instrumentation;
(c) instrumenting the portions; and
(d) creating an intermediate representation tree of nodes corresponding to intermediate representation operations and operands of the initial intermediate representation, the nodes being interconnected according to a logical relationship between the operators and the operands, wherein instrumenting the portions includes modifying the intermediate representation tree;
wherein said creating an intermediate represenation further imcluding;
interconnecting the nodes so that children nodes of an operator are operands thereof; and
placing the children nodes on a local stack and then popping the children nodes off the local stack to connect the children nodes to parents thereof. - View Dependent Claims (2, 3, 4)
(e) following instrumenting the portions by modifying the intermediate representation tree, transforming the tree into an instrumented intermediate representation that is structurally equivalent to the initial intermediate representation.
-
-
5. A method of instrumenting a computer program, comprising:
-
(a) examining an initial intermediate representation of the program, wherein the initial intermediate representation is independent of source languagefor the program;
(b) selecting portions of the initial intermediate representation for instruction;
(c) instrumenting the portions;
(d) creating an effective scope table that correlates a unique scope identifier for each block of intermediate representation code contained within the intial intermediate representation to an effective scope identifier that indicates whether new program variables are defined within a each block of intermediate representation code; and
(e) in reponse to a first block of the intermediate representation code having a first effective scope identifier not equal to a second effective scope identifier of a second block of the intermediate represenation code that precedes the first block of the intermediate representation code, selecting for instrumentation a portion of the intermediate representation code corresponding to a transition between the first and second blocks. - View Dependent Claims (6, 7, 8, 9, 10, 11)
(f) creating an intermediate representation tree of nodes corresponding to intermediate representation operations and operands of the initial intermediate representation, the nodes being interconnected according to a logical relationship between the operators and the operands, wherein instrumenting the portions includes modifying the intermediate representation tree.
-
-
9. The method of claim 8, further comprising:
(g) following instrumenting the portions by modifying the intermediate representation tree, transforming the tree into an instrumented intermediate representation that is structurally equivalent to the initial intermediate representation.
-
10. The method of claim 8, wherein creating the intermediate representation tree includes interconnecting the nodes so that the children nodes of an operator are operands thereof.
-
11. The method of claim 10, wherein creating the intermediate representation tree includes placing the children nodes on a local stack and the popping the children nodes off the local stack to connect the children nodes to parents thereof.
-
12. A method of instrumenting a computer program, comprising:
-
(a) examining an initial intermediate representation of the program, wherein the initial intermediate representation is independent of source languagefor the program;
(b) selecting portions of the initial intermediate representation for instruction;
(c) instrumenting the portions;
(d) creating an effective scope table that correlates a unique scope identifier for each block of intermediate representation code contained within the intial intermediate representation to an effective scope identifier that indicates whether new program variables are defined within a each block of intermediate representation code; and
(e) in reponse to a first block of the intermediate representation code containing a label and having associated a therewith a first effective scope identifier not equal to a second effective scope identifier of a second block of the intermediate represenation code containing a control flow instruction to the label, selecting for instrumentation a portion of the Intermediate representation code corresponding to a transition between the control flow instruction and the label. - View Dependent Claims (13, 14, 15, 16, 17, 18)
(f) creating an intermediate representation tree of nodes corresponding to intermediate representation operations and operands of the initial intermediate representation, the nodes being interconnected according to a logical relationship between the operators and the operands, wherein instrumenting the portions includes modifying the intermediate representation tree.
-
-
16. The method of claim 15, further comprising:
(g) following instrumenting the portions by modifying the intermediate representation tree, transforming the tree into an instrumented intermediate representation that is structurally equivalent to the initial intermediate representation.
-
17. The method of claim 15, wherein creating the intermediate representation tree includes interconnecting the nodes so that children nodes of an operator are operands thereof.
-
18. The method of claim 17, wherein creating the intermediate representation tree includes placing the children nodes on a local stack and then popping the children nodes off the local stack to connect the children nodes to parents thereof.
-
19. A method of instrumenting a computer program, comprising:
-
(a) examining an initial intermediate representation of the program;
(a) creating an intermediate representation tree of nodes corresponding to intermediate representation operations and operands of the intial intermediate representation, the nodes being interconnected according to a logical relationship between the operators and the operands;
(c) selecting portions of the initial intermediate representation for instrumentation; and
(d) instrumenting the portions by modifying the intermediate representation tree, wherein creating the intermediate representation tree further including; interconnecting the nodes so that children nodes of an operator are operands thereof; and
placing the children nodes on a local stack and then popping the children nodes off the local stack to connect the children nodes to parents thereof. - View Dependent Claims (20)
-
-
21. A method of intsrumenting a computer program, comprising:
-
(a) examining an initial intermediate representation of the program;
(b) creating an intermediate representation tree of nodes corresponding to intermediate representation operations and operands of the initial intermediate representation, the nodes being interconnected according to a logical relationship between the operators and the operands;
(c) selecting portions of the initial intermediate representation for instrumentation; and
(d) instrumenting the portions by modifying the intermediate representation tree;
(e) creating an effective scope table that correlates a unique scope identifier for each block of intermediate representation code contained within the initial intermediate representation to an effective scope identifier that indicates whether new program variables are defined with a each block of intermediate representation code; and
(f) in response to a first block of intermediate representation code having a first effective scope identifier not equal to a second effective scope identifier of a second block of intermediate representation code that precedes the first block of intermediate representation code, selecting for instructmentation a portion of the intermediate representation code corresponding to a transition between the first and second blocks. - View Dependent Claims (22, 23, 24)
-
-
25. A method of instrumenting a computer program, comprising:
-
(a) examining an initial intermediate representation of the program;
(b) creating an intermediate representation tree of nodes corresponding to intermediate representation operations and operands of the initial intermediate representation, the nodes being interconnected according to a logical relationship between the operators and the operands;
(c) selecting portions of the initial intermediate representation for instrumentation; and
(d) instrumenting the portions by modifying the intermediate representation tree;
(e) creating an effective scope table that correlates a unique scope identifier for each block of intermediate representation code contained within the initial intermediate representation to an effective scope identifier that indicates whether new program variables are defined within a each block of intermediate representation code; and
(f) in response to a first block of the intermediate representation code containing a label and having associated therewith a first effective scope identifier not equal to a second effive scope Identifier of a second block of the intermediate representation code containing a control flow instruction to the label, selecting for instrumentation a portion of the intermediate representation code corresponding to a transition between the control flow instruction and the label. - View Dependent Claims (26, 27, 28)
-
-
29. A computer program instrumenter, comprising:
-
(a) examining means for examining an initial intermediate representation of the program;
(b) creating means, coupled to the examining means, for creating an intermediate representation of tree nodes corresponding to intermediate representation operations and operands of the initial intermediate representation, the nodes being interconnected according to a logical relationship between the operators and the operands;
(c) selecting means, coupled to the examining means, for selecting portions of the initial intermediate representation for instrumentation; and
(d) instrumenting means, coupled to the creating means and the selecting means, for instrumenting the portions by modifying the intermediate representation tree, wherein said creating means further including; means for interconnecting the nodesso that children nodes of an operator are operands thereof; and
means for placing the children nodes on a local stack and then popping the children nodes off the local stack to connect the children nodes to parents thereof. - View Dependent Claims (30, 31)
-
-
32. A computer program instrumenter, comprising:
-
(a) examining means for examining an initial intermediate representation of the program;
(b) creating means, coupled to the examining means, for creating an intermediate representation of tree nodes corresponding to intermediate representation operations and operands of the initial intermediate representation, the nodes being interconnected according to a logical relationship between the operators and the operands;
(c) selecting means, coupled to the examining means, for selecting portions of the initial intermediate representation for instrumentation;
(d) instrumenting means, coupled to the creating means and the selecting means, for instrumenting the portions by modifying the intermediate representation tree;
(e) means for creating an effective scope table that correlates a unique scope identifier for each block of intermediate representation code contained within the initial intermediate representation to an effective scope identifier that indicates whether new program variables are defined within each block of intermediate representation code; and
(f) means, operating in response to a first block of the intermediate representation code having a first effective scope identifier not equal to a second effective scope identifier of a second block of the intermediate representation code that precedes the first block of the intermediate representation code, for selecting for instrumentation a portion of the intermediate representation code corresponding to a transition between the first and second blocks. - View Dependent Claims (33, 34, 35)
-
-
36. A computer program instrumenter, comprising:
-
(a) examining means for examining an initial intermediate representation of the program;
(b) creating means, coupled to the examining means, for creating an intermediate representation of tree nodes corresponding to intermediate representation operations and operands of the initial intermediate representation, the nodes being interconnected according to a logical relationship between the operators and the operands;
(c) selecting means, coupled to the examining means, for selecting portions of the initial intermediate representation for instrumentation;
(d) instrumenting means, coupled to the creating means and the selecting means, for instrumenting the portions by modifying the intermediate representation tree;
(e) means for creating an effective scope table that correlates a unique scope identifier for each block of intermediate representation code contained within the initial intermediate representation to an effective scope identifier that indicates whether new program variables are defined within each block of intermediate representation code; and
(f) means, operating in response to a first block of the intermediate representation code containing a label and having associated therewith a first effective scope identifier not equal to a second effective scope identifier of the intermediate representation code containing a control flow instruction to the label, for selecting for instrumentation a portion of the intermediate representation code corresponding to a transition between the control flow instruction and the label. - View Dependent Claims (37, 38, 39)
-
Specification