RFR: 8256306: ObjectMonitor::_contentions field should not be 'jint'
Coleen Phillimore
coleenp at openjdk.java.net
Tue Jun 22 16:00:34 UTC 2021
On Tue, 22 Jun 2021 15:45:19 GMT, Daniel D. Daugherty <dcubed at openjdk.org> wrote:
>> I changed the _contentions and _waiters fields from jint to int and ran tests tier1-3. Tested tier1 with linux, mac, windows platforms. Also changed the _previous_owner_tid to unintptr_t from jlong, since that's what the cast did.
>
> src/hotspot/share/runtime/objectMonitor.hpp line 151:
>
>> 149: #define DEFLATER_MARKER reinterpret_cast<void*>(-1)
>> 150: void* volatile _owner; // pointer to owning thread OR BasicLock
>> 151: volatile uintptr_t _previous_owner_tid; // thread id of the previous owner of the monitor
>
> Since you are changing the type for `_previous_owner_tid`, you also
> need to change the `DEFINE_PAD_MINUS_SIZE` below:
>
>
> DEFINE_PAD_MINUS_SIZE(1, OM_CACHE_LINE_SIZE, sizeof(void* volatile) +
> sizeof(volatile uintptr_t));
Okay, yes, thank you for pointing this out.
-------------
PR: https://git.openjdk.java.net/jdk/pull/3980
More information about the serviceability-dev
mailing list