In a method for dynamically replacing code within a software application on a device, an annotated code segment that performs a function according to a first data policy is received. The computer determines an alternate segment that performs the function according to a second data policy.
대표청구항▼
1. A method for dynamically replacing code within a software application on a device, the method comprising: a computer receiving an annotated code segment of a software application of a device that performs a function according to a first data policy, wherein: the device is capable of operating acc
1. A method for dynamically replacing code within a software application on a device, the method comprising: a computer receiving an annotated code segment of a software application of a device that performs a function according to a first data policy, wherein: the device is capable of operating according to the first data policy and a second data policy, based upon a selection of a respective data policy received from a user of the device;each respective data policy includes a set of requirements associated with the respective data policy;the code segment is associated with a first tag indicating that the code segment performs the function according to the first data policy; andthe annotation indicates that the annotated code segment can be substituted with another code segment, external from code of the software application, if the device is configured to utilize a data policy that is not the first data policy;the computer determining an alternate code segment that performs the function according to the second data policy, wherein: the alternate code segment is stored in a repository external from code of the software application; andthe repository contains source code for performing the function according to various data policies;the computer causing a compiler to compile the alternate code segment;subsequent to the computer determining the alternate code segment, the computer storing the compiled alternate code segment and a second tag in a compiled code database, wherein the second tag indicates that the alternate code segment corresponds to the second data policy;the computer determining that the device is set to utilize the second data policy; andthe computer substituting the annotated code segment with the compiled alternate code segment. 2. The method of claim 1, wherein the first and second data policies are energy policies for data. 3. The method of claim 1, wherein the annotated code segment includes a data structure class, wherein properties of the data structure class associate the data structure class with the first data policy. 4. The method of claim 1, further comprising: the computer causing the software application to execute using the compiled alternate code segment. 5. The method of claim 1, wherein the computer determining the alternate code segment that performs the function according to the second data policy comprises: the computer identifying the alternate code segment that performs the function according to the second data policy from the repository based on, at least, the second tag. 6. The method of claim 1, further comprising: the computer determining that the alternate code segment provides a different external interface than the annotated code segment;the computer generating a prompt for an interface mapper, wherein the interface mapper is capable of bridging from a first interface of the annotated code segment to a second interface of the alternate code segment;the computer receiving the interface mapper. 7. The method of claim 1, wherein the computer receiving the annotated code segment of the software application of the device that performs the function according to the first data policy comprises: the computer comparing performance of the software application during runtime on the device to each set of requirements associated with each of a plurality of data policies, including, at least, the first data policy;the computer receiving the annotated code segment; andthe computer determining that the annotated code segment performs the function according to the first data policy based on the comparison of the performance of the software during runtime to the set of requirements associated with the first data policy. 8. The method of claim 1, wherein the computer determining an alternate code segment that performs the function according to a second data policy comprises: the computer determining that no code segment performs the function according to rules of the second data policy; andthe computer determining that the alternate code segment performs the function more closely aligned to the rules associated with the second data policy, as compared to the annotated code segment. 9. The method of claim 1, wherein: the computer storing the compiled alternate code segment and the second tag comprises the computer storing the compiled alternate code segment to a repository prior to the computer determining that the device is set to utilize the second data policy; andthe computer substituting the annotated code segment with the compiled alternate code segment comprises:retrieving the compiled alternate code segment from the repository; andsubstituting the annotated code segment with the compiled alternate code segment. 10. The method of claim 1, wherein the computer comprises an annotation processor, and the annotation processor is operative to process annotations and modify code. 11. A computer program product for dynamically replacing code within a software application on a device, the computer program product comprising: one or more computer-readable storage media and program instructions stored on the one or more computer-readable storage media, the program instructions comprising:program instructions to receive an annotated code segment of a software application of a device that performs a function according to a first data policy, wherein: the device is capable of operating according to the first data policy and a second data policy, based upon a selection of a respective data policy received from a user of the device;each respective data policy includes a set of requirements associated with the respective data policy;the code segment is associated with a first tag indicating that the code segment performs the function according to the first data policy; andthe annotation indicates that the annotated code segment can be substituted with another code segment, external from code of the software application, if the device is configured to utilize a data policy that is not the first data policy;program instructions to determine an alternate code segment that performs the function according to the second data policy, wherein: the alternate code segment is stored in a repository external from code of the software application; andthe repository contains source code for performing the function according to various data policies;program instructions to cause a compiler to compile the alternate code segment;program instructions to, subsequent to determining the alternate code segment, store the compiled alternate code segment and a second tag in a compiled code database, wherein the second tag indicates that the alternate code segment corresponds to the second data policy;program instructions to determine that the device is set to utilize the second data policy; andprogram instructions to substitute the annotated code segment with the compiled alternate code segment. 12. The computer program product of claim 11, wherein the first and second data policies are energy policies for data. 13. The computer program product of claim 11, wherein the annotated code segment includes a data structure class, wherein properties of the data structure class associate the data structure class with the first data policy. 14. The computer program product of claim 11, further comprising: program instructions to cause the software application to execute using the compiled alternate code segment. 15. A computer system for dynamically replacing code within a software application on a device, the computer system comprising: one or more computer processors, one or more computer-readable storage media, and program instructions stored on the computer-readable storage media for execution by at least one of the one or more processors, the program instructions comprising: program instructions to receive an annotated code segment of a software application of a device that performs a function according to a first data policy, wherein:the device is capable of operating according to the first data policy and a second data policy, based upon a selection of a respective data policy received from a user of the device;each respective data policy includes a set of requirements associated with the respective data policy;the code segment is associated with a first tag indicating that the code segment performs the function according to the first data policy; andthe annotation indicates that the annotated code segment can be substituted with another code segment, external from code of the software application, if the device is configured to utilize a data policy that is not the first data policy;program instructions to determine an alternate code segment that performs the function according to the second data policy, wherein: the alternate code segment is stored in a repository external from code of the software application; andthe repository contains source code for performing the function according to various data policies;program instructions to cause a compiler to compile the alternate code segment;program instructions to, subsequent to determining the alternate code segment, store the compiled alternate code segment and a second tag in a compiled code database, wherein the second tag indicates that the alternate code segment corresponds to the second data policy;program instructions to determine that the device is set to utilize the second data policy; andprogram instructions to substitute the annotated code segment with the compiled alternate code segment. 16. The computer system of claim 15, wherein the first and second data policies are energy policies for data. 17. The computer system of claim 15, wherein the annotated code segment includes a data structure class, wherein properties of the data structure class associate the data structure class with the first data policy. 18. The computer system of claim 15, further comprising: program instructions to cause the software application to execute using the compiled alternate code segment.
연구과제 타임라인
LOADING...
LOADING...
LOADING...
LOADING...
LOADING...
이 특허에 인용된 특허 (20)
Hussain,Riaz Yousuf; John, Jr.,Chester Charles; Levine,Frank Eliot; Richardson,Christopher Michael, Apparatus and method for cataloging symbolic data for use in performance analysis of computer programs.
Abadi Martin ; Ghemawat Sanjay ; Stata Raymond Paul, Method and apparatus for annotating a computer program to facilitate subsequent processing of the program.
Master,Paul L.; Hogenauer,Eugene; Wu,Bicheng William; Chuang,Dan MingLun; Freeman Benson,Bjorn, Method, system and program for developing and scheduling adaptive integrated circuity and corresponding control or configuration information.
Craig Chambers ; Susan J. Eggers ; Brian K. Grant ; Markus Mock ; Matthai Philipose, System and method for performing selective dynamic compilation using run-time information.
Vanderspek, Julius; Wilt, Nicholas Patrick; Kolhe, Jayant; Buck, Ian A.; Aarts, Bastiaan, System and method for representing and managing a multi-architecture co-processor application program.
※ AI-Helper는 부적절한 답변을 할 수 있습니다.