From c4daec516d3f3f5ba84c706eeb1835b3a266f19e Mon Sep 17 00:00:00 2001 From: Maurizio Cimadamore Date: Wed, 2 Oct 2024 14:58:00 +0100 Subject: [PATCH] Add `@ForceInline` to `MethodHandle::asType`, as per review comment --- src/java.base/share/classes/java/lang/invoke/MethodHandle.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/java.base/share/classes/java/lang/invoke/MethodHandle.java b/src/java.base/share/classes/java/lang/invoke/MethodHandle.java index a6f8321635ebb..9d8c0f70e2dc7 100644 --- a/src/java.base/share/classes/java/lang/invoke/MethodHandle.java +++ b/src/java.base/share/classes/java/lang/invoke/MethodHandle.java @@ -28,6 +28,7 @@ import jdk.internal.loader.ClassLoaders; import jdk.internal.vm.annotation.DontInline; +import jdk.internal.vm.annotation.ForceInline; import jdk.internal.vm.annotation.IntrinsicCandidate; import java.lang.constant.ClassDesc; @@ -857,6 +858,7 @@ public Object invokeWithArguments(java.util.List arguments) throws Throwable * @throws WrongMethodTypeException if the conversion cannot be made * @see MethodHandles#explicitCastArguments */ + @ForceInline public final MethodHandle asType(MethodType newType) { // Fast path alternative to a heavyweight {@code asType} call. // Return 'this' if the conversion will be a no-op.