diff src/share/vm/compiler/compilerOracle.cpp @ 6196:3759236eea14

7167142: Consider a warning when finding a .hotspotrc or .hotspot_compiler file that isn't used Summary: Send warnings to output stream Reviewed-by: dholmes, fparain
author kamg
date Mon, 02 Jul 2012 10:54:17 -0400
parents 1e76463170b3
children 90d5a592ea8f
line wrap: on
line diff
--- a/src/share/vm/compiler/compilerOracle.cpp	Fri Jun 29 17:12:15 2012 -0700
+++ b/src/share/vm/compiler/compilerOracle.cpp	Mon Jul 02 10:54:17 2012 -0400
@@ -550,10 +550,12 @@
   }
 }
 
+static const char* default_cc_file = ".hotspot_compiler";
+
 static const char* cc_file() {
 #ifdef ASSERT
   if (CompileCommandFile == NULL)
-    return ".hotspot_compiler";
+    return default_cc_file;
 #endif
   return CompileCommandFile;
 }
@@ -636,10 +638,17 @@
   CompilerOracle::parse_from_string(CompileOnly, CompilerOracle::parse_compile_only);
   if (CompilerOracle::has_command_file()) {
     CompilerOracle::parse_from_file();
+  } else {
+    struct stat buf;
+    if (os::stat(default_cc_file, &buf) == 0) {
+      warning("%s file is present but has been ignored.  "
+              "Run with -XX:CompileCommandFile=%s to load the file.",
+              default_cc_file, default_cc_file);
+    }
   }
   if (lists[PrintCommand] != NULL) {
     if (PrintAssembly) {
-      warning("CompileCommand and/or .hotspot_compiler file contains 'print' commands, but PrintAssembly is also enabled");
+      warning("CompileCommand and/or %s file contains 'print' commands, but PrintAssembly is also enabled", default_cc_file);
     } else if (FLAG_IS_DEFAULT(DebugNonSafepoints)) {
       warning("printing of assembly code is enabled; turning on DebugNonSafepoints to gain additional output");
       DebugNonSafepoints = true;