Does C2 disable incremental inlining for methods without @ForceInline?

Roland Westrelin rwestrel at redhat.com
Tue Jan 21 08:46:24 UTC 2020


Hi lx,

> If I understand correctly, C2 has actually disabled incremental
> inlining for almost all methods without @ForceInline.  Is it
> intentional?

Incremental inlining was implemented to help with method
handle/invokedynamic and dynamic languages performance (nashorn at the
time). The problem there is that inlining through a method handle invoke
causes the inlining budget to be exhausted quickly both because the
graph grows fast and the inlining budget estimate C2 uses (number of
nodes in the graph estimated during parsing as number of nodes added to
the graph) is especially inaccurate for method invoke handle because the
graph at the call optimizes well. So the idea is that once the inlining
budget is exhausted, we run a pass of IGVN to clean the graph, count the
number of actual live nodes to have an accurate estimate of the graph
size and resume inlining with incremental inlining if the inlining
budget allows it.

There was no attempt at using incremental inlining for "regular" java
programs eventhough with lambdas, java code relies on invokedynamic and
so should trigger incremental inlining.

Roland.



More information about the hotspot-compiler-dev mailing list