equal
deleted
inserted
replaced
150 |
150 |
151 // Note: Arrays can have intermediate array supers. Use java_super to skip them. |
151 // Note: Arrays can have intermediate array supers. Use java_super to skip them. |
152 KlassHandle super (THREAD, klass()->java_super()); |
152 KlassHandle super (THREAD, klass()->java_super()); |
153 int nofNewEntries = 0; |
153 int nofNewEntries = 0; |
154 |
154 |
155 if (PrintVtables && !klass()->oop_is_array()) { |
155 if (PrintVtables && !klass()->is_array_klass()) { |
156 ResourceMark rm(THREAD); |
156 ResourceMark rm(THREAD); |
157 tty->print_cr("Initializing: %s", _klass->name()->as_C_string()); |
157 tty->print_cr("Initializing: %s", _klass->name()->as_C_string()); |
158 } |
158 } |
159 |
159 |
160 #ifdef ASSERT |
160 #ifdef ASSERT |
168 for (int i = 0; i < _length; i++) table()[i].clear(); |
168 for (int i = 0; i < _length; i++) table()[i].clear(); |
169 return; |
169 return; |
170 } |
170 } |
171 |
171 |
172 int super_vtable_len = initialize_from_super(super); |
172 int super_vtable_len = initialize_from_super(super); |
173 if (klass()->oop_is_array()) { |
173 if (klass()->is_array_klass()) { |
174 assert(super_vtable_len == _length, "arrays shouldn't introduce new methods"); |
174 assert(super_vtable_len == _length, "arrays shouldn't introduce new methods"); |
175 } else { |
175 } else { |
176 assert(_klass->oop_is_instance(), "must be InstanceKlass"); |
176 assert(_klass->is_instance_klass(), "must be InstanceKlass"); |
177 |
177 |
178 Array<Method*>* methods = ik()->methods(); |
178 Array<Method*>* methods = ik()->methods(); |
179 int len = methods->length(); |
179 int len = methods->length(); |
180 int initialized = super_vtable_len; |
180 int initialized = super_vtable_len; |
181 |
181 |
310 bool klassVtable::update_inherited_vtable(InstanceKlass* klass, methodHandle target_method, |
310 bool klassVtable::update_inherited_vtable(InstanceKlass* klass, methodHandle target_method, |
311 int super_vtable_len, int default_index, |
311 int super_vtable_len, int default_index, |
312 bool checkconstraints, TRAPS) { |
312 bool checkconstraints, TRAPS) { |
313 ResourceMark rm; |
313 ResourceMark rm; |
314 bool allocate_new = true; |
314 bool allocate_new = true; |
315 assert(klass->oop_is_instance(), "must be InstanceKlass"); |
315 assert(klass->is_instance_klass(), "must be InstanceKlass"); |
316 |
316 |
317 Array<int>* def_vtable_indices = NULL; |
317 Array<int>* def_vtable_indices = NULL; |
318 bool is_default = false; |
318 bool is_default = false; |
319 // default methods are concrete methods in superinterfaces which are added to the vtable |
319 // default methods are concrete methods in superinterfaces which are added to the vtable |
320 // with their real method_holder |
320 // with their real method_holder |
1108 assert(ime_num == method_count_for_interface(klass), "proper sizing"); |
1108 assert(ime_num == method_count_for_interface(klass), "proper sizing"); |
1109 return ime_num; |
1109 return ime_num; |
1110 } |
1110 } |
1111 |
1111 |
1112 int klassItable::method_count_for_interface(Klass* interf) { |
1112 int klassItable::method_count_for_interface(Klass* interf) { |
1113 assert(interf->oop_is_instance(), "must be"); |
1113 assert(interf->is_instance_klass(), "must be"); |
1114 assert(interf->is_interface(), "must be"); |
1114 assert(interf->is_interface(), "must be"); |
1115 Array<Method*>* methods = InstanceKlass::cast(interf)->methods(); |
1115 Array<Method*>* methods = InstanceKlass::cast(interf)->methods(); |
1116 int nof_methods = methods->length(); |
1116 int nof_methods = methods->length(); |
1117 int length = 0; |
1117 int length = 0; |
1118 while (nof_methods > 0) { |
1118 while (nof_methods > 0) { |
1525 static void do_class(Klass* k) { |
1525 static void do_class(Klass* k) { |
1526 Klass* kl = k; |
1526 Klass* kl = k; |
1527 klassVtable* vt = kl->vtable(); |
1527 klassVtable* vt = kl->vtable(); |
1528 if (vt == NULL) return; |
1528 if (vt == NULL) return; |
1529 no_klasses++; |
1529 no_klasses++; |
1530 if (kl->oop_is_instance()) { |
1530 if (kl->is_instance_klass()) { |
1531 no_instance_klasses++; |
1531 no_instance_klasses++; |
1532 kl->array_klasses_do(do_class); |
1532 kl->array_klasses_do(do_class); |
1533 } |
1533 } |
1534 if (kl->oop_is_array()) { |
1534 if (kl->is_array_klass()) { |
1535 no_array_klasses++; |
1535 no_array_klasses++; |
1536 sum_of_array_vtable_len += vt->length(); |
1536 sum_of_array_vtable_len += vt->length(); |
1537 } |
1537 } |
1538 sum_of_vtable_len += vt->length(); |
1538 sum_of_vtable_len += vt->length(); |
1539 } |
1539 } |