hotspot/src/share/vm/memory/filemap.cpp
changeset 15101 58d43bf04c45
parent 15100 0ae85ac7c8b0
child 15461 e3acbfdabafa
equal deleted inserted replaced
15100:0ae85ac7c8b0 15101:58d43bf04c45
   117 
   117 
   118 void FileMapInfo::populate_header(size_t alignment) {
   118 void FileMapInfo::populate_header(size_t alignment) {
   119   _header._magic = 0xf00baba2;
   119   _header._magic = 0xf00baba2;
   120   _header._version = _current_version;
   120   _header._version = _current_version;
   121   _header._alignment = alignment;
   121   _header._alignment = alignment;
       
   122   _header._obj_alignment = ObjectAlignmentInBytes;
   122 
   123 
   123   // The following fields are for sanity checks for whether this archive
   124   // The following fields are for sanity checks for whether this archive
   124   // will function correctly with this JVM and the bootclasspath it's
   125   // will function correctly with this JVM and the bootclasspath it's
   125   // invoked with.
   126   // invoked with.
   126 
   127 
   469   char header_version[JVM_IDENT_MAX];
   470   char header_version[JVM_IDENT_MAX];
   470   get_header_version(header_version);
   471   get_header_version(header_version);
   471   if (strncmp(_header._jvm_ident, header_version, JVM_IDENT_MAX-1) != 0) {
   472   if (strncmp(_header._jvm_ident, header_version, JVM_IDENT_MAX-1) != 0) {
   472     fail_continue("The shared archive file was created by a different"
   473     fail_continue("The shared archive file was created by a different"
   473                   " version or build of HotSpot.");
   474                   " version or build of HotSpot.");
       
   475     return false;
       
   476   }
       
   477   if (_header._obj_alignment != ObjectAlignmentInBytes) {
       
   478     fail_continue("The shared archive file's ObjectAlignmentInBytes of %d"
       
   479                   " does not equal the current ObjectAlignmentInBytes of %d.",
       
   480                   _header._obj_alignment, ObjectAlignmentInBytes);
   474     return false;
   481     return false;
   475   }
   482   }
   476 
   483 
   477   // Cannot verify interpreter yet, as it can only be created after the GC
   484   // Cannot verify interpreter yet, as it can only be created after the GC
   478   // heap has been initialized.
   485   // heap has been initialized.