RFR: 8332670: C1 clone intrinsic needs memory barriers [v2]
Galder Zamarreño
galder at openjdk.org
Wed Jun 5 15:40:16 UTC 2024
> Adds a storestore barrier after copying the contents in the primitive array intrinsic (credit @shipilev). The barrier is a no-op in platforms where not needed so no need for an ifdef.
>
> The barrier after new array creation is only added if zeroing the array on aarch64 (credit @dean-long). Since the primitive array clone intrinsic does not zero the array, that means there's a single barrier added for this use case.
>
> There's no barrier added on x86 c1 macro assembler for nothing to do there.
>
> I've run the following tests:
> * tier 1 on darwin/aarch64
> * tier 1 on linux/x86_64
> * `hotspot_compiler` tests on darwin/aarch64
> * `copy.clone.arrays` jcstress tests on darwin/aarch64.
>
> I tried but was unable to create a standalone test for the jdk source tree that would fail.
>
> FYI @bulasevich @TheRealMDoerr @RealFYang @RealLucy similar platform specific c1 macro assembler changes might be required for other platforms.
Galder Zamarreño has updated the pull request incrementally with one additional commit since the last revision:
Keep storestore barrier for array allocation
* Having c1 array clone use 2 storestore barriers
has no performance impact, so it's safer to keep it in place.
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/19538/files
- new: https://git.openjdk.org/jdk/pull/19538/files/6400b755..24d72c67
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=19538&range=01
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=19538&range=00-01
Stats: 6 lines in 1 file changed: 0 ins; 5 del; 1 mod
Patch: https://git.openjdk.org/jdk/pull/19538.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/19538/head:pull/19538
PR: https://git.openjdk.org/jdk/pull/19538
More information about the hotspot-compiler-dev
mailing list