[11] RFR (S): 8202465: C1: Casts should not be eliminated for interface types

Tobias Hartmann tobias.hartmann at oracle.com
Thu May 3 07:12:47 UTC 2018


Just wondering, should this code be adapted as well?
http://hg.openjdk.java.net/jdk/jdk/rev/c63bdf53a1a7

On 03.05.2018 08:35, Tobias Hartmann wrote:
> Hi Vladimir,
> 
> looks good to me too.
> 
> Best regards,
> Tobias
> 
> On 03.05.2018 04:33, Vladimir Ivanov wrote:
>> http://cr.openjdk.java.net/~vlivanov/8202465/webrev.00
>> https://bugs.openjdk.java.net/browse/JDK-8202465
>>
>> Interface casts can't be eliminated when there's no exact type known for the object and its declared
>> type is interface as well. Verifier doesn't enforce interface types, so there are no guarantees at
>> runtime that values have interface types as declared in bytecode.
>>
>> The fix checks that declared type of the object being casted is not an interface before performing
>> subtype check.
>>
>> Also, refactored the test to use jasm instead of jcod.
>>
>> Testing: failing test, hs-precheckin-comp, hs-tier1, hs-tier2
>>
>> Thanks!
>>
>> Best regards,
>> Vladimir Ivanov


More information about the hotspot-compiler-dev mailing list