115 protected:
116 SpoolBlock* nextSpoolBlock;
117 size_t bufferSize; // number of usable words in this block
118 markOop* displacedHdr; // the displaced headers start here
119
120 // Note about bufferSize: it denotes the number of entries available plus 1;
121 // legal indices range from 1 through BufferSize - 1. See the verification
122 // code verify() that counts the number of displaced headers spooled.
123 size_t computeBufferSize() {
124 return (size() * sizeof(HeapWord) - sizeof(*this)) / sizeof(markOop);
125 }
126
127 public:
128 void init() {
129 bufferSize = computeBufferSize();
130 displacedHdr = (markOop*)&displacedHdr;
131 nextSpoolBlock = NULL;
132 }
133
134 void print_on(outputStream* st) const;
135 void print() const { print_on(gclog_or_tty); }
136 };
137
138 class PromotionInfo VALUE_OBJ_CLASS_SPEC {
139 bool _tracking; // set if tracking
140 CompactibleFreeListSpace* _space; // the space to which this belongs
141 PromotedObject* _promoHead; // head of list of promoted objects
142 PromotedObject* _promoTail; // tail of list of promoted objects
143 SpoolBlock* _spoolHead; // first spooling block
144 SpoolBlock* _spoolTail; // last non-full spooling block or null
145 SpoolBlock* _splice_point; // when _spoolTail is null, holds list tail
146 SpoolBlock* _spareSpool; // free spool buffer
147 size_t _firstIndex; // first active index in
148 // first spooling block (_spoolHead)
149 size_t _nextIndex; // last active index + 1 in last
150 // spooling block (_spoolTail)
151 private:
152 // ensure that spooling space exists; return true if there is spooling space
153 bool ensure_spooling_space_work();
154
155 public:
190 #define PROMOTED_OOPS_ITERATE_DECL(OopClosureType, nv_suffix) \
191 void promoted_oops_iterate##nv_suffix(OopClosureType* cl);
192 ALL_SINCE_SAVE_MARKS_CLOSURES(PROMOTED_OOPS_ITERATE_DECL)
193 #undef PROMOTED_OOPS_ITERATE_DECL
194 void promoted_oops_iterate(OopsInGenClosure* cl) {
195 promoted_oops_iterate_v(cl);
196 }
197 void verify() const;
198 void reset() {
199 _promoHead = NULL;
200 _promoTail = NULL;
201 _spoolHead = NULL;
202 _spoolTail = NULL;
203 _spareSpool = NULL;
204 _firstIndex = 0;
205 _nextIndex = 0;
206
207 }
208
209 void print_on(outputStream* st) const;
210 void print_statistics(uint worker_id) const;
211 };
212
213
214 #endif // SHARE_VM_GC_CMS_PROMOTIONINFO_HPP
|
115 protected:
116 SpoolBlock* nextSpoolBlock;
117 size_t bufferSize; // number of usable words in this block
118 markOop* displacedHdr; // the displaced headers start here
119
120 // Note about bufferSize: it denotes the number of entries available plus 1;
121 // legal indices range from 1 through BufferSize - 1. See the verification
122 // code verify() that counts the number of displaced headers spooled.
123 size_t computeBufferSize() {
124 return (size() * sizeof(HeapWord) - sizeof(*this)) / sizeof(markOop);
125 }
126
127 public:
128 void init() {
129 bufferSize = computeBufferSize();
130 displacedHdr = (markOop*)&displacedHdr;
131 nextSpoolBlock = NULL;
132 }
133
134 void print_on(outputStream* st) const;
135 void print() const { print_on(tty); }
136 };
137
138 class PromotionInfo VALUE_OBJ_CLASS_SPEC {
139 bool _tracking; // set if tracking
140 CompactibleFreeListSpace* _space; // the space to which this belongs
141 PromotedObject* _promoHead; // head of list of promoted objects
142 PromotedObject* _promoTail; // tail of list of promoted objects
143 SpoolBlock* _spoolHead; // first spooling block
144 SpoolBlock* _spoolTail; // last non-full spooling block or null
145 SpoolBlock* _splice_point; // when _spoolTail is null, holds list tail
146 SpoolBlock* _spareSpool; // free spool buffer
147 size_t _firstIndex; // first active index in
148 // first spooling block (_spoolHead)
149 size_t _nextIndex; // last active index + 1 in last
150 // spooling block (_spoolTail)
151 private:
152 // ensure that spooling space exists; return true if there is spooling space
153 bool ensure_spooling_space_work();
154
155 public:
190 #define PROMOTED_OOPS_ITERATE_DECL(OopClosureType, nv_suffix) \
191 void promoted_oops_iterate##nv_suffix(OopClosureType* cl);
192 ALL_SINCE_SAVE_MARKS_CLOSURES(PROMOTED_OOPS_ITERATE_DECL)
193 #undef PROMOTED_OOPS_ITERATE_DECL
194 void promoted_oops_iterate(OopsInGenClosure* cl) {
195 promoted_oops_iterate_v(cl);
196 }
197 void verify() const;
198 void reset() {
199 _promoHead = NULL;
200 _promoTail = NULL;
201 _spoolHead = NULL;
202 _spoolTail = NULL;
203 _spareSpool = NULL;
204 _firstIndex = 0;
205 _nextIndex = 0;
206
207 }
208
209 void print_on(outputStream* st) const;
210 };
211
212
213 #endif // SHARE_VM_GC_CMS_PROMOTIONINFO_HPP
|