253 static const uint InvalidCSetIndex = UINT_MAX; |
253 static const uint InvalidCSetIndex = UINT_MAX; |
254 |
254 |
255 // The index in the optional regions array, if this region |
255 // The index in the optional regions array, if this region |
256 // is considered optional during a mixed collections. |
256 // is considered optional during a mixed collections. |
257 uint _index_in_opt_cset; |
257 uint _index_in_opt_cset; |
258 int _young_index_in_cset; |
258 |
|
259 // Data for young region survivor prediction. |
|
260 uint _young_index_in_cset; |
259 SurvRateGroup* _surv_rate_group; |
261 SurvRateGroup* _surv_rate_group; |
260 int _age_index; |
262 int _age_index; |
261 |
263 |
262 // The start of the unmarked area. The unmarked area extends from this |
264 // The start of the unmarked area. The unmarked area extends from this |
263 // word until the top and/or end of the region, and is the part |
265 // word until the top and/or end of the region, and is the part |
561 } |
563 } |
562 bool has_index_in_opt_cset() const { return _index_in_opt_cset != InvalidCSetIndex; } |
564 bool has_index_in_opt_cset() const { return _index_in_opt_cset != InvalidCSetIndex; } |
563 void set_index_in_opt_cset(uint index) { _index_in_opt_cset = index; } |
565 void set_index_in_opt_cset(uint index) { _index_in_opt_cset = index; } |
564 void clear_index_in_opt_cset() { _index_in_opt_cset = InvalidCSetIndex; } |
566 void clear_index_in_opt_cset() { _index_in_opt_cset = InvalidCSetIndex; } |
565 |
567 |
566 int young_index_in_cset() const { return _young_index_in_cset; } |
568 uint young_index_in_cset() const { return _young_index_in_cset; } |
567 void set_young_index_in_cset(int index) { |
569 void clear_young_index_in_cset() { _young_index_in_cset = 0; } |
568 assert( (index == -1) || is_young(), "pre-condition" ); |
570 void set_young_index_in_cset(uint index) { |
|
571 assert(index != UINT_MAX, "just checking"); |
|
572 assert(index != 0, "just checking"); |
|
573 assert(is_young(), "pre-condition"); |
569 _young_index_in_cset = index; |
574 _young_index_in_cset = index; |
570 } |
575 } |
571 |
576 |
572 int age_in_surv_rate_group() { |
577 int age_in_surv_rate_group() { |
573 assert( _surv_rate_group != NULL, "pre-condition" ); |
578 assert(_surv_rate_group != NULL, "pre-condition"); |
574 assert( _age_index > -1, "pre-condition" ); |
579 assert(_age_index > -1, "pre-condition"); |
575 return _surv_rate_group->age_in_group(_age_index); |
580 return _surv_rate_group->age_in_group(_age_index); |
576 } |
581 } |
577 |
582 |
578 void record_surv_words_in_group(size_t words_survived) { |
583 void record_surv_words_in_group(size_t words_survived) { |
579 assert( _surv_rate_group != NULL, "pre-condition" ); |
584 assert(_surv_rate_group != NULL, "pre-condition"); |
580 assert( _age_index > -1, "pre-condition" ); |
585 assert(_age_index > -1, "pre-condition"); |
581 int age_in_group = age_in_surv_rate_group(); |
586 int age_in_group = age_in_surv_rate_group(); |
582 _surv_rate_group->record_surviving_words(age_in_group, words_survived); |
587 _surv_rate_group->record_surviving_words(age_in_group, words_survived); |
583 } |
588 } |
584 |
589 |
585 int age_in_surv_rate_group_cond() { |
590 int age_in_surv_rate_group_cond() { |
592 SurvRateGroup* surv_rate_group() { |
597 SurvRateGroup* surv_rate_group() { |
593 return _surv_rate_group; |
598 return _surv_rate_group; |
594 } |
599 } |
595 |
600 |
596 void install_surv_rate_group(SurvRateGroup* surv_rate_group) { |
601 void install_surv_rate_group(SurvRateGroup* surv_rate_group) { |
597 assert( surv_rate_group != NULL, "pre-condition" ); |
602 assert(surv_rate_group != NULL, "pre-condition"); |
598 assert( _surv_rate_group == NULL, "pre-condition" ); |
603 assert(_surv_rate_group == NULL, "pre-condition"); |
599 assert( is_young(), "pre-condition" ); |
604 assert(is_young(), "pre-condition"); |
600 |
605 |
601 _surv_rate_group = surv_rate_group; |
606 _surv_rate_group = surv_rate_group; |
602 _age_index = surv_rate_group->next_age_index(); |
607 _age_index = surv_rate_group->next_age_index(); |
603 } |
608 } |
604 |
609 |
605 void uninstall_surv_rate_group() { |
610 void uninstall_surv_rate_group() { |
606 if (_surv_rate_group != NULL) { |
611 if (_surv_rate_group != NULL) { |
607 assert( _age_index > -1, "pre-condition" ); |
612 assert(_age_index > -1, "pre-condition"); |
608 assert( is_young(), "pre-condition" ); |
613 assert(is_young(), "pre-condition"); |
609 |
614 |
610 _surv_rate_group = NULL; |
615 _surv_rate_group = NULL; |
611 _age_index = -1; |
616 _age_index = -1; |
612 } else { |
617 } else { |
613 assert( _age_index == -1, "pre-condition" ); |
618 assert(_age_index == -1, "pre-condition"); |
614 } |
619 } |
615 } |
620 } |
616 |
621 |
617 void set_free(); |
622 void set_free(); |
618 |
623 |