< prev index next >

src/share/vm/gc_implementation/g1/g1CollectorPolicy.hpp

Print this page
rev 7471 : 8060025: Object copy time regressions after JDK-8031323 and JDK-8057536
Summary: Evaluate and improve object copy time by micro-optimizations and splitting out slow and fast paths aggressively.
Reviewed-by:
Contributed-by: Tony Printezis <tprintezis@twitter.com>, Thomas Schatzl <thomas.schatzl@oracle.com>
rev 7473 : imported patch mikael-refactor-cset-state


 864 
 865   size_t _eden_used_bytes_before_gc;         // Eden occupancy before GC
 866   size_t _survivor_used_bytes_before_gc;     // Survivor occupancy before GC
 867   size_t _heap_used_bytes_before_gc;         // Heap occupancy before GC
 868   size_t _metaspace_used_bytes_before_gc;    // Metaspace occupancy before GC
 869 
 870   size_t _eden_capacity_bytes_before_gc;     // Eden capacity before GC
 871   size_t _heap_capacity_bytes_before_gc;     // Heap capacity before GC
 872 
 873   // The amount of survivor regions after a collection.
 874   uint _recorded_survivor_regions;
 875   // List of survivor regions.
 876   HeapRegion* _recorded_survivor_head;
 877   HeapRegion* _recorded_survivor_tail;
 878 
 879   ageTable _survivors_age_table;
 880 
 881 public:
 882   uint tenuring_threshold() const { return _tenuring_threshold; }
 883 
 884   inline GCAllocPurpose
 885     evacuation_destination(HeapRegion* src_region, uint age, size_t word_sz) {
 886       if (age < _tenuring_threshold && src_region->is_young()) {
 887         return GCAllocForSurvived;
 888       } else {
 889         return GCAllocForTenured;
 890       }
 891   }
 892 
 893   inline bool track_object_age(GCAllocPurpose purpose) {
 894     return purpose == GCAllocForSurvived;
 895   }
 896 
 897   static const uint REGIONS_UNLIMITED = (uint) -1;
 898 
 899   uint max_regions(int purpose);
 900 
 901   // The limit on regions for a particular purpose is reached.
 902   void note_alloc_region_limit_reached(int purpose) {
 903     if (purpose == GCAllocForSurvived) {
 904       _tenuring_threshold = 0;



 905     }


 906   }
 907 
 908   void note_start_adding_survivor_regions() {
 909     _survivor_surv_rate_group->start_adding_regions();
 910   }
 911 
 912   void note_stop_adding_survivor_regions() {
 913     _survivor_surv_rate_group->stop_adding_regions();
 914   }
 915 
 916   void record_survivor_regions(uint regions,
 917                                HeapRegion* head,
 918                                HeapRegion* tail) {
 919     _recorded_survivor_regions = regions;
 920     _recorded_survivor_head    = head;
 921     _recorded_survivor_tail    = tail;
 922   }
 923 
 924   uint recorded_survivor_regions() {
 925     return _recorded_survivor_regions;




 864 
 865   size_t _eden_used_bytes_before_gc;         // Eden occupancy before GC
 866   size_t _survivor_used_bytes_before_gc;     // Survivor occupancy before GC
 867   size_t _heap_used_bytes_before_gc;         // Heap occupancy before GC
 868   size_t _metaspace_used_bytes_before_gc;    // Metaspace occupancy before GC
 869 
 870   size_t _eden_capacity_bytes_before_gc;     // Eden capacity before GC
 871   size_t _heap_capacity_bytes_before_gc;     // Heap capacity before GC
 872 
 873   // The amount of survivor regions after a collection.
 874   uint _recorded_survivor_regions;
 875   // List of survivor regions.
 876   HeapRegion* _recorded_survivor_head;
 877   HeapRegion* _recorded_survivor_tail;
 878 
 879   ageTable _survivors_age_table;
 880 
 881 public:
 882   uint tenuring_threshold() const { return _tenuring_threshold; }
 883 













 884   static const uint REGIONS_UNLIMITED = (uint) -1;
 885 
 886   uint max_regions(InCSetState dest) {
 887     switch (dest.value()) {
 888       case InCSetState::Young:
 889         return _max_survivor_regions;
 890       case InCSetState::Old:
 891         return REGIONS_UNLIMITED;
 892       default:
 893         assert(false, err_msg("Unknown dest state: %d", dest.value()));
 894         break;
 895     }
 896     // keep some compilers happy
 897     return 0;
 898   }
 899 
 900   void note_start_adding_survivor_regions() {
 901     _survivor_surv_rate_group->start_adding_regions();
 902   }
 903 
 904   void note_stop_adding_survivor_regions() {
 905     _survivor_surv_rate_group->stop_adding_regions();
 906   }
 907 
 908   void record_survivor_regions(uint regions,
 909                                HeapRegion* head,
 910                                HeapRegion* tail) {
 911     _recorded_survivor_regions = regions;
 912     _recorded_survivor_head    = head;
 913     _recorded_survivor_tail    = tail;
 914   }
 915 
 916   uint recorded_survivor_regions() {
 917     return _recorded_survivor_regions;


< prev index next >