hotspot/src/share/vm/runtime/synchronizer.cpp
changeset 2526 39a58a50be35
parent 2105 347008ce7984
child 5547 f4b087cbb361
child 5710 d664086c0add
equal deleted inserted replaced
2364:7c9f46e9d37c 2526:39a58a50be35
  1115           // Setup monitor fields to proper values -- prepare the monitor
  1115           // Setup monitor fields to proper values -- prepare the monitor
  1116           m->set_header(dmw) ;
  1116           m->set_header(dmw) ;
  1117 
  1117 
  1118           // Optimization: if the mark->locker stack address is associated
  1118           // Optimization: if the mark->locker stack address is associated
  1119           // with this thread we could simply set m->_owner = Self and
  1119           // with this thread we could simply set m->_owner = Self and
  1120           // m->OwnerIsThread = 1.  Note that a thread can inflate an object
  1120           // m->OwnerIsThread = 1. Note that a thread can inflate an object
  1121           // that it has stack-locked -- as might happen in wait() -- directly
  1121           // that it has stack-locked -- as might happen in wait() -- directly
  1122           // with CAS.  That is, we can avoid the xchg-NULL .... ST idiom.
  1122           // with CAS.  That is, we can avoid the xchg-NULL .... ST idiom.
  1123           m->set_owner (mark->locker());
  1123           m->set_owner(mark->locker());
  1124           m->set_object(object);
  1124           m->set_object(object);
  1125           // TODO-FIXME: assert BasicLock->dhw != 0.
  1125           // TODO-FIXME: assert BasicLock->dhw != 0.
  1126 
  1126 
  1127           // Must preserve store ordering. The monitor state must
  1127           // Must preserve store ordering. The monitor state must
  1128           // be stable at the time of publishing the monitor address.
  1128           // be stable at the time of publishing the monitor address.
  1212     } else {
  1212     } else {
  1213       assert(!attempt_rebias, "can not rebias toward VM thread");
  1213       assert(!attempt_rebias, "can not rebias toward VM thread");
  1214       BiasedLocking::revoke_at_safepoint(obj);
  1214       BiasedLocking::revoke_at_safepoint(obj);
  1215     }
  1215     }
  1216     assert(!obj->mark()->has_bias_pattern(), "biases should be revoked by now");
  1216     assert(!obj->mark()->has_bias_pattern(), "biases should be revoked by now");
  1217   }
  1217  }
  1218 
  1218 
  1219   THREAD->update_highest_lock((address)lock);
  1219  slow_enter (obj, lock, THREAD) ;
  1220   slow_enter (obj, lock, THREAD) ;
       
  1221 }
  1220 }
  1222 
  1221 
  1223 void ObjectSynchronizer::fast_exit(oop object, BasicLock* lock, TRAPS) {
  1222 void ObjectSynchronizer::fast_exit(oop object, BasicLock* lock, TRAPS) {
  1224   assert(!object->mark()->has_bias_pattern(), "should not see bias pattern here");
  1223   assert(!object->mark()->has_bias_pattern(), "should not see bias pattern here");
  1225   // if displaced header is null, the previous enter is recursive enter, no-op
  1224   // if displaced header is null, the previous enter is recursive enter, no-op