< prev index next >

src/hotspot/share/classfile/systemDictionary.cpp

Print this page




1143   if (HAS_PENDING_EXCEPTION) {
1144     assert(k != NULL, "Must have an instance klass here!");
1145     loader_data->add_to_deallocate_list(k);
1146     return NULL;
1147   }
1148 
1149   // Make sure we have an entry in the SystemDictionary on success
1150   debug_only( {
1151     MutexLocker mu(SystemDictionary_lock, THREAD);
1152 
1153     Klass* check = find_class(h_name, k->class_loader_data());
1154     assert(check == k, "should be present in the dictionary");
1155   } );
1156 
1157   return k;
1158 }
1159 
1160 #if INCLUDE_CDS
1161 void SystemDictionary::set_shared_dictionary(HashtableBucket<mtClass>* t, int length,
1162                                              int number_of_entries) {

1163   assert(length == _shared_dictionary_size * sizeof(HashtableBucket<mtClass>),
1164          "bad shared dictionary size.");
1165   _shared_dictionary = new Dictionary(ClassLoaderData::the_null_class_loader_data(),
1166                                       _shared_dictionary_size, t, number_of_entries);

1167 }
1168 
1169 
1170 // If there is a shared dictionary, then find the entry for the
1171 // given shared system class, if any.
1172 
1173 InstanceKlass* SystemDictionary::find_shared_class(Symbol* class_name) {
1174   if (shared_dictionary() != NULL) {
1175     unsigned int d_hash = shared_dictionary()->compute_hash(class_name);
1176     int d_index = shared_dictionary()->hash_to_index(d_hash);
1177 
1178     return shared_dictionary()->find_shared_class(d_index, d_hash, class_name);
1179   } else {
1180     return NULL;
1181   }
1182 }
1183 
1184 
1185 // Load a class from the shared spaces (found through the shared system
1186 // dictionary).  Force the superclass and all interfaces to be loaded.




1143   if (HAS_PENDING_EXCEPTION) {
1144     assert(k != NULL, "Must have an instance klass here!");
1145     loader_data->add_to_deallocate_list(k);
1146     return NULL;
1147   }
1148 
1149   // Make sure we have an entry in the SystemDictionary on success
1150   debug_only( {
1151     MutexLocker mu(SystemDictionary_lock, THREAD);
1152 
1153     Klass* check = find_class(h_name, k->class_loader_data());
1154     assert(check == k, "should be present in the dictionary");
1155   } );
1156 
1157   return k;
1158 }
1159 
1160 #if INCLUDE_CDS
1161 void SystemDictionary::set_shared_dictionary(HashtableBucket<mtClass>* t, int length,
1162                                              int number_of_entries) {
1163   assert(!DumpSharedSpaces, "Should not be called with DumpSharedSpaces");
1164   assert(length == _shared_dictionary_size * sizeof(HashtableBucket<mtClass>),
1165          "bad shared dictionary size.");
1166   _shared_dictionary = new Dictionary(ClassLoaderData::the_null_class_loader_data(),
1167                                       _shared_dictionary_size, t, number_of_entries,
1168                                       false /* explicitly set _resizable to false */);
1169 }
1170 
1171 
1172 // If there is a shared dictionary, then find the entry for the
1173 // given shared system class, if any.
1174 
1175 InstanceKlass* SystemDictionary::find_shared_class(Symbol* class_name) {
1176   if (shared_dictionary() != NULL) {
1177     unsigned int d_hash = shared_dictionary()->compute_hash(class_name);
1178     int d_index = shared_dictionary()->hash_to_index(d_hash);
1179 
1180     return shared_dictionary()->find_shared_class(d_index, d_hash, class_name);
1181   } else {
1182     return NULL;
1183   }
1184 }
1185 
1186 
1187 // Load a class from the shared spaces (found through the shared system
1188 // dictionary).  Force the superclass and all interfaces to be loaded.


< prev index next >