roman_version
164 return java_lang_ClassLoader::parallelCapable(class_loader());
165 }
166 // ----------------------------------------------------------------------------
167 // ParallelDefineClass flag does not apply to bootclass loader
168 bool SystemDictionary::is_parallelDefine(Handle class_loader) {
169 if (class_loader.is_null()) return false;
170 if (AllowParallelDefineClass && java_lang_ClassLoader::parallelCapable(class_loader())) {
171 return true;
172 }
173 return false;
174 }
175
176 // Returns true if the passed class loader is the builtin application class loader
177 // or a custom system class loader. A customer system class loader can be
178 // specified via -Djava.system.class.loader.
179 bool SystemDictionary::is_system_class_loader(oop class_loader) {
180 if (class_loader == NULL) {
181 return false;
182 }
183 return (class_loader->klass() == SystemDictionary::jdk_internal_loader_ClassLoaders_AppClassLoader_klass() ||
184 class_loader == _java_system_loader);
185 }
186
187 // Returns true if the passed class loader is the platform class loader.
188 bool SystemDictionary::is_platform_class_loader(oop class_loader) {
189 if (class_loader == NULL) {
190 return false;
191 }
192 return (class_loader->klass() == SystemDictionary::jdk_internal_loader_ClassLoaders_PlatformClassLoader_klass());
193 }
194
195 // ----------------------------------------------------------------------------
196 // Resolving of classes
197
198 // Forwards to resolve_or_null
199
200 Klass* SystemDictionary::resolve_or_fail(Symbol* class_name, Handle class_loader, Handle protection_domain, bool throw_error, TRAPS)
201 Klass* klass = resolve_or_null(class_name, class_loader, protection_domain, THREAD);
202 if (HAS_PENDING_EXCEPTION || klass == NULL) {
203 // can return a null klass
|
164 return java_lang_ClassLoader::parallelCapable(class_loader());
165 }
166 // ----------------------------------------------------------------------------
167 // ParallelDefineClass flag does not apply to bootclass loader
168 bool SystemDictionary::is_parallelDefine(Handle class_loader) {
169 if (class_loader.is_null()) return false;
170 if (AllowParallelDefineClass && java_lang_ClassLoader::parallelCapable(class_loader())) {
171 return true;
172 }
173 return false;
174 }
175
176 // Returns true if the passed class loader is the builtin application class loader
177 // or a custom system class loader. A customer system class loader can be
178 // specified via -Djava.system.class.loader.
179 bool SystemDictionary::is_system_class_loader(oop class_loader) {
180 if (class_loader == NULL) {
181 return false;
182 }
183 return (class_loader->klass() == SystemDictionary::jdk_internal_loader_ClassLoaders_AppClassLoader_klass() ||
184 oopDesc::equals(class_loader, _java_system_loader));
185 }
186
187 // Returns true if the passed class loader is the platform class loader.
188 bool SystemDictionary::is_platform_class_loader(oop class_loader) {
189 if (class_loader == NULL) {
190 return false;
191 }
192 return (class_loader->klass() == SystemDictionary::jdk_internal_loader_ClassLoaders_PlatformClassLoader_klass());
193 }
194
195 // ----------------------------------------------------------------------------
196 // Resolving of classes
197
198 // Forwards to resolve_or_null
199
200 Klass* SystemDictionary::resolve_or_fail(Symbol* class_name, Handle class_loader, Handle protection_domain, bool throw_error, TRAPS)
201 Klass* klass = resolve_or_null(class_name, class_loader, protection_domain, THREAD);
202 if (HAS_PENDING_EXCEPTION || klass == NULL) {
203 // can return a null klass
|
373 unsigned int d_hash = dictionary->compute_hash(child_name);
374 unsigned int p_hash = placeholders()->compute_hash(child_name);
375 int p_index = placeholders()->hash_to_index(p_hash);
376 // can't throw error holding a lock
377 bool child_already_loaded = false;
378 bool throw_circularity_error = false;
379 {
380 MutexLocker mu(SystemDictionary_lock, THREAD);
381 Klass* childk = find_class(d_hash, child_name, dictionary);
382 Klass* quicksuperk;
383 // to support // loading: if child done loading, just return superclass
384 // if class_name, & class_loader don't match:
385 // if initial define, SD update will give LinkageError
386 // if redefine: compare_class_versions will give HIERARCHY_CHANGED
387 // so we don't throw an exception here.
388 // see: nsk redefclass014 & java.lang.instrument Instrument032
389 if ((childk != NULL ) && (is_superclass) &&
390 ((quicksuperk = childk->super()) != NULL) &&
391
392 ((quicksuperk->name() == class_name) &&
393 (quicksuperk->class_loader() == class_loader()))) {
394 return quicksuperk;
395 } else {
396 PlaceholderEntry* probe = placeholders()->get_entry(p_index, p_hash, child_name, loader_data);
397 if (probe && probe->check_seen_thread(THREAD, PlaceholderTable::LOAD_SUPER)) {
398 throw_circularity_error = true;
399 }
400 }
401 if (!throw_circularity_error) {
402 // Be careful not to exit resolve_super
403 PlaceholderEntry* newprobe = placeholders()->find_and_add(p_index, p_hash, child_name, loader_data, PlaceholderTable::LOAD_SUPE
404 }
405 }
406 if (throw_circularity_error) {
407 ResourceMark rm(THREAD);
408 THROW_MSG_NULL(vmSymbols::java_lang_ClassCircularityError(), child_name->as_C_string());
409 }
410
411 // java.lang.Object should have been found above
412 assert(class_name != NULL, "null super class for resolving");
|
373 unsigned int d_hash = dictionary->compute_hash(child_name);
374 unsigned int p_hash = placeholders()->compute_hash(child_name);
375 int p_index = placeholders()->hash_to_index(p_hash);
376 // can't throw error holding a lock
377 bool child_already_loaded = false;
378 bool throw_circularity_error = false;
379 {
380 MutexLocker mu(SystemDictionary_lock, THREAD);
381 Klass* childk = find_class(d_hash, child_name, dictionary);
382 Klass* quicksuperk;
383 // to support // loading: if child done loading, just return superclass
384 // if class_name, & class_loader don't match:
385 // if initial define, SD update will give LinkageError
386 // if redefine: compare_class_versions will give HIERARCHY_CHANGED
387 // so we don't throw an exception here.
388 // see: nsk redefclass014 & java.lang.instrument Instrument032
389 if ((childk != NULL ) && (is_superclass) &&
390 ((quicksuperk = childk->super()) != NULL) &&
391
392 ((quicksuperk->name() == class_name) &&
393 (oopDesc::equals(quicksuperk->class_loader(), class_loader())))) {
394 return quicksuperk;
395 } else {
396 PlaceholderEntry* probe = placeholders()->get_entry(p_index, p_hash, child_name, loader_data);
397 if (probe && probe->check_seen_thread(THREAD, PlaceholderTable::LOAD_SUPER)) {
398 throw_circularity_error = true;
399 }
400 }
401 if (!throw_circularity_error) {
402 // Be careful not to exit resolve_super
403 PlaceholderEntry* newprobe = placeholders()->find_and_add(p_index, p_hash, child_name, loader_data, PlaceholderTable::LOAD_SUPE
404 }
405 }
406 if (throw_circularity_error) {
407 ResourceMark rm(THREAD);
408 THROW_MSG_NULL(vmSymbols::java_lang_ClassCircularityError(), child_name->as_C_string());
409 }
410
411 // java.lang.Object should have been found above
412 assert(class_name != NULL, "null super class for resolving");
|
507 // so another thread got here in parallel
508 //
509 // lockObject must be held.
510 // Complicated dance due to lock ordering:
511 // Must first release the classloader object lock to
512 // allow initial definer to complete the class definition
513 // and to avoid deadlock
514 // Reclaim classloader lock object with same original recursion count
515 // Must release SystemDictionary_lock after notify, since
516 // class loader lock must be claimed before SystemDictionary_lock
517 // to prevent deadlocks
518 //
519 // The notify allows applications that did an untimed wait() on
520 // the classloader object lock to not hang.
521 void SystemDictionary::double_lock_wait(Handle lockObject, TRAPS) {
522 assert_lock_strong(SystemDictionary_lock);
523
524 bool calledholdinglock
525 = ObjectSynchronizer::current_thread_holds_lock((JavaThread*)THREAD, lockObject);
526 assert(calledholdinglock,"must hold lock for notify");
527 assert((!(lockObject() == _system_loader_lock_obj) && !is_parallelCapable(lockObject)), "unexpected double_lock_wait");
528 ObjectSynchronizer::notifyall(lockObject, THREAD);
529 intptr_t recursions = ObjectSynchronizer::complete_exit(lockObject, THREAD);
530 SystemDictionary_lock->wait();
531 SystemDictionary_lock->unlock();
532 ObjectSynchronizer::reenter(lockObject, recursions, THREAD);
533 SystemDictionary_lock->lock();
534 }
535
536 // If the class in is in the placeholder table, class loading is in progress
537 // For cases where the application changes threads to load classes, it
538 // is critical to ClassCircularity detection that we try loading
539 // the superclass on the same thread internally, so we do parallel
540 // super class loading here.
541 // This also is critical in cases where the original thread gets stalled
542 // even in non-circularity situations.
543 // Note: must call resolve_super_or_fail even if null super -
544 // to force placeholder entry creation for this class for circularity detection
545 // Caller must check for pending exception
546 // Returns non-null Klass* if other thread has completed load
|
507 // so another thread got here in parallel
508 //
509 // lockObject must be held.
510 // Complicated dance due to lock ordering:
511 // Must first release the classloader object lock to
512 // allow initial definer to complete the class definition
513 // and to avoid deadlock
514 // Reclaim classloader lock object with same original recursion count
515 // Must release SystemDictionary_lock after notify, since
516 // class loader lock must be claimed before SystemDictionary_lock
517 // to prevent deadlocks
518 //
519 // The notify allows applications that did an untimed wait() on
520 // the classloader object lock to not hang.
521 void SystemDictionary::double_lock_wait(Handle lockObject, TRAPS) {
522 assert_lock_strong(SystemDictionary_lock);
523
524 bool calledholdinglock
525 = ObjectSynchronizer::current_thread_holds_lock((JavaThread*)THREAD, lockObject);
526 assert(calledholdinglock,"must hold lock for notify");
527 assert((!oopDesc::equals(lockObject(), _system_loader_lock_obj) && !is_parallelCapable(lockObject)), "unexpected double_lock_wait")
528 ObjectSynchronizer::notifyall(lockObject, THREAD);
529 intptr_t recursions = ObjectSynchronizer::complete_exit(lockObject, THREAD);
530 SystemDictionary_lock->wait();
531 SystemDictionary_lock->unlock();
532 ObjectSynchronizer::reenter(lockObject, recursions, THREAD);
533 SystemDictionary_lock->lock();
534 }
535
536 // If the class in is in the placeholder table, class loading is in progress
537 // For cases where the application changes threads to load classes, it
538 // is critical to ClassCircularity detection that we try loading
539 // the superclass on the same thread internally, so we do parallel
540 // super class loading here.
541 // This also is critical in cases where the original thread gets stalled
542 // even in non-circularity situations.
543 // Note: must call resolve_super_or_fail even if null super -
544 // to force placeholder entry creation for this class for circularity detection
545 // Caller must check for pending exception
546 // Returns non-null Klass* if other thread has completed load
|
825 class_has_been_loaded = true;
826 }
827 }
828 }
829
830 // must throw error outside of owning lock
831 if (throw_circularity_error) {
832 assert(!HAS_PENDING_EXCEPTION && load_instance_added == false,"circularity error cleanup");
833 ResourceMark rm(THREAD);
834 THROW_MSG_NULL(vmSymbols::java_lang_ClassCircularityError(), name->as_C_string());
835 }
836
837 if (!class_has_been_loaded) {
838
839 // Do actual loading
840 k = load_instance_class(name, class_loader, THREAD);
841
842 // If everything was OK (no exceptions, no null return value), and
843 // class_loader is NOT the defining loader, do a little more bookkeeping.
844 if (!HAS_PENDING_EXCEPTION && k != NULL &&
845 k->class_loader() != class_loader()) {
846
847 check_constraints(d_hash, k, class_loader, false, THREAD);
848
849 // Need to check for a PENDING_EXCEPTION again; check_constraints
850 // can throw and doesn't use the CHECK macro.
851 if (!HAS_PENDING_EXCEPTION) {
852 { // Grabbing the Compile_lock prevents systemDictionary updates
853 // during compilations.
854 MutexLocker mu(Compile_lock, THREAD);
855 update_dictionary(d_hash, p_index, p_hash,
856 k, class_loader, THREAD);
857 }
858
859 if (JvmtiExport::should_post_class_load()) {
860 Thread *thread = THREAD;
861 assert(thread->is_Java_thread(), "thread->is_Java_thread()");
862 JvmtiExport::post_class_load((JavaThread *) thread, k);
863 }
864 }
|
825 class_has_been_loaded = true;
826 }
827 }
828 }
829
830 // must throw error outside of owning lock
831 if (throw_circularity_error) {
832 assert(!HAS_PENDING_EXCEPTION && load_instance_added == false,"circularity error cleanup");
833 ResourceMark rm(THREAD);
834 THROW_MSG_NULL(vmSymbols::java_lang_ClassCircularityError(), name->as_C_string());
835 }
836
837 if (!class_has_been_loaded) {
838
839 // Do actual loading
840 k = load_instance_class(name, class_loader, THREAD);
841
842 // If everything was OK (no exceptions, no null return value), and
843 // class_loader is NOT the defining loader, do a little more bookkeeping.
844 if (!HAS_PENDING_EXCEPTION && k != NULL &&
845 !oopDesc::equals(k->class_loader(), class_loader())) {
846
847 check_constraints(d_hash, k, class_loader, false, THREAD);
848
849 // Need to check for a PENDING_EXCEPTION again; check_constraints
850 // can throw and doesn't use the CHECK macro.
851 if (!HAS_PENDING_EXCEPTION) {
852 { // Grabbing the Compile_lock prevents systemDictionary updates
853 // during compilations.
854 MutexLocker mu(Compile_lock, THREAD);
855 update_dictionary(d_hash, p_index, p_hash,
856 k, class_loader, THREAD);
857 }
858
859 if (JvmtiExport::should_post_class_load()) {
860 Thread *thread = THREAD;
861 assert(thread->is_Java_thread(), "thread->is_Java_thread()");
862 JvmtiExport::post_class_load((JavaThread *) thread, k);
863 }
864 }
|
971 }
972
973 // Note: this method is much like resolve_from_stream, but
974 // does not publish the classes via the SystemDictionary.
975 // Handles unsafe_DefineAnonymousClass and redefineclasses
976 // RedefinedClasses do not add to the class hierarchy
977 InstanceKlass* SystemDictionary::parse_stream(Symbol* class_name,
978 Handle class_loader,
979 Handle protection_domain,
980 ClassFileStream* st,
981 const InstanceKlass* host_klass,
982 GrowableArray<Handle>* cp_patches,
983 TRAPS) {
984
985 EventClassLoad class_load_start_event;
986
987 ClassLoaderData* loader_data;
988 if (host_klass != NULL) {
989 // Create a new CLD for anonymous class, that uses the same class loader
990 // as the host_klass
991 guarantee(host_klass->class_loader() == class_loader(), "should be the same");
992 loader_data = ClassLoaderData::anonymous_class_loader_data(class_loader);
993 } else {
994 loader_data = ClassLoaderData::class_loader_data(class_loader());
995 }
996
997 assert(st != NULL, "invariant");
998 assert(st->need_verify(), "invariant");
999
1000 // Parse stream and create a klass.
1001 // Note that we do this even though this klass might
1002 // already be present in the SystemDictionary, otherwise we would not
1003 // throw potential ClassFormatErrors.
1004
1005 InstanceKlass* k = KlassFactory::create_from_stream(st,
1006 class_name,
1007 loader_data,
1008 protection_domain,
1009 host_klass,
1010 cp_patches,
|
971 }
972
973 // Note: this method is much like resolve_from_stream, but
974 // does not publish the classes via the SystemDictionary.
975 // Handles unsafe_DefineAnonymousClass and redefineclasses
976 // RedefinedClasses do not add to the class hierarchy
977 InstanceKlass* SystemDictionary::parse_stream(Symbol* class_name,
978 Handle class_loader,
979 Handle protection_domain,
980 ClassFileStream* st,
981 const InstanceKlass* host_klass,
982 GrowableArray<Handle>* cp_patches,
983 TRAPS) {
984
985 EventClassLoad class_load_start_event;
986
987 ClassLoaderData* loader_data;
988 if (host_klass != NULL) {
989 // Create a new CLD for anonymous class, that uses the same class loader
990 // as the host_klass
991 guarantee(oopDesc::equals(host_klass->class_loader(), class_loader()), "should be the same");
992 loader_data = ClassLoaderData::anonymous_class_loader_data(class_loader);
993 } else {
994 loader_data = ClassLoaderData::class_loader_data(class_loader());
995 }
996
997 assert(st != NULL, "invariant");
998 assert(st->need_verify(), "invariant");
999
1000 // Parse stream and create a klass.
1001 // Note that we do this even though this klass might
1002 // already be present in the SystemDictionary, otherwise we would not
1003 // throw potential ClassFormatErrors.
1004
1005 InstanceKlass* k = KlassFactory::create_from_stream(st,
1006 class_name,
1007 loader_data,
1008 protection_domain,
1009 host_klass,
1010 cp_patches,
|
1729 } else {
1730 return class_loader;
1731 }
1732 }
1733
1734 // This method is added to check how often we have to wait to grab loader
1735 // lock. The results are being recorded in the performance counters defined in
1736 // ClassLoader::_sync_systemLoaderLockContentionRate and
1737 // ClassLoader::_sync_nonSystemLoaderLockConteionRate.
1738 void SystemDictionary::check_loader_lock_contention(Handle loader_lock, TRAPS) {
1739 if (!UsePerfData) {
1740 return;
1741 }
1742
1743 assert(!loader_lock.is_null(), "NULL lock object");
1744
1745 if (ObjectSynchronizer::query_lock_ownership((JavaThread*)THREAD, loader_lock)
1746 == ObjectSynchronizer::owner_other) {
1747 // contention will likely happen, so increment the corresponding
1748 // contention counter.
1749 if (loader_lock() == _system_loader_lock_obj) {
1750 ClassLoader::sync_systemLoaderLockContentionRate()->inc();
1751 } else {
1752 ClassLoader::sync_nonSystemLoaderLockContentionRate()->inc();
1753 }
1754 }
1755 }
1756
1757 // ----------------------------------------------------------------------------
1758 // Lookup
1759
1760 InstanceKlass* SystemDictionary::find_class(unsigned int hash,
1761 Symbol* class_name,
1762 Dictionary* dictionary) {
1763 assert_locked_or_safepoint(SystemDictionary_lock);
1764 int index = dictionary->hash_to_index(hash);
1765 return dictionary->find_class(index, hash, class_name);
1766 }
1767
1768
|
1729 } else {
1730 return class_loader;
1731 }
1732 }
1733
1734 // This method is added to check how often we have to wait to grab loader
1735 // lock. The results are being recorded in the performance counters defined in
1736 // ClassLoader::_sync_systemLoaderLockContentionRate and
1737 // ClassLoader::_sync_nonSystemLoaderLockConteionRate.
1738 void SystemDictionary::check_loader_lock_contention(Handle loader_lock, TRAPS) {
1739 if (!UsePerfData) {
1740 return;
1741 }
1742
1743 assert(!loader_lock.is_null(), "NULL lock object");
1744
1745 if (ObjectSynchronizer::query_lock_ownership((JavaThread*)THREAD, loader_lock)
1746 == ObjectSynchronizer::owner_other) {
1747 // contention will likely happen, so increment the corresponding
1748 // contention counter.
1749 if (oopDesc::equals(loader_lock(), _system_loader_lock_obj)) {
1750 ClassLoader::sync_systemLoaderLockContentionRate()->inc();
1751 } else {
1752 ClassLoader::sync_nonSystemLoaderLockContentionRate()->inc();
1753 }
1754 }
1755 }
1756
1757 // ----------------------------------------------------------------------------
1758 // Lookup
1759
1760 InstanceKlass* SystemDictionary::find_class(unsigned int hash,
1761 Symbol* class_name,
1762 Dictionary* dictionary) {
1763 assert_locked_or_safepoint(SystemDictionary_lock);
1764 int index = dictionary->hash_to_index(hash);
1765 return dictionary->find_class(index, hash, class_name);
1766 }
1767
1768
|
2211 ClassLoaderData *loader_data = class_loader_data(class_loader);
2212
2213 {
2214 MutexLocker mu1(SystemDictionary_lock, THREAD);
2215
2216 // See whether biased locking is enabled and if so set it for this
2217 // klass.
2218 // Note that this must be done past the last potential blocking
2219 // point / safepoint. We enable biased locking lazily using a
2220 // VM_Operation to iterate the SystemDictionary and installing the
2221 // biasable mark word into each InstanceKlass's prototype header.
2222 // To avoid race conditions where we accidentally miss enabling the
2223 // optimization for one class in the process of being added to the
2224 // dictionary, we must not safepoint after the test of
2225 // BiasedLocking::enabled().
2226 if (UseBiasedLocking && BiasedLocking::enabled()) {
2227 // Set biased locking bit for all loaded classes; it will be
2228 // cleared if revocation occurs too often for this type
2229 // NOTE that we must only do this when the class is initally
2230 // defined, not each time it is referenced from a new class loader
2231 if (k->class_loader() == class_loader()) {
2232 k->set_prototype_header(markOopDesc::biased_locking_prototype());
2233 }
2234 }
2235
2236 // Make a new dictionary entry.
2237 Dictionary* dictionary = loader_data->dictionary();
2238 InstanceKlass* sd_check = find_class(d_hash, name, dictionary);
2239 if (sd_check == NULL) {
2240 dictionary->add_klass(d_hash, name, k);
2241 notice_modification();
2242 }
2243 #ifdef ASSERT
2244 sd_check = find_class(d_hash, name, dictionary);
2245 assert (sd_check != NULL, "should have entry in dictionary");
2246 // Note: there may be a placeholder entry: for circularity testing
2247 // or for parallel defines
2248 #endif
2249 SystemDictionary_lock->notify_all();
2250 }
|
2211 ClassLoaderData *loader_data = class_loader_data(class_loader);
2212
2213 {
2214 MutexLocker mu1(SystemDictionary_lock, THREAD);
2215
2216 // See whether biased locking is enabled and if so set it for this
2217 // klass.
2218 // Note that this must be done past the last potential blocking
2219 // point / safepoint. We enable biased locking lazily using a
2220 // VM_Operation to iterate the SystemDictionary and installing the
2221 // biasable mark word into each InstanceKlass's prototype header.
2222 // To avoid race conditions where we accidentally miss enabling the
2223 // optimization for one class in the process of being added to the
2224 // dictionary, we must not safepoint after the test of
2225 // BiasedLocking::enabled().
2226 if (UseBiasedLocking && BiasedLocking::enabled()) {
2227 // Set biased locking bit for all loaded classes; it will be
2228 // cleared if revocation occurs too often for this type
2229 // NOTE that we must only do this when the class is initally
2230 // defined, not each time it is referenced from a new class loader
2231 if (oopDesc::equals(k->class_loader(), class_loader())) {
2232 k->set_prototype_header(markOopDesc::biased_locking_prototype());
2233 }
2234 }
2235
2236 // Make a new dictionary entry.
2237 Dictionary* dictionary = loader_data->dictionary();
2238 InstanceKlass* sd_check = find_class(d_hash, name, dictionary);
2239 if (sd_check == NULL) {
2240 dictionary->add_klass(d_hash, name, k);
2241 notice_modification();
2242 }
2243 #ifdef ASSERT
2244 sd_check = find_class(d_hash, name, dictionary);
2245 assert (sd_check != NULL, "should have entry in dictionary");
2246 // Note: there may be a placeholder entry: for circularity testing
2247 // or for parallel defines
2248 #endif
2249 SystemDictionary_lock->notify_all();
2250 }
|
2403 // constraints are placed as if the supertype were the caller to the
2404 // overriding method. (This works well, since callers to the
2405 // supertype have already established agreement between themselves and
2406 // the supertype.) As a result of all this, a class can disagree with
2407 // its supertype about the meaning of a type name, as long as that
2408 // class neither calls a relevant method of the supertype, nor is
2409 // called (perhaps via an override) from the supertype.
2410 //
2411 //
2412 // SystemDictionary::check_signature_loaders(sig, l1, l2)
2413 //
2414 // Make sure all class components (including arrays) in the given
2415 // signature will be resolved to the same class in both loaders.
2416 // Returns the name of the type that failed a loader constraint check, or
2417 // NULL if no constraint failed. No exception except OOME is thrown.
2418 // Arrays are not added to the loader constraint table, their elements are.
2419 Symbol* SystemDictionary::check_signature_loaders(Symbol* signature,
2420 Handle loader1, Handle loader2,
2421 bool is_method, TRAPS) {
2422 // Nothing to do if loaders are the same.
2423 if (loader1() == loader2()) {
2424 return NULL;
2425 }
2426
2427 SignatureStream sig_strm(signature, is_method);
2428 while (!sig_strm.is_done()) {
2429 if (sig_strm.is_object()) {
2430 Symbol* sig = sig_strm.as_symbol(CHECK_NULL);
2431 if (!add_loader_constraint(sig, loader1, loader2, THREAD)) {
2432 return sig;
2433 }
2434 }
2435 sig_strm.next();
2436 }
2437 return NULL;
2438 }
2439
2440
2441 methodHandle SystemDictionary::find_method_handle_intrinsic(vmIntrinsics::ID iid,
2442 Symbol* signature,
|
2403 // constraints are placed as if the supertype were the caller to the
2404 // overriding method. (This works well, since callers to the
2405 // supertype have already established agreement between themselves and
2406 // the supertype.) As a result of all this, a class can disagree with
2407 // its supertype about the meaning of a type name, as long as that
2408 // class neither calls a relevant method of the supertype, nor is
2409 // called (perhaps via an override) from the supertype.
2410 //
2411 //
2412 // SystemDictionary::check_signature_loaders(sig, l1, l2)
2413 //
2414 // Make sure all class components (including arrays) in the given
2415 // signature will be resolved to the same class in both loaders.
2416 // Returns the name of the type that failed a loader constraint check, or
2417 // NULL if no constraint failed. No exception except OOME is thrown.
2418 // Arrays are not added to the loader constraint table, their elements are.
2419 Symbol* SystemDictionary::check_signature_loaders(Symbol* signature,
2420 Handle loader1, Handle loader2,
2421 bool is_method, TRAPS) {
2422 // Nothing to do if loaders are the same.
2423 if (oopDesc::equals(loader1(), loader2())) {
2424 return NULL;
2425 }
2426
2427 SignatureStream sig_strm(signature, is_method);
2428 while (!sig_strm.is_done()) {
2429 if (sig_strm.is_object()) {
2430 Symbol* sig = sig_strm.as_symbol(CHECK_NULL);
2431 if (!add_loader_constraint(sig, loader1, loader2, THREAD)) {
2432 return sig;
2433 }
2434 }
2435 sig_strm.next();
2436 }
2437 return NULL;
2438 }
2439
2440
2441 methodHandle SystemDictionary::find_method_handle_intrinsic(vmIntrinsics::ID iid,
2442 Symbol* signature,
|