RFR: 8201516: DebugNonSafepoints generates incorrect information [v4]
Xin Liu
xliu at openjdk.org
Wed Mar 8 06:19:28 UTC 2023
On Fri, 3 Mar 2023 06:31:53 GMT, Tobias Hartmann <thartmann at openjdk.org> wrote:
>> src/hotspot/share/opto/phaseX.cpp line 474:
>>
>>> 472: GrowableArray<Node_Notes*>* old_node_note_array = C->node_note_array();
>>> 473: if (old_node_note_array != nullptr) {
>>> 474: int new_size = (_useful.size() >> 8) + 1; // The node note array uses blocks, see C->_log2_node_notes_block_size
>>
>> You should call `new_size = MAX2(8, new_size)` to make sure that we have at least 8 elements for initial allocation.
>
> Okay, I added that. The 8 seems arbitrary to me but since we already use that for initial allocation of the array, we can as well be consistent here. Just note that since we are calling `C->grow_node_notes`, we will also initialize with `Node_Notes*` right away.
Why don't we just use `C->_log2_node_notes_block_size` directly in (_useful.size() >> 8)?
I don't understand why we have to add MAX2(8, new_size) either. It looks like c2 doesn't want to have node-level accuracy. It drops the lowest 8bits of node_idx as block_id. I think the minimal number of "block" is 1, or arr is NULL.
-------------
PR: https://git.openjdk.org/jdk/pull/12806
More information about the hotspot-compiler-dev
mailing list