mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 06:45:07 +02:00
8311906: Improve robustness of String constructors with mutable array inputs
Co-authored-by: Damon Fenacci <dfenacci@openjdk.org> Co-authored-by: Claes Redestad <redestad@openjdk.org> Co-authored-by: Amit Kumar <amitkumar@openjdk.org> Co-authored-by: Martin Doerr <mdoerr@openjdk.org> Reviewed-by: rgiulietti, thartmann, redestad, dfenacci
This commit is contained in:
parent
316b78336c
commit
155abc576a
15 changed files with 1300 additions and 248 deletions
|
@ -44,6 +44,11 @@ public class Helper {
|
|||
return dst;
|
||||
}
|
||||
|
||||
@jdk.internal.vm.annotation.ForceInline
|
||||
public static int compress(byte[] src, int srcOff, byte[] dst, int dstOff, int len) {
|
||||
return StringUTF16.compress(src, srcOff, dst, dstOff, len);
|
||||
}
|
||||
|
||||
@jdk.internal.vm.annotation.ForceInline
|
||||
public static byte[] compressChar(char[] src, int srcOff, int dstSize, int dstOff, int len) {
|
||||
byte[] dst = new byte[dstSize];
|
||||
|
@ -51,6 +56,11 @@ public class Helper {
|
|||
return dst;
|
||||
}
|
||||
|
||||
@jdk.internal.vm.annotation.ForceInline
|
||||
public static int compress(char[] src, int srcOff, byte[] dst, int dstOff, int len) {
|
||||
return StringUTF16.compress(src, srcOff, dst, dstOff, len);
|
||||
}
|
||||
|
||||
@jdk.internal.vm.annotation.ForceInline
|
||||
public static byte[] inflateByte(byte[] src, int srcOff, int dstSize, int dstOff, int len) {
|
||||
byte[] dst = new byte[dstSize];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue