In-place function modification
First Claim
1. A method, comprising:
- comparing a function associated with a computer program being executed to configuration data from a user created configuration file to determine whether the function is to be modified, the function specified within a callback sent from a runtime library, the configuration data identifying functions desired for modification; and
responsive to determining that the function is to be modified;
trapping the callback before delivery of the callback to a compiler associated with the computer program;
injecting modifying intermediate language code from a file separate from the computer program into intermediate language code associated with the computer program to create modified intermediate language code, the modified intermediate language code comprising at least some of the intermediate language code and the modifying intermediate language code, the modified intermediate language code configured to perform a modified function when executed, the modified function comprising a modification of the function;
modifying the callback with the modified intermediate language code to create a modified callback; and
providing the modified callback, instead of the callback, to the compiler for compilation.
2 Assignments
0 Petitions
Accused Products
Abstract
Modifying computer program code can be performed at or immediately prior to runtime of the computer code in a runtime environment of a common language infrastructure of a language-neutral framework for developing and executing computer applications. A function in a computer program can be modified at runtime by injecting arbitrary code, while mitigating an alteration of a program'"'"'s call stack. A just-in-time compilation service is used to compile and execute intermediate language code of the program, and the runtime environment sends callback functions to an event-based profiling agent (profiler) attached to the runtime environment. The profiler can trap desired functions, as determined by configuration data, and inject modification code from stub methods in a stub assembly file. The modified code can be sent back to the runtime environment to be executed by the just-in-time compilation service.
61 Citations
20 Claims
-
1. A method, comprising:
comparing a function associated with a computer program being executed to configuration data from a user created configuration file to determine whether the function is to be modified, the function specified within a callback sent from a runtime library, the configuration data identifying functions desired for modification; and
responsive to determining that the function is to be modified;trapping the callback before delivery of the callback to a compiler associated with the computer program; injecting modifying intermediate language code from a file separate from the computer program into intermediate language code associated with the computer program to create modified intermediate language code, the modified intermediate language code comprising at least some of the intermediate language code and the modifying intermediate language code, the modified intermediate language code configured to perform a modified function when executed, the modified function comprising a modification of the function; modifying the callback with the modified intermediate language code to create a modified callback; and providing the modified callback, instead of the callback, to the compiler for compilation. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12)
-
13. A system, comprising:
-
one or more processing units; and memory comprising instructions that when executed by at least one of the one or more processing units implement a modification component configured to; compare a function associated with a computer program being executed to configuration data from a user created configuration file to determine whether the function is to be modified, the function specified within a callback sent from a runtime library, the configuration data identifying functions desired to be modified; and responsive to determining that the function is to be modified; trap the callback before delivery of the callback to a compiler associated with the computer program; inject modifying intermediate language code from a file separate from the computer program into intermediate language code associated with the computer program to create modified intermediate language code, the modified intermediate language code comprising at least some of the intermediate language code and the modifying intermediate language code, the modified intermediate language code configured to perform a modified function when executed; modify the callback with the modified intermediate language code to create a modified callback; and provide the modified callback, instead of the callback, to the compiler for compilation. - View Dependent Claims (14, 15, 16, 17, 18, 19)
-
-
20. A computer-readable device comprising a hardware processor and processor-executable instructions that when executed perform a method, comprising:
-
comparing a function associated with a computer program to configuration data to determine whether the function is to be modified, the function specified within a callback sent from a runtime library, the configuration data identifying functions desired for modification; and responsive to determining that the function is to be modified; trapping the callback before delivery of the callback to a compiler associated with the computer program; injecting modifying intermediate language code from a file separate from the computer program into intermediate language code associated with the computer program to create modified intermediate language code, the modified intermediate language code comprising at least some of the intermediate language code and the modifying intermediate language code, the modified intermediate language code configured to perform a modified function when executed, the modified function comprising a modification of the function; modifying the callback with the modified intermediate language code to create a modified callback; and providing the modified callback, instead of the callback, to the compiler for compilation.
-
Specification