src/share/vm/memory/filemap.cpp

Print this page




  61 
  62 
  63 void FileMapInfo::fail_stop(const char *msg, ...) {
  64         va_list ap;
  65   va_start(ap, msg);
  66   fail(msg, ap);        // Never returns.
  67   va_end(ap);           // for completeness.
  68 }
  69 
  70 
  71 // Complain and continue.  Recoverable errors during the reading of the
  72 // archive file may continue (with sharing disabled).
  73 //
  74 // If we continue, then disable shared spaces and close the file.
  75 
  76 void FileMapInfo::fail_continue(const char *msg, ...) {
  77   va_list ap;
  78   va_start(ap, msg);
  79   if (RequireSharedSpaces) {
  80     fail(msg, ap);




  81   }
  82   va_end(ap);
  83   UseSharedSpaces = false;
  84   close();
  85 }
  86 
  87 // Fill in the fileMapInfo structure with data about this VM instance.
  88 
  89 // This method copies the vm version info into header_version.  If the version is too
  90 // long then a truncated version, which has a hash code appended to it, is copied.
  91 //
  92 // Using a template enables this method to verify that header_version is an array of
  93 // length JVM_IDENT_MAX.  This ensures that the code that writes to the CDS file and
  94 // the code that reads the CDS file will both use the same size buffer.  Hence, will
  95 // use identical truncation.  This is necessary for matching of truncated versions.
  96 template <int N> static void get_header_version(char (&header_version) [N]) {
  97   assert(N == JVM_IDENT_MAX, "Bad header_version size");
  98 
  99   const char *vm_version = VM_Version::internal_vm_info_string();
 100   const int version_len = (int)strlen(vm_version);




  61 
  62 
  63 void FileMapInfo::fail_stop(const char *msg, ...) {
  64         va_list ap;
  65   va_start(ap, msg);
  66   fail(msg, ap);        // Never returns.
  67   va_end(ap);           // for completeness.
  68 }
  69 
  70 
  71 // Complain and continue.  Recoverable errors during the reading of the
  72 // archive file may continue (with sharing disabled).
  73 //
  74 // If we continue, then disable shared spaces and close the file.
  75 
  76 void FileMapInfo::fail_continue(const char *msg, ...) {
  77   va_list ap;
  78   va_start(ap, msg);
  79   if (RequireSharedSpaces) {
  80     fail(msg, ap);
  81   } else {
  82     if (PrintSharedSpaces) {
  83       tty->print_cr("UseSharedSpaces: %s", msg);
  84     }
  85   }
  86   va_end(ap);
  87   UseSharedSpaces = false;
  88   close();
  89 }
  90 
  91 // Fill in the fileMapInfo structure with data about this VM instance.
  92 
  93 // This method copies the vm version info into header_version.  If the version is too
  94 // long then a truncated version, which has a hash code appended to it, is copied.
  95 //
  96 // Using a template enables this method to verify that header_version is an array of
  97 // length JVM_IDENT_MAX.  This ensures that the code that writes to the CDS file and
  98 // the code that reads the CDS file will both use the same size buffer.  Hence, will
  99 // use identical truncation.  This is necessary for matching of truncated versions.
 100 template <int N> static void get_header_version(char (&header_version) [N]) {
 101   assert(N == JVM_IDENT_MAX, "Bad header_version size");
 102 
 103   const char *vm_version = VM_Version::internal_vm_info_string();
 104   const int version_len = (int)strlen(vm_version);