RFR: 8352620: C2: rename MemNode::memory_type() to MemNode::value_basic_type() [v2]

Emanuel Peter epeter at openjdk.org
Tue Apr 22 09:15:10 UTC 2025


On Mon, 14 Apr 2025 21:46:26 GMT, Saranya Natarajan <duke at openjdk.org> wrote:

>> Description: The current name MemNode::memory_type() is misleading because the returned type is a property of the value that is loaded/stored, not the memory that is accessed. Usually, the two of them match, but for mismatched memory accesses (arising e.g. from using Unsafe or memory segments) they might differ, e.g. one might store a value of type 'short' into an array of elements of type 'long'. The proposal was to rename MemNode::memory_type() to MemNode::value_basic_type() to clarify these cases.
>> 
>> Solution: Replaced all occurrence of MemNode::memory_type() with MemNode::value_basic_type()
>
> Saranya Natarajan has updated the pull request incrementally with one additional commit since the last revision:
> 
>   addressing review comments

src/hotspot/share/opto/escape.cpp line 2822:

> 2820:         Node* value = nullptr;
> 2821:         if (ini != nullptr) {
> 2822:           //StoreP::value_basic_type() == T_ADDRESS

Suggestion:

          // StoreP::value_basic_type() == T_ADDRESS

Nit: generally we have a space after the comment.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/24427#discussion_r2053696696


More information about the hotspot-compiler-dev mailing list