86 87 deduplicate_shared_strings(total_stat); 88 89 // Main loop 90 for (;;) { 91 G1StringDedupStat stat; 92 93 stat.mark_idle(); 94 95 // Wait for the queue to become non-empty 96 G1StringDedupQueue::wait(); 97 if (should_terminate()) { 98 break; 99 } 100 101 { 102 // Include thread in safepoints 103 SuspendibleThreadSetJoiner sts_join; 104 105 stat.mark_exec(); 106 107 // Process the queue 108 for (;;) { 109 oop java_string = G1StringDedupQueue::pop(); 110 if (java_string == NULL) { 111 break; 112 } 113 114 G1StringDedupTable::deduplicate(java_string, stat); 115 116 // Safepoint this thread if needed 117 if (sts_join.should_yield()) { 118 stat.mark_block(); 119 sts_join.yield(); 120 stat.mark_unblock(); 121 } 122 } 123 124 stat.mark_done(); 125 126 // Print statistics 127 total_stat.add(stat); 128 print(stat, total_stat); 129 } 130 131 G1StringDedupTable::clean_entry_cache(); 132 } 133 } 134 135 void G1StringDedupThread::stop_service() { 136 G1StringDedupQueue::cancel_wait(); 137 } 138 139 void G1StringDedupThread::print(const G1StringDedupStat& last_stat, const G1StringDedupStat& total_stat) { 140 if (log_is_enabled(Info, gc, stringdedup)) { 141 G1StringDedupStat::print_summary(last_stat, total_stat); 142 if (log_is_enabled(Debug, gc, stringdedup)) { 143 G1StringDedupStat::print_statistics(last_stat, false); 144 G1StringDedupStat::print_statistics(total_stat, true); 145 G1StringDedupTable::print_statistics(); 146 G1StringDedupQueue::print_statistics(); 147 } 148 } 149 } | 86 87 deduplicate_shared_strings(total_stat); 88 89 // Main loop 90 for (;;) { 91 G1StringDedupStat stat; 92 93 stat.mark_idle(); 94 95 // Wait for the queue to become non-empty 96 G1StringDedupQueue::wait(); 97 if (should_terminate()) { 98 break; 99 } 100 101 { 102 // Include thread in safepoints 103 SuspendibleThreadSetJoiner sts_join; 104 105 stat.mark_exec(); 106 print_start(stat); 107 108 // Process the queue 109 for (;;) { 110 oop java_string = G1StringDedupQueue::pop(); 111 if (java_string == NULL) { 112 break; 113 } 114 115 G1StringDedupTable::deduplicate(java_string, stat); 116 117 // Safepoint this thread if needed 118 if (sts_join.should_yield()) { 119 stat.mark_block(); 120 sts_join.yield(); 121 stat.mark_unblock(); 122 } 123 } 124 125 stat.mark_done(); 126 127 total_stat.add(stat); 128 print_end(stat, total_stat); 129 } 130 131 G1StringDedupTable::clean_entry_cache(); 132 } 133 } 134 135 void G1StringDedupThread::stop_service() { 136 G1StringDedupQueue::cancel_wait(); 137 } 138 139 void G1StringDedupThread::print_start(const G1StringDedupStat& last_stat) { 140 G1StringDedupStat::print_start(last_stat); 141 } 142 143 void G1StringDedupThread::print_end(const G1StringDedupStat& last_stat, const G1StringDedupStat& total_stat) { 144 G1StringDedupStat::print_end(last_stat, total_stat); 145 if (log_is_enabled(Debug, gc, stringdedup)) { 146 G1StringDedupStat::print_statistics(last_stat, false); 147 G1StringDedupStat::print_statistics(total_stat, true); 148 G1StringDedupTable::print_statistics(); 149 G1StringDedupQueue::print_statistics(); 150 } 151 } |