< prev index next >

src/hotspot/share/runtime/arguments.cpp

Print this page




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







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




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

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


< prev index next >