RFR: 8332900: RISC-V: refactor nativeInst_riscv.cpp and macroAssembler_riscv.cpp [v3]
Hamlin Li
mli at openjdk.org
Fri May 31 07:56:00 UTC 2024
On Fri, 31 May 2024 07:40:14 GMT, Fei Yang <fyang at openjdk.org> wrote:
> There will surely be some protocols between the them under the hood.
If this protocol means lots of dual direction communication, then we should consider if it's right (from a point of view OO design, it's an obvious code smell for me).
NativeInstruction could be a wrapper upon MacroAssembler, but not in reverse direction, in that way it makes things complicated and it's not necessary and bring no benefit.
> BTW: this is also adopted by other CPUs like aarch64.
Yes, we can refer or copy some code from other platforms in case they're well implemented.
Please check https://github.com/openjdk/jdk/blob/master/src/hotspot/cpu/aarch64/nativeInst_aarch64.hpp#L137, the `extract` is not in nativeInst_aarch64, it's in assembler_aarch64.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/19459#issuecomment-2141421523
More information about the hotspot-dev
mailing list