RFR: JDK-8294947: Use 64bit atomics in patch_verified_entry on x86_64
Dean Long
dlong at openjdk.org
Fri Nov 11 22:42:03 UTC 2022
On Fri, 11 Nov 2022 12:09:10 GMT, Dmitry Samersoff <dsamersoff at openjdk.org> wrote:
>> src/hotspot/cpu/x86/nativeInst_x86.cpp line 514:
>>
>>> 512: // complete jump instruction (to be inserted) is in code_buffer;
>>> 513: #ifdef AMD64
>>> 514: unsigned char code_buffer[8];
>>
>> Should we align this buffer too (to 8/jlong)?
>
> @vnkozlov
>
> CXX optimizes that code to a few of register operations, and optimize out local variable _code_buffer_, so we need not to care about its alignment.
> ```
> union {
> jlong cb_long;
> unsigned char code_buffer[8];
> } u;
> ```
>
This version is fine. It removes any question about the alignment of cb_long at the same time.
-------------
PR: https://git.openjdk.org/jdk/pull/11059
More information about the hotspot-compiler-dev
mailing list