[crac] RFR: 8368929: [CRaC] Move CPUFeatures check to C/R engine
Radim Vansa
rvansa at openjdk.org
Thu Oct 2 10:12:28 UTC 2025
On Wed, 1 Oct 2025 12:50:20 GMT, Jan Kratochvil <jkratochvil at openjdk.org> wrote:
>> How is this different from creating an arch-specific method with different implementations? To me that look just like a boilerplate (and the presence is only checked for currently compiled arch - so I won't make sure that the code work on all archs).
>
> It is true there are no target-specific files/classes. But there still can be:
>
> class crac {
> static bool is_x86_64() {
> #ifdef __x86_64__
> return true;
> #else
> return false;
> #endif
> };
> };
> if (is_x86_64()) {
> ...
> }
>
> Then all arch-specific code is compile-time checked on all arches.
The ifdef in here is doing exactly that - guarding a VM option that is defined only on x86_64... though it looks like the CI is compiling against the 'zero' architecture (which lacks the VM option despite the macro is defined).
-------------
PR Review Comment: https://git.openjdk.org/crac/pull/266#discussion_r2398158611
More information about the crac-dev
mailing list