< prev index next >

src/java.base/share/classes/java/lang/invoke/StringConcatFactory.java

Print this page

        

*** 42,51 **** --- 42,52 ---- import java.util.Properties; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; import java.util.function.Function; + import static java.lang.invoke.MethodHandles.Lookup.*; import static jdk.internal.org.objectweb.asm.Opcodes.*; /** * <p>Methods to facilitate the creation of String concatenation methods, that * can be used to efficiently concatenate a known number of arguments of known
*** 1136,1147 **** mv.visitEnd(); cw.visitEnd(); byte[] classBytes = cw.toByteArray(); try { ! Class<?> hostClass = lookup.lookupClass(); ! Class<?> innerClass = UNSAFE.defineAnonymousClass(hostClass, classBytes, null); UNSAFE.ensureClassInitialized(innerClass); dumpIfEnabled(innerClass.getName(), classBytes); return Lookup.IMPL_LOOKUP.findStatic(innerClass, METHOD_NAME, args); } catch (Exception e) { dumpIfEnabled(className + "$$FAILED", classBytes); --- 1137,1147 ---- mv.visitEnd(); cw.visitEnd(); byte[] classBytes = cw.toByteArray(); try { ! Class<?> innerClass = lookup.defineClassWithNoCheck(classBytes, HIDDEN_NESTMATE); UNSAFE.ensureClassInitialized(innerClass); dumpIfEnabled(innerClass.getName(), classBytes); return Lookup.IMPL_LOOKUP.findStatic(innerClass, METHOD_NAME, args); } catch (Exception e) { dumpIfEnabled(className + "$$FAILED", classBytes);
< prev index next >