mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 06:45:07 +02:00
8318457: Use prefix-less prepend methods directly to reduce branches in String concat expressions
Reviewed-by: jlaskey, liach
This commit is contained in:
parent
71c99a0e59
commit
fe52917054
3 changed files with 35 additions and 30 deletions
|
@ -61,7 +61,7 @@ class FormatItem {
|
|||
private static final MethodHandle STRING_PREPEND =
|
||||
JLA.stringConcatHelper("prepend",
|
||||
MethodType.methodType(long.class, long.class, byte[].class,
|
||||
String.class, String.class));
|
||||
String.class));
|
||||
|
||||
private static final MethodHandle SELECT_GETCHAR_MH =
|
||||
JLA.stringConcatHelper("selectGetChar",
|
||||
|
@ -87,8 +87,7 @@ class FormatItem {
|
|||
|
||||
private static long stringPrepend(long lengthCoder, byte[] buffer,
|
||||
String value) throws Throwable {
|
||||
return (long)STRING_PREPEND.invokeExact(lengthCoder, buffer, value,
|
||||
(String)null);
|
||||
return (long)STRING_PREPEND.invokeExact(lengthCoder, buffer, value);
|
||||
}
|
||||
|
||||
private static MethodHandle selectGetChar(long indexCoder) throws Throwable {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue