[jdk17] RFR: 8268362: [REDO] C2 crash when compile negative Arrays.copyOf length after loop [v3]
Hui Shi
hshi at openjdk.java.net
Fri Jun 18 07:50:25 UTC 2021
On Thu, 17 Jun 2021 16:14:52 GMT, Vladimir Kozlov <kvn at openjdk.org> wrote:
>> @vnkozlov Thanks for your review!
>>
>> GraphKit::load_array_length code is different with new_array() and arraycopy_move_allocation_here(), it doesn't replace_in_map. Currently GraphKit::cast_replace_array_length_post_allocation warpper is used in new_array() and arraycopy_move_allocation_here().
>>
>> Would you prefer a wrapper for all these three places? It would be like following code.
>>
>> Node* GraphKit::cast_array_length_post_allocation(AllocateArrayNode* alloc, const TypeOopPtr* oop_type, bool replace_map /false in load_array_length/) {
>> Node* length = alloc->in(AllocateNode::ALength);
>> if (replace_map == false || map()->find_edge(length) >= 0) {
>> Node* ccast = alloc->make_ideal_length(oop_type, &_gvn);
>> if (ccast != length) {
>> _gvn.set_type_bottom(ccast);
>> record_for_igvn(ccast);
>> if (replace_map) {
>> replace_in_map(length, ccast);
>> }
>> return cast;
>> }
>> }
>> return length;
>> }
>
> All places, please. I prefer different names for this method and its parameters `GraphKit::array_ideal_length(alloc , ary_type, replace_length_in_map)`. No need for parameter's comment in declaration - it is clear from name.
done, new wrapper is added, all 3 places: 1) new_array 2) arraycopy_move_allocation_here 3) load_array_length use GraphKit::array_ideal_length(alloc , ary_type, replace_length_in_map)
-------------
PR: https://git.openjdk.java.net/jdk17/pull/49
More information about the hotspot-compiler-dev
mailing list