Skip to content
Permalink
Browse files

8245094: Reduce overhead of initializing the default StringConcatFact…

…ory strategy

Reviewed-by: psandoz, jlaskey
  • Loading branch information
cl4es committed May 15, 2020
1 parent e839687 commit 150d6cfea81afd3900ff69a7ab60efdadf5de76d
@@ -2283,6 +2283,10 @@ public MethodHandle stringConcatHelper(String name, MethodType methodType) {
return StringConcatHelper.lookupStatic(name, methodType);
}

public long stringConcatInitialCoder() {
return StringConcatHelper.initialCoder();
}

public Object classData(Class<?> c) {
return c.getClassData();
}
@@ -1724,12 +1724,7 @@ public MethodHandle apply(Class<?> c) {
private static final long INITIAL_CODER;

static {
try {
MethodHandle initCoder = JLA.stringConcatHelper("initialCoder", methodType(long.class));
INITIAL_CODER = (long) initCoder.invoke();
} catch (Throwable e) {
throw new AssertionError(e);
}
INITIAL_CODER = JLA.stringConcatInitialCoder();

PREPENDERS = new ConcurrentHashMap<>();
MIXERS = new ConcurrentHashMap<>();
@@ -333,6 +333,11 @@
*/
MethodHandle stringConcatHelper(String name, MethodType methodType);

/**
* Get the string concat initial coder
*/
long stringConcatInitialCoder();

/*
* Get the class data associated with the given class.
* @param c the class

0 comments on commit 150d6cf

Please sign in to comment.