8139996: CompileCommand prints quoted ascii strings
authorneliasso
Mon, 26 Oct 2015 10:36:54 +0100
changeset 33468 b82c87453d2d
parent 33467 8d4741610aa9
child 33469 30f4811eded0
8139996: CompileCommand prints quoted ascii strings Summary: Print symbols as utf8 Reviewed-by: kvn
hotspot/src/share/vm/compiler/methodMatcher.cpp
hotspot/src/share/vm/oops/symbol.cpp
hotspot/src/share/vm/oops/symbol.hpp
--- a/hotspot/src/share/vm/compiler/methodMatcher.cpp	Fri Oct 23 07:18:31 2015 +0000
+++ b/hotspot/src/share/vm/compiler/methodMatcher.cpp	Mon Oct 26 10:36:54 2015 +0100
@@ -320,13 +320,11 @@
 }
 
 void MethodMatcher::print_symbol(outputStream* st, Symbol* h, Mode mode) {
-  ResourceMark rm;
-
   if (mode == Suffix || mode == Substring || mode == Any) {
     st->print("*");
   }
   if (mode != Any) {
-    h->print_symbol_on(st);
+    h->print_utf8_on(st);
   }
   if (mode == Prefix || mode == Substring) {
     st->print("*");
@@ -334,11 +332,13 @@
 }
 
 void MethodMatcher::print_base(outputStream* st) {
+  ResourceMark rm;
+
   print_symbol(st, class_name(), _class_mode);
   st->print(".");
   print_symbol(st, method_name(), _method_mode);
   if (signature() != NULL) {
-    signature()->print_symbol_on(st);
+    signature()->print_utf8_on(st);
   }
 }
 
--- a/hotspot/src/share/vm/oops/symbol.cpp	Fri Oct 23 07:18:31 2015 +0000
+++ b/hotspot/src/share/vm/oops/symbol.cpp	Mon Oct 26 10:36:54 2015 +0100
@@ -154,6 +154,10 @@
   return as_C_string(str, buf_len);
 }
 
+void Symbol::print_utf8_on(outputStream* st) const {
+  st->print("%s", as_C_string());
+}
+
 void Symbol::print_symbol_on(outputStream* st) const {
   ResourceMark rm;
   st = st ? st : tty;
--- a/hotspot/src/share/vm/oops/symbol.hpp	Fri Oct 23 07:18:31 2015 +0000
+++ b/hotspot/src/share/vm/oops/symbol.hpp	Mon Oct 26 10:36:54 2015 +0100
@@ -225,6 +225,7 @@
 
   // Printing
   void print_symbol_on(outputStream* st = NULL) const;
+  void print_utf8_on(outputStream* st) const;
   void print_on(outputStream* st) const;         // First level print
   void print_value_on(outputStream* st) const;   // Second level print.