Mercurial > hg > graal-compiler
comparison src/share/vm/gc_implementation/g1/heapRegion.hpp @ 2361:1216415d8e35
7014923: G1: code cleanup
Summary: Some G1 code cleanup.
Reviewed-by: johnc, jcoomes, jwilhelm
author | tonyp |
---|---|
date | Fri, 04 Mar 2011 17:13:19 -0500 |
parents | 0fa27f37d4d4 |
children | abdfc822206f |
comparison
equal
deleted
inserted
replaced
2312:11303bede852 | 2361:1216415d8e35 |
---|---|
51 class HeapRegionRemSetIterator; | 51 class HeapRegionRemSetIterator; |
52 class HeapRegion; | 52 class HeapRegion; |
53 class HeapRegionSetBase; | 53 class HeapRegionSetBase; |
54 | 54 |
55 #define HR_FORMAT "%d:["PTR_FORMAT","PTR_FORMAT","PTR_FORMAT"]" | 55 #define HR_FORMAT "%d:["PTR_FORMAT","PTR_FORMAT","PTR_FORMAT"]" |
56 #define HR_FORMAT_PARAMS(__hr) (__hr)->hrs_index(), (__hr)->bottom(), \ | 56 #define HR_FORMAT_PARAMS(_hr_) (_hr_)->hrs_index(), (_hr_)->bottom(), \ |
57 (__hr)->top(), (__hr)->end() | 57 (_hr_)->top(), (_hr_)->end() |
58 | 58 |
59 // A dirty card to oop closure for heap regions. It | 59 // A dirty card to oop closure for heap regions. It |
60 // knows how to get the G1 heap and how to use the bitmap | 60 // knows how to get the G1 heap and how to use the bitmap |
61 // in the concurrent marker used by G1 to filter remembered | 61 // in the concurrent marker used by G1 to filter remembered |
62 // sets. | 62 // sets. |
516 err_msg("containing_set: "PTR_FORMAT" " | 516 err_msg("containing_set: "PTR_FORMAT" " |
517 "_containing_set: "PTR_FORMAT, | 517 "_containing_set: "PTR_FORMAT, |
518 containing_set, _containing_set)); | 518 containing_set, _containing_set)); |
519 | 519 |
520 _containing_set = containing_set; | 520 _containing_set = containing_set; |
521 } | 521 } |
522 | 522 |
523 HeapRegionSetBase* containing_set() { return _containing_set; } | 523 HeapRegionSetBase* containing_set() { return _containing_set; } |
524 #else // ASSERT | 524 #else // ASSERT |
525 void set_containing_set(HeapRegionSetBase* containing_set) { } | 525 void set_containing_set(HeapRegionSetBase* containing_set) { } |
526 | 526 |
527 // containing_set() is only used in asserts so there's not reason | 527 // containing_set() is only used in asserts so there's no reason |
528 // to provide a dummy version of it. | 528 // to provide a dummy version of it. |
529 #endif // ASSERT | 529 #endif // ASSERT |
530 | 530 |
531 // If we want to remove regions from a list in bulk we can simply tag | 531 // If we want to remove regions from a list in bulk we can simply tag |
532 // them with the pending_removal tag and call the | 532 // them with the pending_removal tag and call the |
533 // remove_all_pending() method on the list. | 533 // remove_all_pending() method on the list. |
534 | 534 |
535 bool pending_removal() { return _pending_removal; } | 535 bool pending_removal() { return _pending_removal; } |
536 | 536 |
537 void set_pending_removal(bool pending_removal) { | 537 void set_pending_removal(bool pending_removal) { |
538 // We can only set pending_removal to true, if it's false and the | 538 if (pending_removal) { |
539 // region belongs to a set. | 539 assert(!_pending_removal && containing_set() != NULL, |
540 assert(!pending_removal || | 540 "can only set pending removal to true if it's false and " |
541 (!_pending_removal && containing_set() != NULL), "pre-condition"); | 541 "the region belongs to a region set"); |
542 // We can only set pending_removal to false, if it's true and the | 542 } else { |
543 // region does not belong to a set. | 543 assert( _pending_removal && containing_set() == NULL, |
544 assert( pending_removal || | 544 "can only set pending removal to false if it's true and " |
545 ( _pending_removal && containing_set() == NULL), "pre-condition"); | 545 "the region does not belong to a region set"); |
546 } | |
546 | 547 |
547 _pending_removal = pending_removal; | 548 _pending_removal = pending_removal; |
548 } | 549 } |
549 | 550 |
550 HeapRegion* get_next_young_region() { return _next_young_region; } | 551 HeapRegion* get_next_young_region() { return _next_young_region; } |