1966 if (message == NULL) {
1967 // Shouldn't happen, but don't cause even more problems if it does
1968 message = const_cast<char*>(caster_klass->external_name());
1969 } else {
1970 jio_snprintf(message,
1971 msglen,
1972 "%s cannot be cast to %s",
1973 caster_name,
1974 target_name);
1975 }
1976 return message;
1977 }
1978
1979 JRT_LEAF(void, SharedRuntime::reguard_yellow_pages())
1980 (void) JavaThread::current()->reguard_stack();
1981 JRT_END
1982
1983
1984 // Handles the uncommon case in locking, i.e., contention or an inflated lock.
1985 JRT_BLOCK_ENTRY(void, SharedRuntime::complete_monitor_locking_C(oopDesc* _obj, BasicLock* lock, JavaThread* thread))
1986 // Disable ObjectSynchronizer::quick_enter() in default config
1987 // on AARCH64 and ARM until JDK-8153107 is resolved.
1988 if (ARM_ONLY((SyncFlags & 256) != 0 &&)
1989 AARCH64_ONLY((SyncFlags & 256) != 0 &&)
1990 !SafepointSynchronize::is_synchronizing()) {
1991 // Only try quick_enter() if we're not trying to reach a safepoint
1992 // so that the calling thread reaches the safepoint more quickly.
1993 if (ObjectSynchronizer::quick_enter(_obj, thread, lock)) return;
1994 }
1995 // NO_ASYNC required because an async exception on the state transition destructor
1996 // would leave you with the lock held and it would never be released.
1997 // The normal monitorenter NullPointerException is thrown without acquiring a lock
1998 // and the model is that an exception implies the method failed.
1999 JRT_BLOCK_NO_ASYNC
2000 oop obj(_obj);
2001 if (PrintBiasedLockingStatistics) {
2002 Atomic::inc(BiasedLocking::slow_path_entry_count_addr());
2003 }
2004 Handle h_obj(THREAD, obj);
2005 if (UseBiasedLocking) {
2006 // Retry fast entry if bias is revoked to avoid unnecessary inflation
2007 ObjectSynchronizer::fast_enter(h_obj, lock, true, CHECK);
2008 } else {
2009 ObjectSynchronizer::slow_enter(h_obj, lock, CHECK);
2010 }
|
1966 if (message == NULL) {
1967 // Shouldn't happen, but don't cause even more problems if it does
1968 message = const_cast<char*>(caster_klass->external_name());
1969 } else {
1970 jio_snprintf(message,
1971 msglen,
1972 "%s cannot be cast to %s",
1973 caster_name,
1974 target_name);
1975 }
1976 return message;
1977 }
1978
1979 JRT_LEAF(void, SharedRuntime::reguard_yellow_pages())
1980 (void) JavaThread::current()->reguard_stack();
1981 JRT_END
1982
1983
1984 // Handles the uncommon case in locking, i.e., contention or an inflated lock.
1985 JRT_BLOCK_ENTRY(void, SharedRuntime::complete_monitor_locking_C(oopDesc* _obj, BasicLock* lock, JavaThread* thread))
1986 if (!SafepointSynchronize::is_synchronizing()) {
1987 // Only try quick_enter() if we're not trying to reach a safepoint
1988 // so that the calling thread reaches the safepoint more quickly.
1989 if (ObjectSynchronizer::quick_enter(_obj, thread, lock)) return;
1990 }
1991 // NO_ASYNC required because an async exception on the state transition destructor
1992 // would leave you with the lock held and it would never be released.
1993 // The normal monitorenter NullPointerException is thrown without acquiring a lock
1994 // and the model is that an exception implies the method failed.
1995 JRT_BLOCK_NO_ASYNC
1996 oop obj(_obj);
1997 if (PrintBiasedLockingStatistics) {
1998 Atomic::inc(BiasedLocking::slow_path_entry_count_addr());
1999 }
2000 Handle h_obj(THREAD, obj);
2001 if (UseBiasedLocking) {
2002 // Retry fast entry if bias is revoked to avoid unnecessary inflation
2003 ObjectSynchronizer::fast_enter(h_obj, lock, true, CHECK);
2004 } else {
2005 ObjectSynchronizer::slow_enter(h_obj, lock, CHECK);
2006 }
|