Tracking variable information in optimized code
First Claim
1. At a computer system including a processor and a memory, a computer-implemented method for tracking variable location information in optimized code, the method comprising the computer system performing the following acts:
- receiving a portion of source code at a compiler, wherein the compiler is configured to compile and optimize the source code for execution;
tagging one or more selected variables in the source code with a tag, wherein the tag is configured to provide location information for the variable and wherein tagging the one or more selected variables occurs before the compiler converts the source code into an intermediate form;
the compiler optimizing the received portion of source code, wherein optimizing comprises changing one or more of the tagged variables and changing comprises replacing the one or more of the tagged variables with a value or a set of instructions;
tracking the tagged variables as the variables are changed by the compiler during code optimization, wherein tracking the tagged variables comprises each of tracking each change, move, and replacement of each of the tagged variables so that the tar associated with a tagged variable adheres to the value or set of instructions which replaced the tagged variable and so that the value or set of instructions which replaced the tagged variable are tracked in place of the tagged variable;
persisting the variable location information, so that the persisted variable location information is available to one or more other compiler components;
compressing the persisted variable location information using a domain-specific compression algorithm;
a debugger decompressing the compressed variable location information; and
the debugger displaying the decompressed variable location information to a user.
2 Assignments
0 Petitions
Accused Products
Abstract
Embodiments are directed to tracking variable location information in optimized code and efficiently collecting and storing reaching definition information. A computer system receives a portion of source code at a compiler, where the compiler is configured to compile and optimize the source code for execution. The computer system tags selected variables in the source code with a tag, where the tag is configured to provide location information for the variable. The computer system optimizes the received portion of source code including changing at least one of the tagged variables. The computer system also tracks the tagged variables as the variables are changed by the compiler during code optimization and persists the variable location information, so that the persisted variable location information is available to other compiler components.
-
Citations
17 Claims
-
1. At a computer system including a processor and a memory, a computer-implemented method for tracking variable location information in optimized code, the method comprising the computer system performing the following acts:
-
receiving a portion of source code at a compiler, wherein the compiler is configured to compile and optimize the source code for execution; tagging one or more selected variables in the source code with a tag, wherein the tag is configured to provide location information for the variable and wherein tagging the one or more selected variables occurs before the compiler converts the source code into an intermediate form; the compiler optimizing the received portion of source code, wherein optimizing comprises changing one or more of the tagged variables and changing comprises replacing the one or more of the tagged variables with a value or a set of instructions; tracking the tagged variables as the variables are changed by the compiler during code optimization, wherein tracking the tagged variables comprises each of tracking each change, move, and replacement of each of the tagged variables so that the tar associated with a tagged variable adheres to the value or set of instructions which replaced the tagged variable and so that the value or set of instructions which replaced the tagged variable are tracked in place of the tagged variable; persisting the variable location information, so that the persisted variable location information is available to one or more other compiler components; compressing the persisted variable location information using a domain-specific compression algorithm; a debugger decompressing the compressed variable location information; and the debugger displaying the decompressed variable location information to a user. - View Dependent Claims (2, 3, 4, 5, 6, 7)
-
-
8. A computer program product for implementing a method for efficiently collecting and storing reaching definition information, the computer program product comprising one or more computer-readable hardware storage devices having stored thereon computer-executable instructions that, when executed by one or more processors of the computing system, cause the computing system to perform the method, the method comprising:
-
receiving a portion of source code at a compiler, wherein the compiler is configured to compile and optimize the source code for execution; tagging one or more selected variables in the source code with a tag, wherein the tag is configured to provide location information for the variable and wherein tagging the one or more selected variables occurs before the compiler converts the source code into an intermediate form; the compiler optimizing the received portion of source code, wherein optimizing comprises changing one or more of the tagged variables and changing comprises replacing the one or more of the tagged variables with a value or a set of instructions; calculating one or more reaching definitions for one or more tagged variables implemented by the compiler during source code optimization, wherein the reaching definitions comprise sets of instructions for which the variables possess an indicated location, so that each variable that is written to is represented by its reaching definition, wherein calculating the reaching definitions comprises tracking each change, move, and replacement of each of the one or more tagged variables during compilation and optimization of the one or more tagged variables so that the reaching definitions of the one or more tagged variables are tracked in place of the one or more tagged variables; persisting the variable location information, so that the persisted variable location information is available to one or more other compiler components; compressing at least one of the calculated reaching definitions using a domain-specific compression algorithm; and sending the compressed reaching definitions from the compiler to the debugger for display to the user. - View Dependent Claims (9, 10, 11, 12, 13, 14, 15, 16)
-
-
17. A computer system comprising the following:
-
one or more processors; system memory; one or more computer-readable storage media having stored thereon computer-executable instructions that, when executed by the one or more processors, causes the computing system to perform a method for tracking variable location information in optimized code, the method comprising the following; receiving a portion of source code at a compiler, wherein the compiler is configured to compile and optimize the source code for execution; tagging one or more selected variables in the source code with a tag, wherein the tag is configured to provide location information for the variable and wherein tagging the one or more selected variables occurs before the compiler converts the source code into an intermediate form; the compiler optimizing the received portion of source code, wherein optimizing comprises changing one or more of the tagged variables and changing comprises replacing the one or more of the tagged variables with a value or a set of instructions; tracking the tagged variables as the variables are changed by the compiler during code optimization, wherein tracking the tagged variables comprises each of tracking each change, move, and replacement of each of the tagged variables so that the tag associated with a tagged variable adheres to the value or set of instructions which replaced the tagged variable and so that the value or set of instructions which replaced the tagged variable are tracked in place of the tagged variable; persisting the variable location information, so that the persisted variable location information is available to one or more other compiler components; compressing the persisted variable location information using a domain-specific compression algorithm; a debugger decompressing the compressed variable location information; and the debugger displaying the decompressed variable location information to a user.
-
Specification