summaryrefslogtreecommitdiff
path: root/src/java.base/share/classes/java/lang/System.java
diff options
context:
space:
mode:
authorClaes Redestad <redestad@openjdk.org>2021-02-19 15:05:25 +0000
committerClaes Redestad <redestad@openjdk.org>2021-02-19 15:05:25 +0000
commit433096a45ea847e2e2ae8cd5a100971939f6a11f (patch)
tree503889b178e7c2c08750593e8ab139d554b4ed38 /src/java.base/share/classes/java/lang/System.java
parentefbaedeb815d7913bdef6fe19a798ed4b83d58e7 (diff)
downloadopenjdk-433096a45ea847e2e2ae8cd5a100971939f6a11f.tar.gz
openjdk-433096a45ea847e2e2ae8cd5a100971939f6a11f.zip
8261744: Implement CharsetDecoder ASCII and latin-1 fast-paths
Reviewed-by: naoto, alanb
Diffstat (limited to 'src/java.base/share/classes/java/lang/System.java')
-rw-r--r--src/java.base/share/classes/java/lang/System.java15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/java.base/share/classes/java/lang/System.java b/src/java.base/share/classes/java/lang/System.java
index db1b20b3fd7..706077f803a 100644
--- a/src/java.base/share/classes/java/lang/System.java
+++ b/src/java.base/share/classes/java/lang/System.java
@@ -1981,6 +1981,11 @@ public final class System {
* Initialize the system class. Called after thread initialization.
*/
private static void initPhase1() {
+
+ // register the shared secrets - do this first, since SystemProps.initProperties
+ // might initialize CharsetDecoders that rely on it
+ setJavaLangAccess();
+
// VM might invoke JNU_NewStringPlatform() to set those encoding
// sensitive properties (user.home, user.name, boot.class.path, etc.)
// during "props" initialization.
@@ -2026,8 +2031,6 @@ public final class System {
Thread current = Thread.currentThread();
current.getThreadGroup().add(current);
- // register shared secrets
- setJavaLangAccess();
// Subsystems that are invoked during initialization can invoke
// VM.isBooted() in order to avoid doing things that should
@@ -2277,6 +2280,14 @@ public final class System {
return String.getBytesUTF8NoRepl(s);
}
+ public void inflateBytesToChars(byte[] src, int srcOff, char[] dst, int dstOff, int len) {
+ StringLatin1.inflate(src, srcOff, dst, dstOff, len);
+ }
+
+ public int decodeASCII(byte[] src, int srcOff, char[] dst, int dstOff, int len) {
+ return String.decodeASCII(src, srcOff, dst, dstOff, len);
+ }
+
public void setCause(Throwable t, Throwable cause) {
t.setCause(cause);
}