< prev index next >

src/hotspot/share/classfile/classLoaderExt.cpp

Print this page




 274     stream = e->open_stream(file_name, CHECK_NULL);
 275   }
 276 
 277   if (NULL == stream) {
 278     log_warning(cds)("Preload Warning: Cannot find %s", class_name);
 279     return NULL;
 280   }
 281 
 282   assert(stream != NULL, "invariant");
 283   stream->set_verify(true);
 284 
 285   ClassLoaderData* loader_data = ClassLoaderData::the_null_class_loader_data();
 286   Handle protection_domain;
 287 
 288   InstanceKlass* result = KlassFactory::create_from_stream(stream,
 289                                                            name,
 290                                                            loader_data,
 291                                                            protection_domain,
 292                                                            NULL, // unsafe_anonymous_host
 293                                                            NULL, // cp_patches




 294                                                            THREAD);
 295 
 296   if (HAS_PENDING_EXCEPTION) {
 297     log_error(cds)("Preload Error: Failed to load %s", class_name);
 298     return NULL;
 299   }
 300   return result;
 301 }
 302 
 303 struct CachedClassPathEntry {
 304   const char* _path;
 305   ClassPathEntry* _entry;
 306 };
 307 
 308 static GrowableArray<CachedClassPathEntry>* cached_path_entries = NULL;
 309 
 310 ClassPathEntry* ClassLoaderExt::find_classpath_entry_from_cache(const char* path, TRAPS) {
 311   // This is called from dump time so it's single threaded and there's no need for a lock.
 312   assert(DumpSharedSpaces, "this function is only used with -Xshare:dump");
 313   if (cached_path_entries == NULL) {




 274     stream = e->open_stream(file_name, CHECK_NULL);
 275   }
 276 
 277   if (NULL == stream) {
 278     log_warning(cds)("Preload Warning: Cannot find %s", class_name);
 279     return NULL;
 280   }
 281 
 282   assert(stream != NULL, "invariant");
 283   stream->set_verify(true);
 284 
 285   ClassLoaderData* loader_data = ClassLoaderData::the_null_class_loader_data();
 286   Handle protection_domain;
 287 
 288   InstanceKlass* result = KlassFactory::create_from_stream(stream,
 289                                                            name,
 290                                                            loader_data,
 291                                                            protection_domain,
 292                                                            NULL,  // unsafe_anonymous_host
 293                                                            NULL,  // cp_patches
 294                                                            false, // is_hidden
 295                                                            false, // can_access_vm_annotations
 296                                                            NULL,  // dynamic_nest_host
 297                                                            Handle(), // classData
 298                                                            THREAD);
 299 
 300   if (HAS_PENDING_EXCEPTION) {
 301     log_error(cds)("Preload Error: Failed to load %s", class_name);
 302     return NULL;
 303   }
 304   return result;
 305 }
 306 
 307 struct CachedClassPathEntry {
 308   const char* _path;
 309   ClassPathEntry* _entry;
 310 };
 311 
 312 static GrowableArray<CachedClassPathEntry>* cached_path_entries = NULL;
 313 
 314 ClassPathEntry* ClassLoaderExt::find_classpath_entry_from_cache(const char* path, TRAPS) {
 315   // This is called from dump time so it's single threaded and there's no need for a lock.
 316   assert(DumpSharedSpaces, "this function is only used with -Xshare:dump");
 317   if (cached_path_entries == NULL) {


< prev index next >