RFR: 8087223: InterfaceMethod CP entry pointing to a class should cause ICCE

Yumin Qi yumin.qi at oracle.com
Fri Nov 13 06:00:33 UTC 2015


   Thanks for the correction, the correct link is:


On 11/12/2015 8:54 PM, David Holmes wrote:
> Hi Yumin,
> On 13/11/2015 6:54 AM, Yumin Qi wrote:
>> Please review:
>> bug: https://bugs.openjdk.java.net/browse/JDK-8087223
>> webrev:
>> http://javaweb.us.oracle.com/~yqi/webrev/webrevs/8087223/8087223/webrev-01/ 
> This is not a cr.openjdk link.
> Thanks,
> David
>> According to JVMS-8:
>> JVMS- Method Resolution:
>>   " If C is an interface, method resolution throws an
>> IncompatibleClassChangeError."
>> JVMS- Interface Method Resolution:
>>   "If C is not an interface, interface method resolution throws an
>> IncompatibleClassChangeError"
>> When invoke a method with resolved to an interface method, or invoke a
>> interface method with resolved to an instance method,  ICCE should be
>> thrown. The case usually happens when using tools like asmtools or
>> jdk.internal.org.objectweb.asm to generate java bytecode.
>> The fix is carrying the constantTag for the method at call and check if
>> tag is consistent with the method called. Doing this by adding a member
>> of constantTag, _tag,  to LinkInfo, and check tag in resolve functions
>> to see if tag matched with the correct method.
>> The fix solved the problem when call is from interpreter and compiler,
>> bug for MethodHandle invoke, which should be addressed in another bug,
>> since the MethodHandle does not come with a byte stream and getting the
>> constant pool index at the invoke is not possible.  It will be addressed
>> in another bug.
>> Tests: test case (added, minor modified from bug), JPRT, rutime quick
>> test list(in progress).
>> manually tested:  1) -Xint
>>                                 2) -Xcomp
>>                                 3) -Xcomp -XX:-TieredCompiltion
>>                                 4) -Xcomp -XX:+TieredCompilation
>> Thanks to Coleen for helping fixed constant pool index and cleaned
>> LinkInfo.
>> Thanks
>> Yumin

More information about the hotspot-compiler-dev mailing list