< prev index next >

src/hotspot/share/oops/instanceKlass.cpp

Print this page




2625     result |= JVMTI_CLASS_STATUS_INITIALIZED;
2626   }
2627   if (is_in_error_state()) {
2628     result |= JVMTI_CLASS_STATUS_ERROR;
2629   }
2630   return result;
2631 }
2632 
2633 Method* InstanceKlass::method_at_itable(Klass* holder, int index, TRAPS) {
2634   itableOffsetEntry* ioe = (itableOffsetEntry*)start_of_itable();
2635   int method_table_offset_in_words = ioe->offset()/wordSize;
2636   int nof_interfaces = (method_table_offset_in_words - itable_offset_in_words())
2637                        / itableOffsetEntry::size();
2638 
2639   for (int cnt = 0 ; ; cnt ++, ioe ++) {
2640     // If the interface isn't implemented by the receiver class,
2641     // the VM should throw IncompatibleClassChangeError.
2642     if (cnt >= nof_interfaces) {
2643       ResourceMark rm(THREAD);
2644       stringStream ss;

2645       ss.print("Receiver class %s does not implement "
2646                "the interface %s defining the method to be called",
2647                class_loader_and_module_name(), holder->class_loader_and_module_name());




2648       THROW_MSG_NULL(vmSymbols::java_lang_IncompatibleClassChangeError(), ss.as_string());
2649     }
2650 
2651     Klass* ik = ioe->interface_klass();
2652     if (ik == holder) break;
2653   }
2654 
2655   itableMethodEntry* ime = ioe->first_method_entry(this);
2656   Method* m = ime[index].method();
2657   if (m == NULL) {
2658     THROW_NULL(vmSymbols::java_lang_AbstractMethodError());
2659   }
2660   return m;
2661 }
2662 
2663 
2664 #if INCLUDE_JVMTI
2665 // update default_methods for redefineclasses for methods that are
2666 // not yet in the vtable due to concurrent subclass define and superinterface
2667 // redefinition




2625     result |= JVMTI_CLASS_STATUS_INITIALIZED;
2626   }
2627   if (is_in_error_state()) {
2628     result |= JVMTI_CLASS_STATUS_ERROR;
2629   }
2630   return result;
2631 }
2632 
2633 Method* InstanceKlass::method_at_itable(Klass* holder, int index, TRAPS) {
2634   itableOffsetEntry* ioe = (itableOffsetEntry*)start_of_itable();
2635   int method_table_offset_in_words = ioe->offset()/wordSize;
2636   int nof_interfaces = (method_table_offset_in_words - itable_offset_in_words())
2637                        / itableOffsetEntry::size();
2638 
2639   for (int cnt = 0 ; ; cnt ++, ioe ++) {
2640     // If the interface isn't implemented by the receiver class,
2641     // the VM should throw IncompatibleClassChangeError.
2642     if (cnt >= nof_interfaces) {
2643       ResourceMark rm(THREAD);
2644       stringStream ss;
2645       bool same_module = (module() == holder->module());      
2646       ss.print("Receiver class %s does not implement "
2647                "the interface %s defining the method to be called "
2648                "(%s%s%s)",
2649                external_name(), holder->external_name(),
2650                (same_module) ? joint_in_module_of_loader(holder) : class_in_module_of_loader(),
2651                (same_module) ? "" : "; ",
2652                (same_module) ? "" : holder->class_in_module_of_loader());
2653       THROW_MSG_NULL(vmSymbols::java_lang_IncompatibleClassChangeError(), ss.as_string());
2654     }
2655 
2656     Klass* ik = ioe->interface_klass();
2657     if (ik == holder) break;
2658   }
2659 
2660   itableMethodEntry* ime = ioe->first_method_entry(this);
2661   Method* m = ime[index].method();
2662   if (m == NULL) {
2663     THROW_NULL(vmSymbols::java_lang_AbstractMethodError());
2664   }
2665   return m;
2666 }
2667 
2668 
2669 #if INCLUDE_JVMTI
2670 // update default_methods for redefineclasses for methods that are
2671 // not yet in the vtable due to concurrent subclass define and superinterface
2672 // redefinition


< prev index next >