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

Thomas Stuefe stuefe at openjdk.java.net
Tue Jun 22 04:16: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.

LGTM

src/hotspot/share/runtime/objectMonitor.hpp line 244:

> 242:     int cnts = contentions(); // read once
> 243:     if (cnts > 0) {
> 244:       ret_code |= intptr_t(cnts);

I know it has nothing to do with your patch, but I am just curious. IIUC this is a strange way of saying "if A!=0 || B!=0 || C!=0..." . Is this for performance reasons? Also, why the "if (cnts > 0)", would that not be superfluous?

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

Marked as reviewed by stuefe (Reviewer).

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


More information about the serviceability-dev mailing list