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

src/hotspot/share/memory/metaspaceShared.cpp

Print this page




1628   // We need to iterate because verification may cause additional classes
1629   // to be loaded.
1630   LinkSharedClassesClosure link_closure(THREAD);
1631   do {
1632     link_closure.reset();
1633     ClassLoaderDataGraph::unlocked_loaded_classes_do(&link_closure);
1634     guarantee(!HAS_PENDING_EXCEPTION, "exception in link_class");
1635   } while (link_closure.made_progress());
1636 
1637   if (_has_error_classes) {
1638     // Mark all classes whose super class or interfaces failed verification.
1639     CheckSharedClassesClosure check_closure;
1640     do {
1641       // Not completely sure if we need to do this iteratively. Anyway,
1642       // we should come here only if there are unverifiable classes, which
1643       // shouldn't happen in normal cases. So better safe than sorry.
1644       check_closure.reset();
1645       ClassLoaderDataGraph::unlocked_loaded_classes_do(&check_closure);
1646     } while (check_closure.made_progress());
1647 
1648     if (IgnoreUnverifiableClassesDuringDump) {
1649       // IgnoreUnverifiableClassesDuringDump is enabled by default.
1650       // Unverifiable classes will not be included in the CDS archive.
1651       SystemDictionary::remove_classes_in_error_state();
1652     } else {
1653       vm_exit_during_cds_dumping("Please remove the unverifiable classes from your class list and try again");
1654     }
1655   }
1656 }
1657 
1658 void MetaspaceShared::prepare_for_dumping() {
1659   Arguments::check_unsupported_dumping_properties();
1660   ClassLoader::initialize_shared_path();
1661 }
1662 
1663 // Preload classes from a list, populate the shared spaces and dump to a
1664 // file.
1665 void MetaspaceShared::preload_and_dump(TRAPS) {
1666   { TraceTime timer("Dump Shared Spaces", TRACETIME_LOG(Info, startuptime));
1667     ResourceMark rm;
1668     char class_list_path_str[JVM_MAXPATHLEN];
1669     // Preload classes to be shared.
1670     // Should use some os:: method rather than fopen() here. aB.
1671     const char* class_list_path;
1672     if (SharedClassListFile == NULL) {
1673       // Construct the path to the class list (in jre/lib)
1674       // Walk up two directories from the location of the VM and




1628   // We need to iterate because verification may cause additional classes
1629   // to be loaded.
1630   LinkSharedClassesClosure link_closure(THREAD);
1631   do {
1632     link_closure.reset();
1633     ClassLoaderDataGraph::unlocked_loaded_classes_do(&link_closure);
1634     guarantee(!HAS_PENDING_EXCEPTION, "exception in link_class");
1635   } while (link_closure.made_progress());
1636 
1637   if (_has_error_classes) {
1638     // Mark all classes whose super class or interfaces failed verification.
1639     CheckSharedClassesClosure check_closure;
1640     do {
1641       // Not completely sure if we need to do this iteratively. Anyway,
1642       // we should come here only if there are unverifiable classes, which
1643       // shouldn't happen in normal cases. So better safe than sorry.
1644       check_closure.reset();
1645       ClassLoaderDataGraph::unlocked_loaded_classes_do(&check_closure);
1646     } while (check_closure.made_progress());
1647 


1648     // Unverifiable classes will not be included in the CDS archive.
1649     SystemDictionary::remove_classes_in_error_state();



1650   }
1651 }
1652 
1653 void MetaspaceShared::prepare_for_dumping() {
1654   Arguments::check_unsupported_dumping_properties();
1655   ClassLoader::initialize_shared_path();
1656 }
1657 
1658 // Preload classes from a list, populate the shared spaces and dump to a
1659 // file.
1660 void MetaspaceShared::preload_and_dump(TRAPS) {
1661   { TraceTime timer("Dump Shared Spaces", TRACETIME_LOG(Info, startuptime));
1662     ResourceMark rm;
1663     char class_list_path_str[JVM_MAXPATHLEN];
1664     // Preload classes to be shared.
1665     // Should use some os:: method rather than fopen() here. aB.
1666     const char* class_list_path;
1667     if (SharedClassListFile == NULL) {
1668       // Construct the path to the class list (in jre/lib)
1669       // Walk up two directories from the location of the VM and


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