77 // done in the begining of the G1StringDedupThread (see G1StringDedupThread::run()
78 // below).
79 void G1StringDedupThread::deduplicate_shared_strings(G1StringDedupStat& stat) {
80 G1StringDedupSharedClosure sharedStringDedup(stat);
81 StringTable::shared_oops_do(&sharedStringDedup);
82 }
83
84 void G1StringDedupThread::run_service() {
85 G1StringDedupStat total_stat;
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()) {
|
77 // done in the begining of the G1StringDedupThread (see G1StringDedupThread::run()
78 // below).
79 void G1StringDedupThread::deduplicate_shared_strings(G1StringDedupStat& stat) {
80 G1StringDedupSharedClosure sharedStringDedup(stat);
81 StringTable::shared_oops_do(&sharedStringDedup);
82 }
83
84 void G1StringDedupThread::run_service() {
85 G1StringDedupStat total_stat;
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()) {
|