< prev index next >

src/hotspot/share/memory/filemap.cpp

Print this page

 228   // JVM version string ... changes on each build.
 229   get_header_version(_jvm_ident);
 230 
 231   _app_class_paths_start_index = ClassLoaderExt::app_class_paths_start_index();
 232   _app_module_paths_start_index = ClassLoaderExt::app_module_paths_start_index();
 233   _num_module_paths = ClassLoader::num_module_path_entries();
 234   _max_used_path_index = ClassLoaderExt::max_used_path_index();
 235 
 236   _verify_local = BytecodeVerificationLocal;
 237   _verify_remote = BytecodeVerificationRemote;
 238   _has_platform_or_app_classes = ClassLoaderExt::has_platform_or_app_classes();
 239   _requested_base_address = (char*)SharedBaseAddress;
 240   _mapped_base_address = (char*)SharedBaseAddress;
 241   _allow_archiving_with_java_agent = AllowArchivingWithJavaAgent;
 242   // the following 2 fields will be set in write_header for dynamic archive header
 243   _base_archive_name_size = 0;
 244   _base_archive_is_default = false;
 245 
 246   if (!DynamicDumpSharedSpaces) {
 247     set_shared_path_table(mapinfo->_shared_path_table);

 248   }
 249 }
 250 
 251 void SharedClassPathEntry::init_as_non_existent(const char* path, TRAPS) {
 252   _type = non_existent_entry;
 253   set_name(path, THREAD);
 254 }
 255 
 256 void SharedClassPathEntry::init(bool is_modules_image,
 257                                 bool is_module_path,
 258                                 ClassPathEntry* cpe, TRAPS) {
 259   Arguments::assert_is_dumping_archive();
 260   _timestamp = 0;
 261   _filesize  = 0;
 262   _from_class_path_attr = false;
 263 
 264   struct stat st;
 265   if (os::stat(cpe->name(), &st) == 0) {
 266     if ((st.st_mode & S_IFMT) == S_IFDIR) {
 267       _type = dir_entry;

1813     _heap_pointers_need_patching = true;
1814     relocated_closed_heap_region_bottom = start_address_as_decoded_from_archive(si);
1815   }
1816   assert(is_aligned(relocated_closed_heap_region_bottom, HeapRegion::GrainBytes),
1817          "must be");
1818 
1819   // Map the closed_archive_heap regions, GC does not write into the regions.
1820   if (map_heap_data(&closed_archive_heap_ranges,
1821                     MetaspaceShared::first_closed_archive_heap_region,
1822                     MetaspaceShared::max_closed_archive_heap_region,
1823                     &num_closed_archive_heap_ranges)) {
1824     HeapShared::set_closed_archive_heap_region_mapped();
1825 
1826     // Now, map open_archive heap regions, GC can write into the regions.
1827     if (map_heap_data(&open_archive_heap_ranges,
1828                       MetaspaceShared::first_open_archive_heap_region,
1829                       MetaspaceShared::max_open_archive_heap_region,
1830                       &num_open_archive_heap_ranges,
1831                       true /* open */)) {
1832       HeapShared::set_open_archive_heap_region_mapped();

1833     }
1834   }
1835 }
1836 
1837 void FileMapInfo::map_heap_regions() {
1838   if (has_heap_regions()) {
1839     map_heap_regions_impl();
1840   }
1841 
1842   if (!HeapShared::closed_archive_heap_region_mapped()) {
1843     assert(closed_archive_heap_ranges == NULL &&
1844            num_closed_archive_heap_ranges == 0, "sanity");
1845   }
1846 
1847   if (!HeapShared::open_archive_heap_region_mapped()) {
1848     assert(open_archive_heap_ranges == NULL && num_open_archive_heap_ranges == 0, "sanity");
1849     MetaspaceShared::disable_full_module_graph();
1850   }
1851 }
1852 

 228   // JVM version string ... changes on each build.
 229   get_header_version(_jvm_ident);
 230 
 231   _app_class_paths_start_index = ClassLoaderExt::app_class_paths_start_index();
 232   _app_module_paths_start_index = ClassLoaderExt::app_module_paths_start_index();
 233   _num_module_paths = ClassLoader::num_module_path_entries();
 234   _max_used_path_index = ClassLoaderExt::max_used_path_index();
 235 
 236   _verify_local = BytecodeVerificationLocal;
 237   _verify_remote = BytecodeVerificationRemote;
 238   _has_platform_or_app_classes = ClassLoaderExt::has_platform_or_app_classes();
 239   _requested_base_address = (char*)SharedBaseAddress;
 240   _mapped_base_address = (char*)SharedBaseAddress;
 241   _allow_archiving_with_java_agent = AllowArchivingWithJavaAgent;
 242   // the following 2 fields will be set in write_header for dynamic archive header
 243   _base_archive_name_size = 0;
 244   _base_archive_is_default = false;
 245 
 246   if (!DynamicDumpSharedSpaces) {
 247     set_shared_path_table(mapinfo->_shared_path_table);
 248     CDS_JAVA_HEAP_ONLY(_heap_obj_roots = CompressedOops::encode(HeapShared::roots()));
 249   }
 250 }
 251 
 252 void SharedClassPathEntry::init_as_non_existent(const char* path, TRAPS) {
 253   _type = non_existent_entry;
 254   set_name(path, THREAD);
 255 }
 256 
 257 void SharedClassPathEntry::init(bool is_modules_image,
 258                                 bool is_module_path,
 259                                 ClassPathEntry* cpe, TRAPS) {
 260   Arguments::assert_is_dumping_archive();
 261   _timestamp = 0;
 262   _filesize  = 0;
 263   _from_class_path_attr = false;
 264 
 265   struct stat st;
 266   if (os::stat(cpe->name(), &st) == 0) {
 267     if ((st.st_mode & S_IFMT) == S_IFDIR) {
 268       _type = dir_entry;

1814     _heap_pointers_need_patching = true;
1815     relocated_closed_heap_region_bottom = start_address_as_decoded_from_archive(si);
1816   }
1817   assert(is_aligned(relocated_closed_heap_region_bottom, HeapRegion::GrainBytes),
1818          "must be");
1819 
1820   // Map the closed_archive_heap regions, GC does not write into the regions.
1821   if (map_heap_data(&closed_archive_heap_ranges,
1822                     MetaspaceShared::first_closed_archive_heap_region,
1823                     MetaspaceShared::max_closed_archive_heap_region,
1824                     &num_closed_archive_heap_ranges)) {
1825     HeapShared::set_closed_archive_heap_region_mapped();
1826 
1827     // Now, map open_archive heap regions, GC can write into the regions.
1828     if (map_heap_data(&open_archive_heap_ranges,
1829                       MetaspaceShared::first_open_archive_heap_region,
1830                       MetaspaceShared::max_open_archive_heap_region,
1831                       &num_open_archive_heap_ranges,
1832                       true /* open */)) {
1833       HeapShared::set_open_archive_heap_region_mapped();
1834       HeapShared::set_roots(header()->heap_obj_roots());
1835     }
1836   }
1837 }
1838 
1839 void FileMapInfo::map_heap_regions() {
1840   if (has_heap_regions()) {
1841     map_heap_regions_impl();
1842   }
1843 
1844   if (!HeapShared::closed_archive_heap_region_mapped()) {
1845     assert(closed_archive_heap_ranges == NULL &&
1846            num_closed_archive_heap_ranges == 0, "sanity");
1847   }
1848 
1849   if (!HeapShared::open_archive_heap_region_mapped()) {
1850     assert(open_archive_heap_ranges == NULL && num_open_archive_heap_ranges == 0, "sanity");
1851     MetaspaceShared::disable_full_module_graph();
1852   }
1853 }
1854 
< prev index next >