A method, apparatus, system, and signal-bearing medium that in an
embodiment collect profile information about class-type checks, calculate
a number of class-type checks that minimizes a cost of inlining, generate
inline code for the number of class-type checks for a site in a method,
and sort the inline code based on a frequency of the class types. Any
remaining class-type checks at the site that are not handled by the
inlined class-type checks are handled via an out-of-line function call.
In this way, inlined code is used when it provides better performance
than an out-of-line function, and the out-of-line function call is used
when it provides better performance than the inlined code.