src/share/vm/compiler/methodMatcher.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File hotspot Sdiff src/share/vm/compiler

src/share/vm/compiler/methodMatcher.cpp

Print this page
rev 9166 : 8139996: CompileCommand prints quoted ascii strings
Summary: Print symbols as utf8
Reviewed-by:


 303     return;
 304   } else {
 305     error_msg = "Could not parse method pattern";
 306   }
 307 }
 308 
 309 bool MethodMatcher::matches(methodHandle method) const {
 310   Symbol* class_name  = method->method_holder()->name();
 311   Symbol* method_name = method->name();
 312   Symbol* signature = method->signature();
 313 
 314   if (match(class_name, this->class_name(), _class_mode) &&
 315       match(method_name, this->method_name(), _method_mode) &&
 316       ((this->signature() == NULL) || match(signature, this->signature(), Prefix))) {
 317     return true;
 318   }
 319   return false;
 320 }
 321 
 322 void MethodMatcher::print_symbol(outputStream* st, Symbol* h, Mode mode) {
 323   ResourceMark rm;
 324 
 325   if (mode == Suffix || mode == Substring || mode == Any) {
 326     st->print("*");
 327   }
 328   if (mode != Any) {
 329     h->print_symbol_on(st);
 330   }
 331   if (mode == Prefix || mode == Substring) {
 332     st->print("*");
 333   }
 334 }
 335 
 336 void MethodMatcher::print_base(outputStream* st) {


 337   print_symbol(st, class_name(), _class_mode);
 338   st->print(".");
 339   print_symbol(st, method_name(), _method_mode);
 340   if (signature() != NULL) {
 341     signature()->print_symbol_on(st);
 342   }
 343 }
 344 
 345 BasicMatcher* BasicMatcher::parse_method_pattern(char* line, const char*& error_msg) {
 346   assert(error_msg == NULL, "Don't call here with error_msg already set");
 347   BasicMatcher* bm = new BasicMatcher();
 348   MethodMatcher::parse_method_pattern(line, error_msg, bm);
 349   if (error_msg != NULL) {
 350     delete bm;
 351     return NULL;
 352   }
 353 
 354   // check for bad trailing characters
 355   int bytes_read = 0;
 356   sscanf(line, "%*[ \t]%n", &bytes_read);
 357   if (line[bytes_read] != '\0') {
 358     error_msg = "Unrecognized trailing text after method pattern";
 359     delete bm;
 360     return NULL;
 361   }




 303     return;
 304   } else {
 305     error_msg = "Could not parse method pattern";
 306   }
 307 }
 308 
 309 bool MethodMatcher::matches(methodHandle method) const {
 310   Symbol* class_name  = method->method_holder()->name();
 311   Symbol* method_name = method->name();
 312   Symbol* signature = method->signature();
 313 
 314   if (match(class_name, this->class_name(), _class_mode) &&
 315       match(method_name, this->method_name(), _method_mode) &&
 316       ((this->signature() == NULL) || match(signature, this->signature(), Prefix))) {
 317     return true;
 318   }
 319   return false;
 320 }
 321 
 322 void MethodMatcher::print_symbol(outputStream* st, Symbol* h, Mode mode) {


 323   if (mode == Suffix || mode == Substring || mode == Any) {
 324     st->print("*");
 325   }
 326   if (mode != Any) {
 327     h->print_utf8_on(st);
 328   }
 329   if (mode == Prefix || mode == Substring) {
 330     st->print("*");
 331   }
 332 }
 333 
 334 void MethodMatcher::print_base(outputStream* st) {
 335   ResourceMark rm;
 336 
 337   print_symbol(st, class_name(), _class_mode);
 338   st->print(".");
 339   print_symbol(st, method_name(), _method_mode);
 340   if (signature() != NULL) {
 341     signature()->print_utf8_on(st);
 342   }
 343 }
 344 
 345 BasicMatcher* BasicMatcher::parse_method_pattern(char* line, const char*& error_msg) {
 346   assert(error_msg == NULL, "Don't call here with error_msg already set");
 347   BasicMatcher* bm = new BasicMatcher();
 348   MethodMatcher::parse_method_pattern(line, error_msg, bm);
 349   if (error_msg != NULL) {
 350     delete bm;
 351     return NULL;
 352   }
 353 
 354   // check for bad trailing characters
 355   int bytes_read = 0;
 356   sscanf(line, "%*[ \t]%n", &bytes_read);
 357   if (line[bytes_read] != '\0') {
 358     error_msg = "Unrecognized trailing text after method pattern";
 359     delete bm;
 360     return NULL;
 361   }


src/share/vm/compiler/methodMatcher.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File