JDK-8073705 : more performance issues in class redefinition
  • Type: Bug
  • Component: hotspot
  • Sub-Component: jvmti
  • Affected Version: 9
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2015-02-24
  • Updated: 2015-09-29
  • Resolved: 2015-04-28
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 8 JDK 9
8u60Fixed 9 b64Fixed
Related Reports
Relates :  
Relates :  
Description
The following scalability/performance issue is currently in the public review:
   https://bugs.openjdk.java.net/browse/JDK-8046246

It is going to improve the implementation of the functions:
     ConstantPoolCache::adjust_method_entries()
     klassVtable::adjust_method_entries()
     klassItable::adjust_method_entries()
     InstanceKlass::adjust_default_methods()


However, there is more space for improvements:
  - The above functions can be run just once for all the redefined classes instead of multiple times after
    redefinition of each class in the list (they have no parameters specific for redefined classes anymore)
  - The MemberNameTable::adjust_method_entries() can be fixed to use the same optimization as
     the other adjust_method_entries() above
  - Consider the following fragment to be optimized as well to use the new adjust_method_entries()
    approach (it can be tricky though):

    for (InstanceKlass* pv_node = ik->previous_versions();
         pv_node != NULL;
         pv_node = pv_node->previous_versions()) {
      cp_cache = pv_node->constants()->cache();
      if (cp_cache != NULL) {
        cp_cache->adjust_method_entries(_matching_old_methods,
                                        _matching_new_methods,
                                        _matching_methods_length,
                                        &trace_name_printed);
      }
    }



Comments
This is the suggested fix: --- a/src/share/vm/interpreter/interpreterRuntime.cpp Tue Apr 07 20:18:28 2015 -0700 +++ b/src/share/vm/interpreter/interpreterRuntime.cpp Mon Apr 27 13:58:45 2015 -0700 @@ -1319,6 +1319,7 @@ IRT_ENTRY(void, InterpreterRuntime::memb Symbol* cname = cpool->klass_name_at(cpool->klass_ref_index_at(cp_index)); Symbol* mname = cpool->name_ref_at(cp_index); + thread->set_vm_result(NULL); if (MethodHandles::has_member_arg(cname, mname)) { oop member_name_oop = (oop) member_name; if (java_lang_invoke_DirectMethodHandle::is_instance(member_name_oop)) { The first item in the list of optimization from description is considered as separate bug that is covered by the bug report: https://bugs.openjdk.java.net/browse/JDK-8078725
28-04-2015