58
59 public:
60 StringDedupSharedClosure(StringDedupStat* stat) : _stat(stat) {}
61
62 virtual void do_oop(narrowOop* p) { ShouldNotReachHere(); }
63 virtual void do_oop(oop* p) {
64 oop java_string = RawAccess<>::oop_load(p);
65 StringDedupTable::deduplicate(java_string, _stat);
66 }
67 };
68
69 // The CDS archive does not include the string dedupication table. Only the string
70 // table is saved in the archive. The shared strings from CDS archive need to be
71 // added to the string dedupication table before deduplication occurs. That is
72 // done in the begining of the StringDedupThread (see StringDedupThread::do_deduplication()).
73 void StringDedupThread::deduplicate_shared_strings(StringDedupStat* stat) {
74 StringDedupSharedClosure sharedStringDedup(stat);
75 StringTable::shared_oops_do(&sharedStringDedup);
76 }
77
78 void StringDedupThread::stop_service() {
79 StringDedupQueue::cancel_wait();
80 }
81
82 void StringDedupThread::print_start(const StringDedupStat* last_stat) {
83 StringDedupStat::print_start(last_stat);
84 }
85
86 void StringDedupThread::print_end(const StringDedupStat* last_stat, const StringDedupStat* total_stat) {
87 StringDedupStat::print_end(last_stat, total_stat);
88 if (log_is_enabled(Debug, gc, stringdedup)) {
89 last_stat->print_statistics(false);
90 total_stat->print_statistics(true);
91
92 StringDedupTable::print_statistics();
93 StringDedupQueue::print_statistics();
94 }
95 }
|
58
59 public:
60 StringDedupSharedClosure(StringDedupStat* stat) : _stat(stat) {}
61
62 virtual void do_oop(narrowOop* p) { ShouldNotReachHere(); }
63 virtual void do_oop(oop* p) {
64 oop java_string = RawAccess<>::oop_load(p);
65 StringDedupTable::deduplicate(java_string, _stat);
66 }
67 };
68
69 // The CDS archive does not include the string dedupication table. Only the string
70 // table is saved in the archive. The shared strings from CDS archive need to be
71 // added to the string dedupication table before deduplication occurs. That is
72 // done in the begining of the StringDedupThread (see StringDedupThread::do_deduplication()).
73 void StringDedupThread::deduplicate_shared_strings(StringDedupStat* stat) {
74 StringDedupSharedClosure sharedStringDedup(stat);
75 StringTable::shared_oops_do(&sharedStringDedup);
76 }
77
78 void StringDedupThread::pre_run() {
79 SuspendibleThreadSetJoiner sts_join;
80 ConcurrentGCThread::pre_run();
81 }
82
83 void StringDedupThread::post_run() {
84 SuspendibleThreadSetJoiner sts_join;
85 ConcurrentGCThread::post_run();
86 }
87
88 void StringDedupThread::stop_service() {
89 StringDedupQueue::cancel_wait();
90 }
91
92 void StringDedupThread::print_start(const StringDedupStat* last_stat) {
93 StringDedupStat::print_start(last_stat);
94 }
95
96 void StringDedupThread::print_end(const StringDedupStat* last_stat, const StringDedupStat* total_stat) {
97 StringDedupStat::print_end(last_stat, total_stat);
98 if (log_is_enabled(Debug, gc, stringdedup)) {
99 last_stat->print_statistics(false);
100 total_stat->print_statistics(true);
101
102 StringDedupTable::print_statistics();
103 StringDedupQueue::print_statistics();
104 }
105 }
|