RFR: 8366990: C2: Compilation hits the memory limit when verifying loop opts in Split-If code [v2]
    Marc Chevalier 
    mchevalier at openjdk.org
       
    Mon Oct 13 07:27:04 UTC 2025
    
    
  
On Mon, 13 Oct 2025 06:52:42 GMT, Damon Fenacci <dfenacci at openjdk.org> wrote:
>> Benoît Maillard has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Add -XX:+UnlockDiagnosticVMOptions
>
> src/hotspot/share/ci/ciInstanceKlass.hpp line 207:
> 
>> 205:   ciField* get_field_by_offset(int field_offset, bool is_static);
>> 206:   ciField* get_field_by_name(ciSymbol* name, ciSymbol* signature, bool is_static);
>> 207:   BasicType get_field_type_by_offset(int field_offset, bool is_static);
> 
> Following @chhagedorn's suggestion:
> Suggestion:
> 
>   BasicType get_field_type_by_offset(const int field_offset, const bool is_static);
I don't think that is a good suggestion. `const` in this context is useless (and CLion will gray it and suggest to remove it). It doesn't need to appear here to make @chhagedorn's suggestion work, and it just makes the signature longer. Making the parameter const is merely an implementation detail, it doesn't need to be part of the signature or the contract since it won't have any effect on the caller, it doesn't document anything... It doesn't even prevent to implement the function without the `const`.
That being said, I'm all for sprinkling `const` everywhere it makes a difference.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/27731#discussion_r2425412323
    
    
More information about the hotspot-compiler-dev
mailing list