RFR: 8340297: Use-after-free recognition for metaspace and class space [v4]

Thomas Stuefe stuefe at openjdk.org
Wed Aug 20 04:57:19 UTC 2025


On Tue, 19 Aug 2025 13:35:47 GMT, Casper Norrbin <cnorrbin at openjdk.org> wrote:

>> Thomas Stuefe has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Feedback Johan
>
> src/hotspot/share/oops/metadata.hpp line 49:
> 
>> 47:   static constexpr uint32_t common_prefix_mask   = BUILD_32(0xFFFF, 0);
>> 48:   static constexpr uint32_t instance_klass_token = BUILD_32(0x3E7A, 0x100);
>> 49:   static constexpr uint32_t array_klass_token    = BUILD_32(0x3E7A, 0x101);
> 
> Nit / question: Any particular reason we're building the tokens with `BUILD_32(high, low)` instead of writing out the full literal (e.g. `0x3E7A0100`)? Is it mainly for readability or are there other considerations?

None whatsoever, apart from readability. I changed to use plain constants.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/25891#discussion_r2286977051


More information about the hotspot-dev mailing list