< prev index next >

src/hotspot/share/runtime/arguments.cpp

Print this page




3447 
3448     if (RequireSharedSpaces) {
3449       warning("Cannot dump shared archive while using shared archive");
3450     }
3451     UseSharedSpaces = false;
3452 #ifdef _LP64
3453     if (!UseCompressedOops || !UseCompressedClassPointers) {
3454       vm_exit_during_initialization(
3455         "Cannot dump shared archive when UseCompressedOops or UseCompressedClassPointers is off.", NULL);
3456     }
3457   } else {
3458     if (!UseCompressedOops || !UseCompressedClassPointers) {
3459       no_shared_spaces("UseCompressedOops and UseCompressedClassPointers must be on for UseSharedSpaces.");
3460     }
3461 #endif
3462   }
3463 }
3464 
3465 // Sharing support
3466 // Construct the path to the archive
3467 static char* get_shared_archive_path() {
3468   char *shared_archive_path;
3469   if (SharedArchiveFile == NULL) {
3470     char jvm_path[JVM_MAXPATHLEN];
3471     os::jvm_path(jvm_path, sizeof(jvm_path));
3472     char *end = strrchr(jvm_path, *os::file_separator());
3473     if (end != NULL) *end = '\0';
3474     size_t jvm_path_len = strlen(jvm_path);
3475     size_t file_sep_len = strlen(os::file_separator());
3476     const size_t len = jvm_path_len + file_sep_len + 20;
3477     shared_archive_path = NEW_C_HEAP_ARRAY(char, len, mtArguments);
3478     if (shared_archive_path != NULL) {
3479       jio_snprintf(shared_archive_path, len, "%s%sclasses.jsa",
3480         jvm_path, os::file_separator());
3481     }







3482   } else {
3483     shared_archive_path = os::strdup_check_oom(SharedArchiveFile, mtArguments);
3484   }
3485   return shared_archive_path;
3486 }
3487 
3488 #ifndef PRODUCT
3489 // Determine whether LogVMOutput should be implicitly turned on.
3490 static bool use_vm_log() {
3491   if (LogCompilation || !FLAG_IS_DEFAULT(LogFile) ||
3492       PrintCompilation || PrintInlining || PrintDependencies || PrintNativeNMethods ||
3493       PrintDebugInfo || PrintRelocations || PrintNMethods || PrintExceptionHandlers ||
3494       PrintAssembly || TraceDeoptimization || TraceDependencies ||
3495       (VerifyDependencies && FLAG_IS_CMDLINE(VerifyDependencies))) {
3496     return true;
3497   }
3498 
3499 #ifdef COMPILER1
3500   if (PrintC1Statistics) {
3501     return true;




3447 
3448     if (RequireSharedSpaces) {
3449       warning("Cannot dump shared archive while using shared archive");
3450     }
3451     UseSharedSpaces = false;
3452 #ifdef _LP64
3453     if (!UseCompressedOops || !UseCompressedClassPointers) {
3454       vm_exit_during_initialization(
3455         "Cannot dump shared archive when UseCompressedOops or UseCompressedClassPointers is off.", NULL);
3456     }
3457   } else {
3458     if (!UseCompressedOops || !UseCompressedClassPointers) {
3459       no_shared_spaces("UseCompressedOops and UseCompressedClassPointers must be on for UseSharedSpaces.");
3460     }
3461 #endif
3462   }
3463 }
3464 
3465 // Sharing support
3466 // Construct the path to the archive
3467 char* Arguments::get_default_shared_archive_path() {
3468   char *default_archive_path;

3469   char jvm_path[JVM_MAXPATHLEN];
3470   os::jvm_path(jvm_path, sizeof(jvm_path));
3471   char *end = strrchr(jvm_path, *os::file_separator());
3472   if (end != NULL) *end = '\0';
3473   size_t jvm_path_len = strlen(jvm_path);
3474   size_t file_sep_len = strlen(os::file_separator());
3475   const size_t len = jvm_path_len + file_sep_len + 20;
3476   default_archive_path = NEW_C_HEAP_ARRAY(char, len, mtArguments);
3477   if (default_archive_path != NULL) {
3478     jio_snprintf(default_archive_path, len, "%s%sclasses.jsa",
3479       jvm_path, os::file_separator());
3480   }
3481   return default_archive_path;
3482 }
3483 
3484 static char* get_shared_archive_path() {
3485   char *shared_archive_path;
3486   if (SharedArchiveFile == NULL) {
3487     shared_archive_path = Arguments::get_default_shared_archive_path();
3488   } else {
3489     shared_archive_path = os::strdup_check_oom(SharedArchiveFile, mtArguments);
3490   }
3491   return shared_archive_path;
3492 }
3493 
3494 #ifndef PRODUCT
3495 // Determine whether LogVMOutput should be implicitly turned on.
3496 static bool use_vm_log() {
3497   if (LogCompilation || !FLAG_IS_DEFAULT(LogFile) ||
3498       PrintCompilation || PrintInlining || PrintDependencies || PrintNativeNMethods ||
3499       PrintDebugInfo || PrintRelocations || PrintNMethods || PrintExceptionHandlers ||
3500       PrintAssembly || TraceDeoptimization || TraceDependencies ||
3501       (VerifyDependencies && FLAG_IS_CMDLINE(VerifyDependencies))) {
3502     return true;
3503   }
3504 
3505 #ifdef COMPILER1
3506   if (PrintC1Statistics) {
3507     return true;


< prev index next >