RFR: 8331033: EA fails with "EA unexpected CallLeaf unsafe_setmemory" after JDK-8329331

Vladimir Kozlov kvn at openjdk.org
Wed May 1 18:29:01 UTC 2024


On Wed, 1 May 2024 14:01:38 GMT, Scott Gibbons <sgibbons at openjdk.org> wrote:

> Added a strcmp for unsafe_setmemory in process_call_arguments() so the assert would not trigger.
> 
> I believe this is the correct fix as I do not think the arguments for setMemory need special handling like arraycopy.
> 
> I would like suggestions on how to generate a testcase to catch this type of error in mainline.

`Unsafe.setMemory()` has `checkPrimitivePointer()` call which check that input is a primitive array or some address (`raw` address in EA terms). This check is done before intrinsic is called. Which means your fix is correct. It is similar to other intrinsics which operates on primitive arrays. 

The test could be locally allocated not-escaped array which is passed to `Unsafe.setMemory()` to be initialized to some value.

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

PR Review: https://git.openjdk.org/jdk/pull/19032#pullrequestreview-2034177223


More information about the hotspot-compiler-dev mailing list