175 bool SystemDictionary::is_system_class_loader(oop class_loader) { |
175 bool SystemDictionary::is_system_class_loader(oop class_loader) { |
176 if (class_loader == NULL) { |
176 if (class_loader == NULL) { |
177 return false; |
177 return false; |
178 } |
178 } |
179 return (class_loader->klass() == SystemDictionary::jdk_internal_loader_ClassLoaders_AppClassLoader_klass() || |
179 return (class_loader->klass() == SystemDictionary::jdk_internal_loader_ClassLoaders_AppClassLoader_klass() || |
180 oopDesc::equals(class_loader, _java_system_loader)); |
180 class_loader == _java_system_loader); |
181 } |
181 } |
182 |
182 |
183 // Returns true if the passed class loader is the platform class loader. |
183 // Returns true if the passed class loader is the platform class loader. |
184 bool SystemDictionary::is_platform_class_loader(oop class_loader) { |
184 bool SystemDictionary::is_platform_class_loader(oop class_loader) { |
185 if (class_loader == NULL) { |
185 if (class_loader == NULL) { |
391 // so we don't throw an exception here. |
391 // so we don't throw an exception here. |
392 // see: nsk redefclass014 & java.lang.instrument Instrument032 |
392 // see: nsk redefclass014 & java.lang.instrument Instrument032 |
393 if ((childk != NULL ) && (is_superclass) && |
393 if ((childk != NULL ) && (is_superclass) && |
394 ((quicksuperk = childk->java_super()) != NULL) && |
394 ((quicksuperk = childk->java_super()) != NULL) && |
395 ((quicksuperk->name() == super_name) && |
395 ((quicksuperk->name() == super_name) && |
396 (oopDesc::equals(quicksuperk->class_loader(), class_loader())))) { |
396 (quicksuperk->class_loader() == class_loader()))) { |
397 return quicksuperk; |
397 return quicksuperk; |
398 } else { |
398 } else { |
399 PlaceholderEntry* probe = placeholders()->get_entry(p_index, p_hash, child_name, loader_data); |
399 PlaceholderEntry* probe = placeholders()->get_entry(p_index, p_hash, child_name, loader_data); |
400 if (probe && probe->check_seen_thread(THREAD, PlaceholderTable::LOAD_SUPER)) { |
400 if (probe && probe->check_seen_thread(THREAD, PlaceholderTable::LOAD_SUPER)) { |
401 throw_circularity_error = true; |
401 throw_circularity_error = true; |
540 assert_lock_strong(SystemDictionary_lock); |
540 assert_lock_strong(SystemDictionary_lock); |
541 |
541 |
542 bool calledholdinglock |
542 bool calledholdinglock |
543 = ObjectSynchronizer::current_thread_holds_lock((JavaThread*)THREAD, lockObject); |
543 = ObjectSynchronizer::current_thread_holds_lock((JavaThread*)THREAD, lockObject); |
544 assert(calledholdinglock,"must hold lock for notify"); |
544 assert(calledholdinglock,"must hold lock for notify"); |
545 assert((!oopDesc::equals(lockObject(), _system_loader_lock_obj) && !is_parallelCapable(lockObject)), "unexpected double_lock_wait"); |
545 assert((lockObject() != _system_loader_lock_obj && !is_parallelCapable(lockObject)), "unexpected double_lock_wait"); |
546 ObjectSynchronizer::notifyall(lockObject, THREAD); |
546 ObjectSynchronizer::notifyall(lockObject, THREAD); |
547 intptr_t recursions = ObjectSynchronizer::complete_exit(lockObject, THREAD); |
547 intptr_t recursions = ObjectSynchronizer::complete_exit(lockObject, THREAD); |
548 SystemDictionary_lock->wait(); |
548 SystemDictionary_lock->wait(); |
549 SystemDictionary_lock->unlock(); |
549 SystemDictionary_lock->unlock(); |
550 ObjectSynchronizer::reenter(lockObject, recursions, THREAD); |
550 ObjectSynchronizer::reenter(lockObject, recursions, THREAD); |
848 k = load_instance_class(name, class_loader, THREAD); |
848 k = load_instance_class(name, class_loader, THREAD); |
849 |
849 |
850 // If everything was OK (no exceptions, no null return value), and |
850 // If everything was OK (no exceptions, no null return value), and |
851 // class_loader is NOT the defining loader, do a little more bookkeeping. |
851 // class_loader is NOT the defining loader, do a little more bookkeeping. |
852 if (!HAS_PENDING_EXCEPTION && k != NULL && |
852 if (!HAS_PENDING_EXCEPTION && k != NULL && |
853 !oopDesc::equals(k->class_loader(), class_loader())) { |
853 k->class_loader() != class_loader()) { |
854 |
854 |
855 check_constraints(d_hash, k, class_loader, false, THREAD); |
855 check_constraints(d_hash, k, class_loader, false, THREAD); |
856 |
856 |
857 // Need to check for a PENDING_EXCEPTION again; check_constraints |
857 // Need to check for a PENDING_EXCEPTION again; check_constraints |
858 // can throw but we may have to remove entry from the placeholder table below. |
858 // can throw but we may have to remove entry from the placeholder table below. |
1001 |
1001 |
1002 ClassLoaderData* loader_data; |
1002 ClassLoaderData* loader_data; |
1003 if (unsafe_anonymous_host != NULL) { |
1003 if (unsafe_anonymous_host != NULL) { |
1004 // Create a new CLD for an unsafe anonymous class, that uses the same class loader |
1004 // Create a new CLD for an unsafe anonymous class, that uses the same class loader |
1005 // as the unsafe_anonymous_host |
1005 // as the unsafe_anonymous_host |
1006 guarantee(oopDesc::equals(unsafe_anonymous_host->class_loader(), class_loader()), "should be the same"); |
1006 guarantee(unsafe_anonymous_host->class_loader() == class_loader(), "should be the same"); |
1007 loader_data = ClassLoaderData::unsafe_anonymous_class_loader_data(class_loader); |
1007 loader_data = ClassLoaderData::unsafe_anonymous_class_loader_data(class_loader); |
1008 } else { |
1008 } else { |
1009 loader_data = ClassLoaderData::class_loader_data(class_loader()); |
1009 loader_data = ClassLoaderData::class_loader_data(class_loader()); |
1010 } |
1010 } |
1011 |
1011 |
1727 |
1727 |
1728 if (ObjectSynchronizer::query_lock_ownership((JavaThread*)THREAD, loader_lock) |
1728 if (ObjectSynchronizer::query_lock_ownership((JavaThread*)THREAD, loader_lock) |
1729 == ObjectSynchronizer::owner_other) { |
1729 == ObjectSynchronizer::owner_other) { |
1730 // contention will likely happen, so increment the corresponding |
1730 // contention will likely happen, so increment the corresponding |
1731 // contention counter. |
1731 // contention counter. |
1732 if (oopDesc::equals(loader_lock(), _system_loader_lock_obj)) { |
1732 if (loader_lock() == _system_loader_lock_obj) { |
1733 ClassLoader::sync_systemLoaderLockContentionRate()->inc(); |
1733 ClassLoader::sync_systemLoaderLockContentionRate()->inc(); |
1734 } else { |
1734 } else { |
1735 ClassLoader::sync_nonSystemLoaderLockContentionRate()->inc(); |
1735 ClassLoader::sync_nonSystemLoaderLockContentionRate()->inc(); |
1736 } |
1736 } |
1737 } |
1737 } |
2148 if (UseBiasedLocking && BiasedLocking::enabled()) { |
2148 if (UseBiasedLocking && BiasedLocking::enabled()) { |
2149 // Set biased locking bit for all loaded classes; it will be |
2149 // Set biased locking bit for all loaded classes; it will be |
2150 // cleared if revocation occurs too often for this type |
2150 // cleared if revocation occurs too often for this type |
2151 // NOTE that we must only do this when the class is initally |
2151 // NOTE that we must only do this when the class is initally |
2152 // defined, not each time it is referenced from a new class loader |
2152 // defined, not each time it is referenced from a new class loader |
2153 if (oopDesc::equals(k->class_loader(), class_loader())) { |
2153 if (k->class_loader() == class_loader()) { |
2154 k->set_prototype_header(markWord::biased_locking_prototype()); |
2154 k->set_prototype_header(markWord::biased_locking_prototype()); |
2155 } |
2155 } |
2156 } |
2156 } |
2157 |
2157 |
2158 // Make a new dictionary entry. |
2158 // Make a new dictionary entry. |
2341 // Arrays are not added to the loader constraint table, their elements are. |
2341 // Arrays are not added to the loader constraint table, their elements are. |
2342 Symbol* SystemDictionary::check_signature_loaders(Symbol* signature, |
2342 Symbol* SystemDictionary::check_signature_loaders(Symbol* signature, |
2343 Handle loader1, Handle loader2, |
2343 Handle loader1, Handle loader2, |
2344 bool is_method, TRAPS) { |
2344 bool is_method, TRAPS) { |
2345 // Nothing to do if loaders are the same. |
2345 // Nothing to do if loaders are the same. |
2346 if (oopDesc::equals(loader1(), loader2())) { |
2346 if (loader1() == loader2()) { |
2347 return NULL; |
2347 return NULL; |
2348 } |
2348 } |
2349 |
2349 |
2350 SignatureStream sig_strm(signature, is_method); |
2350 SignatureStream sig_strm(signature, is_method); |
2351 while (!sig_strm.is_done()) { |
2351 while (!sig_strm.is_done()) { |