< prev index next >

src/hotspot/share/classfile/systemDictionary.cpp

Print this page
rev 49275 : [mq]: JDK-8199781.patch

*** 179,189 **** bool SystemDictionary::is_system_class_loader(oop class_loader) { if (class_loader == NULL) { return false; } return (class_loader->klass() == SystemDictionary::jdk_internal_loader_ClassLoaders_AppClassLoader_klass() || ! class_loader == _java_system_loader); } // Returns true if the passed class loader is the platform class loader. bool SystemDictionary::is_platform_class_loader(oop class_loader) { if (class_loader == NULL) { --- 179,189 ---- bool SystemDictionary::is_system_class_loader(oop class_loader) { if (class_loader == NULL) { return false; } return (class_loader->klass() == SystemDictionary::jdk_internal_loader_ClassLoaders_AppClassLoader_klass() || ! oopDesc::equals(class_loader, _java_system_loader)); } // Returns true if the passed class loader is the platform class loader. bool SystemDictionary::is_platform_class_loader(oop class_loader) { if (class_loader == NULL) {
*** 388,398 **** // see: nsk redefclass014 & java.lang.instrument Instrument032 if ((childk != NULL ) && (is_superclass) && ((quicksuperk = childk->super()) != NULL) && ((quicksuperk->name() == class_name) && ! (quicksuperk->class_loader() == class_loader()))) { return quicksuperk; } else { PlaceholderEntry* probe = placeholders()->get_entry(p_index, p_hash, child_name, loader_data); if (probe && probe->check_seen_thread(THREAD, PlaceholderTable::LOAD_SUPER)) { throw_circularity_error = true; --- 388,398 ---- // see: nsk redefclass014 & java.lang.instrument Instrument032 if ((childk != NULL ) && (is_superclass) && ((quicksuperk = childk->super()) != NULL) && ((quicksuperk->name() == class_name) && ! (oopDesc::equals(quicksuperk->class_loader(), class_loader())))) { return quicksuperk; } else { PlaceholderEntry* probe = placeholders()->get_entry(p_index, p_hash, child_name, loader_data); if (probe && probe->check_seen_thread(THREAD, PlaceholderTable::LOAD_SUPER)) { throw_circularity_error = true;
*** 522,532 **** assert_lock_strong(SystemDictionary_lock); bool calledholdinglock = ObjectSynchronizer::current_thread_holds_lock((JavaThread*)THREAD, lockObject); assert(calledholdinglock,"must hold lock for notify"); ! assert((!(lockObject() == _system_loader_lock_obj) && !is_parallelCapable(lockObject)), "unexpected double_lock_wait"); ObjectSynchronizer::notifyall(lockObject, THREAD); intptr_t recursions = ObjectSynchronizer::complete_exit(lockObject, THREAD); SystemDictionary_lock->wait(); SystemDictionary_lock->unlock(); ObjectSynchronizer::reenter(lockObject, recursions, THREAD); --- 522,532 ---- assert_lock_strong(SystemDictionary_lock); bool calledholdinglock = ObjectSynchronizer::current_thread_holds_lock((JavaThread*)THREAD, lockObject); assert(calledholdinglock,"must hold lock for notify"); ! assert((!oopDesc::equals(lockObject(), _system_loader_lock_obj) && !is_parallelCapable(lockObject)), "unexpected double_lock_wait"); ObjectSynchronizer::notifyall(lockObject, THREAD); intptr_t recursions = ObjectSynchronizer::complete_exit(lockObject, THREAD); SystemDictionary_lock->wait(); SystemDictionary_lock->unlock(); ObjectSynchronizer::reenter(lockObject, recursions, THREAD);
*** 840,850 **** k = load_instance_class(name, class_loader, THREAD); // If everything was OK (no exceptions, no null return value), and // class_loader is NOT the defining loader, do a little more bookkeeping. if (!HAS_PENDING_EXCEPTION && k != NULL && ! k->class_loader() != class_loader()) { check_constraints(d_hash, k, class_loader, false, THREAD); // Need to check for a PENDING_EXCEPTION again; check_constraints // can throw and doesn't use the CHECK macro. --- 840,850 ---- k = load_instance_class(name, class_loader, THREAD); // If everything was OK (no exceptions, no null return value), and // class_loader is NOT the defining loader, do a little more bookkeeping. if (!HAS_PENDING_EXCEPTION && k != NULL && ! !oopDesc::equals(k->class_loader(), class_loader())) { check_constraints(d_hash, k, class_loader, false, THREAD); // Need to check for a PENDING_EXCEPTION again; check_constraints // can throw and doesn't use the CHECK macro.
*** 986,996 **** ClassLoaderData* loader_data; if (host_klass != NULL) { // Create a new CLD for anonymous class, that uses the same class loader // as the host_klass ! guarantee(host_klass->class_loader() == class_loader(), "should be the same"); loader_data = ClassLoaderData::anonymous_class_loader_data(class_loader); } else { loader_data = ClassLoaderData::class_loader_data(class_loader()); } --- 986,996 ---- ClassLoaderData* loader_data; if (host_klass != NULL) { // Create a new CLD for anonymous class, that uses the same class loader // as the host_klass ! guarantee(oopDesc::equals(host_klass->class_loader(), class_loader()), "should be the same"); loader_data = ClassLoaderData::anonymous_class_loader_data(class_loader); } else { loader_data = ClassLoaderData::class_loader_data(class_loader()); }
*** 1744,1754 **** if (ObjectSynchronizer::query_lock_ownership((JavaThread*)THREAD, loader_lock) == ObjectSynchronizer::owner_other) { // contention will likely happen, so increment the corresponding // contention counter. ! if (loader_lock() == _system_loader_lock_obj) { ClassLoader::sync_systemLoaderLockContentionRate()->inc(); } else { ClassLoader::sync_nonSystemLoaderLockContentionRate()->inc(); } } --- 1744,1754 ---- if (ObjectSynchronizer::query_lock_ownership((JavaThread*)THREAD, loader_lock) == ObjectSynchronizer::owner_other) { // contention will likely happen, so increment the corresponding // contention counter. ! if (oopDesc::equals(loader_lock(), _system_loader_lock_obj)) { ClassLoader::sync_systemLoaderLockContentionRate()->inc(); } else { ClassLoader::sync_nonSystemLoaderLockContentionRate()->inc(); } }
*** 2226,2236 **** if (UseBiasedLocking && BiasedLocking::enabled()) { // Set biased locking bit for all loaded classes; it will be // cleared if revocation occurs too often for this type // NOTE that we must only do this when the class is initally // defined, not each time it is referenced from a new class loader ! if (k->class_loader() == class_loader()) { k->set_prototype_header(markOopDesc::biased_locking_prototype()); } } // Make a new dictionary entry. --- 2226,2236 ---- if (UseBiasedLocking && BiasedLocking::enabled()) { // Set biased locking bit for all loaded classes; it will be // cleared if revocation occurs too often for this type // NOTE that we must only do this when the class is initally // defined, not each time it is referenced from a new class loader ! if (oopDesc::equals(k->class_loader(), class_loader())) { k->set_prototype_header(markOopDesc::biased_locking_prototype()); } } // Make a new dictionary entry.
*** 2418,2428 **** // Arrays are not added to the loader constraint table, their elements are. Symbol* SystemDictionary::check_signature_loaders(Symbol* signature, Handle loader1, Handle loader2, bool is_method, TRAPS) { // Nothing to do if loaders are the same. ! if (loader1() == loader2()) { return NULL; } SignatureStream sig_strm(signature, is_method); while (!sig_strm.is_done()) { --- 2418,2428 ---- // Arrays are not added to the loader constraint table, their elements are. Symbol* SystemDictionary::check_signature_loaders(Symbol* signature, Handle loader1, Handle loader2, bool is_method, TRAPS) { // Nothing to do if loaders are the same. ! if (oopDesc::equals(loader1(), loader2())) { return NULL; } SignatureStream sig_strm(signature, is_method); while (!sig_strm.is_done()) {
< prev index next >