aboutsummaryrefslogtreecommitdiff
path: root/src/java.base/share/classes/java/lang/StringConcatHelper.java
diff options
context:
space:
mode:
authorMandy Chung <mchung@openjdk.org>2020-04-21 06:55:38 -0700
committerMandy Chung <mchung@openjdk.org>2020-04-21 06:55:38 -0700
commit7cc137105928ec109a29d9315565f7f49af3cf2b (patch)
treee183db4d2bbfe1988dcba6fcaf4581228b026a2e /src/java.base/share/classes/java/lang/StringConcatHelper.java
parent642041adbcaa496a10c266c6dbfe9b1b7c670419 (diff)
downloadopenjdk-7cc137105928ec109a29d9315565f7f49af3cf2b.tar.gz
openjdk-7cc137105928ec109a29d9315565f7f49af3cf2b.zip
8238358: Implementation of JEP 371: Hidden Classes
Co-authored-by: Lois Foltan <lois.foltan@oracle.com> Co-authored-by: David Holmes <david.holmes@oracle.com> Co-authored-by: Harold Seigel <harold.seigel@oracle.com> Co-authored-by: Serguei Spitsyn <serguei.spitsyn@oracle.com> Co-authored-by: Alex Buckley <alex.buckley@oracle.com> Co-authored-by: Jamsheed Mohammed C M <jamsheed.c.m@oracle.com> Co-authored-by: Jan Lahoda <jan.lahoda@oracle.com> Co-authored-by: Amy Lu <amy.lu@oracle.com> Reviewed-by: alanb, cjplummer, coleenp, dholmes, dlong, forax, jlahoda, psandoz, plevart, sspitsyn, vromero
Diffstat (limited to 'src/java.base/share/classes/java/lang/StringConcatHelper.java')
-rw-r--r--src/java.base/share/classes/java/lang/StringConcatHelper.java13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/java.base/share/classes/java/lang/StringConcatHelper.java b/src/java.base/share/classes/java/lang/StringConcatHelper.java
index b0b263af5ec..41fa6cca15d 100644
--- a/src/java.base/share/classes/java/lang/StringConcatHelper.java
+++ b/src/java.base/share/classes/java/lang/StringConcatHelper.java
@@ -28,6 +28,10 @@ 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}
@@ -466,4 +470,13 @@ final class StringConcatHelper {
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);
+ }
+ }
+
+
}