8u-aarch64 has this addition against 8u upstream:
https://hg.openjdk.java.net/aarch64-port/jdk8u-shenandoah/hotspot/rev/df889e70ff81
It is not clear why that addition is needed. There is no code change like that in any of upstream versions. It is also on the path that says:
// Print whatever the library wants to print, w/o fancy callbacks.
// This is mainly for debugging the library itself.
...so it does not really needed for product code? This should be reverted. If this was needed to fix some bug, it should go in via upstream updates.