RFR: 8290840: Refactor the "os" class [v2]
Thomas Stuefe
stuefe at openjdk.org
Mon Aug 1 19:32:13 UTC 2022
On Mon, 1 Aug 2022 16:04:25 GMT, Gerard Ziemski <gziemski at openjdk.org> wrote:
>> After this PR, os.hpp no longer includes any os- or cpu-specific os_xxx.hpp files. I did this to avoid including large amount of os-specific declarations (such as os::Linux, which is about 400 lines) into generic source files, which aren't interested in these declarations.
>>
>> As a result of this change, there's no way to let os.hpp know whether `HAVE_FUNCTION_DESCRIPTORS` is defined for the current OS+CPU. If we want to do that, we need to either:
>>
>> - include os_xxx.hpp back in os.hpp (which I want to avoid)
>> - add new header files such as `os_<os>.defs.hpp` `os_<os>_<cpu>.defs.hpp` to define `HAVE_FUNCTION_DESCRIPTORS` (this will result in lots of header files that usually have nothing inside)
>>
>> Since there are only 4 functions that fall under this pattern (functions that are used in generic code but most platforms have dummy implementations), I think what I have is a good compromise
>
> Could we do:
>
>
> #if defined(LINUX) && defined(PPC) && !defined(ABI_ELFv2)
> #define HAVE_FUNCTION_DESCRIPTORS
> #endif
>
>
> in `os.hpp` and whatever the equivalent for AIX/PPC is?
#if defined(PPC) && !defined(ABI_ELFv2)
#define HAVE_FUNCTION_DESCRIPTORS
#endif
should do the trick. AIX uses XCOFF, not Elf, so ABI_ELFv2 should never be defined.
But I have no emotions. We can leave it like this. Or do it in a follow up.
-------------
PR: https://git.openjdk.org/jdk/pull/9600
More information about the hotspot-dev
mailing list