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