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_GC_SERIAL_DEFNEWGENERATION_HPP
26 #define SHARE_GC_SERIAL_DEFNEWGENERATION_HPP
27
28 #include "gc/serial/cSpaceCounters.hpp"
29 #include "gc/shared/ageTable.hpp"
30 #include "gc/shared/copyFailedInfo.hpp"
31 #include "gc/shared/generation.hpp"
32 #include "gc/shared/generationCounters.hpp"
33 #include "gc/shared/preservedMarks.hpp"
34 #include "utilities/align.hpp"
35 #include "utilities/stack.hpp"
36
37 class ContiguousSpace;
38 class STWGCTimer;
39 class CSpaceCounters;
40 class ScanWeakRefClosure;
41 class SerialHeap;
42
43 // DefNewGeneration is a young generation containing eden, from- and
44 // to-space.
45
46 class DefNewGeneration: public Generation {
47 friend class VMStructs;
48
49 protected:
50 Generation* _old_gen;
51 uint _tenuring_threshold; // Tenuring threshold for next collection.
52 AgeTable _age_table;
53 // Size of object to pretenure in words; command line provides bytes
54 size_t _pretenure_size_threshold_words;
55
56 AgeTable* age_table() { return &_age_table; }
57
58 // Initialize state to optimistically assume no promotion failure will
59 // happen.
60 void init_assuming_no_promotion_failure();
61 // True iff a promotion has failed in the current collection.
163 CardTableRS* _rs;
164 template <class T> void do_oop_work(T* p);
165 public:
166 KeepAliveClosure(ScanWeakRefClosure* cl);
167 virtual void do_oop(oop* p);
168 virtual void do_oop(narrowOop* p);
169 };
170
171 class FastKeepAliveClosure: public KeepAliveClosure {
172 protected:
173 HeapWord* _boundary;
174 template <class T> void do_oop_work(T* p);
175 public:
176 FastKeepAliveClosure(DefNewGeneration* g, ScanWeakRefClosure* cl);
177 virtual void do_oop(oop* p);
178 virtual void do_oop(narrowOop* p);
179 };
180
181 class FastEvacuateFollowersClosure: public VoidClosure {
182 SerialHeap* _heap;
183 FastScanClosure* _scan_cur_or_nonheap;
184 FastScanClosure* _scan_older;
185 public:
186 FastEvacuateFollowersClosure(SerialHeap* heap,
187 FastScanClosure* cur,
188 FastScanClosure* older);
189 void do_void();
190 };
191
192 public:
193 DefNewGeneration(ReservedSpace rs,
194 size_t initial_byte_size,
195 size_t min_byte_size,
196 size_t max_byte_size,
197 const char* policy="Serial young collection pauses");
198
199 virtual void ref_processor_init();
200
201 virtual Generation::Name kind() { return Generation::DefNew; }
202
203 // Accessing spaces
204 ContiguousSpace* eden() const { return _eden_space; }
205 ContiguousSpace* from() const { return _from_space; }
206 ContiguousSpace* to() const { return _to_space; }
207
208 virtual CompactibleSpace* first_compaction_space() const;
|
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_GC_SERIAL_DEFNEWGENERATION_HPP
26 #define SHARE_GC_SERIAL_DEFNEWGENERATION_HPP
27
28 #include "gc/serial/cSpaceCounters.hpp"
29 #include "gc/shared/ageTable.hpp"
30 #include "gc/shared/copyFailedInfo.hpp"
31 #include "gc/shared/generation.hpp"
32 #include "gc/shared/generationCounters.hpp"
33 #include "gc/shared/preservedMarks.hpp"
34 #include "utilities/align.hpp"
35 #include "utilities/stack.hpp"
36
37 class ContiguousSpace;
38 class CSpaceCounters;
39 class DefNewYoungerGenClosure;
40 class DefNewScanClosure;
41 class ScanWeakRefClosure;
42 class SerialHeap;
43 class STWGCTimer;
44
45 // DefNewGeneration is a young generation containing eden, from- and
46 // to-space.
47
48 class DefNewGeneration: public Generation {
49 friend class VMStructs;
50
51 protected:
52 Generation* _old_gen;
53 uint _tenuring_threshold; // Tenuring threshold for next collection.
54 AgeTable _age_table;
55 // Size of object to pretenure in words; command line provides bytes
56 size_t _pretenure_size_threshold_words;
57
58 AgeTable* age_table() { return &_age_table; }
59
60 // Initialize state to optimistically assume no promotion failure will
61 // happen.
62 void init_assuming_no_promotion_failure();
63 // True iff a promotion has failed in the current collection.
165 CardTableRS* _rs;
166 template <class T> void do_oop_work(T* p);
167 public:
168 KeepAliveClosure(ScanWeakRefClosure* cl);
169 virtual void do_oop(oop* p);
170 virtual void do_oop(narrowOop* p);
171 };
172
173 class FastKeepAliveClosure: public KeepAliveClosure {
174 protected:
175 HeapWord* _boundary;
176 template <class T> void do_oop_work(T* p);
177 public:
178 FastKeepAliveClosure(DefNewGeneration* g, ScanWeakRefClosure* cl);
179 virtual void do_oop(oop* p);
180 virtual void do_oop(narrowOop* p);
181 };
182
183 class FastEvacuateFollowersClosure: public VoidClosure {
184 SerialHeap* _heap;
185 DefNewScanClosure* _scan_cur_or_nonheap;
186 DefNewYoungerGenClosure* _scan_older;
187 public:
188 FastEvacuateFollowersClosure(SerialHeap* heap,
189 DefNewScanClosure* cur,
190 DefNewYoungerGenClosure* older);
191 void do_void();
192 };
193
194 public:
195 DefNewGeneration(ReservedSpace rs,
196 size_t initial_byte_size,
197 size_t min_byte_size,
198 size_t max_byte_size,
199 const char* policy="Serial young collection pauses");
200
201 virtual void ref_processor_init();
202
203 virtual Generation::Name kind() { return Generation::DefNew; }
204
205 // Accessing spaces
206 ContiguousSpace* eden() const { return _eden_space; }
207 ContiguousSpace* from() const { return _from_space; }
208 ContiguousSpace* to() const { return _to_space; }
209
210 virtual CompactibleSpace* first_compaction_space() const;
|