comparison src/share/vm/gc_implementation/g1/g1StringDedupThread.cpp @ 20192:581e70386ec9

8039147: Cleanup SuspendibleThreadSet Reviewed-by: brutisso, tschatzl, mgerdin
author pliden
date Fri, 11 Apr 2014 12:29:24 +0200
parents 1772223a25a2
children
comparison
equal deleted inserted replaced
20191:fd81a5764900 20192:581e70386ec9
75 G1StringDedupQueue::wait(); 75 G1StringDedupQueue::wait();
76 if (_should_terminate) { 76 if (_should_terminate) {
77 break; 77 break;
78 } 78 }
79 79
80 // Include this thread in safepoints 80 {
81 stsJoin(); 81 // Include thread in safepoints
82 SuspendibleThreadSetJoiner sts;
82 83
83 stat.mark_exec(); 84 stat.mark_exec();
84 85
85 // Process the queue 86 // Process the queue
86 for (;;) { 87 for (;;) {
87 oop java_string = G1StringDedupQueue::pop(); 88 oop java_string = G1StringDedupQueue::pop();
88 if (java_string == NULL) { 89 if (java_string == NULL) {
89 break; 90 break;
91 }
92
93 G1StringDedupTable::deduplicate(java_string, stat);
94
95 // Safepoint this thread if needed
96 if (sts.should_yield()) {
97 stat.mark_block();
98 sts.yield();
99 stat.mark_unblock();
100 }
90 } 101 }
91 102
92 G1StringDedupTable::deduplicate(java_string, stat); 103 G1StringDedupTable::trim_entry_cache();
93 104
94 // Safepoint this thread if needed 105 stat.mark_done();
95 if (stsShouldYield()) { 106
96 stat.mark_block(); 107 // Print statistics
97 stsYield(NULL); 108 total_stat.add(stat);
98 stat.mark_unblock(); 109 print(gclog_or_tty, stat, total_stat);
99 }
100 } 110 }
101
102 G1StringDedupTable::trim_entry_cache();
103
104 stat.mark_done();
105
106 // Print statistics
107 total_stat.add(stat);
108 print(gclog_or_tty, stat, total_stat);
109
110 // Exclude this thread from safepoints
111 stsLeave();
112 } 111 }
113 112
114 terminate(); 113 terminate();
115 } 114 }
116 115