952 mapinfo->verify_region_checksum(md) &&
953 (_mc_base = mapinfo->map_region(mc)) != NULL &&
954 mapinfo->verify_region_checksum(mc) &&
955 (image_alignment == (size_t)max_alignment()) &&
956 mapinfo->validate_classpath_entry_table()) {
957 // Success (no need to do anything)
958 return true;
959 } else {
960 // If there was a failure in mapping any of the spaces, unmap the ones
961 // that succeeded
962 if (_ro_base != NULL) mapinfo->unmap_region(ro);
963 if (_rw_base != NULL) mapinfo->unmap_region(rw);
964 if (_md_base != NULL) mapinfo->unmap_region(md);
965 if (_mc_base != NULL) mapinfo->unmap_region(mc);
966 #ifndef _WINDOWS
967 // Release the entire mapped region
968 shared_rs.release();
969 #endif
970 // If -Xshare:on is specified, print out the error message and exit VM,
971 // otherwise, set UseSharedSpaces to false and continue.
972 if (RequireSharedSpaces) {
973 vm_exit_during_initialization("Unable to use shared archive.", "Failed map_region for using -Xshare:on.");
974 } else {
975 FLAG_SET_DEFAULT(UseSharedSpaces, false);
976 }
977 return false;
978 }
979 }
980
981 // Read the miscellaneous data from the shared file, and
982 // serialize it out to its various destinations.
983
984 void MetaspaceShared::initialize_shared_spaces() {
985 FileMapInfo *mapinfo = FileMapInfo::current_info();
986
987 char* buffer = mapinfo->region_base(md);
988
989 // Skip over (reserve space for) a list of addresses of C++ vtables
990 // for Klass objects. They get filled in later.
991
992 void** vtbl_list = (void**)buffer;
|
952 mapinfo->verify_region_checksum(md) &&
953 (_mc_base = mapinfo->map_region(mc)) != NULL &&
954 mapinfo->verify_region_checksum(mc) &&
955 (image_alignment == (size_t)max_alignment()) &&
956 mapinfo->validate_classpath_entry_table()) {
957 // Success (no need to do anything)
958 return true;
959 } else {
960 // If there was a failure in mapping any of the spaces, unmap the ones
961 // that succeeded
962 if (_ro_base != NULL) mapinfo->unmap_region(ro);
963 if (_rw_base != NULL) mapinfo->unmap_region(rw);
964 if (_md_base != NULL) mapinfo->unmap_region(md);
965 if (_mc_base != NULL) mapinfo->unmap_region(mc);
966 #ifndef _WINDOWS
967 // Release the entire mapped region
968 shared_rs.release();
969 #endif
970 // If -Xshare:on is specified, print out the error message and exit VM,
971 // otherwise, set UseSharedSpaces to false and continue.
972 if (RequireSharedSpaces || PrintSharedArchiveAndExit) {
973 vm_exit_during_initialization("Unable to use shared archive.", "Failed map_region for using -Xshare:on.");
974 } else {
975 FLAG_SET_DEFAULT(UseSharedSpaces, false);
976 }
977 return false;
978 }
979 }
980
981 // Read the miscellaneous data from the shared file, and
982 // serialize it out to its various destinations.
983
984 void MetaspaceShared::initialize_shared_spaces() {
985 FileMapInfo *mapinfo = FileMapInfo::current_info();
986
987 char* buffer = mapinfo->region_base(md);
988
989 // Skip over (reserve space for) a list of addresses of C++ vtables
990 // for Klass objects. They get filled in later.
991
992 void** vtbl_list = (void**)buffer;
|