Skip to content
Permalink
Browse files
8256304: should MonitorUsedDeflationThreshold be experimental or diag…
…nostic

8256301: ObjectMonitor::is_busy() should return bool

Reviewed-by: coleenp, pchilanomate
  • Loading branch information
Daniel D. Daugherty committed May 21, 2021
1 parent 8f10c5a commit fe333431c8c0f089e4fd55bf10903e1fba7fc6c4
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
@@ -712,7 +712,7 @@ const intx ObjectAlignmentInBytes = 8;
"at one time (minimum is 1024).") \
range(1024, max_jint) \
\
product(intx, MonitorUsedDeflationThreshold, 90, EXPERIMENTAL, \
product(intx, MonitorUsedDeflationThreshold, 90, DIAGNOSTIC, \
"Percentage of used monitors before triggering deflation (0 is " \
"off). The check is performed on GuaranteedSafepointInterval " \
"or AsyncDeflationInterval.") \
@@ -519,7 +519,7 @@ int ObjectMonitor::TryLock(JavaThread* current) {
// Contending threads that see that condition know to retry their operation.
//
bool ObjectMonitor::deflate_monitor() {
if (is_busy() != 0) {
if (is_busy()) {
// Easy checks are first - the ObjectMonitor is busy so no deflation.
return false;
}
@@ -236,7 +236,7 @@ class ObjectMonitor : public CHeapObj<mtInternal> {
volatile markWord* header_addr();
void set_header(markWord hdr);

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

@@ -1771,9 +1771,9 @@ void ObjectSynchronizer::log_in_use_monitor_details(outputStream* out) {
const markWord mark = mid->header();
ResourceMark rm;
out->print(INTPTR_FORMAT " %d%d%d " INTPTR_FORMAT " %s", p2i(mid),
mid->is_busy() != 0, mark.hash() != 0, mid->owner() != NULL,
mid->is_busy(), mark.hash() != 0, mid->owner() != NULL,
p2i(obj), obj == NULL ? "" : obj->klass()->external_name());
if (mid->is_busy() != 0) {
if (mid->is_busy()) {
out->print(" (%s)", mid->is_busy_to_string(&ss));
ss.reset();
}

1 comment on commit fe33343

@openjdk-notifier
Copy link

@openjdk-notifier openjdk-notifier bot commented on fe33343 May 21, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.