RFR: 8366363: MemBaseline accesses VMT without using lock [v9]

Johan Sjölen jsjolen at openjdk.org
Tue Sep 2 13:18:44 UTC 2025


On Tue, 2 Sep 2025 13:06:02 GMT, Paul Hübner <phubner at openjdk.org> wrote:

>> Johan Sjölen has updated the pull request incrementally with three additional commits since the last revision:
>> 
>>  - Yup
>>  - Some more ugly casts
>>  - Aha, _root is typed as an IntrusiveRBNode
>
> src/hotspot/share/utilities/rbTree.hpp line 464:
> 
>> 462:     struct node_pair { const RBNode<K, V>* current; RBNode<K, V>* other_parent; Dir d; };
>> 463:     struct stack {
>> 464:       node_pair s[64];
> 
> Could you clarify the choice of 64 as an upper bound? It's not immediately obvious to me if we guarantee (or if we don't care about) the maximum visitation size in the code below.

It's an arbitrary depth (it's used in other parts of the RBTree code as well). The maximum length of the stack represents the maximum depth of the tree that we support. A perfectly balanced binary tree of depth 64 has 2**64 - 1 nodes, so in practice this will never be reached.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/27003#discussion_r2316065902


More information about the hotspot-dev mailing list