src/hotspot/share/classfile/classLoader.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File open Sdiff src/hotspot/share/classfile

src/hotspot/share/classfile/classLoader.cpp

Print this page




1518 #endif
1519   } else if (strncmp(source, "jrt:/", 5) == 0) {
1520     source += 5;
1521   }
1522   return source;
1523 }
1524 
1525 // Record the shared classpath index and loader type for classes loaded
1526 // by the builtin loaders at dump time.
1527 void ClassLoader::record_result(InstanceKlass* ik, const ClassFileStream* stream, TRAPS) {
1528   assert(DumpSharedSpaces, "sanity");
1529   assert(stream != NULL, "sanity");
1530 
1531   if (ik->is_anonymous()) {
1532     // We do not archive anonymous classes.
1533     return;
1534   }
1535 
1536   oop loader = ik->class_loader();
1537   char* src = (char*)stream->source();
1538   if (src == NULL) {

1539     if (loader == NULL) {
1540       // JFR classes
1541       ik->set_shared_classpath_index(0);
1542       ik->set_class_loader_type(ClassLoader::BOOT_LOADER);
1543     }
1544     return;
1545   }
1546 
1547   assert(has_jrt_entry(), "CDS dumping does not support exploded JDK build");
1548 
1549   ResourceMark rm(THREAD);
1550   int classpath_index = -1;
1551   PackageEntry* pkg_entry = ik->package();
1552 
1553   if (FileMapInfo::get_number_of_shared_paths() > 0) {
1554     char* canonical_path_table_entry = NEW_RESOURCE_ARRAY_IN_THREAD(THREAD, char, JVM_MAXPATHLEN);
1555 
1556     // save the path from the file: protocol or the module name from the jrt: protocol
1557     // if no protocol prefix is found, path is the same as stream->source()
1558     char* path = skip_uri_protocol(src);




1518 #endif
1519   } else if (strncmp(source, "jrt:/", 5) == 0) {
1520     source += 5;
1521   }
1522   return source;
1523 }
1524 
1525 // Record the shared classpath index and loader type for classes loaded
1526 // by the builtin loaders at dump time.
1527 void ClassLoader::record_result(InstanceKlass* ik, const ClassFileStream* stream, TRAPS) {
1528   assert(DumpSharedSpaces, "sanity");
1529   assert(stream != NULL, "sanity");
1530 
1531   if (ik->is_anonymous()) {
1532     // We do not archive anonymous classes.
1533     return;
1534   }
1535 
1536   oop loader = ik->class_loader();
1537   char* src = (char*)stream->source();
1538   if (src == NULL ||
1539       (strcmp(src, "__JVM_DefineClass__") == 0)) {
1540     if (loader == NULL) {
1541       // JFR classes
1542       ik->set_shared_classpath_index(0);
1543       ik->set_class_loader_type(ClassLoader::BOOT_LOADER);
1544     }
1545     return;
1546   }
1547 
1548   assert(has_jrt_entry(), "CDS dumping does not support exploded JDK build");
1549 
1550   ResourceMark rm(THREAD);
1551   int classpath_index = -1;
1552   PackageEntry* pkg_entry = ik->package();
1553 
1554   if (FileMapInfo::get_number_of_shared_paths() > 0) {
1555     char* canonical_path_table_entry = NEW_RESOURCE_ARRAY_IN_THREAD(THREAD, char, JVM_MAXPATHLEN);
1556 
1557     // save the path from the file: protocol or the module name from the jrt: protocol
1558     // if no protocol prefix is found, path is the same as stream->source()
1559     char* path = skip_uri_protocol(src);


src/hotspot/share/classfile/classLoader.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File