RFR: 8377507: Store cpu features in AOTCodeCache
Vladimir Kozlov
kvn at openjdk.org
Wed Feb 11 09:28:46 UTC 2026
On Tue, 10 Feb 2026 15:04:05 GMT, Ashutosh Mehra <asmehra at openjdk.org> wrote:
> This PR adds the ability to cache and validate cpu features in the AOTCodeCache. It adds new APIs to `Abstract_VM_Version` to facilitate retrieval, storage and validation of cpu features between assembly phase and production run. Default implementation of these APIs is no-op. Each platform that supports AOTCodeCache can implement these APIs in the arch-specific `VM_Version` class.
> This patch follows the Leyden premain implementation. It allows the cpu feature set of the production run to be a super-set of that of the assembly phase. This may change in future if we decide to that the cpu feature set should be the exact match.
Please update copyright year in updated files.
src/hotspot/share/code/aotCodeCache.cpp line 440:
> 438: if (log.is_enabled()) {
> 439: log.print_cr("Available CPU features: %s", VM_Version::features_string());
> 440: }
I don't think output needed. As I noticed in my testing, it is usually duplicate of recorded features you print next.
May be in addition to report when features are not supported print which features does not match but we can still use AOT code.
test/hotspot/jtreg/runtime/cds/appcds/aotCode/AOTCodeCPUFeatureIncompatibilityTest.java line 2:
> 1: /*
> 2: * Copyright (c) 2025, Oracle and/or its affiliates. All rights reserved.
Update copyright year by adding 2026.
-------------
PR Review: https://git.openjdk.org/jdk/pull/29655#pullrequestreview-3780419735
PR Review Comment: https://git.openjdk.org/jdk/pull/29655#discussion_r2789235610
PR Review Comment: https://git.openjdk.org/jdk/pull/29655#discussion_r2789241220
More information about the hotspot-dev
mailing list