src/share/vm/runtime/sharedRuntime.cpp

Print this page




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




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


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