src/share/vm/runtime/arguments.cpp

changeset 3899
3759236eea14
parent 3861
f9d57285de70
child 3907
90d5a592ea8f
     1.1 --- a/src/share/vm/runtime/arguments.cpp	Fri Jun 29 17:12:15 2012 -0700
     1.2 +++ b/src/share/vm/runtime/arguments.cpp	Mon Jul 02 10:54:17 2012 -0400
     1.3 @@ -2971,7 +2971,10 @@
     1.4    const char* tail;
     1.5  
     1.6    // If flag "-XX:Flags=flags-file" is used it will be the first option to be processed.
     1.7 +  const char* hotspotrc = ".hotspotrc";
     1.8    bool settings_file_specified = false;
     1.9 +  bool needs_hotspotrc_warning = false;
    1.10 +
    1.11    const char* flags_file;
    1.12    int index;
    1.13    for (index = 0; index < args->nOptions; index++) {
    1.14 @@ -3015,16 +3018,19 @@
    1.15      if (!process_settings_file(flags_file, true, args->ignoreUnrecognized)) {
    1.16        return JNI_EINVAL;
    1.17      }
    1.18 -  }
    1.19 -
    1.20 +  } else {
    1.21  #ifdef ASSERT
    1.22 -  // Parse default .hotspotrc settings file
    1.23 -  if (!settings_file_specified) {
    1.24 +    // Parse default .hotspotrc settings file
    1.25      if (!process_settings_file(".hotspotrc", false, args->ignoreUnrecognized)) {
    1.26        return JNI_EINVAL;
    1.27      }
    1.28 +#else
    1.29 +    struct stat buf;
    1.30 +    if (os::stat(hotspotrc, &buf) == 0) {
    1.31 +      needs_hotspotrc_warning = true;
    1.32 +    }
    1.33 +#endif
    1.34    }
    1.35 -#endif
    1.36  
    1.37    if (PrintVMOptions) {
    1.38      for (index = 0; index < args->nOptions; index++) {
    1.39 @@ -3041,6 +3047,14 @@
    1.40      return result;
    1.41    }
    1.42  
    1.43 +  // Delay warning until here so that we've had a chance to process
    1.44 +  // the -XX:-PrintWarnings flag
    1.45 +  if (needs_hotspotrc_warning) {
    1.46 +    warning("%s file is present but has been ignored.  "
    1.47 +            "Run with -XX:Flags=%s to load the file.",
    1.48 +            hotspotrc, hotspotrc);
    1.49 +  }
    1.50 +
    1.51  #if (defined JAVASE_EMBEDDED || defined ARM)
    1.52    UNSUPPORTED_OPTION(UseG1GC, "G1 GC");
    1.53  #endif

mercurial