equal
deleted
inserted
replaced
27 |
27 |
28 constantPoolOop constantPoolKlass::allocate(int length, TRAPS) { |
28 constantPoolOop constantPoolKlass::allocate(int length, TRAPS) { |
29 int size = constantPoolOopDesc::object_size(length); |
29 int size = constantPoolOopDesc::object_size(length); |
30 KlassHandle klass (THREAD, as_klassOop()); |
30 KlassHandle klass (THREAD, as_klassOop()); |
31 constantPoolOop c = |
31 constantPoolOop c = |
32 (constantPoolOop)CollectedHeap::permanent_array_allocate(klass, size, length, CHECK_NULL); |
32 (constantPoolOop)CollectedHeap::permanent_obj_allocate(klass, size, CHECK_NULL); |
33 |
33 |
|
34 c->set_length(length); |
34 c->set_tags(NULL); |
35 c->set_tags(NULL); |
35 c->set_cache(NULL); |
36 c->set_cache(NULL); |
36 c->set_pool_holder(NULL); |
37 c->set_pool_holder(NULL); |
37 // only set to non-zero if constant pool is merged by RedefineClasses |
38 // only set to non-zero if constant pool is merged by RedefineClasses |
38 c->set_orig_length(0); |
39 c->set_orig_length(0); |
52 return pool(); |
53 return pool(); |
53 } |
54 } |
54 |
55 |
55 klassOop constantPoolKlass::create_klass(TRAPS) { |
56 klassOop constantPoolKlass::create_klass(TRAPS) { |
56 constantPoolKlass o; |
57 constantPoolKlass o; |
57 KlassHandle klassklass(THREAD, Universe::arrayKlassKlassObj()); |
58 KlassHandle h_this_klass(THREAD, Universe::klassKlassObj()); |
58 arrayKlassHandle k = base_create_array_klass(o.vtbl_value(), header_size(), klassklass, CHECK_NULL); |
59 KlassHandle k = base_create_klass(h_this_klass, header_size(), o.vtbl_value(), CHECK_NULL); |
59 arrayKlassHandle super (THREAD, k->super()); |
60 // Make sure size calculation is right |
60 complete_create_array_klass(k, super, CHECK_NULL); |
61 assert(k()->size() == align_object_size(header_size()), "wrong size for object"); |
|
62 java_lang_Class::create_mirror(k, CHECK_NULL); // Allocate mirror |
61 return k(); |
63 return k(); |
62 } |
64 } |
63 |
|
64 |
65 |
65 int constantPoolKlass::oop_size(oop obj) const { |
66 int constantPoolKlass::oop_size(oop obj) const { |
66 assert(obj->is_constantPool(), "must be constantPool"); |
67 assert(obj->is_constantPool(), "must be constantPool"); |
67 return constantPoolOop(obj)->object_size(); |
68 return constantPoolOop(obj)->object_size(); |
68 } |
69 } |
273 |
274 |
274 void constantPoolKlass::oop_print_on(oop obj, outputStream* st) { |
275 void constantPoolKlass::oop_print_on(oop obj, outputStream* st) { |
275 EXCEPTION_MARK; |
276 EXCEPTION_MARK; |
276 oop anObj; |
277 oop anObj; |
277 assert(obj->is_constantPool(), "must be constantPool"); |
278 assert(obj->is_constantPool(), "must be constantPool"); |
278 arrayKlass::oop_print_on(obj, st); |
279 Klass::oop_print_on(obj, st); |
279 constantPoolOop cp = constantPoolOop(obj); |
280 constantPoolOop cp = constantPoolOop(obj); |
280 |
281 |
281 // Temp. remove cache so we can do lookups with original indicies. |
282 // Temp. remove cache so we can do lookups with original indicies. |
282 constantPoolCacheHandle cache (THREAD, cp->cache()); |
283 constantPoolCacheHandle cache (THREAD, cp->cache()); |
283 cp->set_cache(NULL); |
284 cp->set_cache(NULL); |