src/share/vm/oops/klassVtable.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File 6845426 Cdiff src/share/vm/oops/klassVtable.cpp

src/share/vm/oops/klassVtable.cpp

Print this page
rev 2113 : 6845426: non-static <clinit> method with no args is called during the class initialization process
Summary: Only call <clinit> with ACC_STATIC for classfiles with version > 50
Reviewed-by:

*** 881,891 **** assert(nof_methods > 0, "at least one method must exist for interface to be in vtable"); Handle interface_loader (THREAD, instanceKlass::cast(interf_h())->class_loader()); int ime_num = 0; // Skip first methodOop if it is a class initializer ! int i = ((methodOop)methods()->obj_at(0))->name() != vmSymbols::class_initializer_name() ? 0 : 1; // m, method_name, method_signature, klass reset each loop so they // don't need preserving across check_signature_loaders call // methods needs a handle in case of gc from check_signature_loaders for(; i < nof_methods; i++) { --- 881,891 ---- assert(nof_methods > 0, "at least one method must exist for interface to be in vtable"); Handle interface_loader (THREAD, instanceKlass::cast(interf_h())->class_loader()); int ime_num = 0; // Skip first methodOop if it is a class initializer ! int i = ((methodOop)methods()->obj_at(0))->is_static_initializer() ? 1 : 0; // m, method_name, method_signature, klass reset each loop so they // don't need preserving across check_signature_loaders call // methods needs a handle in case of gc from check_signature_loaders for(; i < nof_methods; i++) {
*** 1119,1129 **** while(methods->obj_at(index) != m) { index++; assert(index < methods->length(), "should find index for resolve_invoke"); } // Adjust for <clinit>, which is left out of table if first method ! if (methods->length() > 0 && ((methodOop)methods->obj_at(0))->name() == vmSymbols::class_initializer_name()) { index--; } return index; } --- 1119,1129 ---- while(methods->obj_at(index) != m) { index++; assert(index < methods->length(), "should find index for resolve_invoke"); } // Adjust for <clinit>, which is left out of table if first method ! if (methods->length() > 0 && ((methodOop)methods->obj_at(0))->is_static_initializer()) { index--; } return index; }
*** 1133,1143 **** assert(instanceKlass::cast(intf)->is_interface(), "sanity check"); objArrayOop methods = instanceKlass::cast(intf)->methods(); int index = itable_index; // Adjust for <clinit>, which is left out of table if first method ! if (methods->length() > 0 && ((methodOop)methods->obj_at(0))->name() == vmSymbols::class_initializer_name()) { index++; } if (itable_index < 0 || index >= methods->length()) return NULL; // help caller defend against bad indexes --- 1133,1143 ---- assert(instanceKlass::cast(intf)->is_interface(), "sanity check"); objArrayOop methods = instanceKlass::cast(intf)->methods(); int index = itable_index; // Adjust for <clinit>, which is left out of table if first method ! if (methods->length() > 0 && ((methodOop)methods->obj_at(0))->is_static_initializer()) { index++; } if (itable_index < 0 || index >= methods->length()) return NULL; // help caller defend against bad indexes
src/share/vm/oops/klassVtable.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File