comparison 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
comparison
equal deleted inserted replaced
6195:bcffa4c5eef6 6196:3759236eea14
548 tty->print_cr(error_msg); 548 tty->print_cr(error_msg);
549 } 549 }
550 } 550 }
551 } 551 }
552 552
553 static const char* default_cc_file = ".hotspot_compiler";
554
553 static const char* cc_file() { 555 static const char* cc_file() {
554 #ifdef ASSERT 556 #ifdef ASSERT
555 if (CompileCommandFile == NULL) 557 if (CompileCommandFile == NULL)
556 return ".hotspot_compiler"; 558 return default_cc_file;
557 #endif 559 #endif
558 return CompileCommandFile; 560 return CompileCommandFile;
559 } 561 }
560 562
561 bool CompilerOracle::has_command_file() { 563 bool CompilerOracle::has_command_file() {
634 void compilerOracle_init() { 636 void compilerOracle_init() {
635 CompilerOracle::parse_from_string(CompileCommand, CompilerOracle::parse_from_line); 637 CompilerOracle::parse_from_string(CompileCommand, CompilerOracle::parse_from_line);
636 CompilerOracle::parse_from_string(CompileOnly, CompilerOracle::parse_compile_only); 638 CompilerOracle::parse_from_string(CompileOnly, CompilerOracle::parse_compile_only);
637 if (CompilerOracle::has_command_file()) { 639 if (CompilerOracle::has_command_file()) {
638 CompilerOracle::parse_from_file(); 640 CompilerOracle::parse_from_file();
641 } else {
642 struct stat buf;
643 if (os::stat(default_cc_file, &buf) == 0) {
644 warning("%s file is present but has been ignored. "
645 "Run with -XX:CompileCommandFile=%s to load the file.",
646 default_cc_file, default_cc_file);
647 }
639 } 648 }
640 if (lists[PrintCommand] != NULL) { 649 if (lists[PrintCommand] != NULL) {
641 if (PrintAssembly) { 650 if (PrintAssembly) {
642 warning("CompileCommand and/or .hotspot_compiler file contains 'print' commands, but PrintAssembly is also enabled"); 651 warning("CompileCommand and/or %s file contains 'print' commands, but PrintAssembly is also enabled", default_cc_file);
643 } else if (FLAG_IS_DEFAULT(DebugNonSafepoints)) { 652 } else if (FLAG_IS_DEFAULT(DebugNonSafepoints)) {
644 warning("printing of assembly code is enabled; turning on DebugNonSafepoints to gain additional output"); 653 warning("printing of assembly code is enabled; turning on DebugNonSafepoints to gain additional output");
645 DebugNonSafepoints = true; 654 DebugNonSafepoints = true;
646 } 655 }
647 } 656 }