8165492: Reduce number of lambda forms generated by MethodHandleInlineCopyStrategy

Reviewed-by: mhaupt, vlivanov, psandoz, shade
This commit is contained in:
Claes Redestad 2016-09-12 13:23:07 +02:00
parent ed6ffa4c96
commit 32f983128d
4 changed files with 173 additions and 79 deletions

View file

@ -334,11 +334,15 @@ final class StringConcatHelper {
/**
* Instantiates the String with given buffer and coder
* @param buf buffer to use
* @param index remaining index
* @param coder coder to use
* @return String resulting string
*/
static String newString(byte[] buf, byte coder) {
static String newString(byte[] buf, int index, byte coder) {
// Use the private, non-copying constructor (unsafe!)
if (index != 0) {
throw new InternalError("Storage is not completely initialized, " + index + " bytes left");
}
return new String(buf, coder);
}