comparison src/share/vm/memory/heapInspection.hpp @ 10265:92ef81e2f571

8003557: NPG: Klass* const k should be const Klass* k. Summary: With NPG, const KlassOop klass which is in fact a definition converted to Klass* const, which is not the original intention. The right usage is converting them to const Klass*. Reviewed-by: coleenp, kvn Contributed-by: yumin.qi@oracle.com
author minqi
date Fri, 10 May 2013 08:27:30 -0700
parents 927a311d00f9
children f2110083203d
comparison
equal deleted inserted replaced
10262:c272092594bd 10265:92ef81e2f571
187 187
188 public: 188 public:
189 KlassInfoEntry(Klass* k, KlassInfoEntry* next) : 189 KlassInfoEntry(Klass* k, KlassInfoEntry* next) :
190 _klass(k), _instance_count(0), _instance_words(0), _next(next), _index(-1) 190 _klass(k), _instance_count(0), _instance_words(0), _next(next), _index(-1)
191 {} 191 {}
192 KlassInfoEntry* next() { return _next; } 192 KlassInfoEntry* next() const { return _next; }
193 bool is_equal(Klass* k) { return k == _klass; } 193 bool is_equal(const Klass* k) { return k == _klass; }
194 Klass* klass() { return _klass; } 194 Klass* klass() const { return _klass; }
195 long count() { return _instance_count; } 195 long count() const { return _instance_count; }
196 void set_count(long ct) { _instance_count = ct; } 196 void set_count(long ct) { _instance_count = ct; }
197 size_t words() { return _instance_words; } 197 size_t words() const { return _instance_words; }
198 void set_words(size_t wds) { _instance_words = wds; } 198 void set_words(size_t wds) { _instance_words = wds; }
199 void set_index(long index) { _index = index; } 199 void set_index(long index) { _index = index; }
200 long index() { return _index; } 200 long index() const { return _index; }
201 int compare(KlassInfoEntry* e1, KlassInfoEntry* e2); 201 int compare(KlassInfoEntry* e1, KlassInfoEntry* e2);
202 void print_on(outputStream* st) const; 202 void print_on(outputStream* st) const;
203 const char* name() const; 203 const char* name() const;
204 }; 204 };
205 205
213 private: 213 private:
214 KlassInfoEntry* _list; 214 KlassInfoEntry* _list;
215 KlassInfoEntry* list() { return _list; } 215 KlassInfoEntry* list() { return _list; }
216 void set_list(KlassInfoEntry* l) { _list = l; } 216 void set_list(KlassInfoEntry* l) { _list = l; }
217 public: 217 public:
218 KlassInfoEntry* lookup(Klass* const k); 218 KlassInfoEntry* lookup(Klass* k);
219 void initialize() { _list = NULL; } 219 void initialize() { _list = NULL; }
220 void empty(); 220 void empty();
221 void iterate(KlassInfoClosure* cic); 221 void iterate(KlassInfoClosure* cic);
222 }; 222 };
223 223
229 // address in the perm gen) used for hashing klass 229 // address in the perm gen) used for hashing klass
230 // objects. 230 // objects.
231 HeapWord* _ref; 231 HeapWord* _ref;
232 232
233 KlassInfoBucket* _buckets; 233 KlassInfoBucket* _buckets;
234 uint hash(Klass* p); 234 uint hash(const Klass* p);
235 KlassInfoEntry* lookup(Klass* const k); // allocates if not found! 235 KlassInfoEntry* lookup(Klass* k); // allocates if not found!
236 236
237 class AllClassesFinder : public KlassClosure { 237 class AllClassesFinder : public KlassClosure {
238 KlassInfoTable *_table; 238 KlassInfoTable *_table;
239 public: 239 public:
240 AllClassesFinder(KlassInfoTable* table) : _table(table) {} 240 AllClassesFinder(KlassInfoTable* table) : _table(table) {}