RFR: Store cpu features in AOTCodeCache header

Ashutosh Mehra asmehra at openjdk.org
Mon Jul 14 19:22:58 UTC 2025


On Sun, 13 Jul 2025 19:38:14 GMT, Vladimir Kozlov <kvn at openjdk.org> wrote:

>> This is the initial version of storing cpu features in the AOTCodeCache to verify runtime env has the same cpu capabilities as the assembly env. It covers both x86 and aarch64.
>> AOTCodeCache header is updated to store the cpu features in arch-dependent form (although its same for currently supported architectures - x86 and aarch64).
>> 
>> It also fixes a bug - the `polling_page_vectors_safepoint_handler_blob` can be null if AVX is not present on a system. This causes crash as this blob's entry point is stored in the address table.
>> I came across this when I did the assembly run with -XX:UseAVX=0 option.
>
> src/hotspot/cpu/x86/vm_version_x86.hpp line 373:
> 
>> 371:     decl(FXSR,              fxsr,              2)  \
>> 372:     decl(HT,                ht,                3)  \
>> 373:                                                      \
> 
> Please, revert alignment change to reduce size of changes. We can do it in mainline later.

This change is not about alignment, but removing the quotes around the cpu feature names and use XSTR macro in DECLARE_CPU_FEATURE_NAME macros instead. Any change in alignment is the consequence of that.
Do you want me to go back to using quotes and remove XSTR usage?

> src/hotspot/share/code/aotCodeCache.cpp line 3253:
> 
>> 3251: #ifdef COMPILER2
>> 3252:   // polling_page_vectors_safepoint_handler_blob can be nullptr if AVX feature is not present or is disabled
>> 3253:   if (SharedRuntime::polling_page_vectors_safepoint_handler_blob() != nullptr) {
> 
> I will push this separately.

okay,  I will take this out and push it separately.

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

PR Review Comment: https://git.openjdk.org/leyden/pull/84#discussion_r2205636794
PR Review Comment: https://git.openjdk.org/leyden/pull/84#discussion_r2205637740


More information about the leyden-dev mailing list