RFR(M): 8031754: Type speculation should favor profile data from outermost inlined method
Roland Westrelin
roland.westrelin at oracle.com
Wed Jan 22 01:42:06 PST 2014
When a node already has a speculative type, and parsing encounters extra profiling data, the new profiling data is ignored. So profiling data coming from profile points closer to the root of the compilation is favored which I think makes sense: it's the data that is most specific to the context of this compilation.
During runs, profile data is not always entirely coherent so we may hit something like this:
m1() {
m3();
}
m() {
m1();
m2();
}
With: m3() and m2() have profile data for the same node. The first profile data to be encountered during parsing is from m3() and profile data from m2() is ignored but profile data from m2() is the one that is actually the most specific and is the one that should be favored.
When a speculative type is created, this change records the inline depth at which the profile point is. The inline depth is then propagated together with the rest of the type information. When new profile data is available for a node that already has a speculative type, the current inline depth and the inline depth of the current speculative type are used to decide whether the new data should be used to replace the existing speculative type.
This change helps stabilize performance with nashorn.
http://cr.openjdk.java.net/~roland/8031754/webrev.00/
Roland.
More information about the hotspot-compiler-dev
mailing list