[jdk11u-dev] RFR: 8234930: Use MAP_JIT when allocating pages for code cache on macOS
Thomas Stuefe
stuefe at openjdk.java.net
Thu Dec 9 09:49:18 UTC 2021
On Wed, 8 Dec 2021 16:55:16 GMT, Vladimir Kempik <vkempik at openjdk.org> wrote:
> Hello, here is alternative backport of 8234930 to jdk11u.
> Very minimalistic change for platforms other than macos, just one unused argument.
> We have used this patch in zulu11 for more than a year now and found no issues with it on macos and other platforms.
>
> Technically it's mostly the same as previous (3patch) version but has no prerequests.
> > 2. Please, instead of adding "exec" to every version of pd_commit/uncommit, only add it for MacOS like this:
> >
> > ```
> > pd_uncommit_memory(char* addr, size_t bytes MACOS_ONLY(, bool exec));
> > pd_commit_memory(char* addr, size_t bytes MACOS_ONLY(, bool exec));
> > ```
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > and do the same with the two places where this parameter actually matters on invocation (os.cpp and VirtualSpace).
> > Thanks, Thomas
>
> Hello Thomas, that plan doesn't seem to work
>
> ```
> /Users/vkempik/ws/openjdk/git/jdk11u-dev/src/hotspot/share/runtime/os.hpp:349:71: error: too many arguments provided to function-like macro invocation
> static bool uncommit_memory(char* addr, size_t bytes MACOS_ONLY(, bool executable = false));
> ^
> /Users/vkempik/ws/openjdk/git/jdk11u-dev/src/hotspot/share/utilities/macros.hpp:422:9: note: macro 'MACOS_ONLY' defined here
> #define MACOS_ONLY(code) code
> ```
>
> placing whole line under macro seems to work
>
> ```
> MACOS_ONLY(static bool pd_uncommit_memory(char* addr, size_t bytes,
> bool executable = false);)
> NOT_MACOS(static bool pd_uncommit_memory(char* addr, size_t bytes);)
> ```
Hmm, weird, we use this syntax in many places. Okay, if this turns out to be too ugly, feel free to ignore my request (2) and keep the platform-dependent changes in all versions of pd_commit/uncommit. I leave this up to you.
Thanks, Thomas
-------------
PR: https://git.openjdk.java.net/jdk11u-dev/pull/710
More information about the jdk-updates-dev
mailing list