RFR 8213708: Different #ifdef guards cause incorrect use of Monitor::check_block_state()

Patricio Chilano patricio.chilano.mateo at oracle.com
Tue Nov 13 22:27:17 UTC 2018


Thanks Dan!

Patricio

On 11/13/18 4:48 PM, Daniel D. Daugherty wrote:
> On 11/13/18 4:24 PM, Patricio Chilano wrote:
>> Hi all,
>>
>> Could you review this small fix to the Monitor class?
>> Executing method check_block_state() was causing incorrect warnings 
>> to be printed out in optimized builds due to variable _allow_vm_block 
>> being incorrectly initialized in the constructor. The fix involved 
>> wrapping the call to check_block_state() under the DEBUG_ONLY macro.
>> Built an optimized image with and without the fix, run a couple of 
>> tests and checked the warning messages appear before the fix but not 
>> after it. Also built in debug and release modes to check those build 
>> okay too.
>>
>> Since the fix had to do with using the DEBUG_ONLY macro I also 
>> changed in those files instances of debug_only to DEBUG_ONLY and 
>> changed some instances of DEBUG_ONLY(code); to DEBUG_ONLY(code;) to 
>> make the usage consistent.
>>
>> Webrev URL:
>> http://cr.openjdk.java.net/~pchilanomate/8213708.01/webrev
>
> src/hotspot/share/runtime/mutex.cpp
>     No comments.
>
> src/hotspot/share/runtime/mutex.hpp
>     No comments.
>
> Thumbs up!
>
> Thanks for cleaning up the old debug_only macros uses. It did
> make reviewing the optimized build fix a little harder since
> it was "buried".
>
> Dan
>
>
>> Bug URL:
>> https://bugs.openjdk.java.net/browse/JDK-8213708
>>
>> Thanks,
>> Patricio
>



More information about the hotspot-runtime-dev mailing list