hotspot/src/share/vm/classfile/stringTable.cpp
changeset 46554 aa1cfd918c4f
parent 46522 86b13b03a053
child 46742 24ec8a039c90
--- a/hotspot/src/share/vm/classfile/stringTable.cpp	Wed Jul 05 23:44:18 2017 +0200
+++ b/hotspot/src/share/vm/classfile/stringTable.cpp	Thu Jun 22 00:51:07 2017 +0200
@@ -30,6 +30,7 @@
 #include "classfile/systemDictionary.hpp"
 #include "gc/shared/collectedHeap.inline.hpp"
 #include "gc/shared/gcLocker.inline.hpp"
+#include "logging/log.hpp"
 #include "memory/allocation.inline.hpp"
 #include "memory/filemap.hpp"
 #include "memory/resourceArea.hpp"
@@ -245,6 +246,7 @@
   assert(!Universe::heap()->is_in_reserved(name),
          "proposed name of symbol must be stable");
 
+  HandleMark hm(THREAD);  // cleanup strings created
   Handle string;
   // try to reuse the string if possible
   if (!string_or_null.is_null()) {
@@ -743,14 +745,12 @@
   _shared_table.reset();
   if (soc->writing()) {
     if (!(UseG1GC && UseCompressedOops && UseCompressedClassPointers)) {
-      if (PrintSharedSpaces) {
-        tty->print_cr(
+      log_info(cds)(
           "Shared strings are excluded from the archive as UseG1GC, "
           "UseCompressedOops and UseCompressedClassPointers are required."
           "Current settings: UseG1GC=%s, UseCompressedOops=%s, UseCompressedClassPointers=%s.",
           BOOL_TO_STR(UseG1GC), BOOL_TO_STR(UseCompressedOops),
           BOOL_TO_STR(UseCompressedClassPointers));
-      }
     } else {
       int num_buckets = the_table()->number_of_entries() /
                              SharedSymbolTableBucketSize;