RFR: 8299168: RISC-V: Fix MachNode size mismatch for MacroAssembler::_verify_oops*
Fei Yang
fyang at openjdk.org
Wed Dec 21 07:35:49 UTC 2022
On Wed, 21 Dec 2022 04:47:51 GMT, Xiaolin Zheng <xlinzheng at openjdk.org> wrote:
> Nearly the same as [JDK-8285437](https://bugs.openjdk.org/browse/JDK-8285437). MachNode size should match in scratch emission and real emission phases. The address of the local char buffer is a random value, but when RVC is enabled, the `movptr`, containing `lui+addi+slli+addi+slli`, with another dangling `addi` at last to load the immediate address of the special local char buffer may get compressed depending on the char buffer's different addresses. So the size may at last mismatch. Due to this part containing implicit fixed-length semantics, it shall be a reasonable fix to add an `IncompressibleRegion` for these two special positions to disable automatic RVC transformations.
>
> `test/hotspot/jtreg/testlibrary_tests/ir_framework/tests/TestDFlags.java` in hotspot tier4 can reflect this issue. It contains a `vm.flagless` so it didn't run in my local environment until recently.
>
> Tested Hotspot tier1~4 with fastdebug build on physical hardware along with some other patches.
>
> Thanks,
> Xiaolin
Looks like the code comments could be further improved. Did you checked other possible occurrences else where?
src/hotspot/cpu/riscv/macroAssembler_riscv.cpp line 414:
> 412: // The length of the instruction sequence emitted should be independent
> 413: // of the value of the local char buffer address so that the size of mach
> 414: // nodes for scratch emit and normal emit matches.
Suggestion:
"
// The length of the instruction sequence emitted should not depend
// on the address of the char buffer so that the size of mach nodes for
// scratch emit and normal emit matches.
"
src/hotspot/cpu/riscv/macroAssembler_riscv.cpp line 459:
> 457: // The length of the instruction sequence emitted should be independent
> 458: // of the value of the local char buffer address so that the size of mach
> 459: // nodes for scratch emit and normal emit matches.
Same as above.
-------------
PR: https://git.openjdk.org/jdk/pull/11750
More information about the hotspot-dev
mailing list