I know that one of the criteria that Java HotSpot uses to decide whether a method is worth inlining is how large it the method is. On one hand, this seems sensible: if the method is large, in-lining leads to code bloat and the method would take so long to execute that the call overhead is trivial. The trouble with this logic is that it might turn out that AFTER you decide to inline, it becomes clear that for this particular call-site, most of the method is dead code. For instance, the method may be a giant switch statement, but most call sites call the method with a compile-time constant, so that actually: in-lining is cheap (don't need whole method body; minimal code bloat) and effective (method call overhead dominates actual work done).
Does HotSpot have any mechanism to take advantage of such situations and inline the method anyway, or is there a limit beyond which it refuses to even consider inlining a method, even though it would have a minimal code bloat effect?