RFR: 8357601: Checked version of JNI Release<type>ArrayElements needs to filter out known wrapped arrays

David Holmes dholmes at openjdk.org
Mon Jun 30 01:41:55 UTC 2025


On Tue, 27 May 2025 21:41:15 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:

> So tag is STRING_TAG and STRING_UTF_TAG and the purpose of tag2 is CRITICAL_TAG? Maybe just call it critical_tag()?

Both `tag` and `tag2` are general purpose from the perspective of the `GuardedMemory` class. It is the user of `GuardedMemory` that assigns a meaning to them.

> src/hotspot/share/memory/guardedMemory.hpp line 249:
> 
>> 247:   void* get_tag() const { return get_head_guard()->get_tag(); }
>> 248: 
>> 249:     /**
> 
> Extra whitespace.  Why these blocky comments?  That say the same thing twice in 5 lines.

I am just copying the existing style in this code. It is based on old javadoc style for Java code.

I have fixed the indentation error. Thanks

> src/hotspot/share/prims/jniCheck.cpp line 357:
> 
>> 355: 
>> 356: // Arbitrary (but well-known) tag for GetStringUTFChars
>> 357: const void* STRING_UTF_TAG = (void*) 0x48124812;
> 
> Why is this well-known?  This ending in 12 could be an address, do you not want to make this a possible address?

These are "well-known" by this code. Note I just moved these definitions, I did not invent them.

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

PR Comment: https://git.openjdk.org/jdk/pull/25444#issuecomment-2918183046
PR Review Comment: https://git.openjdk.org/jdk/pull/25444#discussion_r2113118037
PR Review Comment: https://git.openjdk.org/jdk/pull/25444#discussion_r2113115923


More information about the hotspot-dev mailing list