RFR: 8356942: invokeinterface Throws AbstractMethodError Instead of IncompatibleClassChangeError [v2]

David Holmes dholmes at openjdk.org
Tue Jul 8 21:31:39 UTC 2025


On Tue, 8 Jul 2025 12:21:46 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:

>> David Holmes has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Replaced new test by updating existing defmeth case that was missing the invokeinterface variants of the
>>   test scenario. Also updated all tests therein to use `throwsExact` so that the wrong kind of ICCE does not
>>   cause the test to pass by mistake.
>
> src/hotspot/share/oops/klassVtable.cpp line 1185:
> 
>> 1183:       // Do not check loader constraints for overpass methods because overpass
>> 1184:       // methods are created by the jvm to throw exceptions.
>> 1185:       if (!target->is_overpass()) {
> 
> Why are loader constraints not checked for overpass methods?  In your description it says they _are_ checked?  But not here?  If the two methods that are duplicate on the inheritance path and should get ICCE have a loader constraint violation with one of their parameter or return type, they should get a LinkageError, but not ICCE.
> 
> What's confusing is that there are two check_constraints - I was looking at the wrong one that also has the !target->is_overpass() condition.  Are these mostly the same now?  Maybe after this change is backported they can be refactored so they share more code.

> Why are loader constraints not checked for overpass methods? In your description it says they are checked? 

I don't follow. They were checked prior to [JDK-8186092](https://bugs.openjdk.org/browse/JDK-8186092) but they should not be - you need to read [JDK-8186092](https://bugs.openjdk.org/browse/JDK-8186092) for the "why". I'm simply changing how we decide to skip them for overpass methods - using the same technique as is already applied to the vtable methods.

> What's confusing is that there are two check_constraints 

Yes one on the `klassVtable` and one on the `klassItable`. They do the same high-level job but are quite different in structure.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/26122#discussion_r2193474205


More information about the hotspot-dev mailing list