comparison src/share/vm/opto/library_call.cpp @ 12264:b2e698d2276c

8014013: CallInfo structure no longer accurately reports the result of a LinkResolver operation Summary: Enhance method resolution and resulting data structures, plus some refactoring. Reviewed-by: twisti, acorn, jrose
author drchase
date Fri, 13 Sep 2013 22:38:02 -0400
parents edb5ab0f3fe5
children da051ce490eb
comparison
equal deleted inserted replaced
12261:2c98370f2611 12264:b2e698d2276c
3732 // Helper for hashCode and clone. Peeks inside the vtable to avoid a call. 3732 // Helper for hashCode and clone. Peeks inside the vtable to avoid a call.
3733 Node* LibraryCallKit::generate_virtual_guard(Node* obj_klass, 3733 Node* LibraryCallKit::generate_virtual_guard(Node* obj_klass,
3734 RegionNode* slow_region) { 3734 RegionNode* slow_region) {
3735 ciMethod* method = callee(); 3735 ciMethod* method = callee();
3736 int vtable_index = method->vtable_index(); 3736 int vtable_index = method->vtable_index();
3737 assert(vtable_index >= 0 || vtable_index == Method::nonvirtual_vtable_index,
3738 err_msg_res("bad index %d", vtable_index));
3737 // Get the Method* out of the appropriate vtable entry. 3739 // Get the Method* out of the appropriate vtable entry.
3738 int entry_offset = (InstanceKlass::vtable_start_offset() + 3740 int entry_offset = (InstanceKlass::vtable_start_offset() +
3739 vtable_index*vtableEntry::size()) * wordSize + 3741 vtable_index*vtableEntry::size()) * wordSize +
3740 vtableEntry::method_offset_in_bytes(); 3742 vtableEntry::method_offset_in_bytes();
3741 Node* entry_addr = basic_plus_adr(obj_klass, entry_offset); 3743 Node* entry_addr = basic_plus_adr(obj_klass, entry_offset);
3782 } else { 3784 } else {
3783 // hashCode and clone are not a miranda methods, 3785 // hashCode and clone are not a miranda methods,
3784 // so the vtable index is fixed. 3786 // so the vtable index is fixed.
3785 // No need to use the linkResolver to get it. 3787 // No need to use the linkResolver to get it.
3786 vtable_index = method->vtable_index(); 3788 vtable_index = method->vtable_index();
3789 assert(vtable_index >= 0 || vtable_index == Method::nonvirtual_vtable_index,
3790 err_msg_res("bad index %d", vtable_index));
3787 } 3791 }
3788 slow_call = new(C) CallDynamicJavaNode(tf, 3792 slow_call = new(C) CallDynamicJavaNode(tf,
3789 SharedRuntime::get_resolve_virtual_call_stub(), 3793 SharedRuntime::get_resolve_virtual_call_stub(),
3790 method, vtable_index, bci()); 3794 method, vtable_index, bci());
3791 } else { // neither virtual nor static: opt_virtual 3795 } else { // neither virtual nor static: opt_virtual