RFR: 8267904: C2 crash when compile negative Arrays.copyOf length after loop [v2]

Roland Westrelin roland at openjdk.java.net
Tue Jun 1 07:59:20 UTC 2021


On Mon, 31 May 2021 10:57:14 GMT, Hui Shi <hshi at openjdk.org> wrote:

>> Thanks for your comment!
>> 
>> Multiple identical CastII node do happens and check is added to ensure they are identical CastIINodes. Cases are:
>> 1. CastIINode created in GraphKit::new_array 
>> 2. CastIINode might created before inline_arraycopy if GraphKit::load_array_length is invoked. If new array's length is loaded multiple times before System.arraycopy, there could be multiple CastIINode.
>
> simple example
> 
>         byte[] result = new byte[len];   // first CastII in GraphKit::new_array
>         System.arraycopy(path, begin, result, 0, result.length);  // second CastII  when processing "result.length"

Could you use hash_find() instead? hash_find(prev) == hash_find(cur) maybe?

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

PR: https://git.openjdk.java.net/jdk/pull/4238


More information about the hotspot-compiler-dev mailing list