mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 14:54:52 +02:00
8337167: StringSize deduplication
Reviewed-by: liach, rriggs
This commit is contained in:
parent
487450cb5e
commit
7f11935461
8 changed files with 40 additions and 95 deletions
|
@ -26,6 +26,7 @@
|
|||
package java.lang;
|
||||
|
||||
import jdk.internal.misc.Unsafe;
|
||||
import jdk.internal.util.DecimalDigits;
|
||||
import jdk.internal.vm.annotation.ForceInline;
|
||||
|
||||
import java.lang.invoke.MethodHandle;
|
||||
|
@ -96,7 +97,7 @@ final class StringConcatHelper {
|
|||
* @return new length and coder
|
||||
*/
|
||||
static long mix(long lengthCoder, int value) {
|
||||
return checkOverflow(lengthCoder + Integer.stringSize(value));
|
||||
return checkOverflow(lengthCoder + DecimalDigits.stringSize(value));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -107,7 +108,7 @@ final class StringConcatHelper {
|
|||
* @return new length and coder
|
||||
*/
|
||||
static long mix(long lengthCoder, long value) {
|
||||
return checkOverflow(lengthCoder + Long.stringSize(value));
|
||||
return checkOverflow(lengthCoder + DecimalDigits.stringSize(value));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue