JDK-8027162 : JSR292: implement MemberName interning
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: hs25
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • Submitted: 2013-10-23
  • Updated: 2014-05-01
  • Resolved: 2013-10-24
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.
Related Reports
Duplicate :  
Relates :  
Relates :  
Implement MemberName interning.

There's a problem with initializing MemberNames.
MethodHandles::init_method_MemberName stores a reference to corresponding MemberName in InstanceKlass's MemberNameTable: 
  m->method_holder()->add_member_name(m->method_idnum(), mname);

But it's possible to create multiple MemberName instances for the same method and previously stored reference is overwritten.
It can lead to problems (like JDK-8023004) during class redefinition.  

Interning of MemberName instances should solve the problem.

Agree. I'm not aware about any existing product issues due to that bug.

This is a followup to JDK-8027162 to make the code more robust. If there are no known failures in this area, I suggest deferring or reprioritizing downward. ILM = MLM = P4

memberName: invokebasic method_holder::method: java.lang.invoke.MethodHandle.linkToStatic(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/invoke/MemberName;)Ljava/lang/Object;, receiver: java.lang.invoke.MethodHandle, method_id: 0, access_flags:

Asserting clean slot fails in a number of different ways (logs attached): diff --git a/src/share/vm/prims/methodHandles.cpp b/src/share/vm/prims/methodHandles.cpp --- a/src/share/vm/prims/methodHandles.cpp +++ b/src/share/vm/prims/methodHandles.cpp @@ -251,6 +251,7 @@ // This is done eagerly, since it is readily available without // constructing any new objects. // TO DO: maybe intern mname_oop + assert(m->method_holder()->get_member_name(m->method_idnum()) == NULL, ""); m->method_holder()->add_member_name(m->method_idnum(), mname); return mname();