RFR: 8369506: Bytecode rewriting causes Java heap corruption on AArch64 [v2]
    Justin King 
    jcking at openjdk.org
       
    Wed Oct 15 14:32:08 UTC 2025
    
    
  
On Wed, 15 Oct 2025 14:08:17 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:
>> Justin King has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Suggestions from shipilev
>>   
>>   Signed-off-by: Justin King <jcking at google.com>
>
> src/hotspot/cpu/aarch64/interp_masm_aarch64.cpp line 1716:
> 
>> 1714:   br(Assembler::GE, valid);
>> 1715:   stop("bad field offset");
>> 1716:   bind(valid);
> 
> Suggestion:
> 
>   // Verify the field offset is not in the header, implicitly checks for 0
>   Label L;
>   subs(zr, reg, oopDesc::base_offset_in_bytes());
>   br(Assembler::GE, L);
>   stop("bad field offset");
>   bind(L);
Done.
> src/hotspot/cpu/aarch64/templateTable_aarch64.cpp line 237:
> 
>> 235: 
>> 236:   // Patch the bytecode using STLR so that the last STLR used in
>> 237:   // ResolvedFieldEntry::fill_in is observed before the patched bytecode.
> 
> Suggestion:
> 
>   // Patch bytecode with release store to coordinate with ResolvedFieldEntry loads
>   // in fast bytecode codelets. load_field_entry has a memory barrier that gains
>   // the needed ordering, together with control dependency on entering the fast codelet
>   // itself.
Done.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/27748#discussion_r2432785427
PR Review Comment: https://git.openjdk.org/jdk/pull/27748#discussion_r2432785956
    
    
More information about the hotspot-compiler-dev
mailing list