[lworld] RFR: Merge jdk [v2]

David Simms dsimms at openjdk.org
Fri Sep 29 07:13:29 UTC 2023


On Thu, 28 Sep 2023 17:52:58 GMT, Frederic Parain <fparain at openjdk.org> wrote:

>> David Simms has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Deferred test issues
>
> src/hotspot/cpu/x86/templateTable_x86.cpp line 3713:
> 
>> 3711:   load_resolved_field_entry(noreg, cache, rax, rbx, rdx);
>> 3712:   // RBX: field offset, RCX: RAX: TOS, RDX: flags
>> 3713:   __ movl(rscratch2, rdx);  // saving flags for is_flat test
> 
> It is dangerous to save the value in a scratch register and not using it immediately. In the current state of the code, there's no corruption of this register. But pop_and_check_object() below can produce a lot of code when verifying the oop, and if this code is modified and starts to use rschratch2, corruption will happen.
> Suggested change:
> 
> load_resolved_field_entry(noreg, cache, rax, rbx, rdx);
> __ pop(rax);
> 
> // Get object from stack
> pop_and_check_object(rcx);
> 
> const Address field(rcx, rbx, Address::times_1);
> 
> // Check for volatile store
> __ movl(rscratch2, rdx);     // preserving flags for is_flat test
> __ testl(rscratch2, rscratch2);
> __ jcc(Assembler::zero, notVolatile);

Agreed, thanks for the suggested fix.

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

PR Review Comment: https://git.openjdk.org/valhalla/pull/930#discussion_r1340982141



More information about the valhalla-dev mailing list