42 inline InstanceKlass* klassVtable::ik() const {
43 return InstanceKlass::cast(_klass());
44 }
45
46
47 // this function computes the vtable size (including the size needed for miranda
48 // methods) and the number of miranda methods in this class.
49 // Note on Miranda methods: Let's say there is a class C that implements
50 // interface I, and none of C's superclasses implements I.
51 // Let's say there is an abstract method m in I that neither C
52 // nor any of its super classes implement (i.e there is no method of any access,
53 // with the same name and signature as m), then m is a Miranda method which is
54 // entered as a public abstract method in C's vtable. From then on it should
55 // treated as any other public method in C for method over-ride purposes.
56 void klassVtable::compute_vtable_size_and_num_mirandas(
57 int* vtable_length_ret, int* num_new_mirandas,
58 GrowableArray<Method*>* all_mirandas, const Klass* super,
59 Array<Method*>* methods, AccessFlags class_flags,
60 Handle classloader, Symbol* classname, Array<Klass*>* local_interfaces,
61 TRAPS) {
62 No_Safepoint_Verifier nsv;
63
64 // set up default result values
65 int vtable_length = 0;
66
67 // start off with super's vtable length
68 vtable_length = super == NULL ? 0 : super->vtable_length();
69
70 // go thru each method in the methods table to see if it needs a new entry
71 int len = methods->length();
72 for (int i = 0; i < len; i++) {
73 assert(methods->at(i)->is_method(), "must be a Method*");
74 methodHandle mh(THREAD, methods->at(i));
75
76 if (needs_new_vtable_entry(mh, super, classloader, classname, class_flags, THREAD)) {
77 vtable_length += vtableEntry::size(); // we need a new entry
78 }
79 }
80
81 GrowableArray<Method*> new_mirandas(20);
82 // compute the number of mirandas methods that must be added to the end
|
42 inline InstanceKlass* klassVtable::ik() const {
43 return InstanceKlass::cast(_klass());
44 }
45
46
47 // this function computes the vtable size (including the size needed for miranda
48 // methods) and the number of miranda methods in this class.
49 // Note on Miranda methods: Let's say there is a class C that implements
50 // interface I, and none of C's superclasses implements I.
51 // Let's say there is an abstract method m in I that neither C
52 // nor any of its super classes implement (i.e there is no method of any access,
53 // with the same name and signature as m), then m is a Miranda method which is
54 // entered as a public abstract method in C's vtable. From then on it should
55 // treated as any other public method in C for method over-ride purposes.
56 void klassVtable::compute_vtable_size_and_num_mirandas(
57 int* vtable_length_ret, int* num_new_mirandas,
58 GrowableArray<Method*>* all_mirandas, const Klass* super,
59 Array<Method*>* methods, AccessFlags class_flags,
60 Handle classloader, Symbol* classname, Array<Klass*>* local_interfaces,
61 TRAPS) {
62 NoSafepointVerifier nsv;
63
64 // set up default result values
65 int vtable_length = 0;
66
67 // start off with super's vtable length
68 vtable_length = super == NULL ? 0 : super->vtable_length();
69
70 // go thru each method in the methods table to see if it needs a new entry
71 int len = methods->length();
72 for (int i = 0; i < len; i++) {
73 assert(methods->at(i)->is_method(), "must be a Method*");
74 methodHandle mh(THREAD, methods->at(i));
75
76 if (needs_new_vtable_entry(mh, super, classloader, classname, class_flags, THREAD)) {
77 vtable_length += vtableEntry::size(); // we need a new entry
78 }
79 }
80
81 GrowableArray<Method*> new_mirandas(20);
82 // compute the number of mirandas methods that must be added to the end
|