'inline' - inlines direct Java method calls.
Inlining pass removes the overhead of a direct call and builds the code of the called method into the code of the caller in place of its call site.
Inlining is an iterative process involving other optimizations. It goes as follows:
- The inliner selects candidates for inlining in the following sequence: - Examines each direct call site in the IR form, including those exposed by guarded devirtualization. - Heuristically estimates the potential benefit of inlining. - Checks whether the benefit exceeds a certain threshold, and, if it does, registers the call in a priority queue.
- The inliner selects the top candidate, if any, for inlining.
- The translator generates an intermediate representation for the method selected for inlining.
- The optimizer runs over HIR of the method using the inliner pipeline.
- The inliner finds further inline candidates, if any, in the analyzed representation and replicates it in the representation of the caller.
- The inliner selects a new inline candidate from the queue and repeats the cycle.
- The inliner stops its work when the queue is empty or after code IR reaches a certain size limit.
header file: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/inliner.h
implementation file: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/inliner.cpp