< prev index next >

src/hotspot/share/compiler/compilerOracle.cpp

Print this page




 677   tty->cr();
 678   tty->print_cr("Usage: '-XX:CompileCommand=command,\"package/Class.method()\"'");
 679   tty->print_cr("Use:   '-XX:CompileCommand=help' for more information.");
 680   tty->cr();
 681 }
 682 
 683 static const char* default_cc_file = ".hotspot_compiler";
 684 
 685 static const char* cc_file() {
 686 #ifdef ASSERT
 687   if (CompileCommandFile == NULL)
 688     return default_cc_file;
 689 #endif
 690   return CompileCommandFile;
 691 }
 692 
 693 bool CompilerOracle::has_command_file() {
 694   return cc_file() != NULL;
 695 }
 696 
 697 bool CompilerOracle::_quiet = false;
 698 
 699 void CompilerOracle::parse_from_file() {
 700   assert(has_command_file(), "command file must be specified");
 701   FILE* stream = fopen(cc_file(), "rt");
 702   if (stream == NULL) return;
 703 
 704   char token[1024];
 705   int  pos = 0;
 706   int  c = getc(stream);
 707   while(c != EOF && pos < (int)(sizeof(token)-1)) {
 708     if (c == '\n') {
 709       token[pos++] = '\0';
 710       parse_from_line(token);
 711       pos = 0;
 712     } else {
 713       token[pos++] = c;
 714     }
 715     c = getc(stream);
 716   }
 717   token[pos++] = '\0';




 677   tty->cr();
 678   tty->print_cr("Usage: '-XX:CompileCommand=command,\"package/Class.method()\"'");
 679   tty->print_cr("Use:   '-XX:CompileCommand=help' for more information.");
 680   tty->cr();
 681 }
 682 
 683 static const char* default_cc_file = ".hotspot_compiler";
 684 
 685 static const char* cc_file() {
 686 #ifdef ASSERT
 687   if (CompileCommandFile == NULL)
 688     return default_cc_file;
 689 #endif
 690   return CompileCommandFile;
 691 }
 692 
 693 bool CompilerOracle::has_command_file() {
 694   return cc_file() != NULL;
 695 }
 696 
 697 bool CompilerOracle::_quiet = true;
 698 
 699 void CompilerOracle::parse_from_file() {
 700   assert(has_command_file(), "command file must be specified");
 701   FILE* stream = fopen(cc_file(), "rt");
 702   if (stream == NULL) return;
 703 
 704   char token[1024];
 705   int  pos = 0;
 706   int  c = getc(stream);
 707   while(c != EOF && pos < (int)(sizeof(token)-1)) {
 708     if (c == '\n') {
 709       token[pos++] = '\0';
 710       parse_from_line(token);
 711       pos = 0;
 712     } else {
 713       token[pos++] = c;
 714     }
 715     c = getc(stream);
 716   }
 717   token[pos++] = '\0';


< prev index next >