equal
deleted
inserted
replaced
155 private final Surrogate.Parser sgp = new Surrogate.Parser(); |
155 private final Surrogate.Parser sgp = new Surrogate.Parser(); |
156 |
156 |
157 // Method possible replaced with a compiler intrinsic. |
157 // Method possible replaced with a compiler intrinsic. |
158 private static int encodeISOArray(char[] sa, int sp, |
158 private static int encodeISOArray(char[] sa, int sp, |
159 byte[] da, int dp, int len) { |
159 byte[] da, int dp, int len) { |
|
160 if (len <= 0) { |
|
161 return 0; |
|
162 } |
160 encodeISOArrayCheck(sa, sp, da, dp, len); |
163 encodeISOArrayCheck(sa, sp, da, dp, len); |
161 return implEncodeISOArray(sa, sp, da, dp, len); |
164 return implEncodeISOArray(sa, sp, da, dp, len); |
162 } |
165 } |
163 |
166 |
164 @HotSpotIntrinsicCandidate |
167 @HotSpotIntrinsicCandidate |
175 return i; |
178 return i; |
176 } |
179 } |
177 |
180 |
178 private static void encodeISOArrayCheck(char[] sa, int sp, |
181 private static void encodeISOArrayCheck(char[] sa, int sp, |
179 byte[] da, int dp, int len) { |
182 byte[] da, int dp, int len) { |
180 if (len <= 0) { |
|
181 return; // not an error because encodeISOArrayImpl won't execute if len <= 0 |
|
182 } |
|
183 |
|
184 Objects.requireNonNull(sa); |
183 Objects.requireNonNull(sa); |
185 Objects.requireNonNull(da); |
184 Objects.requireNonNull(da); |
186 |
185 |
187 if (sp < 0 || sp >= sa.length) { |
186 if (sp < 0 || sp >= sa.length) { |
188 throw new ArrayIndexOutOfBoundsException(sp); |
187 throw new ArrayIndexOutOfBoundsException(sp); |