20 * CA 95054 USA or visit www.sun.com if you need additional information or |
20 * CA 95054 USA or visit www.sun.com if you need additional information or |
21 * have any questions. |
21 * have any questions. |
22 * |
22 * |
23 */ |
23 */ |
24 |
24 |
25 class constantPoolCacheKlass: public arrayKlass { |
25 class constantPoolCacheKlass: public Klass { |
|
26 juint _alloc_size; // allocation profiling support |
26 public: |
27 public: |
27 // Dispatched klass operations |
28 // Dispatched klass operations |
28 bool oop_is_constantPoolCache() const { return true; } |
29 bool oop_is_constantPoolCache() const { return true; } |
29 int oop_size(oop obj) const; |
30 int oop_size(oop obj) const; |
30 int klass_oop_size() const { return object_size(); } |
31 int klass_oop_size() const { return object_size(); } |
39 assert(k->klass_part()->oop_is_constantPoolCache(), "cast to constantPoolCacheKlass"); |
40 assert(k->klass_part()->oop_is_constantPoolCache(), "cast to constantPoolCacheKlass"); |
40 return (constantPoolCacheKlass*)k->klass_part(); |
41 return (constantPoolCacheKlass*)k->klass_part(); |
41 } |
42 } |
42 |
43 |
43 // Sizing |
44 // Sizing |
44 static int header_size() { return oopDesc::header_size() + sizeof(constantPoolCacheKlass)/HeapWordSize; } |
45 static int header_size() { return oopDesc::header_size() + sizeof(constantPoolCacheKlass)/HeapWordSize; } |
45 int object_size() const { return arrayKlass::object_size(header_size()); } |
46 int object_size() const { return align_object_size(header_size()); } |
46 |
47 |
47 // Garbage collection |
48 // Garbage collection |
48 void oop_follow_contents(oop obj); |
49 void oop_follow_contents(oop obj); |
49 int oop_adjust_pointers(oop obj); |
50 int oop_adjust_pointers(oop obj); |
50 |
51 |
53 |
54 |
54 // Iterators |
55 // Iterators |
55 int oop_oop_iterate(oop obj, OopClosure* blk); |
56 int oop_oop_iterate(oop obj, OopClosure* blk); |
56 int oop_oop_iterate_m(oop obj, OopClosure* blk, MemRegion mr); |
57 int oop_oop_iterate_m(oop obj, OopClosure* blk, MemRegion mr); |
57 |
58 |
|
59 // Allocation profiling support |
|
60 juint alloc_size() const { return _alloc_size; } |
|
61 void set_alloc_size(juint n) { _alloc_size = n; } |
|
62 |
58 #ifndef PRODUCT |
63 #ifndef PRODUCT |
59 public: |
64 public: |
60 // Printing |
65 // Printing |
61 void oop_print_on(oop obj, outputStream* st); |
66 void oop_print_on(oop obj, outputStream* st); |
62 #endif |
67 #endif |