< 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() {
 76   size_t total = 0;
 77   for (size_t* p = sizes; p < sizes + table_size; ++p) {
 78     total += *p;
 79   }
 80   return total == 0;
 81 }
 82 #endif // !PRODUCT
 83 
 84 void AgeTable::merge(const AgeTable* subTable) {
 85   for (int i = 0; i < table_size; i++) {
 86     sizes[i]+= subTable->sizes[i];
 87   }
 88 }
 89 
 90 uint AgeTable::compute_tenuring_threshold(size_t desired_survivor_size) {
 91   uint result;
 92 
 93   if (AlwaysTenure || NeverTenure) {
 94     assert(MaxTenuringThreshold == 0 || MaxTenuringThreshold == markWord::max_age + 1,
 95            "MaxTenuringThreshold should be 0 or markWord::max_age + 1, but is " UINTX_FORMAT, MaxTenuringThreshold);
 96     result = MaxTenuringThreshold;
 97   } else {
 98     size_t total = 0;
 99     uint age = 1;
100     assert(sizes[0] == 0, "no objects with age zero should be recorded");
101     while (age < table_size) {
102       total += sizes[age];
103       // check if including objects of age 'age' made us pass the desired
< prev index next >