8222664: runtime/appcds/sharedStrings/SharedStringsStress.java assert GC active during NoGCVerifier
Reviewed-by: iklam, stefank
--- a/src/hotspot/share/gc/shared/stringdedup/stringDedupThread.cpp Wed Apr 24 19:51:38 2019 -0700
+++ b/src/hotspot/share/gc/shared/stringdedup/stringDedupThread.cpp Thu Apr 25 08:55:49 2019 +0200
@@ -66,10 +66,10 @@
}
};
-// The CDS archive does not include the string dedupication table. Only the string
+// The CDS archive does not include the string deduplication table. Only the string
// table is saved in the archive. The shared strings from CDS archive need to be
-// added to the string dedupication table before deduplication occurs. That is
-// done in the begining of the StringDedupThread (see StringDedupThread::do_deduplication()).
+// added to the string deduplication table before deduplication occurs. That is
+// done in the beginning of the StringDedupThread (see StringDedupThread::do_deduplication()).
void StringDedupThread::deduplicate_shared_strings(StringDedupStat* stat) {
StringDedupSharedClosure sharedStringDedup(stat);
StringTable::shared_oops_do(&sharedStringDedup);
--- a/src/hotspot/share/gc/shared/stringdedup/stringDedupThread.inline.hpp Wed Apr 24 19:51:38 2019 -0700
+++ b/src/hotspot/share/gc/shared/stringdedup/stringDedupThread.inline.hpp Thu Apr 25 08:55:49 2019 +0200
@@ -33,7 +33,11 @@
void StringDedupThreadImpl<S>::do_deduplication() {
S total_stat;
- deduplicate_shared_strings(&total_stat);
+ {
+ // Block safepoints while deduplicating shared strings
+ SuspendibleThreadSetJoiner sts_join;
+ deduplicate_shared_strings(&total_stat);
+ }
// Main loop
for (;;) {