@@ -602,7 +602,7 @@ bool ObjectSynchronizer::enter_fast_impl(Handle obj, BasicLock* lock, JavaThread
602602 }
603603
604604 markWord mark = obj ()->mark_acquire ();
605- while (mark.is_neutral ()) {
605+ while (mark.is_unlocked ()) {
606606 // Retry until a lock state change has been observed. cas_set_mark() may collide with non lock bits modifications.
607607 // Try to swing into 'fast-locked' state.
608608 assert (!lock_stack.contains (obj ()), " thread must not already hold the lock" );
@@ -625,7 +625,7 @@ bool ObjectSynchronizer::enter_fast_impl(Handle obj, BasicLock* lock, JavaThread
625625 return false ;
626626 } else if (LockingMode == LM_LEGACY) {
627627 markWord mark = obj->mark ();
628- if (mark.is_neutral ()) {
628+ if (mark.is_unlocked ()) {
629629 // Anticipate successful CAS -- the ST of the displaced mark must
630630 // be visible <= the ST performed by the CAS.
631631 lock->set_displaced_header (mark);
@@ -696,7 +696,7 @@ void ObjectSynchronizer::exit(oop object, BasicLock* lock, JavaThread* current)
696696 // Only do diagnostics if we are not racing an inflation. Simply
697697 // exiting a recursive enter of a Java Monitor that is being
698698 // inflated is safe; see the has_monitor() comment below.
699- assert (!mark.is_neutral (), " invariant" );
699+ assert (!mark.is_unlocked (), " invariant" );
700700 assert (!mark.has_locker () ||
701701 current->is_lock_owned ((address)mark.locker ()), " invariant" );
702702 if (mark.has_monitor ()) {
@@ -1009,7 +1009,7 @@ intptr_t ObjectSynchronizer::FastHashCode(Thread* current, oop obj) {
10091009 assert (LockingMode == LM_MONITOR, " +VerifyHeavyMonitors requires LockingMode == 0 (LM_MONITOR)" );
10101010 guarantee ((obj->mark ().value () & markWord::lock_mask_in_place) != markWord::locked_value, " must not be lightweight/stack-locked" );
10111011 }
1012- if (mark.is_neutral () || (LockingMode == LM_LIGHTWEIGHT && mark.is_fast_locked ())) {
1012+ if (mark.is_unlocked () || (LockingMode == LM_LIGHTWEIGHT && mark.is_fast_locked ())) {
10131013 hash = mark.hash ();
10141014 if (hash != 0 ) { // if it has a hash, just return it
10151015 return hash;
@@ -1139,7 +1139,7 @@ bool ObjectSynchronizer::current_thread_holds_lock(JavaThread* current,
11391139 return monitor->is_entered (current) != 0 ;
11401140 }
11411141 // Unlocked case, header in place
1142- assert (mark.is_neutral (), " sanity check" );
1142+ assert (mark.is_unlocked (), " sanity check" );
11431143 return false ;
11441144}
11451145
@@ -1172,7 +1172,7 @@ JavaThread* ObjectSynchronizer::get_lock_owner(ThreadsList * t_list, Handle h_ob
11721172 // Unlocked case, header in place
11731173 // Cannot have assertion since this object may have been
11741174 // locked by another thread when reaching here.
1175- // assert(mark.is_neutral (), "sanity check");
1175+ // assert(mark.is_unlocked (), "sanity check");
11761176
11771177 return nullptr ;
11781178}
@@ -1423,7 +1423,7 @@ ObjectMonitor* ObjectSynchronizer::inflate_impl(JavaThread* inflating_thread, oo
14231423 // * stack-locked - Coerce it to inflated from stack-locked.
14241424 // * INFLATING - Busy wait for conversion from stack-locked to
14251425 // inflated.
1426- // * neutral - Aggressively inflate the object.
1426+ // * unlocked - Aggressively inflate the object.
14271427
14281428 // CASE: inflated
14291429 if (mark.has_monitor ()) {
@@ -1601,7 +1601,7 @@ ObjectMonitor* ObjectSynchronizer::inflate_impl(JavaThread* inflating_thread, oo
16011601 return m;
16021602 }
16031603
1604- // CASE: neutral
1604+ // CASE: unlocked
16051605 // TODO-FIXME: for entry we currently inflate and then try to CAS _owner.
16061606 // If we know we're inflating for entry it's better to inflate by swinging a
16071607 // pre-locked ObjectMonitor pointer into the object header. A successful
@@ -1610,9 +1610,7 @@ ObjectMonitor* ObjectSynchronizer::inflate_impl(JavaThread* inflating_thread, oo
16101610 // to inflate and then CAS() again to try to swing _owner from null to current.
16111611 // An inflateTry() method that we could call from enter() would be useful.
16121612
1613- // Catch if the object's header is not neutral (not locked and
1614- // not marked is what we care about here).
1615- assert (mark.is_neutral (), " invariant: header=" INTPTR_FORMAT, mark.value ());
1613+ assert (mark.is_unlocked (), " invariant: header=" INTPTR_FORMAT, mark.value ());
16161614 ObjectMonitor* m = new ObjectMonitor (object);
16171615 // prepare m for installation - set monitor to initial state
16181616 m->set_header (mark);
@@ -1635,7 +1633,7 @@ ObjectMonitor* ObjectSynchronizer::inflate_impl(JavaThread* inflating_thread, oo
16351633 OM_PERFDATA_OP (Inflations, inc ());
16361634 if (log_is_enabled (Trace, monitorinflation)) {
16371635 ResourceMark rm;
1638- lsh.print_cr (" inflate(neutral ): object=" INTPTR_FORMAT " , mark="
1636+ lsh.print_cr (" inflate(unlocked ): object=" INTPTR_FORMAT " , mark="
16391637 INTPTR_FORMAT " , type='%s'" , p2i (object),
16401638 object->mark ().value (), object->klass ()->external_name ());
16411639 }
0 commit comments