Mercurial > hg > graal-jvmci-8
comparison src/share/vm/gc_implementation/parNew/parOopClosures.hpp @ 113:ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
Summary: Compressed oops in instances, arrays, and headers. Code contributors are coleenp, phh, never, swamyv
Reviewed-by: jmasa, kamg, acorn, tbell, kvn, rasbold
author | coleenp |
---|---|
date | Sun, 13 Apr 2008 17:43:42 -0400 |
parents | a61af66fc99e |
children | c18cbe5936b8 |
comparison
equal
deleted
inserted
replaced
110:a49a647afe9a | 113:ba764ed4b6f2 |
---|---|
24 | 24 |
25 // Closures for ParNewGeneration | 25 // Closures for ParNewGeneration |
26 | 26 |
27 class ParScanThreadState; | 27 class ParScanThreadState; |
28 class ParNewGeneration; | 28 class ParNewGeneration; |
29 template<class E> class GenericTaskQueueSet; | 29 typedef OopTaskQueueSet ObjToScanQueueSet; |
30 typedef GenericTaskQueueSet<oop> ObjToScanQueueSet; | |
31 class ParallelTaskTerminator; | 30 class ParallelTaskTerminator; |
32 | 31 |
33 class ParScanClosure: public OopsInGenClosure { | 32 class ParScanClosure: public OopsInGenClosure { |
34 protected: | 33 protected: |
35 ParScanThreadState* _par_scan_state; | 34 ParScanThreadState* _par_scan_state; |
36 ParNewGeneration* _g; | 35 ParNewGeneration* _g; |
37 HeapWord* _boundary; | 36 HeapWord* _boundary; |
38 void do_oop_work(oop* p, | 37 template <class T> void inline par_do_barrier(T* p); |
39 bool gc_barrier, | 38 template <class T> void inline do_oop_work(T* p, |
40 bool root_scan); | 39 bool gc_barrier, |
41 | 40 bool root_scan); |
42 void par_do_barrier(oop* p); | 41 public: |
43 | |
44 public: | |
45 ParScanClosure(ParNewGeneration* g, ParScanThreadState* par_scan_state); | 42 ParScanClosure(ParNewGeneration* g, ParScanThreadState* par_scan_state); |
46 }; | 43 }; |
47 | 44 |
48 class ParScanWithBarrierClosure: public ParScanClosure { | 45 class ParScanWithBarrierClosure: public ParScanClosure { |
49 public: | 46 public: |
50 void do_oop(oop* p) { do_oop_work(p, true, false); } | |
51 void do_oop_nv(oop* p) { do_oop_work(p, true, false); } | |
52 ParScanWithBarrierClosure(ParNewGeneration* g, | 47 ParScanWithBarrierClosure(ParNewGeneration* g, |
53 ParScanThreadState* par_scan_state) : | 48 ParScanThreadState* par_scan_state) : |
54 ParScanClosure(g, par_scan_state) {} | 49 ParScanClosure(g, par_scan_state) {} |
50 virtual void do_oop(oop* p); | |
51 virtual void do_oop(narrowOop* p); | |
52 inline void do_oop_nv(oop* p); | |
53 inline void do_oop_nv(narrowOop* p); | |
55 }; | 54 }; |
56 | 55 |
57 class ParScanWithoutBarrierClosure: public ParScanClosure { | 56 class ParScanWithoutBarrierClosure: public ParScanClosure { |
58 public: | 57 public: |
59 ParScanWithoutBarrierClosure(ParNewGeneration* g, | 58 ParScanWithoutBarrierClosure(ParNewGeneration* g, |
60 ParScanThreadState* par_scan_state) : | 59 ParScanThreadState* par_scan_state) : |
61 ParScanClosure(g, par_scan_state) {} | 60 ParScanClosure(g, par_scan_state) {} |
62 void do_oop(oop* p) { do_oop_work(p, false, false); } | 61 virtual void do_oop(oop* p); |
63 void do_oop_nv(oop* p) { do_oop_work(p, false, false); } | 62 virtual void do_oop(narrowOop* p); |
63 inline void do_oop_nv(oop* p); | |
64 inline void do_oop_nv(narrowOop* p); | |
64 }; | 65 }; |
65 | 66 |
66 class ParRootScanWithBarrierTwoGensClosure: public ParScanClosure { | 67 class ParRootScanWithBarrierTwoGensClosure: public ParScanClosure { |
67 public: | 68 public: |
68 ParRootScanWithBarrierTwoGensClosure(ParNewGeneration* g, | 69 ParRootScanWithBarrierTwoGensClosure(ParNewGeneration* g, |
69 ParScanThreadState* par_scan_state) : | 70 ParScanThreadState* par_scan_state) : |
70 ParScanClosure(g, par_scan_state) {} | 71 ParScanClosure(g, par_scan_state) {} |
71 void do_oop(oop* p) { do_oop_work(p, true, true); } | 72 virtual void do_oop(oop* p); |
73 virtual void do_oop(narrowOop* p); | |
72 }; | 74 }; |
73 | 75 |
74 class ParRootScanWithoutBarrierClosure: public ParScanClosure { | 76 class ParRootScanWithoutBarrierClosure: public ParScanClosure { |
75 public: | 77 public: |
76 ParRootScanWithoutBarrierClosure(ParNewGeneration* g, | 78 ParRootScanWithoutBarrierClosure(ParNewGeneration* g, |
77 ParScanThreadState* par_scan_state) : | 79 ParScanThreadState* par_scan_state) : |
78 ParScanClosure(g, par_scan_state) {} | 80 ParScanClosure(g, par_scan_state) {} |
79 void do_oop(oop* p) { do_oop_work(p, false, true); } | 81 virtual void do_oop(oop* p); |
82 virtual void do_oop(narrowOop* p); | |
80 }; | 83 }; |
81 | 84 |
82 class ParScanWeakRefClosure: public ScanWeakRefClosure { | 85 class ParScanWeakRefClosure: public ScanWeakRefClosure { |
83 protected: | 86 protected: |
84 ParScanThreadState* _par_scan_state; | 87 ParScanThreadState* _par_scan_state; |
85 public: | 88 template <class T> inline void do_oop_work(T* p); |
89 public: | |
86 ParScanWeakRefClosure(ParNewGeneration* g, | 90 ParScanWeakRefClosure(ParNewGeneration* g, |
87 ParScanThreadState* par_scan_state); | 91 ParScanThreadState* par_scan_state); |
88 void do_oop(oop* p); | 92 virtual void do_oop(oop* p); |
89 void do_oop_nv(oop* p); | 93 virtual void do_oop(narrowOop* p); |
94 inline void do_oop_nv(oop* p); | |
95 inline void do_oop_nv(narrowOop* p); | |
90 }; | 96 }; |
91 | 97 |
92 class ParEvacuateFollowersClosure: public VoidClosure { | 98 class ParEvacuateFollowersClosure: public VoidClosure { |
99 private: | |
93 ParScanThreadState* _par_scan_state; | 100 ParScanThreadState* _par_scan_state; |
94 ParScanThreadState* par_scan_state() { return _par_scan_state; } | 101 ParScanThreadState* par_scan_state() { return _par_scan_state; } |
95 | 102 |
96 // We want to preserve the specific types here (rather than "OopClosure") | 103 // We want to preserve the specific types here (rather than "OopClosure") |
97 // for later de-virtualization of do_oop calls. | 104 // for later de-virtualization of do_oop calls. |
119 ObjToScanQueueSet* _task_queues; | 126 ObjToScanQueueSet* _task_queues; |
120 ObjToScanQueueSet* task_queues() { return _task_queues; } | 127 ObjToScanQueueSet* task_queues() { return _task_queues; } |
121 | 128 |
122 ParallelTaskTerminator* _terminator; | 129 ParallelTaskTerminator* _terminator; |
123 ParallelTaskTerminator* terminator() { return _terminator; } | 130 ParallelTaskTerminator* terminator() { return _terminator; } |
124 | 131 public: |
125 public: | |
126 ParEvacuateFollowersClosure( | 132 ParEvacuateFollowersClosure( |
127 ParScanThreadState* par_scan_state_, | 133 ParScanThreadState* par_scan_state_, |
128 ParScanWithoutBarrierClosure* to_space_closure_, | 134 ParScanWithoutBarrierClosure* to_space_closure_, |
129 ParScanWithBarrierClosure* old_gen_closure_, | 135 ParScanWithBarrierClosure* old_gen_closure_, |
130 ParRootScanWithoutBarrierClosure* to_space_root_closure_, | 136 ParRootScanWithoutBarrierClosure* to_space_root_closure_, |
131 ParNewGeneration* par_gen_, | 137 ParNewGeneration* par_gen_, |
132 ParRootScanWithBarrierTwoGensClosure* old_gen_root_closure_, | 138 ParRootScanWithBarrierTwoGensClosure* old_gen_root_closure_, |
133 ObjToScanQueueSet* task_queues_, | 139 ObjToScanQueueSet* task_queues_, |
134 ParallelTaskTerminator* terminator_); | 140 ParallelTaskTerminator* terminator_); |
135 void do_void(); | 141 virtual void do_void(); |
136 }; | 142 }; |