Patent ID: 9383980
Filing Date: 2016-07-05
CPC Classification: G06F

Claim Text:
1. A computer-implemented method for calculating an actual footprint of code methods in compiled code, the computer-implemented method comprising: creating, in a computer, a map, wherein the map indicates which code method, in a plurality of code methods, each instruction in the compiled code belongs to; sampling a plurality of executed instructions using a hardware performance counter in the computer; using the created map to map, in the computer, the sampled instructions to the code methods to which the instructions belong by identifying an address of each of the sampled instructions, and mapping each of the sampled instructions to the created map by determining whether the address of a sampled instruction is in a data range of one of the code methods or the plurality of code methods; and calculating the actual footprint of each code method as the total number of executed instructions sampled at least once among the instructions belonging to the code methods, wherein the calculating the actual footprint of each code method further comprises: calculating the size of each context generated by inclining the code method as the total number of instructions sampled at least once among the instructions constituting the context; and calculating the total size of the plurality of contexts corresponding to the code method as the overall actual footprint of the code method, and determining one of the code methods to inline, wherein determining one of the code methods to inline comprises: determining the method for removing the inlining among the code inlined methods on the basis of the overall actual footprint calculated for each code method; obtaining, as a reduction value for each code method, a value calculated by subtracting the largest size of the sizes of the plurality of contexts corresponding to the code method from the overall actual footprint of the code method; subtracting the reduction value of each method from the size of the compiled code in descending order according to size until the size of the compiled code is equal to or less than a target code size; and determining, as the method for removing the inlining, a code method in which the reduction values have been subtracted; and dividing the reduction value of each code method by the number of contexts having a size not equal to zero among the plurality of contexts corresponding to the code method, the dividing producing a benefit value, the method further comprising subtracting the reduction value of each code method from the size of the compiled code in descending order according to the size of the benefit value of each code method.