RFR: 8360000: RISC-V: implement aot [v2]

Andrew Dinn adinn at openjdk.org
Mon Jul 7 12:32:42 UTC 2025


On Fri, 4 Jul 2025 13:50:05 GMT, Hamlin Li <mli at openjdk.org> wrote:

>> Hi,
>> Can you help to review this patch?
>> 
>> https://openjdk.org/jeps/483 introduced aot (class loading/linking) and subsequent prs introduced more features related to it, like preserve adapters(c2i/i2c) and runtime blobs in AOT code cache.
>> 
>> Riscv should support these features and resolve relative issues.
>> 
>> ## Test
>> 
>> ### jtreg
>> 
>> run tier1/2/3 and hotspot_cds tests, no new failure found compared to master jdk. 
>> 
>> ### Performance
>> 
>> perf command to run the simplest Hello world java program:
>> * (perf stat -r 100 ${JAVA_HOME}/bin/java -XX:AOTCache=$AOT_CACHE -cp $CLASS_PATH Hello > /dev/null) 2>&1 | grep elapsed
>> 
>> perf data:
>> * (with patch): 0.181730 +- 0.000296 seconds time elapsed ( +- 0.16% )
>> * (without patch): 0.196627 +- 0.000227 seconds time elapsed ( +- 0.12% )
>> 
>> Thanks
>
> Hamlin Li has updated the pull request incrementally with two additional commits since the last revision:
> 
>  - pass msg via a0 in stop
>  - comment

@Hamlin-Li @RealFYang I think it might be better to discuss this with on the leyden-dev mailing list before trying to implement the changes needed to match what has been done for AArch64 and x86_64. One good reason for caution is that the Leyden premain project is planning to add further code save/restore capabilities to mainline that have already been prototyped in the Leyden premain branch. So, if you enable AOT code cache initialization for RISCV then you will need to be able/ready to provide all the other parts of the implementation when they arrive.

It might be safer to implement what is needed in premain (or in a downstream clone) after discussing both what is needed and why it is needed with the Leyden devs. It would also help if you were to use the testing and benchmark programs that the project is using to check that the aot code cache is working correctly and actually boosting performance.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/26101#issuecomment-3044850283


More information about the hotspot-dev mailing list