src/share/vm/runtime/sharedRuntime.cpp

Print this page




1776     const char* objName, const char* targetKlassName, const char* desc) {
1777   size_t msglen = strlen(objName) + strlen(desc) + strlen(targetKlassName) + 1;
1778 
1779   char* message = NEW_RESOURCE_ARRAY(char, msglen);
1780   if (NULL == message) {
1781     // Shouldn't happen, but don't cause even more problems if it does
1782     message = const_cast<char*>(objName);
1783   } else {
1784     jio_snprintf(message, msglen, "%s%s%s", objName, desc, targetKlassName);
1785   }
1786   return message;
1787 }
1788 
1789 JRT_LEAF(void, SharedRuntime::reguard_yellow_pages())
1790   (void) JavaThread::current()->reguard_stack();
1791 JRT_END
1792 
1793 
1794 // Handles the uncommon case in locking, i.e., contention or an inflated lock.
1795 JRT_BLOCK_ENTRY(void, SharedRuntime::complete_monitor_locking_C(oopDesc* _obj, BasicLock* lock, JavaThread* thread))
1796   // Disable ObjectSynchronizer::quick_enter() in default config
1797   // until JDK-8077392 is resolved.
1798   if ((SyncFlags & 256) != 0 && !SafepointSynchronize::is_synchronizing()) {
1799     // Only try quick_enter() if we're not trying to reach a safepoint
1800     // so that the calling thread reaches the safepoint more quickly.
1801     if (ObjectSynchronizer::quick_enter(_obj, thread, lock)) return;
1802   }
1803   // NO_ASYNC required because an async exception on the state transition destructor
1804   // would leave you with the lock held and it would never be released.
1805   // The normal monitorenter NullPointerException is thrown without acquiring a lock
1806   // and the model is that an exception implies the method failed.
1807   JRT_BLOCK_NO_ASYNC
1808   oop obj(_obj);
1809   if (PrintBiasedLockingStatistics) {
1810     Atomic::inc(BiasedLocking::slow_path_entry_count_addr());
1811   }
1812   Handle h_obj(THREAD, obj);
1813   if (UseBiasedLocking) {
1814     // Retry fast entry if bias is revoked to avoid unnecessary inflation
1815     ObjectSynchronizer::fast_enter(h_obj, lock, true, CHECK);
1816   } else {
1817     ObjectSynchronizer::slow_enter(h_obj, lock, CHECK);
1818   }




1776     const char* objName, const char* targetKlassName, const char* desc) {
1777   size_t msglen = strlen(objName) + strlen(desc) + strlen(targetKlassName) + 1;
1778 
1779   char* message = NEW_RESOURCE_ARRAY(char, msglen);
1780   if (NULL == message) {
1781     // Shouldn't happen, but don't cause even more problems if it does
1782     message = const_cast<char*>(objName);
1783   } else {
1784     jio_snprintf(message, msglen, "%s%s%s", objName, desc, targetKlassName);
1785   }
1786   return message;
1787 }
1788 
1789 JRT_LEAF(void, SharedRuntime::reguard_yellow_pages())
1790   (void) JavaThread::current()->reguard_stack();
1791 JRT_END
1792 
1793 
1794 // Handles the uncommon case in locking, i.e., contention or an inflated lock.
1795 JRT_BLOCK_ENTRY(void, SharedRuntime::complete_monitor_locking_C(oopDesc* _obj, BasicLock* lock, JavaThread* thread))
1796   if (!SafepointSynchronize::is_synchronizing()) {


1797     // Only try quick_enter() if we're not trying to reach a safepoint
1798     // so that the calling thread reaches the safepoint more quickly.
1799     if (ObjectSynchronizer::quick_enter(_obj, thread, lock)) return;
1800   }
1801   // NO_ASYNC required because an async exception on the state transition destructor
1802   // would leave you with the lock held and it would never be released.
1803   // The normal monitorenter NullPointerException is thrown without acquiring a lock
1804   // and the model is that an exception implies the method failed.
1805   JRT_BLOCK_NO_ASYNC
1806   oop obj(_obj);
1807   if (PrintBiasedLockingStatistics) {
1808     Atomic::inc(BiasedLocking::slow_path_entry_count_addr());
1809   }
1810   Handle h_obj(THREAD, obj);
1811   if (UseBiasedLocking) {
1812     // Retry fast entry if bias is revoked to avoid unnecessary inflation
1813     ObjectSynchronizer::fast_enter(h_obj, lock, true, CHECK);
1814   } else {
1815     ObjectSynchronizer::slow_enter(h_obj, lock, CHECK);
1816   }