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