mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 06:45:07 +02:00
8274242: Implement fast-path for ASCII-compatible CharsetEncoders on x86
Reviewed-by: naoto, thartmann
This commit is contained in:
parent
c4d115701d
commit
aaa36cc006
28 changed files with 428 additions and 391 deletions
|
@ -46,7 +46,7 @@ class StringCoding {
|
|||
|
||||
@IntrinsicCandidate
|
||||
public static int implEncodeISOArray(byte[] sa, int sp,
|
||||
byte[] da, int dp, int len) {
|
||||
byte[] da, int dp, int len) {
|
||||
int i = 0;
|
||||
for (; i < len; i++) {
|
||||
char c = StringUTF16.getChar(sa, sp++);
|
||||
|
@ -57,4 +57,18 @@ class StringCoding {
|
|||
return i;
|
||||
}
|
||||
|
||||
@IntrinsicCandidate
|
||||
public static int implEncodeAsciiArray(char[] sa, int sp,
|
||||
byte[] da, int dp, int len)
|
||||
{
|
||||
int i = 0;
|
||||
for (; i < len; i++) {
|
||||
char c = sa[sp++];
|
||||
if (c >= '\u0080')
|
||||
break;
|
||||
da[dp++] = (byte)c;
|
||||
}
|
||||
return i;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue