Inlining before the static analysis improves the precision of the analysis especially when
constants are propagated. So the goal is to inline callees that are folded to constants.
Sometimes, constant folding of callees requires quite deep inlining, when constants are
propagated through chains of wrapper methods. So we want to be able to look deep for potential
inlining. On the other hand, only very small methods can be inlined before analysis in order to
not bloat the type flow graph and later on machine code for infrequently executed methods. So we
do not want to use the regular method inlining mechanism that propagates argument constants into
a possibly large graph and then runs the CanonicalizerPhase. Instead, we leverage the graph
decoding also used by the Truffle partial evaluator. When a direct method invoke is seen during
decoding, we by default go into the callee. When the callee produces too many nodes (configurable
via the
InlineBeforeAnalysisPolicy
) inlining is aborted, i.e., already created nodes from
the callee are deleted and a non-inlined invoke is created instead.