< prev index next >

src/java.base/share/classes/java/lang/StringConcatHelper.java

Print this page

        

@@ -26,10 +26,14 @@
 package java.lang;
 
 import jdk.internal.misc.Unsafe;
 import jdk.internal.vm.annotation.ForceInline;
 
+import java.lang.invoke.MethodHandle;
+import java.lang.invoke.MethodHandles;
+import java.lang.invoke.MethodType;
+
 /**
  * Helper for string concatenation. These methods are mostly looked up with private lookups
  * from {@link java.lang.invoke.StringConcatFactory}, and used in {@link java.lang.invoke.MethodHandle}
  * combinators there.
  */

@@ -464,6 +468,15 @@
      */
     static long initialCoder() {
         return String.COMPACT_STRINGS ? LATIN1 : UTF16;
     }
 
+    static MethodHandle lookupStatic(String name, MethodType methodType) {
+        try {
+            return MethodHandles.lookup().findStatic(StringConcatHelper.class, name, methodType);
+        } catch (NoSuchMethodException|IllegalAccessException e) {
+            throw new AssertionError(e);
+        }
+    }
+
+
 }
< prev index next >