JDK-8147755 : ASM should create correct constant tag for invokestatic on handle point to interface static method
  • Type: Bug
  • Component: other-libs
  • Affected Version: 9
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2016-01-19
  • Updated: 2016-03-31
  • Resolved: 2016-03-15
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 9
9 b112Fixed
Related Reports
Blocks :  
Blocks :  
Blocks :  
Blocks :  
Relates :  
Description
A method handle to interface static method invoked with invokestatic, it generated Methodref in constantpool, which violates
JVMS-5.4.3.3 Method Resolution:
 " If C is an interface, method resolution throws an IncompatibleClassChangeError."
JVMS-5.4.3.4 Interface Method Resolution:
 "If C is not an interface, interface method resolution throws an IncompatibleClassChangeError" 
It should generate InterfaceMethodref instead. See bug 8147419.
Currently 8147419 has a workaround for this, relax check.
When this problem fixed, the relax in hotspot should be removed.
Comments
http://mail.openjdk.java.net/pipermail/core-libs-dev/2016-March/039212.html
02-03-2016

No regression tests, all nashorn, core-libs (streams, indy, lambda based tests), langtools, and serviceability tests must pass.
02-03-2016

Attached the patch that works.
29-01-2016

The last version of asm1.patch is good. It passed all defmeth tests with fix in 8143320. Thanks.
29-01-2016

The diff from you caused more failures, so I think there is problem with it. I will try a clean build over current jdk based on your diff again to see if the problems still remains (>230 failures on defmeth). I guess, there is no new updated version of the diff?
28-01-2016

Yumin, does this resolve your bug or not ?
28-01-2016

From Remi: ----------------------------------------------------------------------- I've pushed a new versions of ASM (the future 5.1) in the trunk that should let you create constant method handles on an interface, ... The code is mostly similar to your patch but it does the full roundtrip, being able not only to encode constant method handles on interface but also to decode them. ----------------------------------------------------------------------- So this problem will be solved when current jdk synced with current ASM(future 5.1). When sync done, the bug should be closed.
25-01-2016

The fix is add an indicator to Handle.java and in callsite, use it to test if an interface static method, if so, use interface method visit.
20-01-2016