79 type = db.lookupType("Generation::StatRecord"); |
79 type = db.lookupType("Generation::StatRecord"); |
80 invocationField = type.getCIntegerField("invocations"); |
80 invocationField = type.getCIntegerField("invocations"); |
81 |
81 |
82 // constants from Generation::Name |
82 // constants from Generation::Name |
83 NAME_DEF_NEW = db.lookupIntConstant("Generation::DefNew").intValue(); |
83 NAME_DEF_NEW = db.lookupIntConstant("Generation::DefNew").intValue(); |
84 NAME_PAR_NEW = db.lookupIntConstant("Generation::ParNew").intValue(); |
|
85 NAME_MARK_SWEEP_COMPACT = db.lookupIntConstant("Generation::MarkSweepCompact").intValue(); |
84 NAME_MARK_SWEEP_COMPACT = db.lookupIntConstant("Generation::MarkSweepCompact").intValue(); |
86 NAME_CONCURRENT_MARK_SWEEP = db.lookupIntConstant("Generation::ConcurrentMarkSweep").intValue(); |
|
87 NAME_OTHER = db.lookupIntConstant("Generation::Other").intValue(); |
85 NAME_OTHER = db.lookupIntConstant("Generation::Other").intValue(); |
88 } |
86 } |
89 |
87 |
90 public Generation(Address addr) { |
88 public Generation(Address addr) { |
91 super(addr); |
89 super(addr); |
92 } |
90 } |
93 |
91 |
94 public static class Name { |
92 public static class Name { |
95 public static final Name DEF_NEW = new Name("DefNew"); |
93 public static final Name DEF_NEW = new Name("DefNew"); |
96 public static final Name PAR_NEW = new Name("ParNew"); |
|
97 public static final Name MARK_SWEEP_COMPACT = new Name("MarkSweepCompact"); |
94 public static final Name MARK_SWEEP_COMPACT = new Name("MarkSweepCompact"); |
98 public static final Name CONCURRENT_MARK_SWEEP = new Name("ConcurrentMarkSweep"); |
|
99 public static final Name OTHER = new Name("Other"); |
95 public static final Name OTHER = new Name("Other"); |
100 |
96 |
101 private Name(String value) { |
97 private Name(String value) { |
102 this.value = value; |
98 this.value = value; |
103 } |
99 } |
113 } |
109 } |
114 |
110 |
115 static Generation.Name nameForEnum(int value) { |
111 static Generation.Name nameForEnum(int value) { |
116 if (value == NAME_DEF_NEW) { |
112 if (value == NAME_DEF_NEW) { |
117 return Name.DEF_NEW; |
113 return Name.DEF_NEW; |
118 } else if (value == NAME_PAR_NEW) { |
|
119 return Name.PAR_NEW; |
|
120 } else if (value == NAME_MARK_SWEEP_COMPACT) { |
114 } else if (value == NAME_MARK_SWEEP_COMPACT) { |
121 return Name.MARK_SWEEP_COMPACT; |
115 return Name.MARK_SWEEP_COMPACT; |
122 } else if (value == NAME_CONCURRENT_MARK_SWEEP) { |
|
123 return Name.CONCURRENT_MARK_SWEEP; |
|
124 } else if (value == NAME_OTHER) { |
116 } else if (value == NAME_OTHER) { |
125 return Name.OTHER; |
117 return Name.OTHER; |
126 } else { |
118 } else { |
127 throw new RuntimeException("should not reach here"); |
119 throw new RuntimeException("should not reach here"); |
128 } |
120 } |