RFR: 8261447: MethodInvocationCounters frequently run into overflow [v8]

Lutz Schmidt lucy at openjdk.java.net
Tue Mar 2 17:33:52 UTC 2021


On Tue, 2 Mar 2021 16:44:44 GMT, Vladimir Kozlov <kvn at openjdk.org> wrote:

>> Lutz Schmidt has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   comment changes requested by TheRealMDoerr
>
> src/hotspot/share/oops/method.cpp line 530:
> 
>> 528: 
>> 529:   if (method_data() != NULL) {
>> 530:     unsigned int dcc    = (unsigned int)method_data()->decompile_count();
> 
> decompile_count() returns `uint` why do cast and why you check decompile_count for overflow? It is very rare updated and limited by `PerMethodRecompilationCutoff` flag (400 by default):
> https://github.com/openjdk/jdk/blob/master/src/hotspot/share/oops/methodData.hpp#L2391

That uint slipped my attention. And with the cutoff parameter, overflow is no issue. I can remove the cast and the check.

> src/hotspot/share/oops/method.cpp line 518:
> 
>> 516:   // Print a "overflow" notification to create awareness.
>> 517:   const char* addMsg;
>> 518:   unsigned int maxInt = (1U<<31) - 1;
> 
> Why not use INT_MAX?

Will change.

-------------

PR: https://git.openjdk.java.net/jdk/pull/2511


More information about the hotspot-dev mailing list