[aarch64-port-dev ] RFC: JEP draft JDK-8251280: macOS/AArch64 Port

Andrew Haley aph at redhat.com
Mon Aug 17 12:28:50 UTC 2020

On 13/08/2020 15:47, Anton Kozlov wrote:

> Another example would be a solution to the W^X problem, parts of
> which may be useful for OpenJDK in hardened runtime[3] configuration
> on mac/x86 (the one which will use MAP_JIT mmap() flag).

The JEP looks good to me.

Re W^X: there are very few places where we now need runtime-patchable
methods in the code cache.

On AArch64, we deoptimize and recompile rather than patch in most
cases. This is because the only instructions we're allowed to patch
concurrently are direct jumps, traps, and nops.

This leads to very little slowdown in practice because in a tiered-
compilation-enabled JVM 90% of recompilations are due to tier
escalation rather than patching needed, and most fields are resolved
in the interpreter before C1 kicks in.

The remaining places we patch today are
nmethod::make_not_entrant_or_zombie and compiled inline caches for
method calls. We can perhaps get rid of the first because we now have
nmethod entry barriers, and Erik Österlund has been working on a
replacement for inline caches.

Finally, we would have to change the trampoline logic to go via a
separate data table.

I think that's it. Not that I'm suggesting you need this for Apple/
AArch64, but we're very close.

Andrew Haley  (he/him)
Java Platform Lead Engineer
Red Hat UK Ltd. <https://www.redhat.com>
EAC8 43EB D3EF DB98 CC77 2FAD A5CD 6035 332F A671

More information about the aarch64-port-dev mailing list