37 // Note: all sizes are in oops 38 39 class ageTable VALUE_OBJ_CLASS_SPEC { 40 friend class VMStructs; 41 42 public: 43 // constants 44 enum { table_size = markOopDesc::max_age + 1 }; 45 46 // instance variables 47 size_t sizes[table_size]; 48 49 // constructor. "global" indicates that this is the global age table 50 // (as opposed to gc-thread-local) 51 ageTable(bool global = true); 52 53 // clear table 54 void clear(); 55 56 // add entry 57 void add(oop p, size_t oop_size) { 58 uint age = p->age(); 59 assert(age > 0 && age < table_size, "invalid age of object"); 60 sizes[age] += oop_size; 61 } 62 63 // Merge another age table with the current one. Used 64 // for parallel young generation gc. 65 void merge(ageTable* subTable); 66 void merge_par(ageTable* subTable); 67 68 // calculate new tenuring threshold based on age information 69 uint compute_tenuring_threshold(size_t survivor_capacity); 70 71 private: 72 PerfVariable* _perf_sizes[table_size]; 73 }; 74 75 #endif // SHARE_VM_GC_IMPLEMENTATION_SHARED_AGETABLE_HPP | 37 // Note: all sizes are in oops 38 39 class ageTable VALUE_OBJ_CLASS_SPEC { 40 friend class VMStructs; 41 42 public: 43 // constants 44 enum { table_size = markOopDesc::max_age + 1 }; 45 46 // instance variables 47 size_t sizes[table_size]; 48 49 // constructor. "global" indicates that this is the global age table 50 // (as opposed to gc-thread-local) 51 ageTable(bool global = true); 52 53 // clear table 54 void clear(); 55 56 // add entry 57 void add(const oop p, const size_t oop_size) { 58 add(p->age(), oop_size); 59 } 60 61 void add(const uint age, const size_t oop_size) { 62 assert(age > 0 && age < table_size, "invalid age of object"); 63 sizes[age] += oop_size; 64 } 65 66 // Merge another age table with the current one. Used 67 // for parallel young generation gc. 68 void merge(ageTable* subTable); 69 void merge_par(ageTable* subTable); 70 71 // calculate new tenuring threshold based on age information 72 uint compute_tenuring_threshold(size_t survivor_capacity); 73 74 private: 75 PerfVariable* _perf_sizes[table_size]; 76 }; 77 78 #endif // SHARE_VM_GC_IMPLEMENTATION_SHARED_AGETABLE_HPP |