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.
Other
tbd_minorResolved
Related Reports
Duplicate :  
Relates :  
Relates :  
Description
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.

Comments
Agree. I'm not aware about any existing product issues due to that bug.
23-10-2013

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
23-10-2013

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:
23-10-2013

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();
23-10-2013