RFR: 8305056: Avoid unaligned access in emit_intX methods if not enabled [v4]

Fei Yang fyang at openjdk.org
Tue Apr 18 02:20:48 UTC 2023


On Mon, 17 Apr 2023 14:19:36 GMT, Vladimir Kempik <vkempik at openjdk.org> wrote:

>> Please review this change which attempts to eliminate unaligned memory stores generated by emit_int16/32/64 methods on some platforms.
>> 
>> Primary aim is risc-v platform. But I had to change some code in ppc/arm32/x86 to prevent possible perf degradation.
>
> Vladimir Kempik has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Rework the fix to use memcpy in codeBuffer.hpp

src/hotspot/share/asm/codeBuffer.hpp line 262:

> 260:   void emit_float( jfloat  x)  { put_native(end(), jint_cast(x)); set_end(end() + sizeof(jfloat)); }
> 261:   void emit_double(jdouble x)  { put_native(end(), julong_cast(x)); set_end(end() + sizeof(jdouble)); }
> 262:   void emit_address(address x) { put_native(end(), p2i(x)); set_end(end() + sizeof(address)); }

You might want to remove the explicit casts of 'x'. And the JBS title might needs to be updated too.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/13227#discussion_r1169420154


More information about the hotspot-compiler-dev mailing list