RFR: 8269119: C2: Avoid redundant memory barriers in Unsafe.copyMemory0 intrinsic [v4]
Vladimir Ivanov
vlivanov at openjdk.java.net
Mon Sep 6 14:20:27 UTC 2021
On Mon, 6 Sep 2021 06:45:15 GMT, Tobias Hartmann <thartmann at openjdk.org> wrote:
>> Vladimir Ivanov has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Stress instruction scheduling
>
> src/hotspot/share/opto/library_call.cpp line 4082:
>
>> 4080: bool is_mixed = !in_heap && !in_native;
>> 4081:
>> 4082: bool is_prim_array = (addr_t != NULL) && (addr_t->elem() != Type::BOTTOM);
>
> What does `is_prim_array` stand for? I read this as "is primitive array" which does not make sense :)
Yes, it stands for "primitive array".
Unsafe.copyMemory() validates inputs using Unsafe.checkPrimitiveArray() to ensure they are primitive arrays for on-heap accesses. I refactored `has_wide_mem` a bit to make it a bit clearer what's going on.
> test/hotspot/jtreg/compiler/unsafe/UnsafeCopyMemory.java line 31:
>
>> 29: *
>> 30: * @run main/othervm -Xbatch -XX:CompileCommand=dontinline,compiler.unsafe.UnsafeCopyMemory::test*
>> 31: * -XX:+UnlockDiagnosticVMOptions -XX:+StressGCM -XX:+StressLCM
>
> You should add `@key stress` to the test.
Fixed.
-------------
PR: https://git.openjdk.java.net/jdk/pull/5259
More information about the hotspot-compiler-dev
mailing list