RFR: 8367341: C2: apply KnownBits and unsigned bounds to And / Or operations [v3]

Quan Anh Mai qamai at openjdk.org
Wed Oct 15 16:15:08 UTC 2025


On Wed, 15 Oct 2025 15:36:18 GMT, Johan Sjölen <jsjolen at openjdk.org> wrote:

>> Not a review, just a drive-by comment, following up on @eme64 "They tell me its fine".
>> 
>> I do not think it's okay to use most standard library headers. Doing so can run into issues with things
>> like our forbidden function mechanism, assert macro collision, and others.  My opinion is the uses in
>> `jfr/test_networkUtilization.cpp` shouldn't be there, and aren't actually necessary.  I just did a spot check,
>> and the only "good" case I found is `test_codestrings.cpp` using `<regex>`, where there isn't any similar
>> functionality available in hotspot. The suggestion in the discussion @eme64 for a set is `RBTree`.  The O(1)
>> lookup by a hashtable is unlikely to matter to a gtest.
>> 
>> There is ongoing work updating our usage (see, for example, https://bugs.openjdk.org/browse/JDK-8369186)
>> and how to do that in a safe and consistent manner.
>
> Use `RBTreeCHeap`, if going the RBTree route. It's just the easiest way of using it.

Thanks for your inputs, I have removed the usage of `std::unordered_map` and replaced it with `RBTreeCHeap`. Is using `std::array` here fine?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/27618#discussion_r2433203193


More information about the hotspot-compiler-dev mailing list