RFR(S) 8153115: Move private interface check to linktime
Tom Rodriguez
tom.rodriguez at oracle.com
Tue Apr 5 17:55:04 UTC 2016
> Thanks for waiting on this. A couple of comments:
>
> - Section 6.5 Instructions for invokeinterface does indicate that a "Linking Exceptions" the VM can throw an ICCE if the resolved method is static or private. So I think moving this exception from runtime to linktime is okay.
>
> - I'm concerned about the change on line #998, #1030, #1316. I don't think you are necessarily guaranteed to have the bytecodes that you are now passing to resolve_interface_method. For example, line #998 within linktime_resolve_static_method, you may not have an invokestatic here, you may have another invoke* bytecode trying to invoke a static interface method. Passing in Bytecodes::_invokestatic seems wrong, because even if the resolved method is static, "nostatics" was set to false.
Unless i’m misunderstanding the code, I’d say that it was a bug that nostatics was being passed as false. The standard naming in LinkResolver follows a pattern where the name is associated with the byte code being used for the invoke. So if you are in {linktime,runtime}_resolve_{foo}_method then an invokefoo byte code is what’s being used. resolve_interface_method is currently not following that naming scheme, which I think should be fixed. Maybe resolve_method_in_interface? I do agree we should be sure that the paths leading to this call agree about the actual byte code being used, but I can’t see a path where a different byte code could have been passed in.
tom
>
> Just curious did you also run the testbase default methods tests?
> Lois
>
>>
>>> On Apr 5, 2016, at 9:30 AM, Lois Foltan <lois.foltan at oracle.com> wrote:
>>>
>>> Hi Igor,
>>>
>>> I know you have two reviews for this but could you hold off committing until I or Karen Kinnear have a chance to review. We both worked in this area a lot to support default methods in JDK 8. Also, have you run the hotspot/test/runtime/SelectionResolution tests on this?
>>>
>>> Thanks,
>>> Lois
>>>
>>> On 4/1/2016 2:28 PM, Igor Veresov wrote:
>>>> When invoking private interface methods with invokeinterface we throw ICCE. The check for that happens in the runtime part of the resolution, however, doing it at linktime seems like a better place, since the check doesn't depend on the receiver type. It also allows compiler interfaces that rely on linktime resolution to detect inconsistencies during parsing (see ciEnv::lookup_method() (CI) and ConstantPool.lookupMethod() (JVMCI) that are affected).
>>>>
>>>> JBS: https://bugs.openjdk.java.net/browse/JDK-8153115
>>>> Webrev: http://cr.openjdk.java.net/~iveresov/8153115/webrev.00/
>>>>
>>>> Thanks,
>>>> igor
>
More information about the hotspot-compiler-dev
mailing list