8245094: Reduce overhead of initializing the default StringConcatFactory strategy
Reviewed-by: psandoz, jlaskey
This commit is contained in:
parent
e83968799e
commit
150d6cfea8
@ -2283,6 +2283,10 @@ public final class System {
|
||||
return StringConcatHelper.lookupStatic(name, methodType);
|
||||
}
|
||||
|
||||
public long stringConcatInitialCoder() {
|
||||
return StringConcatHelper.initialCoder();
|
||||
}
|
||||
|
||||
public Object classData(Class<?> c) {
|
||||
return c.getClassData();
|
||||
}
|
||||
|
@ -1724,12 +1724,7 @@ public final class StringConcatFactory {
|
||||
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 @@ public interface JavaLangAccess {
|
||||
*/
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user