12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 #ifndef SHARE_VM_GC_CMS_PARNEWGENERATION_HPP
26 #define SHARE_VM_GC_CMS_PARNEWGENERATION_HPP
27
28 #include "gc/cms/parOopClosures.hpp"
29 #include "gc/serial/defNewGeneration.hpp"
30 #include "gc/shared/copyFailedInfo.hpp"
31 #include "gc/shared/gcTrace.hpp"
32 #include "gc/shared/plab.hpp"
33 #include "gc/shared/preservedMarks.hpp"
34 #include "gc/shared/taskqueue.hpp"
35 #include "memory/padded.hpp"
36
37 class ChunkArray;
38 class CMSHeap;
39 class ParScanWithoutBarrierClosure;
40 class ParScanWithBarrierClosure;
41 class ParRootScanWithoutBarrierClosure;
42 class ParRootScanWithBarrierTwoGensClosure;
43 class ParEvacuateFollowersClosure;
44 class StrongRootsScope;
45
46 // It would be better if these types could be kept local to the .cpp file,
47 // but they must be here to allow ParScanClosure::do_oop_work to be defined
48 // in genOopClosures.inline.hpp.
49
50 typedef Padded<OopTaskQueue> ObjToScanQueue;
51 typedef GenericTaskQueueSet<ObjToScanQueue, mtGC> ObjToScanQueueSet;
219 TASKQUEUE_STATS_ONLY(note_term_attempt());
220 _start_term = os::elapsedTime();
221 }
222 void end_term_time() {
223 _term_time += (os::elapsedTime() - _start_term);
224 }
225 double term_time() const { return _term_time; }
226
227 double elapsed_time() const {
228 return os::elapsedTime() - _start;
229 }
230 };
231
232 class ParNewGenTask: public AbstractGangTask {
233 private:
234 ParNewGeneration* _young_gen;
235 Generation* _old_gen;
236 HeapWord* _young_old_boundary;
237 class ParScanThreadStateSet* _state_set;
238 StrongRootsScope* _strong_roots_scope;
239
240 public:
241 ParNewGenTask(ParNewGeneration* young_gen,
242 Generation* old_gen,
243 HeapWord* young_old_boundary,
244 ParScanThreadStateSet* state_set,
245 StrongRootsScope* strong_roots_scope);
246
247 HeapWord* young_old_boundary() { return _young_old_boundary; }
248
249 void work(uint worker_id);
250 };
251
252 class KeepAliveClosure: public DefNewGeneration::KeepAliveClosure {
253 protected:
254 template <class T> void do_oop_work(T* p);
255 public:
256 KeepAliveClosure(ScanWeakRefClosure* cl);
257 virtual void do_oop(oop* p);
258 virtual void do_oop(narrowOop* p);
|
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 #ifndef SHARE_VM_GC_CMS_PARNEWGENERATION_HPP
26 #define SHARE_VM_GC_CMS_PARNEWGENERATION_HPP
27
28 #include "gc/cms/parOopClosures.hpp"
29 #include "gc/serial/defNewGeneration.hpp"
30 #include "gc/shared/copyFailedInfo.hpp"
31 #include "gc/shared/gcTrace.hpp"
32 #include "gc/shared/oopStorageParState.hpp"
33 #include "gc/shared/plab.hpp"
34 #include "gc/shared/preservedMarks.hpp"
35 #include "gc/shared/taskqueue.hpp"
36 #include "memory/padded.hpp"
37
38 class ChunkArray;
39 class CMSHeap;
40 class ParScanWithoutBarrierClosure;
41 class ParScanWithBarrierClosure;
42 class ParRootScanWithoutBarrierClosure;
43 class ParRootScanWithBarrierTwoGensClosure;
44 class ParEvacuateFollowersClosure;
45 class StrongRootsScope;
46
47 // It would be better if these types could be kept local to the .cpp file,
48 // but they must be here to allow ParScanClosure::do_oop_work to be defined
49 // in genOopClosures.inline.hpp.
50
51 typedef Padded<OopTaskQueue> ObjToScanQueue;
52 typedef GenericTaskQueueSet<ObjToScanQueue, mtGC> ObjToScanQueueSet;
220 TASKQUEUE_STATS_ONLY(note_term_attempt());
221 _start_term = os::elapsedTime();
222 }
223 void end_term_time() {
224 _term_time += (os::elapsedTime() - _start_term);
225 }
226 double term_time() const { return _term_time; }
227
228 double elapsed_time() const {
229 return os::elapsedTime() - _start;
230 }
231 };
232
233 class ParNewGenTask: public AbstractGangTask {
234 private:
235 ParNewGeneration* _young_gen;
236 Generation* _old_gen;
237 HeapWord* _young_old_boundary;
238 class ParScanThreadStateSet* _state_set;
239 StrongRootsScope* _strong_roots_scope;
240 OopStorage::ParState<false, false> _par_state_string;
241
242 public:
243 ParNewGenTask(ParNewGeneration* young_gen,
244 Generation* old_gen,
245 HeapWord* young_old_boundary,
246 ParScanThreadStateSet* state_set,
247 StrongRootsScope* strong_roots_scope);
248
249 HeapWord* young_old_boundary() { return _young_old_boundary; }
250
251 void work(uint worker_id);
252 };
253
254 class KeepAliveClosure: public DefNewGeneration::KeepAliveClosure {
255 protected:
256 template <class T> void do_oop_work(T* p);
257 public:
258 KeepAliveClosure(ScanWeakRefClosure* cl);
259 virtual void do_oop(oop* p);
260 virtual void do_oop(narrowOop* p);
|