RFR: 8256306: ObjectMonitor::_contentions field should not be 'jint'

Daniel D.Daugherty dcubed at openjdk.java.net
Tue Jun 22 15:50:32 UTC 2021


On Tue, 11 May 2021 15:01:18 GMT, Coleen Phillimore <coleenp 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.

Changes requested by dcubed (Reviewer).

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));

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

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


More information about the serviceability-dev mailing list