RFR(XS) : 8038240 : new WB API to get nmethod
Vladimir Kozlov
vladimir.kozlov at oracle.com
Tue Mar 25 21:51:36 UTC 2014
John,
Current WB osr tests are very simple with only one loop (in
CompilerWhiteBoxTest.java):
private int osrMethod() {
int result = 0;
for (long i = 0; i < CompilerWhiteBoxTest.BACKEDGE_THRESHOLD;
++i) {
result += method();
}
return result;
}
So using Boolean should be fine for now. But it would need to be
extended, as you suggested, if we add more complex loops.
Thanks,
Vladimir
On 3/25/14 2:01 PM, John Rose wrote:
> The boolean parameter is not expressive enough. It will have to change as soon as we have more than two versions of a method.
>
> (In fact, we already do: There is potentially a different OSR method for each entry point BCI. The formulation you have returns just one of them.)
>
> I suggest you change "boolean isOsr" in the WB API to "long version" or even "Object version". The version enumeration can be evolved over time. Values 0 and 1 can be "normal at current compilation" and "first available OSR".
>
> Also, put the version number into the NMethod structure, so it can be requeried. For an OSR method, the entry BCI is important to know.
>
> ...But I see that there is already a use of booleans like this in the WB API. So I guess you should consistent with what you have.
>
> I filed a bug to track this issue of method versioning; there is technical debt here:
> https://bugs.openjdk.java.net/browse/JDK-8038356
>
> — John
>
More information about the hotspot-dev
mailing list