RFR: 8344355: Register corruption in MacroAssembler::lookup_secondary_supers_table_var: x86-64 only [v2]

Dean Long dlong at openjdk.org
Wed Nov 27 01:05:46 UTC 2024


On Tue, 26 Nov 2024 19:23:39 GMT, Vladimir Ivanov <vlivanov at openjdk.org> wrote:

>>> I understand that it greatly increases the reproducibility of the bug, but does such an adhoc code snippet adds much from maintenance perspective? Reusing registers is common in assembly code, so if all places where a register value is destroyed are annotated in a similar way, it would add a lot of noise on source code level.
>> 
>> The point isn't so much that it's destroyed, but that it's destroyed on a rarely-used code path, in this case on a code path that is only ever executed on an obsolete machine. We've had the same problem on AArch64, where there are the old and new versions of compare-and-swap, and fixed the testing in the same way.
>
> Ok, thanks for the pointer. 
> 
> I'm fine with keeping the patch as it is, but I would definitely prefer a cleaner way to zap registers when it comes to scaling its usage across the code base.
> 
> FTR there's a special  place `globalDefinitions.hpp` for constants used for debugging. And I'd be confused to find out that the constant is spelled in camel case after trying to grep for it :-)

It might be useful to have a testing flag that simulates old hardware on modern hardware.  So for example, it would turn off UsePopCountInstruction.  We have something similar on x86 with UseKNLSetting.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/22365#discussion_r1859516618


More information about the hotspot-dev mailing list