< prev index next >

src/hotspot/share/gc/shared/ageTable.cpp

Print this page

 54       char age_name[10];
 55       jio_snprintf(age_name, sizeof(age_name), "%2.2d", age);
 56       const char* cname = PerfDataManager::counter_name(bytes_ns, age_name);
 57       _perf_sizes[age] = PerfDataManager::create_variable(SUN_GC, cname,
 58                                                           PerfData::U_Bytes,
 59                                                           CHECK);
 60     }
 61 
 62     const char* cname = PerfDataManager::counter_name(agetable_ns, "size");
 63     PerfDataManager::create_constant(SUN_GC, cname, PerfData::U_None,
 64                                      table_size, CHECK);
 65   }
 66 }
 67 
 68 void AgeTable::clear() {
 69   for (size_t* p = sizes; p < sizes + table_size; ++p) {
 70     *p = 0;
 71   }
 72 }
 73 









 74 void AgeTable::merge(const AgeTable* subTable) {
 75   for (int i = 0; i < table_size; i++) {
 76     sizes[i]+= subTable->sizes[i];
 77   }
 78 }
 79 
 80 uint AgeTable::compute_tenuring_threshold(size_t desired_survivor_size) {
 81   uint result;
 82 
 83   if (AlwaysTenure || NeverTenure) {
 84     assert(MaxTenuringThreshold == 0 || MaxTenuringThreshold == markWord::max_age + 1,
 85            "MaxTenuringThreshold should be 0 or markWord::max_age + 1, but is " UINTX_FORMAT, MaxTenuringThreshold);
 86     result = MaxTenuringThreshold;
 87   } else {
 88     size_t total = 0;
 89     uint age = 1;
 90     assert(sizes[0] == 0, "no objects with age zero should be recorded");
 91     while (age < table_size) {
 92       total += sizes[age];
 93       // check if including objects of age 'age' made us pass the desired

 54       char age_name[10];
 55       jio_snprintf(age_name, sizeof(age_name), "%2.2d", age);
 56       const char* cname = PerfDataManager::counter_name(bytes_ns, age_name);
 57       _perf_sizes[age] = PerfDataManager::create_variable(SUN_GC, cname,
 58                                                           PerfData::U_Bytes,
 59                                                           CHECK);
 60     }
 61 
 62     const char* cname = PerfDataManager::counter_name(agetable_ns, "size");
 63     PerfDataManager::create_constant(SUN_GC, cname, PerfData::U_None,
 64                                      table_size, CHECK);
 65   }
 66 }
 67 
 68 void AgeTable::clear() {
 69   for (size_t* p = sizes; p < sizes + table_size; ++p) {
 70     *p = 0;
 71   }
 72 }
 73 
 74 #ifndef PRODUCT
 75 bool AgeTable::is_clear() const {
 76   for (const size_t* p = sizes; p < sizes + table_size; ++p) {
 77     if (*p != 0) return false;
 78   }
 79   return true;
 80 }
 81 #endif // !PRODUCT
 82 
 83 void AgeTable::merge(const AgeTable* subTable) {
 84   for (int i = 0; i < table_size; i++) {
 85     sizes[i]+= subTable->sizes[i];
 86   }
 87 }
 88 
 89 uint AgeTable::compute_tenuring_threshold(size_t desired_survivor_size) {
 90   uint result;
 91 
 92   if (AlwaysTenure || NeverTenure) {
 93     assert(MaxTenuringThreshold == 0 || MaxTenuringThreshold == markWord::max_age + 1,
 94            "MaxTenuringThreshold should be 0 or markWord::max_age + 1, but is " UINTX_FORMAT, MaxTenuringThreshold);
 95     result = MaxTenuringThreshold;
 96   } else {
 97     size_t total = 0;
 98     uint age = 1;
 99     assert(sizes[0] == 0, "no objects with age zero should be recorded");
100     while (age < table_size) {
101       total += sizes[age];
102       // check if including objects of age 'age' made us pass the desired
< prev index next >