From 91ddb6d8f29d931ff4b83dc74fd030de97b1a15d Mon Sep 17 00:00:00 2001 From: Foivos Zakkak Date: Mon, 17 Jun 2024 14:19:37 +0300 Subject: [PATCH] Recompute unsafe ArrayIndexShift vallue in shaded jctools Removes warning: ``` Warning: RecomputeFieldValue.ArrayIndexScale automatic substitution failed. The automatic substitution registration was attempted because a call to jdk.internal.misc.Unsafe.arrayIndexScale(Class) was detected in the static initializer of io.netty.util.internal.shaded.org.jctools.util.UnsafeLongArrayAccess. Detailed failure reason(s): Could not determine the field where the value produced by the call to jdk.internal.misc.Unsafe.arrayIndexScale(Class) for the array index scale computation is stored. The call is not directly followed by a field store or by a sign extend node followed directly by a field store. ``` --- .../quarkus/netty/runtime/graal/NettySubstitutions.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/extensions/netty/runtime/src/main/java/io/quarkus/netty/runtime/graal/NettySubstitutions.java b/extensions/netty/runtime/src/main/java/io/quarkus/netty/runtime/graal/NettySubstitutions.java index be76939ecf7ac..37a79003cd594 100644 --- a/extensions/netty/runtime/src/main/java/io/quarkus/netty/runtime/graal/NettySubstitutions.java +++ b/extensions/netty/runtime/src/main/java/io/quarkus/netty/runtime/graal/NettySubstitutions.java @@ -613,6 +613,14 @@ private static PrivateKey getPrivateKeyFromByteBuffer(ByteBuf encodedKeyBuf, Str } } +@TargetClass(className = "io.netty.util.internal.shaded.org.jctools.util.UnsafeLongArrayAccess") +final class Target_io_netty_util_internal_shaded_org_jctools_util_UnsafeRefArrayAccess { + + @Alias + @RecomputeFieldValue(kind = RecomputeFieldValue.Kind.ArrayIndexShift, declClass = Object[].class) + public static int LONG_ELEMENT_SHIFT; +} + class IsBouncyNotThere implements BooleanSupplier { @Override