changeset 50872:22751e393c31

ZGC: UPSTREAM: Add support for resetting StringTable dead count
author duke
date Fri, 08 Jun 2018 18:24:45 +0200
parents 79de7179761c
children 60bcfec25032
files src/hotspot/share/classfile/stringTable.cpp src/hotspot/share/classfile/stringTable.hpp
diffstat 2 files changed, 13 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/hotspot/share/classfile/stringTable.cpp	Fri Jun 08 18:24:44 2018 +0200
+++ b/src/hotspot/share/classfile/stringTable.cpp	Fri Jun 08 18:24:45 2018 +0200
@@ -870,4 +870,14 @@
 void StringTable::shared_oops_do(OopClosure* f) {
   _shared_table.oops_do(f);
 }
+
+void StringTable::reset_dead_counter() {
+  the_table()->_uncleaned_items = 0;
+}
+
+void StringTable::inc_dead_counter(size_t ndead) {
+  items_to_clean(ndead);
+  the_table()->check_concurrent_work();
+}
+
 #endif //INCLUDE_CDS_JAVA_HEAP
--- a/src/hotspot/share/classfile/stringTable.hpp	Fri Jun 08 18:24:44 2018 +0200
+++ b/src/hotspot/share/classfile/stringTable.hpp	Fri Jun 08 18:24:45 2018 +0200
@@ -157,6 +157,9 @@
   static void write_to_archive() NOT_CDS_JAVA_HEAP_RETURN;
   static void serialize(SerializeClosure* soc) NOT_CDS_JAVA_HEAP_RETURN;
 
+  static void reset_dead_counter();
+  static void inc_dead_counter(size_t ndead);
+
   // Jcmd
   static void dump(outputStream* st, bool verbose=false);
   // Debugging