Skip to content

Commit fe33343

Browse files
author
Daniel D. Daugherty
committed
8256304: should MonitorUsedDeflationThreshold be experimental or diagnostic
8256301: ObjectMonitor::is_busy() should return bool Reviewed-by: coleenp, pchilanomate
1 parent 8f10c5a commit fe33343

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

src/hotspot/share/runtime/globals.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -712,7 +712,7 @@ const intx ObjectAlignmentInBytes = 8;
712712
"at one time (minimum is 1024).") \
713713
range(1024, max_jint) \
714714
\
715-
product(intx, MonitorUsedDeflationThreshold, 90, EXPERIMENTAL, \
715+
product(intx, MonitorUsedDeflationThreshold, 90, DIAGNOSTIC, \
716716
"Percentage of used monitors before triggering deflation (0 is " \
717717
"off). The check is performed on GuaranteedSafepointInterval " \
718718
"or AsyncDeflationInterval.") \

src/hotspot/share/runtime/objectMonitor.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -519,7 +519,7 @@ int ObjectMonitor::TryLock(JavaThread* current) {
519519
// Contending threads that see that condition know to retry their operation.
520520
//
521521
bool ObjectMonitor::deflate_monitor() {
522-
if (is_busy() != 0) {
522+
if (is_busy()) {
523523
// Easy checks are first - the ObjectMonitor is busy so no deflation.
524524
return false;
525525
}

src/hotspot/share/runtime/objectMonitor.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ class ObjectMonitor : public CHeapObj<mtInternal> {
236236
volatile markWord* header_addr();
237237
void set_header(markWord hdr);
238238

239-
intptr_t is_busy() const {
239+
bool is_busy() const {
240240
// TODO-FIXME: assert _owner == null implies _recursions = 0
241241
intptr_t ret_code = _waiters | intptr_t(_cxq) | intptr_t(_EntryList);
242242
if (contentions() > 0) {
@@ -245,7 +245,7 @@ class ObjectMonitor : public CHeapObj<mtInternal> {
245245
if (!owner_is_DEFLATER_MARKER()) {
246246
ret_code |= intptr_t(owner_raw());
247247
}
248-
return ret_code;
248+
return ret_code != 0;
249249
}
250250
const char* is_busy_to_string(stringStream* ss);
251251

src/hotspot/share/runtime/synchronizer.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1771,9 +1771,9 @@ void ObjectSynchronizer::log_in_use_monitor_details(outputStream* out) {
17711771
const markWord mark = mid->header();
17721772
ResourceMark rm;
17731773
out->print(INTPTR_FORMAT " %d%d%d " INTPTR_FORMAT " %s", p2i(mid),
1774-
mid->is_busy() != 0, mark.hash() != 0, mid->owner() != NULL,
1774+
mid->is_busy(), mark.hash() != 0, mid->owner() != NULL,
17751775
p2i(obj), obj == NULL ? "" : obj->klass()->external_name());
1776-
if (mid->is_busy() != 0) {
1776+
if (mid->is_busy()) {
17771777
out->print(" (%s)", mid->is_busy_to_string(&ss));
17781778
ss.reset();
17791779
}

0 commit comments

Comments
 (0)