Read, Write, And Array Tracking In Code Representations
AssigneeOracle International Corporation
InventorDaniel Goodman
Life of this patent
Estimating the term…
Abstract
Read, write, and array tracking may be performed for a tree representing a program or a portion of a program. A tree may be obtained from a compiler or an interpreter. The tree may be traversed to generate a map data structure in a single pass, constructing a chain of dependencies between results observed at each node visited as part of traversing the tree.
Claims20
A system, comprising:
- at least one processor;
- a memory, comprising program instructions that when executed by the at least one processor cause the at least one processor to:
- obtain a tree representing a program or a portion of a program;
- traverse the tree to generate a map data structure in a single pass, wherein the map data structure maps the tree, and different subtrees of the tree, to respective data structures that comprise:
- a first set of variables declared prior to the program or the portion of the program represented by the tree and in scope for the tree;
- a second set of variables read by the program or the portion of the program represented by the tree;
- and
- a third set of variables modified by the program or the portion of the program represented by the tree;
- and
- a set of array references that respectively reference an array possibly modified by the program or the portion of the program represented by the tree;
- and
- wherein to traverse the tree, the program instructions cause the at least one processor to construct a chain of dependencies between results observed at each node visited as part of traversing the tree.
A method, comprising:
- performing, by one or more computing devices:
- for a tree representing a program or a portion of the program:
- traversing the tree to generate a map data structure in a single pass, wherein the map data structure maps the tree, and different subtrees of the tree, to respective data structures that comprise:
- a first set of variables declared prior to the program or the portion of the program represented by the tree and in scope for the tree;
- a second set of variables read by the program or the portion of the program represented by the tree;
- a third set of variables modified by the program or the portion of the program represented by the tree;
- and
- a set of array references that respectively reference an array possibly modified by the program or the portion of the program represented by the tree;
- and
- wherein traversing the tree comprises constructing a chain of dependencies between results observed at each node visited as part of traversing the tree.
One or more, non-transitory, computer-readable storage media, storing program instructions that when executed on or across one or more computing devices, cause the one or more computing devices to implement:
- for a tree representing a program or the portion of the program:
- traversing the tree to generate a map data structure in a single pass, wherein the map data structure maps the tree, and different subtrees of the tree, to respective data structures that comprise:
- a first set of variables declared prior to the program or the portion of the program represented by the tree and in scope for the tree;
- a second set of variables read by the program or the portion of the program represented by the tree;
- and
- a third set of variables modified by the program or the portion of the program represented by the tree;
- and
- a set of array references that respectively reference an array possibly modified by the program or the portion of the program represented by the tree;
- and
- wherein in traversing the tree, the program instructions cause the one or more computing devices to implement constructing a chain of dependencies between results observed at each node visited as part of traversing the tree.
Dependencies are inferred from the claim text.