< prev index next >

src/share/vm/classfile/systemDictionary.cpp

Print this page




 897 
 898   if (HAS_PENDING_EXCEPTION || k == NULL) {
 899     return NULL;
 900   }
 901 
 902   post_class_load_event(class_load_start_time, k, loader_data);
 903 
 904 #ifdef ASSERT
 905   {
 906     ClassLoaderData* loader_data = k->class_loader_data();
 907     MutexLocker mu(SystemDictionary_lock, THREAD);
 908     Klass* kk = find_class(name, loader_data);
 909     assert(kk == k, "should be present in dictionary");
 910   }
 911 #endif
 912 
 913   // return if the protection domain in NULL
 914   if (protection_domain() == NULL) return k;
 915 
 916   // Check the protection domain has the right access
 917   {
 918     MutexLocker mu(SystemDictionary_lock, THREAD);
 919     if (dictionary->is_valid_protection_domain(d_index, d_hash, name,
 920                                                protection_domain)) {
 921       return k;
 922     }
 923   }
 924 
 925   // Verify protection domain. If it fails an exception is thrown
 926   validate_protection_domain(k, class_loader, protection_domain, CHECK_NULL);
 927 
 928   return k;
 929 }
 930 
 931 
 932 // This routine does not lock the system dictionary.
 933 //
 934 // Since readers don't hold a lock, we must make sure that system
 935 // dictionary entries are only removed at a safepoint (when only one
 936 // thread is running), and are added to in a safe way (all links must
 937 // be updated in an MT-safe manner).
 938 //
 939 // Callers should be aware that an entry could be added just after
 940 // _dictionary->bucket(index) is read here, so the caller will not see
 941 // the new entry.
 942 




 897 
 898   if (HAS_PENDING_EXCEPTION || k == NULL) {
 899     return NULL;
 900   }
 901 
 902   post_class_load_event(class_load_start_time, k, loader_data);
 903 
 904 #ifdef ASSERT
 905   {
 906     ClassLoaderData* loader_data = k->class_loader_data();
 907     MutexLocker mu(SystemDictionary_lock, THREAD);
 908     Klass* kk = find_class(name, loader_data);
 909     assert(kk == k, "should be present in dictionary");
 910   }
 911 #endif
 912 
 913   // return if the protection domain in NULL
 914   if (protection_domain() == NULL) return k;
 915 
 916   // Check the protection domain has the right access


 917   if (dictionary->is_valid_protection_domain(d_index, d_hash, name,
 918                                              protection_domain)) {
 919     return k;

 920   }
 921 
 922   // Verify protection domain. If it fails an exception is thrown
 923   validate_protection_domain(k, class_loader, protection_domain, CHECK_NULL);
 924 
 925   return k;
 926 }
 927 
 928 
 929 // This routine does not lock the system dictionary.
 930 //
 931 // Since readers don't hold a lock, we must make sure that system
 932 // dictionary entries are only removed at a safepoint (when only one
 933 // thread is running), and are added to in a safe way (all links must
 934 // be updated in an MT-safe manner).
 935 //
 936 // Callers should be aware that an entry could be added just after
 937 // _dictionary->bucket(index) is read here, so the caller will not see
 938 // the new entry.
 939 


< prev index next >