RFR: 8327426: RISC-V: Move alignment shim into initialize_header() in C1_MacroAssembler::allocate_array
Gui Cao
gcao at openjdk.org
Wed Mar 6 05:15:05 UTC 2024
Hi, I noticed that RISC-V missed this change from https://github.com/openjdk/jdk/pull/11044 , comments as follow [1]:
`I know @albertnetymk already touched on this but some thoughts on the unclear boundaries between the header and the data. My feeling is that the most pragmatic solution would be to have the header initialization always initialize up to the word aligned (up) header_size_in_bytes. (Similarly to how it is done for the instanceOop where the klass gap gets initialized with the header, even if it may be data.) And have the body initialization do the rest (word aligned to word aligned clear).`
`This seems preferable than adding these extra alignment shims in-between the header and body/payload/data initialization. (I also tried moving the alignment fix into the body initialization, but it seems a little bit messier in the implementation.)`
After this patch, it will be more consistent with other CPU platforms like X86 and ARM64.
[1] https://github.com/openjdk/jdk/pull/11044#pullrequestreview-1894323275
### Tests
- [x] Run tier1-3 tests on SiFive unmatched (release)
-------------
Commit messages:
- 8327426: RISC-V: Move alignment shim into initialize_header() in C1_MacroAssembler::allocate_array
Changes: https://git.openjdk.org/jdk/pull/18131/files
Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=18131&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8327426
Stats: 16 lines in 1 file changed: 6 ins; 7 del; 3 mod
Patch: https://git.openjdk.org/jdk/pull/18131.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/18131/head:pull/18131
PR: https://git.openjdk.org/jdk/pull/18131
More information about the hotspot-compiler-dev
mailing list