169 void record_top_and_timestamp();
170 void reset_gc_time_stamp() { _gc_time_stamp = 0; }
171 unsigned get_gc_time_stamp() { return _gc_time_stamp; }
172
173 // See the comment above in the declaration of _pre_dummy_top for an
174 // explanation of what it is.
175 void set_pre_dummy_top(HeapWord* pre_dummy_top) {
176 assert(is_in(pre_dummy_top) && pre_dummy_top <= top(), "pre-condition");
177 _pre_dummy_top = pre_dummy_top;
178 }
179 HeapWord* pre_dummy_top() {
180 return (_pre_dummy_top == NULL) ? top() : _pre_dummy_top;
181 }
182 void reset_pre_dummy_top() { _pre_dummy_top = NULL; }
183
184 virtual void clear(bool mangle_space);
185
186 HeapWord* block_start(const void* p);
187 HeapWord* block_start_const(const void* p) const;
188
189 void prepare_for_compaction(CompactPoint* cp);
190
191 // Add offset table update.
192 virtual HeapWord* allocate(size_t word_size);
193 HeapWord* par_allocate(size_t word_size);
194
195 // MarkSweep support phase3
196 virtual HeapWord* initialize_threshold();
197 virtual HeapWord* cross_threshold(HeapWord* start, HeapWord* end);
198
199 virtual void print() const;
200
201 void reset_bot() {
202 _offsets.reset_bot();
203 }
204
205 void print_bot_on(outputStream* out) {
206 _offsets.print_on(out);
207 }
208 };
209
210 class HeapRegion: public G1OffsetTableContigSpace {
335
336 enum ClaimValues {
337 InitialClaimValue = 0,
338 FinalCountClaimValue = 1,
339 NoteEndClaimValue = 2,
340 ScrubRemSetClaimValue = 3,
341 ParVerifyClaimValue = 4,
342 RebuildRSClaimValue = 5,
343 ParEvacFailureClaimValue = 6,
344 AggregateCountClaimValue = 7,
345 VerifyCountClaimValue = 8,
346 ParMarkRootClaimValue = 9
347 };
348
349 // All allocated blocks are occupied by objects in a HeapRegion
350 bool block_is_obj(const HeapWord* p) const;
351
352 // Returns the object size for all valid block starts
353 // and the amount of unallocated words if called on top()
354 size_t block_size(const HeapWord* p) const;
355
356 inline HeapWord* par_allocate_no_bot_updates(size_t word_size);
357 inline HeapWord* allocate_no_bot_updates(size_t word_size);
358
359 // If this region is a member of a HeapRegionManager, the index in that
360 // sequence, otherwise -1.
361 uint hrm_index() const { return _hrm_index; }
362
363 // The number of bytes marked live in the region in the last marking phase.
364 size_t marked_bytes() { return _prev_marked_bytes; }
365 size_t live_bytes() {
366 return (top() - prev_top_at_mark_start()) * HeapWordSize + marked_bytes();
367 }
368
369 // The number of bytes counted in the next marking.
370 size_t next_marked_bytes() { return _next_marked_bytes; }
371 // The number of bytes live wrt the next marking.
372 size_t next_live_bytes() {
373 return
374 (top() - next_top_at_mark_start()) * HeapWordSize + next_marked_bytes();
|
169 void record_top_and_timestamp();
170 void reset_gc_time_stamp() { _gc_time_stamp = 0; }
171 unsigned get_gc_time_stamp() { return _gc_time_stamp; }
172
173 // See the comment above in the declaration of _pre_dummy_top for an
174 // explanation of what it is.
175 void set_pre_dummy_top(HeapWord* pre_dummy_top) {
176 assert(is_in(pre_dummy_top) && pre_dummy_top <= top(), "pre-condition");
177 _pre_dummy_top = pre_dummy_top;
178 }
179 HeapWord* pre_dummy_top() {
180 return (_pre_dummy_top == NULL) ? top() : _pre_dummy_top;
181 }
182 void reset_pre_dummy_top() { _pre_dummy_top = NULL; }
183
184 virtual void clear(bool mangle_space);
185
186 HeapWord* block_start(const void* p);
187 HeapWord* block_start_const(const void* p) const;
188
189 // Add offset table update.
190 virtual HeapWord* allocate(size_t word_size);
191 HeapWord* par_allocate(size_t word_size);
192
193 // MarkSweep support phase3
194 virtual HeapWord* initialize_threshold();
195 virtual HeapWord* cross_threshold(HeapWord* start, HeapWord* end);
196
197 virtual void print() const;
198
199 void reset_bot() {
200 _offsets.reset_bot();
201 }
202
203 void print_bot_on(outputStream* out) {
204 _offsets.print_on(out);
205 }
206 };
207
208 class HeapRegion: public G1OffsetTableContigSpace {
333
334 enum ClaimValues {
335 InitialClaimValue = 0,
336 FinalCountClaimValue = 1,
337 NoteEndClaimValue = 2,
338 ScrubRemSetClaimValue = 3,
339 ParVerifyClaimValue = 4,
340 RebuildRSClaimValue = 5,
341 ParEvacFailureClaimValue = 6,
342 AggregateCountClaimValue = 7,
343 VerifyCountClaimValue = 8,
344 ParMarkRootClaimValue = 9
345 };
346
347 // All allocated blocks are occupied by objects in a HeapRegion
348 bool block_is_obj(const HeapWord* p) const;
349
350 // Returns the object size for all valid block starts
351 // and the amount of unallocated words if called on top()
352 size_t block_size(const HeapWord* p) const;
353
354 // Functions for scan_and_forward support.
355 void prepare_for_compaction(CompactPoint* cp);
356
357 inline HeapWord* scan_limit() const {
358 return top();
359 }
360
361 inline bool scanned_block_is_obj(const HeapWord* addr) const {
362 return true; // Always true, since scan_limit is top
363 }
364
365 inline size_t scanned_block_size(const HeapWord* addr) const {
366 return HeapRegion::block_size(addr); // Avoid virtual call
367 }
368
369 inline HeapWord* par_allocate_no_bot_updates(size_t word_size);
370 inline HeapWord* allocate_no_bot_updates(size_t word_size);
371
372 // If this region is a member of a HeapRegionManager, the index in that
373 // sequence, otherwise -1.
374 uint hrm_index() const { return _hrm_index; }
375
376 // The number of bytes marked live in the region in the last marking phase.
377 size_t marked_bytes() { return _prev_marked_bytes; }
378 size_t live_bytes() {
379 return (top() - prev_top_at_mark_start()) * HeapWordSize + marked_bytes();
380 }
381
382 // The number of bytes counted in the next marking.
383 size_t next_marked_bytes() { return _next_marked_bytes; }
384 // The number of bytes live wrt the next marking.
385 size_t next_live_bytes() {
386 return
387 (top() - next_top_at_mark_start()) * HeapWordSize + next_marked_bytes();
|