!606 sync master to openEuler-24.03-LTS-Next
From: @neu-mobi Reviewed-by: @kuenking111 Signed-off-by: @kuenking111
This commit is contained in:
commit
38f163769b
72
8137165-Tests-fail-in-SR_Handler-because-thread-is-n.patch
Normal file
72
8137165-Tests-fail-in-SR_Handler-because-thread-is-n.patch
Normal file
@ -0,0 +1,72 @@
|
||||
From 11116ea71b22635302759817b43c555ded53f882 Mon Sep 17 00:00:00 2001
|
||||
Subject: 8137165: Tests fail in SR_Handler because thread is not VMThread or JavaThread
|
||||
|
||||
---
|
||||
hotspot/src/os/linux/vm/os_linux.cpp | 16 +++++++++++++---
|
||||
1 file changed, 13 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/hotspot/src/os/linux/vm/os_linux.cpp b/hotspot/src/os/linux/vm/os_linux.cpp
|
||||
index 6ee49eedc..773c746af 100644
|
||||
--- a/hotspot/src/os/linux/vm/os_linux.cpp
|
||||
+++ b/hotspot/src/os/linux/vm/os_linux.cpp
|
||||
@@ -1070,6 +1070,13 @@ void os::free_thread(OSThread* osthread) {
|
||||
assert(osthread != NULL, "osthread not set");
|
||||
|
||||
if (Thread::current()->osthread() == osthread) {
|
||||
+#ifdef ASSERT
|
||||
+ sigset_t current;
|
||||
+ sigemptyset(¤t);
|
||||
+ pthread_sigmask(SIG_SETMASK, NULL, ¤t);
|
||||
+ assert(!sigismember(¤t, SR_signum), "SR signal should not be blocked!");
|
||||
+#endif
|
||||
+
|
||||
// Restore caller's signal mask
|
||||
sigset_t sigmask = osthread->caller_sigmask();
|
||||
pthread_sigmask(SIG_SETMASK, &sigmask, NULL);
|
||||
@@ -4723,7 +4730,8 @@ static void SR_handler(int sig, siginfo_t* siginfo, ucontext_t* context) {
|
||||
// after sigsuspend.
|
||||
int old_errno = errno;
|
||||
|
||||
- Thread* thread = Thread::current();
|
||||
+ Thread* thread = Thread::current_or_null();
|
||||
+ assert(thread != NULL, "Missing current thread in SR_handler");
|
||||
OSThread* osthread = thread->osthread();
|
||||
assert(thread->is_VM_thread() || thread->is_Java_thread(), "Must be VMThread or JavaThread");
|
||||
|
||||
@@ -4735,7 +4743,7 @@ static void SR_handler(int sig, siginfo_t* siginfo, ucontext_t* context) {
|
||||
os::SuspendResume::State state = osthread->sr.suspended();
|
||||
if (state == os::SuspendResume::SR_SUSPENDED) {
|
||||
sigset_t suspend_set; // signals for sigsuspend()
|
||||
-
|
||||
+ sigemptyset(&suspend_set);
|
||||
// get current set of blocked signals and unblock resume signal
|
||||
pthread_sigmask(SIG_BLOCK, NULL, &suspend_set);
|
||||
sigdelset(&suspend_set, SR_signum);
|
||||
@@ -5025,6 +5033,7 @@ static bool call_chained_handler(struct sigaction *actp, int sig,
|
||||
|
||||
// try to honor the signal mask
|
||||
sigset_t oset;
|
||||
+ sigemptyset(&oset);
|
||||
pthread_sigmask(SIG_SETMASK, &(actp->sa_mask), &oset);
|
||||
|
||||
// call into the chained handler
|
||||
@@ -5035,7 +5044,7 @@ static bool call_chained_handler(struct sigaction *actp, int sig,
|
||||
}
|
||||
|
||||
// restore the signal mask
|
||||
- pthread_sigmask(SIG_SETMASK, &oset, 0);
|
||||
+ pthread_sigmask(SIG_SETMASK, &oset, NULL);
|
||||
}
|
||||
// Tell jvm's signal handler the signal is taken care of.
|
||||
return true;
|
||||
@@ -6699,6 +6708,7 @@ void Parker::park(bool isAbsolute, jlong time) {
|
||||
// Don't catch signals while blocked; let the running threads have the signals.
|
||||
// (This allows a debugger to break into the running thread.)
|
||||
sigset_t oldsigs;
|
||||
+ sigemptyset(&oldsigs);
|
||||
sigset_t* allowdebug_blocked = os::Linux::allowdebug_blocked_signals();
|
||||
pthread_sigmask(SIG_BLOCK, allowdebug_blocked, &oldsigs);
|
||||
#endif
|
||||
--
|
||||
2.19.1
|
||||
|
||||
67
Enhance-SIGBUS-and-rlimit-information-in-errlog.patch
Normal file
67
Enhance-SIGBUS-and-rlimit-information-in-errlog.patch
Normal file
@ -0,0 +1,67 @@
|
||||
Subject: [PATCH][Huawei] Enhance SIGBUS and rlimit information in errlog
|
||||
|
||||
---
|
||||
hotspot/src/os/posix/vm/os_posix.cpp | 26 ++++++++++++++++++++++
|
||||
hotspot/src/share/vm/utilities/vmError.cpp | 2 +-
|
||||
2 files changed, 27 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/hotspot/src/os/posix/vm/os_posix.cpp b/hotspot/src/os/posix/vm/os_posix.cpp
|
||||
index f7dab3c7f..a83ae1476 100644
|
||||
--- a/hotspot/src/os/posix/vm/os_posix.cpp
|
||||
+++ b/hotspot/src/os/posix/vm/os_posix.cpp
|
||||
@@ -207,6 +207,26 @@ void os::Posix::print_rlimit_info(outputStream* st) {
|
||||
if (rlim.rlim_cur == RLIM_INFINITY) st->print("infinity");
|
||||
else st->print("%uk", rlim.rlim_cur >> 10);
|
||||
|
||||
+ st->print(", DATA ");
|
||||
+ getrlimit(RLIMIT_DATA, &rlim);
|
||||
+ if (rlim.rlim_cur == RLIM_INFINITY) st->print("infinity");
|
||||
+ else st->print("%uk", rlim.rlim_cur >> 10);
|
||||
+
|
||||
+ st->print(", FSIZE ");
|
||||
+ getrlimit(RLIMIT_FSIZE, &rlim);
|
||||
+ if (rlim.rlim_cur == RLIM_INFINITY) st->print("infinity");
|
||||
+ else st->print("%u", rlim.rlim_cur >> 10);
|
||||
+
|
||||
+ st->print(", CPU ");
|
||||
+ getrlimit(RLIMIT_CPU, &rlim);
|
||||
+ if (rlim.rlim_cur == RLIM_INFINITY) st->print("infinity");
|
||||
+ else st->print("%uk seconds", rlim.rlim_cur >> 10);
|
||||
+
|
||||
+ st->print(", RSS ");
|
||||
+ getrlimit(RLIMIT_RSS, &rlim);
|
||||
+ if (rlim.rlim_cur == RLIM_INFINITY) st->print("infinity");
|
||||
+ else st->print("%u", rlim.rlim_cur >> 10);
|
||||
+
|
||||
// Isn't there on solaris
|
||||
#if !defined(TARGET_OS_FAMILY_solaris) && !defined(TARGET_OS_FAMILY_aix)
|
||||
st->print(", NPROC ");
|
||||
@@ -765,6 +785,12 @@ static bool get_signal_code_description(const siginfo_t* si, enum_sigcode_desc_t
|
||||
{ SIGBUS, BUS_ADRALN, "BUS_ADRALN", "Invalid address alignment." },
|
||||
{ SIGBUS, BUS_ADRERR, "BUS_ADRERR", "Nonexistent physical address." },
|
||||
{ SIGBUS, BUS_OBJERR, "BUS_OBJERR", "Object-specific hardware error." },
|
||||
+#ifdef BUS_MCEERR_AR
|
||||
+ { SIGBUS, BUS_MCEERR_AR,"BUS_MCEERR_AR","hardware memory error consumed on a machine check: action required."},
|
||||
+#endif
|
||||
+#ifdef BUS_MCEERR_AO
|
||||
+ { SIGBUS, BUS_MCEERR_AO,"BUS_MCEERR_AO","hardware memory error detected in process but not consumed: action optional."},
|
||||
+#endif
|
||||
{ SIGTRAP, TRAP_BRKPT, "TRAP_BRKPT", "Process breakpoint." },
|
||||
{ SIGTRAP, TRAP_TRACE, "TRAP_TRACE", "Process trace trap." },
|
||||
{ SIGCHLD, CLD_EXITED, "CLD_EXITED", "Child has exited." },
|
||||
diff --git a/hotspot/src/share/vm/utilities/vmError.cpp b/hotspot/src/share/vm/utilities/vmError.cpp
|
||||
index 0c5c955bf..3233e4b31 100644
|
||||
--- a/hotspot/src/share/vm/utilities/vmError.cpp
|
||||
+++ b/hotspot/src/share/vm/utilities/vmError.cpp
|
||||
@@ -813,7 +813,7 @@ void VMError::report(outputStream* st) {
|
||||
#if defined(AARCH64) || defined(X86)
|
||||
STEP(207, "(printing file descriptor)" )
|
||||
|
||||
- if (ExtensiveErrorReports && _verbose) {
|
||||
+ if (_verbose) {
|
||||
// File Descriptor
|
||||
os::print_file_descriptor(st);
|
||||
st->cr();
|
||||
--
|
||||
2.19.1
|
||||
|
||||
135
Extending-the-IV-Length-Supported-by-KAEProvider-AES.patch
Normal file
135
Extending-the-IV-Length-Supported-by-KAEProvider-AES.patch
Normal file
@ -0,0 +1,135 @@
|
||||
From f4b0357c01f51e813642c3ac5c8ff33c1576eb72 Mon Sep 17 00:00:00 2001
|
||||
Subject: Extending the IV Length Supported by KAEProvider AES/Gcm
|
||||
---
|
||||
.../security/openssl/kae_symmetric_cipher.c | 23 ++++++--
|
||||
.../security/openssl/KAEGcmIvLenTest.java | 52 +++++++++++++++++++
|
||||
2 files changed, 72 insertions(+), 3 deletions(-)
|
||||
create mode 100644 jdk/test/org/openeuler/security/openssl/KAEGcmIvLenTest.java
|
||||
|
||||
diff --git a/jdk/src/solaris/native/org/openeuler/security/openssl/kae_symmetric_cipher.c b/jdk/src/solaris/native/org/openeuler/security/openssl/kae_symmetric_cipher.c
|
||||
index ec8894f1a..7618d6e16 100644
|
||||
--- a/jdk/src/solaris/native/org/openeuler/security/openssl/kae_symmetric_cipher.c
|
||||
+++ b/jdk/src/solaris/native/org/openeuler/security/openssl/kae_symmetric_cipher.c
|
||||
@@ -146,6 +146,7 @@ Java_org_openeuler_security_openssl_KAESymmetricCipherBase_nativeInit(JNIEnv* en
|
||||
const EVP_CIPHER* cipher = NULL;
|
||||
ENGINE* kaeEngine = NULL;
|
||||
int keyLength = (*env)->GetArrayLength(env, key);
|
||||
+ int ivLength = 0;
|
||||
|
||||
const char* algo = (*env)->GetStringUTFChars(env, cipherType, 0);
|
||||
if (StartsWith("aes", algo)) {
|
||||
@@ -158,7 +159,6 @@ Java_org_openeuler_security_openssl_KAESymmetricCipherBase_nativeInit(JNIEnv* en
|
||||
|
||||
KAE_TRACE("KAESymmetricCipherBase_nativeInit: kaeEngine => %p", kaeEngine);
|
||||
|
||||
- (*env)->ReleaseStringUTFChars(env, cipherType, algo);
|
||||
if (cipher == NULL) {
|
||||
KAE_ThrowOOMException(env, "create EVP_CIPHER fail");
|
||||
goto cleanup;
|
||||
@@ -170,19 +170,35 @@ Java_org_openeuler_security_openssl_KAESymmetricCipherBase_nativeInit(JNIEnv* en
|
||||
|
||||
if (iv != NULL) {
|
||||
ivBytes = (*env)->GetByteArrayElements(env, iv, NULL);
|
||||
+ ivLength = (*env)->GetArrayLength(env, iv);
|
||||
}
|
||||
if (key != NULL) {
|
||||
keyBytes = (*env)->GetByteArrayElements(env, key, NULL);
|
||||
}
|
||||
|
||||
- if (!EVP_CipherInit_ex(ctx, cipher, kaeEngine, (const unsigned char*)keyBytes,
|
||||
- (const unsigned char*)ivBytes, encrypt ? 1 : 0)) {
|
||||
+ if (!EVP_CipherInit_ex(ctx, cipher, kaeEngine, NULL,
|
||||
+ NULL, encrypt ? 1 : 0)) {
|
||||
KAE_ThrowFromOpenssl(env, "EVP_CipherInit_ex failed", KAE_ThrowRuntimeException);
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
+ if (strcasecmp(algo + 8, "gcm") == 0) {
|
||||
+ /* Set IV length if default 12 bytes (96 bits) is not appropriate */
|
||||
+ if(!EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_GCM_SET_IVLEN, ivLength, NULL)) {
|
||||
+ KAE_ThrowFromOpenssl(env, "EVP_CIPHER_CTX_ctrl failed", KAE_ThrowRuntimeException);
|
||||
+ goto cleanup;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ if (!EVP_CipherInit_ex(ctx, NULL, kaeEngine, (const unsigned char*)keyBytes,
|
||||
+ (const unsigned char*)ivBytes, encrypt ? 1 : 0)) {
|
||||
+ KAE_ThrowFromOpenssl(env, "EVP_CipherInit_ex int key & iv failed", KAE_ThrowRuntimeException);
|
||||
+ goto cleanup;
|
||||
+ }
|
||||
+
|
||||
EVP_CIPHER_CTX_set_padding(ctx, padding ? 1 : 0);
|
||||
|
||||
+ (*env)->ReleaseStringUTFChars(env, cipherType, algo);
|
||||
FreeMemoryFromInit(env, iv, ivBytes, key, keyBytes, keyLength);
|
||||
return (jlong)ctx;
|
||||
|
||||
@@ -190,6 +206,7 @@ cleanup:
|
||||
if (ctx != NULL) {
|
||||
EVP_CIPHER_CTX_free(ctx);
|
||||
}
|
||||
+ (*env)->ReleaseStringUTFChars(env, cipherType, algo);
|
||||
FreeMemoryFromInit(env, iv, ivBytes, key, keyBytes, keyLength);
|
||||
return 0;
|
||||
}
|
||||
diff --git a/jdk/test/org/openeuler/security/openssl/KAEGcmIvLenTest.java b/jdk/test/org/openeuler/security/openssl/KAEGcmIvLenTest.java
|
||||
new file mode 100644
|
||||
index 000000000..c9e2257aa
|
||||
--- /dev/null
|
||||
+++ b/jdk/test/org/openeuler/security/openssl/KAEGcmIvLenTest.java
|
||||
@@ -0,0 +1,52 @@
|
||||
+import org.openeuler.security.openssl.KAEProvider;
|
||||
+
|
||||
+import javax.crypto.Cipher;
|
||||
+import javax.crypto.spec.GCMParameterSpec;
|
||||
+import javax.crypto.spec.SecretKeySpec;
|
||||
+import java.nio.charset.StandardCharsets;
|
||||
+import java.security.Security;
|
||||
+import java.util.Arrays;
|
||||
+
|
||||
+/**
|
||||
+ * @test
|
||||
+ * @summary Basic test for AES/GCM Iv
|
||||
+ * @requires os.arch=="aarch64"
|
||||
+ * @run main KAEGcmIvLenTest
|
||||
+ */
|
||||
+public class KAEGcmIvLenTest {
|
||||
+ private static String plainText = "helloworldhellow"; // 16bytes for NoPadding
|
||||
+ private static String shortPlainText = "helloworld"; // 5 bytes for padding
|
||||
+ private static SecretKeySpec ks = new SecretKeySpec("AESEncryptionKey".getBytes(StandardCharsets.UTF_8), "AES"); // key has 16 bytes
|
||||
+ private static int[] ivLens = {12, 16};
|
||||
+ public static void main(String[] args) throws Exception {
|
||||
+ Security.addProvider(new KAEProvider());
|
||||
+ for (int ivLen : ivLens) {
|
||||
+ testGcm(plainText,"AES/GCM/NoPadding", "KAEProvider", "SunJCE", ivLen);
|
||||
+ testGcm(plainText,"AES/GCM/NoPadding", "SunJCE", "KAEProvider", ivLen);
|
||||
+ testGcm(shortPlainText,"AES/GCM/PKCS5Padding", "KAEProvider", "SunJCE", ivLen);
|
||||
+ testGcm(shortPlainText,"AES/GCM/PKCS5Padding", "SunJCE", "KAEProvider", ivLen);
|
||||
+ }
|
||||
+
|
||||
+ }
|
||||
+
|
||||
+ private static void testGcm(String plainText, String algo, String encryptProvider, String decryptProvider, int ivLen) throws Exception {
|
||||
+ Cipher enCipher = Cipher.getInstance(algo, encryptProvider);
|
||||
+ enCipher.init(Cipher.ENCRYPT_MODE, ks, getIv(ivLen));
|
||||
+ byte[] cipherText = enCipher.doFinal(plainText.getBytes());
|
||||
+
|
||||
+ Cipher deCipher = Cipher.getInstance(algo, decryptProvider);
|
||||
+ deCipher.init(Cipher.DECRYPT_MODE, ks, getIv(ivLen));
|
||||
+ byte[] origin = deCipher.doFinal(cipherText);
|
||||
+
|
||||
+ if (!Arrays.equals(plainText.getBytes(), origin)) {
|
||||
+ throw new RuntimeException("gcm decryption failed, algo = " + algo);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ private static GCMParameterSpec getIv(int ivLen) {
|
||||
+ if (ivLen == 16) {
|
||||
+ return new GCMParameterSpec(128, "abcdefghabcdefgh".getBytes(StandardCharsets.UTF_8));
|
||||
+ }
|
||||
+ return new GCMParameterSpec(96, "abcdefghabcd".getBytes(StandardCharsets.UTF_8));
|
||||
+ }
|
||||
+}
|
||||
--
|
||||
2.19.1
|
||||
|
||||
691
KAE-zip-support-streaming-data-decompression.patch
Normal file
691
KAE-zip-support-streaming-data-decompression.patch
Normal file
@ -0,0 +1,691 @@
|
||||
---
|
||||
jdk/make/mapfiles/libzip/mapfile-vers | 5 +-
|
||||
.../share/classes/java/util/zip/Deflater.java | 36 +++++--
|
||||
.../java/util/zip/GZIPInputStream.java | 73 +++++++++++---
|
||||
.../java/util/zip/GZIPOutputStream.java | 44 +++++----
|
||||
.../share/classes/java/util/zip/Inflater.java | 37 +++++---
|
||||
.../java/util/zip/InflaterInputStream.java | 25 +++++
|
||||
jdk/src/share/lib/security/java.policy | 2 +
|
||||
jdk/src/share/native/java/util/zip/Deflater.c | 9 +-
|
||||
jdk/src/share/native/java/util/zip/Inflater.c | 73 +-------------
|
||||
.../java/util/zip/GZIP/TestAvailable.java | 94 +++++++++++++++++++
|
||||
10 files changed, 272 insertions(+), 126 deletions(-)
|
||||
create mode 100644 jdk/test/java/util/zip/GZIP/TestAvailable.java
|
||||
|
||||
diff --git a/jdk/make/mapfiles/libzip/mapfile-vers b/jdk/make/mapfiles/libzip/mapfile-vers
|
||||
index 5c6d27d0d..79ef59e5f 100644
|
||||
--- a/jdk/make/mapfiles/libzip/mapfile-vers
|
||||
+++ b/jdk/make/mapfiles/libzip/mapfile-vers
|
||||
@@ -38,16 +38,15 @@ SUNWprivate_1.1 {
|
||||
Java_java_util_zip_Deflater_end;
|
||||
Java_java_util_zip_Deflater_getAdler;
|
||||
Java_java_util_zip_Deflater_init;
|
||||
- Java_java_util_zip_Deflater_initKae;
|
||||
+ Java_java_util_zip_Deflater_initKAE;
|
||||
Java_java_util_zip_Deflater_initIDs;
|
||||
Java_java_util_zip_Deflater_reset;
|
||||
Java_java_util_zip_Deflater_setDictionary;
|
||||
Java_java_util_zip_Inflater_end;
|
||||
Java_java_util_zip_Inflater_getAdler;
|
||||
Java_java_util_zip_Inflater_inflateBytes;
|
||||
- Java_java_util_zip_Inflater_inflateBytesKAE;
|
||||
Java_java_util_zip_Inflater_init;
|
||||
- Java_java_util_zip_Inflater_initKae;
|
||||
+ Java_java_util_zip_Inflater_initKAE;
|
||||
Java_java_util_zip_Inflater_initIDs;
|
||||
Java_java_util_zip_Inflater_reset;
|
||||
Java_java_util_zip_Inflater_setDictionary;
|
||||
diff --git a/jdk/src/share/classes/java/util/zip/Deflater.java b/jdk/src/share/classes/java/util/zip/Deflater.java
|
||||
index a4ea40cf8..509808349 100644
|
||||
--- a/jdk/src/share/classes/java/util/zip/Deflater.java
|
||||
+++ b/jdk/src/share/classes/java/util/zip/Deflater.java
|
||||
@@ -81,7 +81,6 @@ class Deflater {
|
||||
private boolean finish, finished;
|
||||
private long bytesRead;
|
||||
private long bytesWritten;
|
||||
- private boolean defalterUseKae;
|
||||
|
||||
/**
|
||||
* Compression method for the deflate algorithm (the only one currently
|
||||
@@ -169,13 +168,20 @@ class Deflater {
|
||||
public Deflater(int level, boolean nowrap) {
|
||||
this.level = level;
|
||||
this.strategy = DEFAULT_STRATEGY;
|
||||
- if (("true".equals(System.getProperty("GZIP_USE_KAE", "false"))) &&
|
||||
- ("aarch64".equals(System.getProperty("os.arch")))) {
|
||||
- this.defalterUseKae = true;
|
||||
- }
|
||||
- this.zsRef = defalterUseKae ?
|
||||
- new ZStreamRef(initKae(level, DEFAULT_STRATEGY)) :
|
||||
- new ZStreamRef(init(level, DEFAULT_STRATEGY, nowrap));
|
||||
+ this.zsRef = new ZStreamRef(init(level, DEFAULT_STRATEGY, nowrap));
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Creates a new compressor using the specified compression level
|
||||
+ * and windowBits.
|
||||
+ * This method is mainly used to support the KAE-zip feature.
|
||||
+ * @param level the compression level (0-9)
|
||||
+ * @param windowBits compression format (-15~31)
|
||||
+ */
|
||||
+ public Deflater(int level, int windowBits) {
|
||||
+ this.level = level;
|
||||
+ this.strategy = DEFAULT_STRATEGY;
|
||||
+ this.zsRef = new ZStreamRef(initKAE(level, DEFAULT_STRATEGY, windowBits));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -535,6 +541,18 @@ class Deflater {
|
||||
}
|
||||
}
|
||||
|
||||
+ /**
|
||||
+ * Resets deflater so that a new set of input data can be processed.
|
||||
+ * Java fields are not initialized.
|
||||
+ * This method is mainly used to support the KAE-zip feature.
|
||||
+ */
|
||||
+ public void resetKAE() {
|
||||
+ synchronized (zsRef) {
|
||||
+ ensureOpen();
|
||||
+ reset(zsRef.address());
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
/**
|
||||
* Closes the compressor and discards any unprocessed input.
|
||||
* This method should be called when the compressor is no longer
|
||||
@@ -578,7 +596,7 @@ class Deflater {
|
||||
|
||||
private static native void initIDs();
|
||||
private native static long init(int level, int strategy, boolean nowrap);
|
||||
- private native static long initKae(int level, int strategy);
|
||||
+ private native static long initKAE(int level, int strategy, int windowBits);
|
||||
private native static void setDictionary(long addr, byte[] b, int off, int len);
|
||||
private native int deflateBytes(long addr, byte[] b, int off, int len,
|
||||
int flush);
|
||||
diff --git a/jdk/src/share/classes/java/util/zip/GZIPInputStream.java b/jdk/src/share/classes/java/util/zip/GZIPInputStream.java
|
||||
index 7fb753729..10d044caf 100644
|
||||
--- a/jdk/src/share/classes/java/util/zip/GZIPInputStream.java
|
||||
+++ b/jdk/src/share/classes/java/util/zip/GZIPInputStream.java
|
||||
@@ -54,10 +54,22 @@ class GZIPInputStream extends InflaterInputStream {
|
||||
|
||||
private boolean closed = false;
|
||||
|
||||
- /*
|
||||
- * GZIP use KAE.
|
||||
+ /**
|
||||
+ * The field is mainly used to support the KAE-zip feature.
|
||||
*/
|
||||
- private boolean gzipUseKae = false;
|
||||
+ private static boolean GZIP_USE_KAE = false;
|
||||
+
|
||||
+ private static int WINDOWBITS = 31;
|
||||
+
|
||||
+ private static int FLUSHKAE = 2;
|
||||
+
|
||||
+ static {
|
||||
+ if ("aarch64".equals(System.getProperty("os.arch"))) {
|
||||
+ GZIP_USE_KAE = Boolean.parseBoolean(System.getProperty("GZIP_USE_KAE", "false"));
|
||||
+ WINDOWBITS = Integer.parseInt(System.getProperty("WINDOWBITS", "31"));
|
||||
+ FLUSHKAE = Integer.parseInt(System.getProperty("FLUSHKAE", "2"));
|
||||
+ }
|
||||
+ }
|
||||
|
||||
/**
|
||||
* Check to make sure that this stream has not been closed
|
||||
@@ -79,14 +91,13 @@ class GZIPInputStream extends InflaterInputStream {
|
||||
* @exception IllegalArgumentException if {@code size <= 0}
|
||||
*/
|
||||
public GZIPInputStream(InputStream in, int size) throws IOException {
|
||||
- super(in, new Inflater(true), size);
|
||||
+ super(in, GZIP_USE_KAE ? new Inflater(WINDOWBITS, FLUSHKAE) : new Inflater(true), size);
|
||||
usesDefaultInflater = true;
|
||||
- if (("true".equals(System.getProperty("GZIP_USE_KAE", "false"))) &&
|
||||
- ("aarch64".equals(System.getProperty("os.arch")))) {
|
||||
- gzipUseKae = true;
|
||||
- }
|
||||
- // file header will be readed by kae zlib when use kae
|
||||
- if (gzipUseKae) return;
|
||||
+
|
||||
+ // When GZIP_USE_KAE is true, the header of the file is readed
|
||||
+ // through the native zlib library, not in java code.
|
||||
+ if (GZIP_USE_KAE) return;
|
||||
+
|
||||
readHeader(in);
|
||||
}
|
||||
|
||||
@@ -127,13 +138,16 @@ class GZIPInputStream extends InflaterInputStream {
|
||||
}
|
||||
int n = super.read(buf, off, len);
|
||||
if (n == -1) {
|
||||
- if (readTrailer())
|
||||
+ if (GZIP_USE_KAE ? readTrailerKAE() : readTrailer())
|
||||
eos = true;
|
||||
else
|
||||
return this.read(buf, off, len);
|
||||
} else {
|
||||
crc.update(buf, off, n);
|
||||
}
|
||||
+ if (GZIP_USE_KAE && inf.finished()) {
|
||||
+ if (readTrailerKAE()) eos = true;
|
||||
+ }
|
||||
return n;
|
||||
}
|
||||
|
||||
@@ -220,9 +234,7 @@ class GZIPInputStream extends InflaterInputStream {
|
||||
* data set)
|
||||
*/
|
||||
private boolean readTrailer() throws IOException {
|
||||
- // file trailer will be readed by kae zlib when use kae
|
||||
- if (gzipUseKae) return true;
|
||||
-
|
||||
+ if (GZIP_USE_KAE) return true;
|
||||
InputStream in = this.in;
|
||||
int n = inf.getRemaining();
|
||||
if (n > 0) {
|
||||
@@ -251,6 +263,39 @@ class GZIPInputStream extends InflaterInputStream {
|
||||
return false;
|
||||
}
|
||||
|
||||
+ /*
|
||||
+ * Reads GZIP member trailer and returns true if the eos
|
||||
+ * reached, false if there are more (concatenated gzip
|
||||
+ * data set)
|
||||
+ *
|
||||
+ * This method is mainly used to support the KAE-zip feature.
|
||||
+ */
|
||||
+ private boolean readTrailerKAE() throws IOException {
|
||||
+ InputStream in = this.in;
|
||||
+ int n = inf.getRemaining();
|
||||
+ if (n > 0) {
|
||||
+ in = new SequenceInputStream(
|
||||
+ new ByteArrayInputStream(buf, len - n, n),
|
||||
+ new FilterInputStream(in) {
|
||||
+ public void close() throws IOException {}
|
||||
+ });
|
||||
+ }
|
||||
+ // If there are more bytes available in "in" or the leftover in the "inf" is > 18 bytes:
|
||||
+ // next.header.min(10) + next.trailer(8), try concatenated case
|
||||
+
|
||||
+ if (n > 18) {
|
||||
+ inf.reset();
|
||||
+ inf.setInput(buf, len - n, n);
|
||||
+ } else {
|
||||
+ try {
|
||||
+ fillKAE(n);
|
||||
+ } catch (IOException e) {
|
||||
+ return true;
|
||||
+ }
|
||||
+ }
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
/*
|
||||
* Reads unsigned integer in Intel byte order.
|
||||
*/
|
||||
diff --git a/jdk/src/share/classes/java/util/zip/GZIPOutputStream.java b/jdk/src/share/classes/java/util/zip/GZIPOutputStream.java
|
||||
index 0f0be98bb..8eae40739 100644
|
||||
--- a/jdk/src/share/classes/java/util/zip/GZIPOutputStream.java
|
||||
+++ b/jdk/src/share/classes/java/util/zip/GZIPOutputStream.java
|
||||
@@ -52,10 +52,19 @@ class GZIPOutputStream extends DeflaterOutputStream {
|
||||
*/
|
||||
private final static int TRAILER_SIZE = 8;
|
||||
|
||||
- /*
|
||||
- * GZIP use KAE.
|
||||
+ /**
|
||||
+ * The field is mainly used to support the KAE-zip feature.
|
||||
*/
|
||||
- private boolean gzipUseKae = false;
|
||||
+ private static boolean GZIP_USE_KAE = false;
|
||||
+
|
||||
+ private static int WINDOWBITS = 31;
|
||||
+
|
||||
+ static {
|
||||
+ if ("aarch64".equals(System.getProperty("os.arch"))) {
|
||||
+ GZIP_USE_KAE = Boolean.parseBoolean(System.getProperty("GZIP_USE_KAE", "false"));
|
||||
+ WINDOWBITS = Integer.parseInt(System.getProperty("WINDOWBITS", "31"));
|
||||
+ }
|
||||
+ }
|
||||
|
||||
/**
|
||||
* Creates a new output stream with the specified buffer size.
|
||||
@@ -92,16 +101,15 @@ class GZIPOutputStream extends DeflaterOutputStream {
|
||||
public GZIPOutputStream(OutputStream out, int size, boolean syncFlush)
|
||||
throws IOException
|
||||
{
|
||||
- super(out, new Deflater(Deflater.DEFAULT_COMPRESSION, true),
|
||||
+ super(out, GZIP_USE_KAE ? new Deflater(Deflater.DEFAULT_COMPRESSION, WINDOWBITS) :
|
||||
+ new Deflater(Deflater.DEFAULT_COMPRESSION, true),
|
||||
size,
|
||||
syncFlush);
|
||||
usesDefaultDeflater = true;
|
||||
- if (("true".equals(System.getProperty("GZIP_USE_KAE", "false"))) &&
|
||||
- ("aarch64".equals(System.getProperty("os.arch")))) {
|
||||
- gzipUseKae = true;
|
||||
- }
|
||||
- // file header will be writed by kae zlib when use kae
|
||||
- if (gzipUseKae) return;
|
||||
+
|
||||
+ // When GZIP_USE_KAE is true, the header of the file is written
|
||||
+ // through the native zlib library, not in java code.
|
||||
+ if (GZIP_USE_KAE) return;
|
||||
writeHeader();
|
||||
crc.reset();
|
||||
}
|
||||
@@ -171,9 +179,11 @@ class GZIPOutputStream extends DeflaterOutputStream {
|
||||
int len = def.deflate(buf, 0, buf.length);
|
||||
if (def.finished() && len <= buf.length - TRAILER_SIZE) {
|
||||
// last deflater buffer. Fit trailer at the end
|
||||
- // file trailer will be writed by kae zlib when use kae
|
||||
- if (gzipUseKae) {
|
||||
+ // When GZIP_USE_KAE is true, the trailer of the file is written
|
||||
+ // through the native zlib library, not in java code.
|
||||
+ if (GZIP_USE_KAE) {
|
||||
out.write(buf, 0, len);
|
||||
+ def.resetKAE();
|
||||
return;
|
||||
}
|
||||
writeTrailer(buf, len);
|
||||
@@ -184,12 +194,14 @@ class GZIPOutputStream extends DeflaterOutputStream {
|
||||
if (len > 0)
|
||||
out.write(buf, 0, len);
|
||||
}
|
||||
- // file trailer will be writed by kae zlib when use kae
|
||||
- if (gzipUseKae) {
|
||||
- return;
|
||||
- }
|
||||
// if we can't fit the trailer at the end of the last
|
||||
// deflater buffer, we write it separately
|
||||
+ // When GZIP_USE_KAE is true, the trailer of the file is written
|
||||
+ // through the native zlib library, not in java code.
|
||||
+ if (GZIP_USE_KAE) {
|
||||
+ def.resetKAE();
|
||||
+ return;
|
||||
+ }
|
||||
byte[] trailer = new byte[TRAILER_SIZE];
|
||||
writeTrailer(trailer, 0);
|
||||
out.write(trailer);
|
||||
diff --git a/jdk/src/share/classes/java/util/zip/Inflater.java b/jdk/src/share/classes/java/util/zip/Inflater.java
|
||||
index 42e90f525..d1074cd8d 100644
|
||||
--- a/jdk/src/share/classes/java/util/zip/Inflater.java
|
||||
+++ b/jdk/src/share/classes/java/util/zip/Inflater.java
|
||||
@@ -80,7 +80,6 @@ class Inflater {
|
||||
private boolean needDict;
|
||||
private long bytesRead;
|
||||
private long bytesWritten;
|
||||
- private boolean inflaterUseKae;
|
||||
|
||||
private static final byte[] defaultBuf = new byte[0];
|
||||
|
||||
@@ -101,11 +100,18 @@ class Inflater {
|
||||
* @param nowrap if true then support GZIP compatible compression
|
||||
*/
|
||||
public Inflater(boolean nowrap) {
|
||||
- if (("true".equals(System.getProperty("GZIP_USE_KAE", "false"))) &&
|
||||
- ("aarch64".equals(System.getProperty("os.arch")))) {
|
||||
- inflaterUseKae = true;
|
||||
- }
|
||||
- zsRef = inflaterUseKae ? new ZStreamRef(initKae()): new ZStreamRef(init(nowrap));
|
||||
+ zsRef = new ZStreamRef(init(nowrap));
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Creates a new decompressor.
|
||||
+ * This method is mainly used to support the KAE-zip feature.
|
||||
+ *
|
||||
+ * @param windowBits compression format (-15~31)
|
||||
+ * @param flushKAE inflate flush type (0~6)
|
||||
+ */
|
||||
+ public Inflater(int windowBits, int flushKAE) {
|
||||
+ this.zsRef = new ZStreamRef(initKAE(windowBits, flushKAE));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -261,9 +267,7 @@ class Inflater {
|
||||
synchronized (zsRef) {
|
||||
ensureOpen();
|
||||
int thisLen = this.len;
|
||||
- int n = this.inflaterUseKae ?
|
||||
- inflateBytesKAE(zsRef.address(), b, off, len) :
|
||||
- inflateBytes(zsRef.address(), b, off, len);
|
||||
+ int n = inflateBytes(zsRef.address(), b, off, len);
|
||||
bytesWritten += n;
|
||||
bytesRead += (thisLen - this.len);
|
||||
return n;
|
||||
@@ -365,6 +369,17 @@ class Inflater {
|
||||
}
|
||||
}
|
||||
|
||||
+ /**
|
||||
+ * Resets inflater so that a new set of input data can be processed.
|
||||
+ * This method is mainly used to support the KAE-zip feature.
|
||||
+ */
|
||||
+ public void resetKAE() {
|
||||
+ synchronized (zsRef) {
|
||||
+ ensureOpen();
|
||||
+ reset(zsRef.address());
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
/**
|
||||
* Closes the decompressor and discards any unprocessed input.
|
||||
* This method should be called when the decompressor is no longer
|
||||
@@ -404,13 +419,11 @@ class Inflater {
|
||||
|
||||
private native static void initIDs();
|
||||
private native static long init(boolean nowrap);
|
||||
- private native static long initKae();
|
||||
+ private native static long initKAE(int windowBits, int flushKAE);
|
||||
private native static void setDictionary(long addr, byte[] b, int off,
|
||||
int len);
|
||||
private native int inflateBytes(long addr, byte[] b, int off, int len)
|
||||
throws DataFormatException;
|
||||
- private native int inflateBytesKAE(long addr, byte[] b, int off, int len)
|
||||
- throws DataFormatException;
|
||||
private native static int getAdler(long addr);
|
||||
private native static void reset(long addr);
|
||||
private native static void end(long addr);
|
||||
diff --git a/jdk/src/share/classes/java/util/zip/InflaterInputStream.java b/jdk/src/share/classes/java/util/zip/InflaterInputStream.java
|
||||
index 163f619c1..b0ac7dd26 100644
|
||||
--- a/jdk/src/share/classes/java/util/zip/InflaterInputStream.java
|
||||
+++ b/jdk/src/share/classes/java/util/zip/InflaterInputStream.java
|
||||
@@ -179,6 +179,10 @@ class InflaterInputStream extends FilterInputStream {
|
||||
ensureOpen();
|
||||
if (reachEOF) {
|
||||
return 0;
|
||||
+ } else if (inf.finished()) {
|
||||
+ // the end of the compressed data stream has been reached
|
||||
+ reachEOF = true;
|
||||
+ return 0;
|
||||
} else {
|
||||
return 1;
|
||||
}
|
||||
@@ -242,6 +246,27 @@ class InflaterInputStream extends FilterInputStream {
|
||||
inf.setInput(buf, 0, len);
|
||||
}
|
||||
|
||||
+ /**
|
||||
+ * Fills input buffer with more data to decompress.
|
||||
+ * This method is mainly used to support the KAE-zip feature.
|
||||
+ * @param n Maximum Read Bytes
|
||||
+ * @throws IOException if an I/O error has occurred
|
||||
+ */
|
||||
+ protected void fillKAE(int n) throws IOException {
|
||||
+ ensureOpen();
|
||||
+ byte[] buftmp = new byte[buf.length];
|
||||
+ if (n != 0) {
|
||||
+ System.arraycopy(buf, buf.length - n, buftmp, 0, n);
|
||||
+ }
|
||||
+ int kaelen = in.read(buftmp, n, buf.length - n);
|
||||
+ if (kaelen == -1) {
|
||||
+ throw new EOFException("Unexpected end of ZLIB input stream");
|
||||
+ }
|
||||
+ System.arraycopy(buftmp, 0, buf, buf.length - n - kaelen, n + kaelen);
|
||||
+ inf.reset();
|
||||
+ inf.setInput(buf, buf.length - n - kaelen, n + kaelen);
|
||||
+ }
|
||||
+
|
||||
/**
|
||||
* Tests if this input stream supports the <code>mark</code> and
|
||||
* <code>reset</code> methods. The <code>markSupported</code>
|
||||
diff --git a/jdk/src/share/lib/security/java.policy b/jdk/src/share/lib/security/java.policy
|
||||
index baec2ea15..284e3e334 100644
|
||||
--- a/jdk/src/share/lib/security/java.policy
|
||||
+++ b/jdk/src/share/lib/security/java.policy
|
||||
@@ -50,5 +50,7 @@ grant {
|
||||
permission java.util.PropertyPermission "sun.security.pkcs11.disableKeyExtraction", "read";
|
||||
|
||||
permission java.util.PropertyPermission "GZIP_USE_KAE", "read";
|
||||
+ permission java.util.PropertyPermission "WINDOWBITS", "read";
|
||||
+ permission java.util.PropertyPermission "FLUSHKAE", "read";
|
||||
};
|
||||
|
||||
diff --git a/jdk/src/share/native/java/util/zip/Deflater.c b/jdk/src/share/native/java/util/zip/Deflater.c
|
||||
index 1b048e4f5..b26eb1392 100644
|
||||
--- a/jdk/src/share/native/java/util/zip/Deflater.c
|
||||
+++ b/jdk/src/share/native/java/util/zip/Deflater.c
|
||||
@@ -37,7 +37,6 @@
|
||||
#include "java_util_zip_Deflater.h"
|
||||
|
||||
#define DEF_MEM_LEVEL 8
|
||||
-#define KAE_DEFLATER_WindowBit 31
|
||||
|
||||
static jfieldID levelID;
|
||||
static jfieldID strategyID;
|
||||
@@ -106,8 +105,8 @@ Java_java_util_zip_Deflater_init(JNIEnv *env, jclass cls, jint level,
|
||||
}
|
||||
|
||||
JNIEXPORT jlong JNICALL
|
||||
-Java_java_util_zip_Deflater_initKae(JNIEnv *env, jclass cls, jint level,
|
||||
- jint strategy)
|
||||
+Java_java_util_zip_Deflater_initKAE(JNIEnv *env, jclass cls, jint level,
|
||||
+ jint strategy, jint windowBits)
|
||||
{
|
||||
z_stream *strm = calloc(1, sizeof(z_stream));
|
||||
|
||||
@@ -116,7 +115,9 @@ Java_java_util_zip_Deflater_initKae(JNIEnv *env, jclass cls, jint level,
|
||||
return jlong_zero;
|
||||
} else {
|
||||
const char *msg;
|
||||
- int ret = deflateInit2(strm, level, Z_DEFLATED, KAE_DEFLATER_WindowBit, DEF_MEM_LEVEL, strategy);
|
||||
+ int ret = deflateInit2(strm, level, Z_DEFLATED,
|
||||
+ windowBits,
|
||||
+ DEF_MEM_LEVEL, strategy);
|
||||
switch (ret) {
|
||||
case Z_OK:
|
||||
return ptr_to_jlong(strm);
|
||||
diff --git a/jdk/src/share/native/java/util/zip/Inflater.c b/jdk/src/share/native/java/util/zip/Inflater.c
|
||||
index fca207215..8317267ff 100644
|
||||
--- a/jdk/src/share/native/java/util/zip/Inflater.c
|
||||
+++ b/jdk/src/share/native/java/util/zip/Inflater.c
|
||||
@@ -41,11 +41,11 @@
|
||||
|
||||
#define ThrowDataFormatException(env, msg) \
|
||||
JNU_ThrowByName(env, "java/util/zip/DataFormatException", msg)
|
||||
-#define KAE_INFLATER_WindowBit 31
|
||||
|
||||
static jfieldID needDictID;
|
||||
static jfieldID finishedID;
|
||||
static jfieldID bufID, offID, lenID;
|
||||
+static jint inflaterFlushType = Z_PARTIAL_FLUSH;
|
||||
|
||||
JNIEXPORT void JNICALL
|
||||
Java_java_util_zip_Inflater_initIDs(JNIEnv *env, jclass cls)
|
||||
@@ -96,16 +96,17 @@ Java_java_util_zip_Inflater_init(JNIEnv *env, jclass cls, jboolean nowrap)
|
||||
}
|
||||
|
||||
JNIEXPORT jlong JNICALL
|
||||
-Java_java_util_zip_Inflater_initKae(JNIEnv *env, jclass cls)
|
||||
+Java_java_util_zip_Inflater_initKAE(JNIEnv *env, jclass cls, jint windowBits, jint flushKAE)
|
||||
{
|
||||
z_stream *strm = calloc(1, sizeof(z_stream));
|
||||
+ inflaterFlushType = flushKAE;
|
||||
|
||||
if (strm == NULL) {
|
||||
JNU_ThrowOutOfMemoryError(env, 0);
|
||||
return jlong_zero;
|
||||
} else {
|
||||
const char *msg;
|
||||
- int ret = inflateInit2(strm, KAE_INFLATER_WindowBit);
|
||||
+ int ret = inflateInit2(strm, windowBits);
|
||||
switch (ret) {
|
||||
case Z_OK:
|
||||
return ptr_to_jlong(strm);
|
||||
@@ -181,71 +182,7 @@ Java_java_util_zip_Inflater_inflateBytes(JNIEnv *env, jobject this, jlong addr,
|
||||
strm->next_out = (Bytef *) (out_buf + off);
|
||||
strm->avail_in = this_len;
|
||||
strm->avail_out = len;
|
||||
- ret = inflate(strm, Z_PARTIAL_FLUSH);
|
||||
- (*env)->ReleasePrimitiveArrayCritical(env, b, out_buf, 0);
|
||||
- (*env)->ReleasePrimitiveArrayCritical(env, this_buf, in_buf, 0);
|
||||
-
|
||||
- switch (ret) {
|
||||
- case Z_STREAM_END:
|
||||
- (*env)->SetBooleanField(env, this, finishedID, JNI_TRUE);
|
||||
- /* fall through */
|
||||
- case Z_OK:
|
||||
- this_off += this_len - strm->avail_in;
|
||||
- (*env)->SetIntField(env, this, offID, this_off);
|
||||
- (*env)->SetIntField(env, this, lenID, strm->avail_in);
|
||||
- return (jint) (len - strm->avail_out);
|
||||
- case Z_NEED_DICT:
|
||||
- (*env)->SetBooleanField(env, this, needDictID, JNI_TRUE);
|
||||
- /* Might have consumed some input here! */
|
||||
- this_off += this_len - strm->avail_in;
|
||||
- (*env)->SetIntField(env, this, offID, this_off);
|
||||
- (*env)->SetIntField(env, this, lenID, strm->avail_in);
|
||||
- return 0;
|
||||
- case Z_BUF_ERROR:
|
||||
- return 0;
|
||||
- case Z_DATA_ERROR:
|
||||
- ThrowDataFormatException(env, strm->msg);
|
||||
- return 0;
|
||||
- case Z_MEM_ERROR:
|
||||
- JNU_ThrowOutOfMemoryError(env, 0);
|
||||
- return 0;
|
||||
- default:
|
||||
- JNU_ThrowInternalError(env, strm->msg);
|
||||
- return 0;
|
||||
- }
|
||||
-}
|
||||
-
|
||||
-JNIEXPORT jint JNICALL
|
||||
-Java_java_util_zip_Inflater_inflateBytesKAE(JNIEnv *env, jobject this, jlong addr,
|
||||
- jarray b, jint off, jint len)
|
||||
-{
|
||||
- z_stream *strm = jlong_to_ptr(addr);
|
||||
- jarray this_buf = (jarray)(*env)->GetObjectField(env, this, bufID);
|
||||
- jint this_off = (*env)->GetIntField(env, this, offID);
|
||||
- jint this_len = (*env)->GetIntField(env, this, lenID);
|
||||
-
|
||||
- jbyte *in_buf;
|
||||
- jbyte *out_buf;
|
||||
- int ret;
|
||||
-
|
||||
- in_buf = (*env)->GetPrimitiveArrayCritical(env, this_buf, 0);
|
||||
- if (in_buf == NULL) {
|
||||
- if (this_len != 0 && (*env)->ExceptionOccurred(env) == NULL)
|
||||
- JNU_ThrowOutOfMemoryError(env, 0);
|
||||
- return 0;
|
||||
- }
|
||||
- out_buf = (*env)->GetPrimitiveArrayCritical(env, b, 0);
|
||||
- if (out_buf == NULL) {
|
||||
- (*env)->ReleasePrimitiveArrayCritical(env, this_buf, in_buf, 0);
|
||||
- if (len != 0 && (*env)->ExceptionOccurred(env) == NULL)
|
||||
- JNU_ThrowOutOfMemoryError(env, 0);
|
||||
- return 0;
|
||||
- }
|
||||
- strm->next_in = (Bytef *) (in_buf + this_off);
|
||||
- strm->next_out = (Bytef *) (out_buf + off);
|
||||
- strm->avail_in = this_len;
|
||||
- strm->avail_out = len;
|
||||
- ret = inflate(strm, Z_SYNC_FLUSH);
|
||||
+ ret = inflate(strm, inflaterFlushType);
|
||||
(*env)->ReleasePrimitiveArrayCritical(env, b, out_buf, 0);
|
||||
(*env)->ReleasePrimitiveArrayCritical(env, this_buf, in_buf, 0);
|
||||
|
||||
diff --git a/jdk/test/java/util/zip/GZIP/TestAvailable.java b/jdk/test/java/util/zip/GZIP/TestAvailable.java
|
||||
new file mode 100644
|
||||
index 000000000..3dc9b3445
|
||||
--- /dev/null
|
||||
+++ b/jdk/test/java/util/zip/GZIP/TestAvailable.java
|
||||
@@ -0,0 +1,94 @@
|
||||
+/*
|
||||
+ * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
+ *
|
||||
+ * This code is free software; you can redistribute it and/or modify it
|
||||
+ * under the terms of the GNU General Public License version 2 only, as
|
||||
+ * published by the Free Software Foundation.
|
||||
+ *
|
||||
+ * This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
+ * version 2 for more details (a copy is included in the LICENSE file that
|
||||
+ * accompanied this code).
|
||||
+ *
|
||||
+ * You should have received a copy of the GNU General Public License version
|
||||
+ * 2 along with this work; if not, write to the Free Software Foundation,
|
||||
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
+ *
|
||||
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
+ * or visit www.oracle.com if you need additional information or have any
|
||||
+ * questions.
|
||||
+ */
|
||||
+
|
||||
+/* @test
|
||||
+ * @library /lib/testlibrary/
|
||||
+ * @build jdk.testlibrary.*
|
||||
+ * @run main TestAvailable
|
||||
+ * @bug 7031075
|
||||
+ * @summary Make sure that available() method behaves as expected.
|
||||
+ * @key randomness
|
||||
+ */
|
||||
+
|
||||
+import java.io.*;
|
||||
+import java.util.Random;
|
||||
+import java.util.zip.*;
|
||||
+import jdk.testlibrary.RandomFactory;
|
||||
+
|
||||
+public class TestAvailable {
|
||||
+
|
||||
+ public static void main(String args[]) throws Throwable {
|
||||
+ Random r = RandomFactory.getRandom();
|
||||
+ for (int n = 0; n < 10; n++) {
|
||||
+ byte[] src = new byte[r.nextInt(100)];
|
||||
+ r.nextBytes(src);
|
||||
+
|
||||
+ // test InflaterInputStream
|
||||
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
||||
+ try (DeflaterOutputStream dos = new DeflaterOutputStream(baos)) {
|
||||
+ dos.write(src);
|
||||
+ }
|
||||
+ try (InflaterInputStream iis = new InflaterInputStream(
|
||||
+ new ByteArrayInputStream(baos.toByteArray()))) {
|
||||
+ test(iis, src);
|
||||
+ }
|
||||
+
|
||||
+ // test GZIPInputStream
|
||||
+ baos = new ByteArrayOutputStream();
|
||||
+ try (GZIPOutputStream dos = new GZIPOutputStream(baos)) {
|
||||
+ dos.write(src);
|
||||
+ }
|
||||
+ try (GZIPInputStream gis = new GZIPInputStream(
|
||||
+ new ByteArrayInputStream(baos.toByteArray()))) {
|
||||
+ test(gis, src);
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ private static void test(InputStream is, byte[] expected) throws IOException {
|
||||
+ int cnt = 0;
|
||||
+ do {
|
||||
+ int available = is.available();
|
||||
+ if (available > 0) {
|
||||
+ int b = is.read();
|
||||
+ if (b == -1) {
|
||||
+ throw new RuntimeException("available() > 0, read() == -1 : failed!");
|
||||
+ }
|
||||
+ if (expected[cnt++] != (byte)b) {
|
||||
+ throw new RuntimeException("read() : failed!");
|
||||
+ }
|
||||
+ } else if (available == 0) {
|
||||
+ if (is.read() != -1) {
|
||||
+ throw new RuntimeException("available() == 0, read() != -1 : failed!");
|
||||
+ }
|
||||
+ break;
|
||||
+ } else {
|
||||
+ throw new RuntimeException("available() < 0 : failed!");
|
||||
+ }
|
||||
+ } while (true);
|
||||
+ if (cnt != expected.length) {
|
||||
+ throw new RuntimeException("read : failed!");
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+}
|
||||
\ No newline at end of file
|
||||
--
|
||||
2.19.1
|
||||
|
||||
@ -72,7 +72,7 @@ index 151e5a109f..5072409dd4 100644
|
||||
# Configure flags for the tools
|
||||
FLAGS_SETUP_COMPILER_FLAGS_FOR_LIBS
|
||||
diff --git a/common/autoconf/generated-configure.sh b/common/autoconf/generated-configure.sh
|
||||
index 85eb8a16a2..86a533fe1f 100644
|
||||
index 6f17436eff..aedd82e614 100644
|
||||
--- a/common/autoconf/generated-configure.sh
|
||||
+++ b/common/autoconf/generated-configure.sh
|
||||
@@ -716,6 +716,9 @@ SET_EXECUTABLE_ORIGIN
|
||||
@ -162,7 +162,7 @@ index 85eb8a16a2..86a533fe1f 100644
|
||||
|
||||
|
||||
# Setup OPENJDK_TARGET_OS_API_DIR, used in source paths.
|
||||
@@ -42436,6 +42467,47 @@ $as_echo "$ac_cv_c_bigendian" >&6; }
|
||||
@@ -42429,6 +42460,47 @@ $as_echo "$ac_cv_c_bigendian" >&6; }
|
||||
fi
|
||||
|
||||
|
||||
@ -326,7 +326,7 @@ index f54942acf2..51cc28c312 100644
|
||||
+AC_SUBST(HOST_NAME)
|
||||
+])
|
||||
diff --git a/common/autoconf/spec.gmk.in b/common/autoconf/spec.gmk.in
|
||||
index 9573bb2cbd..57a903229a 100644
|
||||
index 9573bb2cbd..ad85aa346f 100644
|
||||
--- a/common/autoconf/spec.gmk.in
|
||||
+++ b/common/autoconf/spec.gmk.in
|
||||
@@ -23,6 +23,12 @@
|
||||
@ -352,7 +352,7 @@ index 9573bb2cbd..57a903229a 100644
|
||||
+HOST_NAME:=@HOST_NAME@
|
||||
+
|
||||
+# Loongson OpenJDK Version info
|
||||
+VER=8.1.19
|
||||
+VER=8.1.20
|
||||
+ifeq ($(HOST_NAME), )
|
||||
+ HOST_NAME=unknown
|
||||
+endif
|
||||
@ -106551,7 +106551,7 @@ index 92b73e1c71..45da327efb 100644
|
||||
bool LIRGenerator::strength_reduce_multiply(LIR_Opr left, jint c, LIR_Opr result, LIR_Opr tmp) {
|
||||
if (tmp->is_valid() && c > 0 && c < max_jint) {
|
||||
diff --git a/hotspot/src/os/linux/vm/os_linux.cpp b/hotspot/src/os/linux/vm/os_linux.cpp
|
||||
index 54cfcdd116..c3d22ba5d3 100644
|
||||
index 5629a640f6..68d5f514c0 100644
|
||||
--- a/hotspot/src/os/linux/vm/os_linux.cpp
|
||||
+++ b/hotspot/src/os/linux/vm/os_linux.cpp
|
||||
@@ -22,6 +22,12 @@
|
||||
@ -106588,8 +106588,8 @@ index 54cfcdd116..c3d22ba5d3 100644
|
||||
static Elf32_Half running_arch_code=EM_LOONGARCH;
|
||||
#else
|
||||
#error Method os::dll_load requires that one of following is defined:\
|
||||
- IA32, AMD64, IA64, __sparc, __powerpc__, ARM, S390, ALPHA, MIPS, MIPSEL, PARISC, M68K, AARCH64, LOONGARCH
|
||||
+ IA32, AMD64, IA64, __sparc, __powerpc__, ARM, S390, ALPHA, MIPS, MIPSEL, __mips64, PARISC, M68K, AARCH64, LOONGARCH
|
||||
- IA32, AMD64, IA64, __sparc, __powerpc__, ARM, S390, ALPHA, MIPS, MIPSEL, PARISC, M68K, AARCH64, LOONGARCH64
|
||||
+ IA32, AMD64, IA64, __sparc, __powerpc__, ARM, S390, ALPHA, MIPS, MIPSEL, __mips64, PARISC, M68K, AARCH64, LOONGARCH64
|
||||
#endif
|
||||
|
||||
// Identify compatability class for VM's architecture and library's architecture
|
||||
@ -112949,7 +112949,7 @@ index 7e22bbaa27..12aca7bf50 100644
|
||||
# include "c1_MacroAssembler_aarch64.hpp"
|
||||
#endif
|
||||
diff --git a/hotspot/src/share/vm/c1/c1_Runtime1.cpp b/hotspot/src/share/vm/c1/c1_Runtime1.cpp
|
||||
index aebc377527..f1253506f6 100644
|
||||
index b2bff3809d..cfcdb43ddc 100644
|
||||
--- a/hotspot/src/share/vm/c1/c1_Runtime1.cpp
|
||||
+++ b/hotspot/src/share/vm/c1/c1_Runtime1.cpp
|
||||
@@ -22,6 +22,12 @@
|
||||
@ -112965,7 +112965,7 @@ index aebc377527..f1253506f6 100644
|
||||
#include "precompiled.hpp"
|
||||
#include "asm/codeBuffer.hpp"
|
||||
#include "c1/c1_CodeStubs.hpp"
|
||||
@@ -710,6 +716,7 @@ JRT_ENTRY(void, Runtime1::deoptimize(JavaThread* thread))
|
||||
@@ -712,6 +718,7 @@ JRT_ENTRY(void, Runtime1::deoptimize(JavaThread* thread))
|
||||
// Return to the now deoptimized frame.
|
||||
JRT_END
|
||||
|
||||
@ -112973,7 +112973,7 @@ index aebc377527..f1253506f6 100644
|
||||
|
||||
static Klass* resolve_field_return_klass(methodHandle caller, int bci, TRAPS) {
|
||||
Bytecode_field field_access(caller, bci);
|
||||
@@ -1186,6 +1193,47 @@ JRT_ENTRY(void, Runtime1::patch_code(JavaThread* thread, Runtime1::StubID stub_i
|
||||
@@ -1188,6 +1195,47 @@ JRT_ENTRY(void, Runtime1::patch_code(JavaThread* thread, Runtime1::StubID stub_i
|
||||
}
|
||||
JRT_END
|
||||
|
||||
@ -113985,7 +113985,7 @@ index 1dc7cb2983..92bbe6b440 100644
|
||||
# include "interpreterGenerator_aarch64.hpp"
|
||||
#endif
|
||||
diff --git a/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp b/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp
|
||||
index cad9d29008..85303e4b73 100644
|
||||
index 425ad7f463..c428b91f5d 100644
|
||||
--- a/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp
|
||||
+++ b/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp
|
||||
@@ -22,6 +22,12 @@
|
||||
@ -114001,7 +114001,7 @@ index cad9d29008..85303e4b73 100644
|
||||
#include "precompiled.hpp"
|
||||
#include "classfile/systemDictionary.hpp"
|
||||
#include "classfile/vmSymbols.hpp"
|
||||
@@ -59,6 +65,12 @@
|
||||
@@ -60,6 +66,12 @@
|
||||
#ifdef TARGET_ARCH_x86
|
||||
# include "vm_version_x86.hpp"
|
||||
#endif
|
||||
@ -114014,7 +114014,7 @@ index cad9d29008..85303e4b73 100644
|
||||
#ifdef TARGET_ARCH_aarch64
|
||||
# include "vm_version_aarch64.hpp"
|
||||
#endif
|
||||
@@ -1290,7 +1302,7 @@ IRT_ENTRY(void, InterpreterRuntime::prepare_native_call(JavaThread* thread, Meth
|
||||
@@ -1292,7 +1304,7 @@ IRT_ENTRY(void, InterpreterRuntime::prepare_native_call(JavaThread* thread, Meth
|
||||
// preparing the same method will be sure to see non-null entry & mirror.
|
||||
IRT_END
|
||||
|
||||
@ -116029,7 +116029,7 @@ index 66392b75f1..5ced38d838 100644
|
||||
} else {
|
||||
base = os::reserve_memory(size, NULL, alignment);
|
||||
diff --git a/hotspot/src/share/vm/runtime/vmStructs.cpp b/hotspot/src/share/vm/runtime/vmStructs.cpp
|
||||
index 32e3921b2b..c6cc4c4329 100644
|
||||
index e0e9bcf7e9..3e4640e698 100644
|
||||
--- a/hotspot/src/share/vm/runtime/vmStructs.cpp
|
||||
+++ b/hotspot/src/share/vm/runtime/vmStructs.cpp
|
||||
@@ -22,6 +22,12 @@
|
||||
|
||||
88
The-fast-serialization-function-of-sun.rmi.transport.patch
Normal file
88
The-fast-serialization-function-of-sun.rmi.transport.patch
Normal file
@ -0,0 +1,88 @@
|
||||
Subject: [PATCH][Huawei] The fast serialization function of
|
||||
sun.rmi.transport.ConnectionOutputStream is disabled by default
|
||||
|
||||
---
|
||||
.../classes/java/io/ObjectOutputStream.java | 23 ++++++++++++++++---
|
||||
.../sun/rmi/server/MarshalOutputStream.java | 10 ++++++++
|
||||
2 files changed, 30 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/jdk/src/share/classes/java/io/ObjectOutputStream.java b/jdk/src/share/classes/java/io/ObjectOutputStream.java
|
||||
index 328f47589..78dc3c5b2 100644
|
||||
--- a/jdk/src/share/classes/java/io/ObjectOutputStream.java
|
||||
+++ b/jdk/src/share/classes/java/io/ObjectOutputStream.java
|
||||
@@ -240,7 +240,7 @@ public class ObjectOutputStream
|
||||
* Value of "UseFastSerializer" property. The fastSerializer is turned
|
||||
* on when it is true.
|
||||
*/
|
||||
- private final boolean useFastSerializer = UNSAFE.getUseFastSerializer();
|
||||
+ private boolean useFastSerializer = UNSAFE.getUseFastSerializer();
|
||||
|
||||
/**
|
||||
* value of "printFastSerializer" property,
|
||||
@@ -254,7 +254,22 @@ public class ObjectOutputStream
|
||||
* Magic number that is written to the stream header when using fastserilizer.
|
||||
*/
|
||||
private static final short STREAM_MAGIC_FAST = (short)0xdeca;
|
||||
+
|
||||
+ /**
|
||||
+ * The default value is true. If you want to disable the fast serialization function, please set it to false.
|
||||
+ */
|
||||
+ protected boolean enableFastSerializerClass(){
|
||||
+ return true;
|
||||
+ }
|
||||
|
||||
+ /**
|
||||
+ * Disable fast serialization functionality.
|
||||
+ */
|
||||
+ private void disableFastSerializerStatusByClass() {
|
||||
+ if ( this.useFastSerializer && !enableFastSerializerClass()){
|
||||
+ this.useFastSerializer = false;
|
||||
+ }
|
||||
+ }
|
||||
/**
|
||||
* Creates an ObjectOutputStream that writes to the specified OutputStream.
|
||||
* This constructor writes the serialization stream header to the
|
||||
@@ -279,7 +294,8 @@ public class ObjectOutputStream
|
||||
* @see ObjectInputStream#ObjectInputStream(InputStream)
|
||||
*/
|
||||
public ObjectOutputStream(OutputStream out) throws IOException {
|
||||
- verifySubclass();
|
||||
+ disableFastSerializerStatusByClass();
|
||||
+ verifySubclass();
|
||||
bout = new BlockDataOutputStream(out);
|
||||
handles = new HandleTable(10, (float) 3.00);
|
||||
subs = new ReplaceTable(10, (float) 3.00);
|
||||
@@ -311,7 +327,8 @@ public class ObjectOutputStream
|
||||
* @see java.io.SerializablePermission
|
||||
*/
|
||||
protected ObjectOutputStream() throws IOException, SecurityException {
|
||||
- SecurityManager sm = System.getSecurityManager();
|
||||
+ disableFastSerializerStatusByClass();
|
||||
+ SecurityManager sm = System.getSecurityManager();
|
||||
if (sm != null) {
|
||||
sm.checkPermission(SUBCLASS_IMPLEMENTATION_PERMISSION);
|
||||
}
|
||||
diff --git a/jdk/src/share/classes/sun/rmi/server/MarshalOutputStream.java b/jdk/src/share/classes/sun/rmi/server/MarshalOutputStream.java
|
||||
index 699f11072..e113441f8 100644
|
||||
--- a/jdk/src/share/classes/sun/rmi/server/MarshalOutputStream.java
|
||||
+++ b/jdk/src/share/classes/sun/rmi/server/MarshalOutputStream.java
|
||||
@@ -48,6 +48,16 @@ import sun.rmi.transport.Target;
|
||||
*/
|
||||
public class MarshalOutputStream extends ObjectOutputStream
|
||||
{
|
||||
+ /**
|
||||
+ * value of "enableRMIFastSerializerClass" property
|
||||
+ */
|
||||
+ private static final boolean enableRMIFastSerializerClass = java.security.AccessController.doPrivileged( new sun.security.action.GetBooleanAction( "enableRMIFastSerializerClass")).booleanValue();
|
||||
+
|
||||
+ @Override
|
||||
+ protected boolean enableFastSerializerClass() {
|
||||
+ return this.enableRMIFastSerializerClass;
|
||||
+ }
|
||||
+
|
||||
/**
|
||||
* Creates a marshal output stream with protocol version 1.
|
||||
*/
|
||||
--
|
||||
2.44.0
|
||||
|
||||
@ -1,15 +1,92 @@
|
||||
From c4fd69c76c41b7b6168f1071d50143566f7d269e
|
||||
From a168b23b9b49998642adabda7edd76a0d45c07b8
|
||||
Date: Fri, 22 Sep 2023 14:48:33 +0800
|
||||
Subject: [PATCH] add Fix-aarch64-runtime-thread-signal-transfer-bug
|
||||
|
||||
---
|
||||
.../src/cpu/aarch64/vm/vm_version_aarch64.cpp | 47 +++++----
|
||||
.../src/cpu/aarch64/vm/vm_version_aarch64.hpp | 8 ++
|
||||
hotspot/src/os/linux/vm/os_linux.cpp | 7 ++
|
||||
.../linux_aarch64/vm/thread_linux_aarch64.cpp | 97 +++++++++++++++++++
|
||||
.../linux_aarch64/vm/thread_linux_aarch64.hpp | 3 +
|
||||
5 files changed, 141 insertions(+), 21 deletions(-)
|
||||
.../vm/interpreterGenerator_aarch64.hpp | 1 +
|
||||
.../cpu/aarch64/vm/stubGenerator_aarch64.cpp | 4 +
|
||||
.../vm/templateInterpreter_aarch64.cpp | 14 ++
|
||||
.../src/cpu/aarch64/vm/vm_version_aarch64.cpp | 47 ++++---
|
||||
.../src/cpu/aarch64/vm/vm_version_aarch64.hpp | 8 ++
|
||||
hotspot/src/cpu/ppc/vm/vm_version_ppc.cpp | 5 +
|
||||
hotspot/src/cpu/sparc/vm/vm_version_sparc.cpp | 5 +
|
||||
hotspot/src/cpu/x86/vm/vm_version_x86.cpp | 5 +
|
||||
hotspot/src/os/linux/vm/os_linux.cpp | 3 +
|
||||
.../linux_aarch64/vm/thread_linux_aarch64.cpp | 122 ++++++++++++++++++
|
||||
.../linux_aarch64/vm/thread_linux_aarch64.hpp | 3 +
|
||||
hotspot/src/share/vm/classfile/vmSymbols.hpp | 5 +
|
||||
.../src/share/vm/compiler/compileBroker.cpp | 13 +-
|
||||
.../vm/interpreter/abstractInterpreter.hpp | 1 +
|
||||
.../src/share/vm/interpreter/interpreter.cpp | 5 +
|
||||
.../vm/interpreter/templateInterpreter.cpp | 4 +
|
||||
hotspot/src/share/vm/oops/method.cpp | 2 +-
|
||||
hotspot/src/share/vm/runtime/globals.hpp | 3 +
|
||||
hotspot/src/share/vm/runtime/os.cpp | 5 +
|
||||
hotspot/src/share/vm/runtime/stubRoutines.cpp | 2 +
|
||||
hotspot/src/share/vm/runtime/stubRoutines.hpp | 6 +
|
||||
.../share/vm/services/diagnosticCommand.hpp | 2 +-
|
||||
.../dcmd/CompilerQueueTest.java | 41 +++---
|
||||
23 files changed, 257 insertions(+), 49 deletions(-)
|
||||
|
||||
diff --git a/hotspot/src/cpu/aarch64/vm/interpreterGenerator_aarch64.hpp b/hotspot/src/cpu/aarch64/vm/interpreterGenerator_aarch64.hpp
|
||||
index 40af38a7..7530edb9 100644
|
||||
--- a/hotspot/src/cpu/aarch64/vm/interpreterGenerator_aarch64.hpp
|
||||
+++ b/hotspot/src/cpu/aarch64/vm/interpreterGenerator_aarch64.hpp
|
||||
@@ -53,6 +53,7 @@ void generate_transcendental_entry(AbstractInterpreter::MethodKind kind, int fpa
|
||||
void emit_array_address(Register src, Register idx, Register dst, BasicType type);
|
||||
address generate_Dgemm_dgemm_entry();
|
||||
address generate_Dgemv_dgemv_entry();
|
||||
+ address generate_JVM_isAmd64_entry();
|
||||
|
||||
void generate_counter_incr(Label* overflow, Label* profile_method, Label* profile_method_continue);
|
||||
void generate_counter_overflow(Label* do_continue);
|
||||
diff --git a/hotspot/src/cpu/aarch64/vm/stubGenerator_aarch64.cpp b/hotspot/src/cpu/aarch64/vm/stubGenerator_aarch64.cpp
|
||||
index 565fe559..8a98bac0 100644
|
||||
--- a/hotspot/src/cpu/aarch64/vm/stubGenerator_aarch64.cpp
|
||||
+++ b/hotspot/src/cpu/aarch64/vm/stubGenerator_aarch64.cpp
|
||||
@@ -5144,6 +5144,10 @@ class StubGenerator: public StubCodeGenerator {
|
||||
StubRoutines::_dgemmDgemm = generate_dgemmDgemm(StubRoutines::_BLAS_library);
|
||||
StubRoutines::_dgemvDgemv = generate_dgemvDgemv(StubRoutines::_BLAS_library);
|
||||
}
|
||||
+
|
||||
+ if (UseHBaseUtilIntrinsics) {
|
||||
+ StubRoutines::_isAmd64JVM = CAST_FROM_FN_PTR(address, StubRoutines::intrinsic_isAmd64_JVM);
|
||||
+ }
|
||||
}
|
||||
|
||||
void generate_all() {
|
||||
diff --git a/hotspot/src/cpu/aarch64/vm/templateInterpreter_aarch64.cpp b/hotspot/src/cpu/aarch64/vm/templateInterpreter_aarch64.cpp
|
||||
index 28b84cb5..6329ff4e 100644
|
||||
--- a/hotspot/src/cpu/aarch64/vm/templateInterpreter_aarch64.cpp
|
||||
+++ b/hotspot/src/cpu/aarch64/vm/templateInterpreter_aarch64.cpp
|
||||
@@ -860,6 +860,18 @@ void InterpreterGenerator::emit_array_address(Register src, Register idx,
|
||||
__ add(dst, src, idx);
|
||||
}
|
||||
|
||||
+
|
||||
+address InterpreterGenerator::generate_JVM_isAmd64_entry() {
|
||||
+ address entry = __ pc();
|
||||
+ __ mov(r19, lr);
|
||||
+ address fn = CAST_FROM_FN_PTR(address, StubRoutines::isAmd64JVM());
|
||||
+ __ mov(rscratch1, fn);
|
||||
+ __ blr(rscratch1);
|
||||
+ __ br(r19);
|
||||
+
|
||||
+ return entry;
|
||||
+}
|
||||
+
|
||||
/**
|
||||
* Stub Arguments:
|
||||
*
|
||||
@@ -1838,6 +1850,8 @@ address AbstractInterpreterGenerator::generate_method_entry(
|
||||
: entry_point = ((InterpreterGenerator*)this)->generate_Dgemm_dgemm_entry(); break;
|
||||
case Interpreter::org_netlib_blas_Dgemv_dgemv
|
||||
: entry_point = ((InterpreterGenerator*)this)->generate_Dgemv_dgemv_entry(); break;
|
||||
+ case Interpreter::org_apache_hadoop_hbase_util_JVM_isAmd64
|
||||
+ : entry_point = ((InterpreterGenerator*)this)->generate_JVM_isAmd64_entry(); break;
|
||||
default : ShouldNotReachHere(); break;
|
||||
}
|
||||
|
||||
diff --git a/hotspot/src/cpu/aarch64/vm/vm_version_aarch64.cpp b/hotspot/src/cpu/aarch64/vm/vm_version_aarch64.cpp
|
||||
index 27ab00dd..839df4a3 100644
|
||||
--- a/hotspot/src/cpu/aarch64/vm/vm_version_aarch64.cpp
|
||||
@ -17,7 +94,7 @@ index 27ab00dd..839df4a3 100644
|
||||
@@ -169,27 +169,7 @@ void VM_Version::get_processor_features() {
|
||||
_features_str = strdup(buf);
|
||||
_cpuFeatures = auxv;
|
||||
|
||||
|
||||
- int cpu_lines = 0;
|
||||
- if (FILE *f = fopen("/proc/cpuinfo", "r")) {
|
||||
- char buf[128], *p;
|
||||
@ -40,13 +117,13 @@ index 27ab00dd..839df4a3 100644
|
||||
- fclose(f);
|
||||
- }
|
||||
+ int cpu_lines = get_cpu_model();
|
||||
|
||||
|
||||
// Enable vendor specific features
|
||||
if (_cpu == CPU_CAVIUM) {
|
||||
@@ -346,6 +326,31 @@ void VM_Version::get_processor_features() {
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
+int VM_Version::get_cpu_model() {
|
||||
+ int cpu_lines = 0;
|
||||
+ if (FILE *f = fopen("/proc/cpuinfo", "r")) {
|
||||
@ -74,7 +151,7 @@ index 27ab00dd..839df4a3 100644
|
||||
+
|
||||
void VM_Version::initialize() {
|
||||
ResourceMark rm;
|
||||
|
||||
|
||||
diff --git a/hotspot/src/cpu/aarch64/vm/vm_version_aarch64.hpp b/hotspot/src/cpu/aarch64/vm/vm_version_aarch64.hpp
|
||||
index 7f3a5326..47353df9 100644
|
||||
--- a/hotspot/src/cpu/aarch64/vm/vm_version_aarch64.hpp
|
||||
@ -90,7 +167,7 @@ index 7f3a5326..47353df9 100644
|
||||
@@ -87,12 +88,19 @@ public:
|
||||
CPU_DMB_ATOMICS = (1 << 31),
|
||||
} cpuFeatureFlags;
|
||||
|
||||
|
||||
+ static int get_cpu_model();
|
||||
static const char* cpu_features() { return _features_str; }
|
||||
static int cpu_family() { return _cpu; }
|
||||
@ -107,22 +184,59 @@ index 7f3a5326..47353df9 100644
|
||||
static ByteSize dczid_el0_offset() { return byte_offset_of(PsrInfo, dczid_el0); }
|
||||
static ByteSize ctr_el0_offset() { return byte_offset_of(PsrInfo, ctr_el0); }
|
||||
static bool is_zva_enabled() {
|
||||
diff --git a/hotspot/src/cpu/ppc/vm/vm_version_ppc.cpp b/hotspot/src/cpu/ppc/vm/vm_version_ppc.cpp
|
||||
index a5a80d29..45ce795d 100644
|
||||
--- a/hotspot/src/cpu/ppc/vm/vm_version_ppc.cpp
|
||||
+++ b/hotspot/src/cpu/ppc/vm/vm_version_ppc.cpp
|
||||
@@ -251,6 +251,11 @@ void VM_Version::initialize() {
|
||||
FLAG_SET_DEFAULT(UseF2jBLASIntrinsics, false);
|
||||
}
|
||||
|
||||
+ if (UseHBaseUtilIntrinsics) {
|
||||
+ warning("hbase.util instructions are not available on this CPU");
|
||||
+ FLAG_SET_DEFAULT(UseHBaseUtilIntrinsics, false);
|
||||
+ }
|
||||
+
|
||||
if (FLAG_IS_DEFAULT(UseMontgomeryMultiplyIntrinsic)) {
|
||||
UseMontgomeryMultiplyIntrinsic = true;
|
||||
}
|
||||
diff --git a/hotspot/src/cpu/sparc/vm/vm_version_sparc.cpp b/hotspot/src/cpu/sparc/vm/vm_version_sparc.cpp
|
||||
index 08d7a731..d73305ca 100644
|
||||
--- a/hotspot/src/cpu/sparc/vm/vm_version_sparc.cpp
|
||||
+++ b/hotspot/src/cpu/sparc/vm/vm_version_sparc.cpp
|
||||
@@ -392,6 +392,11 @@ void VM_Version::initialize() {
|
||||
FLAG_SET_DEFAULT(UseF2jBLASIntrinsics, false);
|
||||
}
|
||||
|
||||
+ if (UseHBaseUtilIntrinsics) {
|
||||
+ warning("hbase.util instructions are not available on this CPU");
|
||||
+ FLAG_SET_DEFAULT(UseHBaseUtilIntrinsics, false);
|
||||
+ }
|
||||
+
|
||||
if (FLAG_IS_DEFAULT(ContendedPaddingWidth) &&
|
||||
(cache_line_size > ContendedPaddingWidth))
|
||||
ContendedPaddingWidth = cache_line_size;
|
||||
diff --git a/hotspot/src/cpu/x86/vm/vm_version_x86.cpp b/hotspot/src/cpu/x86/vm/vm_version_x86.cpp
|
||||
index 028b55cf..a486ade2 100644
|
||||
--- a/hotspot/src/cpu/x86/vm/vm_version_x86.cpp
|
||||
+++ b/hotspot/src/cpu/x86/vm/vm_version_x86.cpp
|
||||
@@ -658,6 +658,11 @@ void VM_Version::get_processor_features() {
|
||||
FLAG_SET_DEFAULT(UseF2jBLASIntrinsics, false);
|
||||
}
|
||||
|
||||
+ if (UseHBaseUtilIntrinsics) {
|
||||
+ warning("hbase.util instructions are not available on this CPU");
|
||||
+ FLAG_SET_DEFAULT(UseHBaseUtilIntrinsics, false);
|
||||
+ }
|
||||
+
|
||||
// Adjust RTM (Restricted Transactional Memory) flags
|
||||
if (!supports_rtm() && UseRTMLocking) {
|
||||
// Can't continue because UseRTMLocking affects UseBiasedLocking flag
|
||||
diff --git a/hotspot/src/os/linux/vm/os_linux.cpp b/hotspot/src/os/linux/vm/os_linux.cpp
|
||||
index 2dde2587..647ef582 100644
|
||||
index 6b1e6b80..6ee49eed 100644
|
||||
--- a/hotspot/src/os/linux/vm/os_linux.cpp
|
||||
+++ b/hotspot/src/os/linux/vm/os_linux.cpp
|
||||
@@ -5576,6 +5576,10 @@ jint os::init_2(void)
|
||||
Linux::is_floating_stack() ? "floating stack" : "fixed stack");
|
||||
}
|
||||
|
||||
+#ifdef AARCH64
|
||||
+ JavaThread::os_linux_aarch64_options(active_processor_count(), argv_for_execvp);
|
||||
+#endif
|
||||
+
|
||||
if (UseNUMA) {
|
||||
if (!Linux::libnuma_init()) {
|
||||
UseNUMA = false;
|
||||
@@ -5760,6 +5764,9 @@ void os::set_native_thread_name(const char *name) {
|
||||
@@ -5760,6 +5760,9 @@ void os::set_native_thread_name(const char *name) {
|
||||
const int rc = Linux::_pthread_setname_np(pthread_self(), buf);
|
||||
// ERANGE should not happen; all other errors should just be ignored.
|
||||
assert(rc != ERANGE, "pthread_setname_np failed");
|
||||
@ -133,7 +247,7 @@ index 2dde2587..647ef582 100644
|
||||
}
|
||||
|
||||
diff --git a/hotspot/src/os_cpu/linux_aarch64/vm/thread_linux_aarch64.cpp b/hotspot/src/os_cpu/linux_aarch64/vm/thread_linux_aarch64.cpp
|
||||
index 87e42318..8b0e2c98 100644
|
||||
index 87e42318..c496c9eb 100644
|
||||
--- a/hotspot/src/os_cpu/linux_aarch64/vm/thread_linux_aarch64.cpp
|
||||
+++ b/hotspot/src/os_cpu/linux_aarch64/vm/thread_linux_aarch64.cpp
|
||||
@@ -25,6 +25,7 @@
|
||||
@ -144,7 +258,7 @@ index 87e42318..8b0e2c98 100644
|
||||
|
||||
// For Forte Analyzer AsyncGetCallTrace profiling support - thread is
|
||||
// currently interrupted by SIGPROF
|
||||
@@ -39,6 +40,102 @@ bool JavaThread::pd_get_top_frame_for_profiling(frame* fr_addr, void* ucontext,
|
||||
@@ -39,6 +40,127 @@ bool JavaThread::pd_get_top_frame_for_profiling(frame* fr_addr, void* ucontext,
|
||||
return pd_get_top_frame(fr_addr, ucontext, isInJava);
|
||||
}
|
||||
|
||||
@ -184,13 +298,11 @@ index 87e42318..8b0e2c98 100644
|
||||
+ const static intx tTypeProfileMajorReceiverPercent = TypeProfileMajorReceiverPercent;
|
||||
+ const static intx tLoopUnrollLimit = LoopUnrollLimit;
|
||||
+ if (stringHash(secondStr) == 2046673384) {
|
||||
+ // makes specjvm compiler.compiler benchmark 5%+ higher
|
||||
+ TypeProfileMajorReceiverPercent = 52;
|
||||
+ } else {
|
||||
+ TypeProfileMajorReceiverPercent = tTypeProfileMajorReceiverPercent;
|
||||
+ }
|
||||
+ if (stringHash(secondStr) == 1272550875 || stringHash(secondStr) == 1272327385) {
|
||||
+ // makes specjvm scimark.sor.small/large benchmark 10%+ higher
|
||||
+ LoopUnrollLimit = 1000;
|
||||
+ } else {
|
||||
+ LoopUnrollLimit = tLoopUnrollLimit;
|
||||
@ -216,6 +328,31 @@ index 87e42318..8b0e2c98 100644
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+void set_compilation_tuner_params() {
|
||||
+ if (FLAG_IS_DEFAULT(UseCounterDecay))
|
||||
+ FLAG_SET_DEFAULT(UseCounterDecay, false);
|
||||
+ if (FLAG_IS_DEFAULT(DontCompileHugeMethods))
|
||||
+ FLAG_SET_DEFAULT(DontCompileHugeMethods, false);
|
||||
+ if (FLAG_IS_DEFAULT(TieredCompilation))
|
||||
+ FLAG_SET_DEFAULT(TieredCompilation, false);
|
||||
+ if (FLAG_IS_DEFAULT(CompileThreshold))
|
||||
+ FLAG_SET_DEFAULT(CompileThreshold, 11132);
|
||||
+ if (FLAG_IS_DEFAULT(BackEdgeThreshold))
|
||||
+ FLAG_SET_DEFAULT(BackEdgeThreshold, 136559);
|
||||
+ if (FLAG_IS_DEFAULT(OnStackReplacePercentage))
|
||||
+ FLAG_SET_DEFAULT(OnStackReplacePercentage, 182);
|
||||
+ if (FLAG_IS_DEFAULT(InterpreterProfilePercentage))
|
||||
+ FLAG_SET_DEFAULT(InterpreterProfilePercentage, 17);
|
||||
+}
|
||||
+
|
||||
+void set_intrinsic_param() {
|
||||
+ if (FLAG_IS_DEFAULT(UseHBaseUtilIntrinsics)) {
|
||||
+ warning("If your HBase version is lower than 2.4.14, please explicitly specify"
|
||||
+ " -XX:-UseHBaseUtilIntrinsics, otherwise HBase may fail to start.");
|
||||
+ FLAG_SET_DEFAULT(UseHBaseUtilIntrinsics, true);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+void JavaThread::os_linux_aarch64_options(int apc, char **name) {
|
||||
+ if (name == NULL) {
|
||||
+ return;
|
||||
@ -226,6 +363,8 @@ index 87e42318..8b0e2c98 100644
|
||||
+ int step = 0;
|
||||
+ while (name[i] != NULL) {
|
||||
+ if (stringHash(name[i]) == 1396789436) {
|
||||
+ set_compilation_tuner_params();
|
||||
+ set_intrinsic_param();
|
||||
+ if (FLAG_IS_DEFAULT(ActiveProcessorCount) && (UseG1GC || UseParallelGC) && apc > 8)
|
||||
+ FLAG_SET_DEFAULT(ActiveProcessorCount, 8);
|
||||
+ break;
|
||||
@ -261,6 +400,271 @@ index a2f0135c..f14ace0d 100644
|
||||
bool pd_get_top_frame_for_profiling(frame* fr_addr, void* ucontext, bool isInJava);
|
||||
private:
|
||||
bool pd_get_top_frame(frame* fr_addr, void* ucontext, bool isInJava);
|
||||
diff --git a/hotspot/src/share/vm/classfile/vmSymbols.hpp b/hotspot/src/share/vm/classfile/vmSymbols.hpp
|
||||
index 494fd9bd..1674d352 100644
|
||||
--- a/hotspot/src/share/vm/classfile/vmSymbols.hpp
|
||||
+++ b/hotspot/src/share/vm/classfile/vmSymbols.hpp
|
||||
@@ -874,6 +874,11 @@
|
||||
do_name( dgemv_name, "dgemv") \
|
||||
do_signature(dgemv_signature, "(Ljava/lang/String;IID[DII[DIID[DII)V") \
|
||||
\
|
||||
+ /* support for org.apache.hadoop.hbase.util.JVM */ \
|
||||
+ do_class(org_apache_hadoop_hbase_util_jvm, "org/apache/hadoop/hbase/util/JVM") \
|
||||
+ do_intrinsic(_jvm_isAmd64, org_apache_hadoop_hbase_util_jvm, isAmd64_name, void_boolean_signature, F_S) \
|
||||
+ do_name( isAmd64_name, "isAmd64") \
|
||||
+ \
|
||||
/* support for sun.security.provider.SHA2 */ \
|
||||
do_class(sun_security_provider_sha2, "sun/security/provider/SHA2") \
|
||||
do_intrinsic(_sha2_implCompress, sun_security_provider_sha2, implCompress_name, implCompress_signature, F_R) \
|
||||
diff --git a/hotspot/src/share/vm/compiler/compileBroker.cpp b/hotspot/src/share/vm/compiler/compileBroker.cpp
|
||||
index e8f97074..01379902 100644
|
||||
--- a/hotspot/src/share/vm/compiler/compileBroker.cpp
|
||||
+++ b/hotspot/src/share/vm/compiler/compileBroker.cpp
|
||||
@@ -813,18 +813,23 @@ CompileQueue* CompileBroker::compile_queue(int comp_level) {
|
||||
|
||||
|
||||
void CompileBroker::print_compile_queues(outputStream* st) {
|
||||
- _c1_compile_queue->print(st);
|
||||
- _c2_compile_queue->print(st);
|
||||
+ MutexLocker locker(MethodCompileQueue_lock);
|
||||
+ if (_c1_compile_queue != NULL) {
|
||||
+ _c1_compile_queue->print(st);
|
||||
+ }
|
||||
+ if (_c2_compile_queue != NULL) {
|
||||
+ _c2_compile_queue->print(st);
|
||||
+ }
|
||||
}
|
||||
|
||||
|
||||
void CompileQueue::print(outputStream* st) {
|
||||
- assert_locked_or_safepoint(lock());
|
||||
+ assert(lock()->owned_by_self(), "must own lock");
|
||||
st->print_cr("Contents of %s", name());
|
||||
st->print_cr("----------------------------");
|
||||
CompileTask* task = _first;
|
||||
if (task == NULL) {
|
||||
- st->print_cr("Empty");;
|
||||
+ st->print_cr("Empty");
|
||||
} else {
|
||||
while (task != NULL) {
|
||||
task->print_compilation(st, NULL, true, true);
|
||||
diff --git a/hotspot/src/share/vm/interpreter/abstractInterpreter.hpp b/hotspot/src/share/vm/interpreter/abstractInterpreter.hpp
|
||||
index 293382b3..cf9cd908 100644
|
||||
--- a/hotspot/src/share/vm/interpreter/abstractInterpreter.hpp
|
||||
+++ b/hotspot/src/share/vm/interpreter/abstractInterpreter.hpp
|
||||
@@ -102,6 +102,7 @@ class AbstractInterpreter: AllStatic {
|
||||
java_util_zip_CRC32_updateByteBuffer, // implementation of java.util.zip.CRC32.updateByteBuffer()
|
||||
org_netlib_blas_Dgemm_dgemm, // implementation of org.netlib.blas.Dgemm.dgemm()
|
||||
org_netlib_blas_Dgemv_dgemv, // implementation of org.netlib.blas.Dgemv.dgemv()
|
||||
+ org_apache_hadoop_hbase_util_JVM_isAmd64, // implementation of org.hbase.hadoop.hbase.util.JVM.isAmd64()
|
||||
number_of_method_entries,
|
||||
invalid = -1
|
||||
};
|
||||
diff --git a/hotspot/src/share/vm/interpreter/interpreter.cpp b/hotspot/src/share/vm/interpreter/interpreter.cpp
|
||||
index d5d94f34..8d4b5b93 100644
|
||||
--- a/hotspot/src/share/vm/interpreter/interpreter.cpp
|
||||
+++ b/hotspot/src/share/vm/interpreter/interpreter.cpp
|
||||
@@ -259,6 +259,10 @@ AbstractInterpreter::MethodKind AbstractInterpreter::method_kind(methodHandle m)
|
||||
}
|
||||
}
|
||||
|
||||
+ if (UseHBaseUtilIntrinsics && m->intrinsic_id() == vmIntrinsics::_jvm_isAmd64) {
|
||||
+ return org_apache_hadoop_hbase_util_JVM_isAmd64;
|
||||
+ }
|
||||
+
|
||||
// Accessor method?
|
||||
if (m->is_accessor()) {
|
||||
assert(m->size_of_parameters() == 1, "fast code for accessors assumes parameter size = 1");
|
||||
@@ -321,6 +325,7 @@ void AbstractInterpreter::print_method_kind(MethodKind kind) {
|
||||
case java_util_zip_CRC32_updateByteBuffer : tty->print("java_util_zip_CRC32_updateByteBuffer"); break;
|
||||
case org_netlib_blas_Dgemm_dgemm : tty->print("org_netlib_blas_Dgemm_dgemm"); break;
|
||||
case org_netlib_blas_Dgemv_dgemv : tty->print("org_netlib_blas_Dgemv_dgemv"); break;
|
||||
+ case org_apache_hadoop_hbase_util_JVM_isAmd64 : tty->print("org_apache_hadoop_hbase_util_JVM_isAmd64"); break;
|
||||
default:
|
||||
if (kind >= method_handle_invoke_FIRST &&
|
||||
kind <= method_handle_invoke_LAST) {
|
||||
diff --git a/hotspot/src/share/vm/interpreter/templateInterpreter.cpp b/hotspot/src/share/vm/interpreter/templateInterpreter.cpp
|
||||
index 09298a7f..3f2961fb 100644
|
||||
--- a/hotspot/src/share/vm/interpreter/templateInterpreter.cpp
|
||||
+++ b/hotspot/src/share/vm/interpreter/templateInterpreter.cpp
|
||||
@@ -406,6 +406,10 @@ void TemplateInterpreterGenerator::generate_all() {
|
||||
method_entry(org_netlib_blas_Dgemv_dgemv)
|
||||
}
|
||||
|
||||
+ if (UseHBaseUtilIntrinsics) {
|
||||
+ method_entry(org_apache_hadoop_hbase_util_JVM_isAmd64)
|
||||
+ }
|
||||
+
|
||||
initialize_method_handle_entries();
|
||||
|
||||
// all native method kinds (must be one contiguous block)
|
||||
diff --git a/hotspot/src/share/vm/oops/method.cpp b/hotspot/src/share/vm/oops/method.cpp
|
||||
index 406cd485..7cf7e08e 100644
|
||||
--- a/hotspot/src/share/vm/oops/method.cpp
|
||||
+++ b/hotspot/src/share/vm/oops/method.cpp
|
||||
@@ -1301,7 +1301,7 @@ vmSymbols::SID Method::klass_id_for_intrinsics(Klass* holder) {
|
||||
// which does not use the class default class loader so we check for its loader here
|
||||
InstanceKlass* ik = InstanceKlass::cast(holder);
|
||||
if ((ik->class_loader() != NULL) && !SystemDictionary::is_ext_class_loader(ik->class_loader())) {
|
||||
- if (!EnableIntrinsicExternal) {
|
||||
+ if (!EnableIntrinsicExternal && !UseHBaseUtilIntrinsics) {
|
||||
return vmSymbols::NO_SID; // regardless of name, no intrinsics here
|
||||
}
|
||||
}
|
||||
diff --git a/hotspot/src/share/vm/runtime/globals.hpp b/hotspot/src/share/vm/runtime/globals.hpp
|
||||
index fdd9db14..69e6587a 100644
|
||||
--- a/hotspot/src/share/vm/runtime/globals.hpp
|
||||
+++ b/hotspot/src/share/vm/runtime/globals.hpp
|
||||
@@ -768,6 +768,9 @@ class CommandLineFlags {
|
||||
product(bool, UseCRC32Intrinsics, false, \
|
||||
"use intrinsics for java.util.zip.CRC32") \
|
||||
\
|
||||
+ product(bool, UseHBaseUtilIntrinsics, false, \
|
||||
+ "use intrinsics for org.apache.hadoop.hbase.util.JVM on aarch64") \
|
||||
+ \
|
||||
experimental(bool, UseF2jBLASIntrinsics, false, \
|
||||
"use intrinsics for com.github.fommil.netlib.F2jBLAS on aarch64") \
|
||||
\
|
||||
diff --git a/hotspot/src/share/vm/runtime/os.cpp b/hotspot/src/share/vm/runtime/os.cpp
|
||||
index ff35e8b3..cae1cf47 100644
|
||||
--- a/hotspot/src/share/vm/runtime/os.cpp
|
||||
+++ b/hotspot/src/share/vm/runtime/os.cpp
|
||||
@@ -366,6 +366,11 @@ static void signal_thread_entry(JavaThread* thread, TRAPS) {
|
||||
}
|
||||
|
||||
void os::init_before_ergo() {
|
||||
+#ifdef AARCH64
|
||||
+ // global variables
|
||||
+ extern char** argv_for_execvp;
|
||||
+ JavaThread::os_linux_aarch64_options(active_processor_count(), argv_for_execvp);
|
||||
+#endif
|
||||
initialize_initial_active_processor_count();
|
||||
// We need to initialize large page support here because ergonomics takes some
|
||||
// decisions depending on large page support and the calculated large page size.
|
||||
diff --git a/hotspot/src/share/vm/runtime/stubRoutines.cpp b/hotspot/src/share/vm/runtime/stubRoutines.cpp
|
||||
index 3cee9c22..c4be88fc 100644
|
||||
--- a/hotspot/src/share/vm/runtime/stubRoutines.cpp
|
||||
+++ b/hotspot/src/share/vm/runtime/stubRoutines.cpp
|
||||
@@ -144,6 +144,8 @@ address StubRoutines::_ddotF2jBLAS = NULL;
|
||||
address StubRoutines::_dgemmDgemm = NULL;
|
||||
address StubRoutines::_dgemvDgemv = NULL;
|
||||
|
||||
+address StubRoutines::_isAmd64JVM = NULL;
|
||||
+
|
||||
address StubRoutines::_multiplyToLen = NULL;
|
||||
address StubRoutines::_squareToLen = NULL;
|
||||
address StubRoutines::_mulAdd = NULL;
|
||||
diff --git a/hotspot/src/share/vm/runtime/stubRoutines.hpp b/hotspot/src/share/vm/runtime/stubRoutines.hpp
|
||||
index fff13dbc..a5231bdd 100644
|
||||
--- a/hotspot/src/share/vm/runtime/stubRoutines.hpp
|
||||
+++ b/hotspot/src/share/vm/runtime/stubRoutines.hpp
|
||||
@@ -221,6 +221,7 @@ class StubRoutines: AllStatic {
|
||||
static address _ddotF2jBLAS;
|
||||
static address _dgemmDgemm;
|
||||
static address _dgemvDgemv;
|
||||
+ static address _isAmd64JVM;
|
||||
|
||||
static address _multiplyToLen;
|
||||
static address _squareToLen;
|
||||
@@ -391,6 +392,7 @@ class StubRoutines: AllStatic {
|
||||
static address ddotF2jBLAS() { return _ddotF2jBLAS; }
|
||||
static address dgemmDgemm() { return _dgemmDgemm; }
|
||||
static address dgemvDgemv() { return _dgemvDgemv; }
|
||||
+ static address isAmd64JVM() { return _isAmd64JVM; }
|
||||
|
||||
static address multiplyToLen() {return _multiplyToLen; }
|
||||
static address squareToLen() {return _squareToLen; }
|
||||
@@ -431,6 +433,10 @@ class StubRoutines: AllStatic {
|
||||
return _intrinsic_tan(d);
|
||||
}
|
||||
|
||||
+ static bool intrinsic_isAmd64_JVM() {
|
||||
+ return true;
|
||||
+ }
|
||||
+
|
||||
//
|
||||
// Safefetch stub support
|
||||
//
|
||||
diff --git a/hotspot/src/share/vm/services/diagnosticCommand.hpp b/hotspot/src/share/vm/services/diagnosticCommand.hpp
|
||||
index d446aab4..c89933f9 100644
|
||||
--- a/hotspot/src/share/vm/services/diagnosticCommand.hpp
|
||||
+++ b/hotspot/src/share/vm/services/diagnosticCommand.hpp
|
||||
@@ -554,7 +554,7 @@ public:
|
||||
return "Compiler.codelist";
|
||||
}
|
||||
static const char* description() {
|
||||
- return "Print all compiled methods in code cache.";
|
||||
+ return "Print all compiled methods in code cache that are alive";
|
||||
}
|
||||
static const char* impact() {
|
||||
return "Medium";
|
||||
diff --git a/hotspot/test/serviceability/dcmd/CompilerQueueTest.java b/hotspot/test/serviceability/dcmd/CompilerQueueTest.java
|
||||
index 661e7cb4..6d2e7309 100644
|
||||
--- a/hotspot/test/serviceability/dcmd/CompilerQueueTest.java
|
||||
+++ b/hotspot/test/serviceability/dcmd/CompilerQueueTest.java
|
||||
@@ -26,6 +26,8 @@
|
||||
* @bug 8054889
|
||||
* @build DcmdUtil CompilerQueueTest
|
||||
* @run main CompilerQueueTest
|
||||
+ * @run main/othervm -XX:-TieredCompilation CompilerQueueTest
|
||||
+ * @run main/othervm -Xint CompilerQueueTest
|
||||
* @summary Test of diagnostic command Compiler.queue
|
||||
*/
|
||||
|
||||
@@ -62,36 +64,31 @@ public class CompilerQueueTest {
|
||||
String result = DcmdUtil.executeDcmd("Compiler.queue");
|
||||
BufferedReader r = new BufferedReader(new StringReader(result));
|
||||
|
||||
- String line;
|
||||
- match(r.readLine(), "Contents of C1 compile queue");
|
||||
- match(r.readLine(), "----------------------------");
|
||||
String str = r.readLine();
|
||||
- if (!str.equals("Empty")) {
|
||||
- while (str.charAt(0) != '-') {
|
||||
- validateMethodLine(str);
|
||||
+ while (str != null) {
|
||||
+ if (str.startsWith("Contents of C")) {
|
||||
+ match(r.readLine(), "----------------------------");
|
||||
str = r.readLine();
|
||||
- }
|
||||
- } else {
|
||||
- str = r.readLine();
|
||||
- }
|
||||
-
|
||||
- match(str, "----------------------------");
|
||||
- match(r.readLine(), "Contents of C2 compile queue");
|
||||
- match(r.readLine(), "----------------------------");
|
||||
- str = r.readLine();
|
||||
- if (!str.equals("Empty")) {
|
||||
- while (str.charAt(0) != '-') {
|
||||
- validateMethodLine(str);
|
||||
+ if (!str.equals("Empty")) {
|
||||
+ while (str.charAt(0) != '-') {
|
||||
+ validateMethodLine(str);
|
||||
+ str = r.readLine();
|
||||
+ }
|
||||
+ } else {
|
||||
+ str = r.readLine();
|
||||
+ }
|
||||
+ match(str,"----------------------------");
|
||||
str = r.readLine();
|
||||
+ } else {
|
||||
+ throw new Exception("Failed parsing dcmd queue, line: " + str);
|
||||
}
|
||||
- } else {
|
||||
- str = r.readLine();
|
||||
}
|
||||
- match(str, "----------------------------");
|
||||
}
|
||||
|
||||
private static void validateMethodLine(String str) throws Exception {
|
||||
- String name = str.substring(19);
|
||||
+ // Skip until package/class name begins. Trim to remove whitespace that
|
||||
+ // may differ.
|
||||
+ String name = str.substring(14).trim();
|
||||
int sep = name.indexOf("::");
|
||||
try {
|
||||
Class.forName(name.substring(0, sep));
|
||||
--
|
||||
2.19.1
|
||||
|
||||
|
||||
3904
heap-dump-redact-support.patch
Normal file
3904
heap-dump-redact-support.patch
Normal file
File diff suppressed because it is too large
Load Diff
@ -619,7 +619,9 @@ exit 0
|
||||
%{_jvmdir}/%{jredir -- %{?1}}/lib/%{archinstall}/libunpack.so
|
||||
%{_jvmdir}/%{jredir -- %{?1}}/lib/%{archinstall}/libverify.so
|
||||
%{_jvmdir}/%{jredir -- %{?1}}/lib/%{archinstall}/libzip.so
|
||||
%ifnarch loongarch64
|
||||
%{_jvmdir}/%{jredir -- %{?1}}/lib/%{archinstall}/libz.so
|
||||
%endif
|
||||
%{_jvmdir}/%{jredir -- %{?1}}/lib/charsets.jar
|
||||
%{_jvmdir}/%{jredir -- %{?1}}/lib/classlist
|
||||
%{_jvmdir}/%{jredir -- %{?1}}/lib/content-types.properties
|
||||
@ -943,7 +945,7 @@ Provides: java-%{javaver}-%{origin}-accessibility%{?1} = %{epoch}:%{version}-%{r
|
||||
|
||||
Name: java-%{javaver}-%{origin}
|
||||
Version: %{javaver}.%{updatever}.%{buildver}
|
||||
Release: 3
|
||||
Release: 11
|
||||
# java-1.5.0-ibm from jpackage.org set Epoch to 1 for unknown reasons
|
||||
# and this change was brought into RHEL-4. java-1.5.0-ibm packages
|
||||
# also included the epoch in their virtual provides. This created a
|
||||
@ -1205,10 +1207,10 @@ Patch301: fix-SUSE-x86_32-build-failure.patch
|
||||
Patch302: fix-the-issue-that-cert-of-geotrustglobalca-expired.patch
|
||||
|
||||
# 8u372
|
||||
Patch303: 8074354-Make-CreateMinidumpOnCrash-a-new-name-and-av.patch
|
||||
Patch304: jcmd-mnt-add-start-time-and-end-time.patch
|
||||
Patch305: Fix-localtime_r-not-defined-on-windows.patch
|
||||
Patch306: 8057743-process-Synchronize-exiting-of-threads-and-p.patch
|
||||
Patch303: 8074354-Make-CreateMinidumpOnCrash-a-new-name-and-av.patch
|
||||
Patch304: jcmd-mnt-add-start-time-and-end-time.patch
|
||||
Patch305: Fix-localtime_r-not-defined-on-windows.patch
|
||||
Patch306: 8057743-process-Synchronize-exiting-of-threads-and-p.patch
|
||||
Patch307: 8305541-C2-Div-Mod-nodes-without-zero-check-could-be.patch
|
||||
Patch308: 0002-8179498-attach-in-linux-should-be-relative-to-proc-p.patch
|
||||
Patch309: 0003-8187408-AbstractQueuedSynchronizer-wait-queue-corrup.patch
|
||||
@ -1339,7 +1341,15 @@ Patch438: Huawei-Add-Aggressive-CDS.patch
|
||||
Patch439: Backport-8151845-Comment-in-globals.hpp-for-MetaspaceSize-is-.patch
|
||||
Patch440: Backport-8210706-G1-may-deadlock-when-starting-a-concurrent-c.patch
|
||||
Patch441: Backport-8318889-Backport-Important-Fixed-Issues-in-Later-Ver.patch
|
||||
|
||||
#422
|
||||
Patch442: Huawei-Keep-objects-when-remove-unshareable-info.patch
|
||||
Patch443: The-fast-serialization-function-of-sun.rmi.transport.patch
|
||||
Patch445: Extending-the-IV-Length-Supported-by-KAEProvider-AES.patch
|
||||
Patch446: 8137165-Tests-fail-in-SR_Handler-because-thread-is-n.patch
|
||||
Patch447: heap-dump-redact-support.patch
|
||||
Patch448: KAE-zip-support-streaming-data-decompression.patch
|
||||
Patch449: Enhance-SIGBUS-and-rlimit-information-in-errlog.patch
|
||||
#############################################
|
||||
#
|
||||
# Upstreamable patches
|
||||
@ -1997,6 +2007,12 @@ pushd %{top_level_dir_name}
|
||||
%patch440 -p1
|
||||
%patch441 -p1
|
||||
%patch442 -p1
|
||||
%patch443 -p1
|
||||
%patch445 -p1
|
||||
%patch446 -p1
|
||||
%patch447 -p1
|
||||
%patch448 -p1
|
||||
%patch449 -p1
|
||||
%endif
|
||||
|
||||
%ifarch loongarch64
|
||||
@ -2131,8 +2147,8 @@ bash ${top_srcdir_abs_path}/configure \
|
||||
--with-update-version=%{updatever} \
|
||||
--with-build-number=%{buildver} \
|
||||
%ifnarch loongarch64 ppc64le
|
||||
--with-company-name="Bisheng" \
|
||||
--with-vendor-name="Bisheng" \
|
||||
--with-company-name="BiSheng" \
|
||||
--with-vendor-name="BiSheng" \
|
||||
%endif
|
||||
--with-vendor-url="https://openeuler.org/" \
|
||||
--with-vendor-bug-url="https://gitee.com/src-openeuler/openjdk-1.8.0/issues/" \
|
||||
@ -2258,7 +2274,7 @@ done
|
||||
|
||||
# Make sure gdb can do a backtrace based on line numbers on libjvm.so
|
||||
# javaCalls.cpp:58 should map to:
|
||||
# http://hg.openjdk.java.net/jdk8u/jdk8u/hotspot/file/ff3b27e6bcc2/src/share/vm/runtime/javaCalls.cpp#l58
|
||||
# http://hg.openjdk.java.net/jdk8u/jdk8u/hotspot/file/ff3b27e6bcc2/src/share/vm/runtime/javaCalls.cpp#l58
|
||||
# Using line number 1 might cause build problems.
|
||||
%ifnarch loongarch64
|
||||
gdb -q "$JAVA_HOME/bin/java" <<EOF | tee gdb.out
|
||||
@ -2354,7 +2370,7 @@ mkdir -p $RPM_BUILD_ROOT%{_jvmdir}/%{jredir -- $suffix}/lib/%{archinstall}/clien
|
||||
# Install demos and samples.
|
||||
cp -a demo $RPM_BUILD_ROOT%{_jvmdir}/%{sdkdir -- $suffix}
|
||||
mkdir -p sample/rmi
|
||||
if [ ! -e sample/rmi/java-rmi.cgi ] ; then
|
||||
if [ ! -e sample/rmi/java-rmi.cgi ] ; then
|
||||
# hack to allow --short-circuit on install
|
||||
mv bin/java-rmi.cgi sample/rmi
|
||||
fi
|
||||
@ -2467,11 +2483,11 @@ for file in lib/security/cacerts lib/security/policy/unlimited/US_export_policy.
|
||||
done
|
||||
|
||||
# stabilize permissions
|
||||
find $RPM_BUILD_ROOT/%{_jvmdir}/%{sdkdir -- $suffix}/ -name "*.so" -exec chmod 755 {} \; ;
|
||||
find $RPM_BUILD_ROOT/%{_jvmdir}/%{sdkdir -- $suffix}/ -type d -exec chmod 755 {} \; ;
|
||||
find $RPM_BUILD_ROOT/%{_jvmdir}/%{sdkdir -- $suffix}/ -name "ASSEMBLY_EXCEPTION" -exec chmod 644 {} \; ;
|
||||
find $RPM_BUILD_ROOT/%{_jvmdir}/%{sdkdir -- $suffix}/ -name "LICENSE" -exec chmod 644 {} \; ;
|
||||
find $RPM_BUILD_ROOT/%{_jvmdir}/%{sdkdir -- $suffix}/ -name "THIRD_PARTY_README" -exec chmod 644 {} \; ;
|
||||
find $RPM_BUILD_ROOT/%{_jvmdir}/%{sdkdir -- $suffix}/ -name "*.so" -exec chmod 755 {} \; ;
|
||||
find $RPM_BUILD_ROOT/%{_jvmdir}/%{sdkdir -- $suffix}/ -type d -exec chmod 755 {} \; ;
|
||||
find $RPM_BUILD_ROOT/%{_jvmdir}/%{sdkdir -- $suffix}/ -name "ASSEMBLY_EXCEPTION" -exec chmod 644 {} \; ;
|
||||
find $RPM_BUILD_ROOT/%{_jvmdir}/%{sdkdir -- $suffix}/ -name "LICENSE" -exec chmod 644 {} \; ;
|
||||
find $RPM_BUILD_ROOT/%{_jvmdir}/%{sdkdir -- $suffix}/ -name "THIRD_PARTY_README" -exec chmod 644 {} \; ;
|
||||
|
||||
# end, dual install
|
||||
done
|
||||
@ -2522,9 +2538,10 @@ end
|
||||
|
||||
-- run content of included file with fake args
|
||||
|
||||
arg = nil; -- it is better to null the arg up, no meter if they exists or not, and use cjc as module in unified way, instead of relaying on "main" method during require "copy_jdk_configs.lua"
|
||||
cjc = require "copy_jdk_configs.lua"
|
||||
arg = {"--currentjvm", "%{uniquesuffix %{nil}}", "--jvmdir", "%{_jvmdir %{nil}}", "--origname", "%{name}", "--origjavaver", "%{javaver}", "--arch", "%{_arch}", "--temp", "%{rpm_state_dir}/%{name}.%{_arch}"}
|
||||
cjc.mainProgram(arg)
|
||||
args = {"--currentjvm", "%{uniquesuffix %{nil}}", "--jvmdir", "%{_jvmdir %{nil}}", "--origname", "%{name}", "--origjavaver", "%{javaver}", "--arch", "%{_arch}", "--temp", "%{rpm_state_dir}/%{name}.%{_arch}"}
|
||||
cjc.mainProgram(args) -- the returns from copy_jdk_configs.lua should not affect this 'main', so it should run under all circumstances, except fatal error
|
||||
|
||||
%post
|
||||
%{post_script %{nil}}
|
||||
@ -2661,15 +2678,43 @@ cjc.mainProgram(arg)
|
||||
%endif
|
||||
|
||||
%changelog
|
||||
* Mon Sep 2 2024 Dingli Zhang <dingli@iscas.ac.cn> -1:1.8.0.422-b05.3
|
||||
* Fri Sep 6 2024 Benshuai5D <zhangyunbo7@huawei.com> -1:1.8.0.422-b05.11
|
||||
- add Enhance-SIGBUS-and-rlimit-information-in-errlog.patch
|
||||
|
||||
* Wed Sep 4 2024 neu-mobi <liuyulong35@huawei.com> -1:1.8.0.422-b05.10
|
||||
- Support KAE Zip
|
||||
- rename Bisheng to BiSheng
|
||||
|
||||
* Mon Sep 2 2024 Dingli Zhang <dingli@iscas.ac.cn> -1:1.8.0.422-b05.9
|
||||
- Fix build error on riscv64 because of patch438
|
||||
|
||||
* Thu Aug 29 2024 Dingli Zhang <dingli@iscas.ac.cn> -1:1.8.0.422-b05.2
|
||||
* Thu Aug 29 2024 Dingli Zhang <dingli@iscas.ac.cn> -1:1.8.0.422-b05.8
|
||||
- Fix build on riscv64 in prep stage for 8u422
|
||||
|
||||
* Tue Jul 30 2024 Xiang Gao <gaoxiang@kylinos.cn> - 1:1.8.0.422-b05.1
|
||||
* Tue Aug 20 2024 wuyafang <wuyafang@huawei.com> -1:1.8.0.422-b05.7
|
||||
- modified add-Fix-aarch64-runtime-thread-signal-transfer-bug.patch
|
||||
|
||||
* Wed Aug 7 2024 songliyang <songliyang@kylinos.cn> -1:1.8.0.422-b05.6
|
||||
- let support-KAE-zip.patch not install libz.so on loongarch64
|
||||
- update LoongArch64 port to 8u422
|
||||
- fix changelog date error
|
||||
|
||||
* Tue Aug 6 2024 benshuai5D <zhangyunbo7@huawei.com> -1:1.8.0.422-b05.5
|
||||
- modified add-Fix-aarch64-runtime-thread-signal-transfer-bug.patch
|
||||
|
||||
* Sat Aug 3 2024 kuenking111 <wangkun49@huawei.com> -1:1.8.0.422-b05.4
|
||||
- Add 8137165-Tests-fail-in-SR_Handler-because-thread-is-n.patch
|
||||
- Extending-the-IV-Length-Supported-by-KAEProvider-AES.patch
|
||||
|
||||
* Tue Jul 30 2024 benshuai5D <zhangyunbo7@huawei.com> -1:1.8.0.422-b05.3
|
||||
- Fix-the-ActiveProcessorCount-function-of-the-spark-s.patch
|
||||
|
||||
* Tue Jul 30 2024 Xiang Gao <gaoxiang@kylinos.cn> - 1:1.8.0.422-b05.2
|
||||
- Backport 8178498,8193710,8196743,8284330, serviceability tools support containers on loongarch
|
||||
|
||||
* Fri Jul 26 2024 benshuai5D <zhangyunbo7@huawei.com> -1:1.8.0.422-b05.1
|
||||
- Add The-fast-serialization-function-of-sun.rmi.transport.patch
|
||||
|
||||
* Tue Jul 16 2024 Autistic_boyya <wangzhongyi7@huawei.com> -1:1.8.0.422-b05.rolling
|
||||
- modified 8014628-Support-AES-Encryption-with-HMAC-SHA2-for-Ke.patch
|
||||
- modified 8136577_Make_AbortVMOnException_available_in_product_builds.patch
|
||||
@ -2940,10 +2985,10 @@ cjc.mainProgram(arg)
|
||||
- 0054-Fix-jmap-heapdump-symbols-when-the-class-is-loaded-f.patch
|
||||
- 0055-Fix-CodelistTest.java-Failed-to-Execute-CodelistTest.patch
|
||||
|
||||
* Fri May 11 2023 crash888 <wangmengqi13@huawei.com> - 1:1.8.0.372-b07.1
|
||||
- modified Fix-the-crash-that-occurs-when-the-process-exits-due.patch
|
||||
* Thu May 11 2023 crash888 <wangmengqi13@huawei.com> - 1:1.8.0.372-b07.1
|
||||
- modified Fix-the-crash-that-occurs-when-the-process-exits-due.patch
|
||||
|
||||
* Fri May 6 2023 crash888 <wangmengqi13@huawei.com> - 1:1.8.0.372-b07.0
|
||||
* Sat May 6 2023 crash888 <wangmengqi13@huawei.com> - 1:1.8.0.372-b07.0
|
||||
- deleted Add-ability-to-configure-third-port-for-remote-JMX.patch
|
||||
- deleted 8287109-Distrust-failed-with-CertificateExpired.patch
|
||||
- deleted Huawei-fix-windows-build-Dynamic-CDS-failure.patch
|
||||
@ -2959,10 +3004,10 @@ cjc.mainProgram(arg)
|
||||
- modified add-missing-test-case.patch
|
||||
- modified fix-the-issue-that-cert-of-geotrustglobalca-expired.patch
|
||||
- modified fix_X509TrustManagerImpl_symantec_distrust.patch
|
||||
- add 8074354-Make-CreateMinidumpOnCrash-a-new-name-and-av.patch
|
||||
- add jcmd-mnt-add-start-time-and-end-time.patch
|
||||
- add Fix-localtime_r-not-defined-on-windows.patch
|
||||
- add 8057743-process-Synchronize-exiting-of-threads-and-p.patch
|
||||
- add 8074354-Make-CreateMinidumpOnCrash-a-new-name-and-av.patch
|
||||
- add jcmd-mnt-add-start-time-and-end-time.patch
|
||||
- add Fix-localtime_r-not-defined-on-windows.patch
|
||||
- add 8057743-process-Synchronize-exiting-of-threads-and-p.patch
|
||||
- add 8305541-C2-Div-Mod-nodes-without-zero-check-could-be.patch
|
||||
- upgrade to jdk8u372-b07
|
||||
|
||||
@ -3166,7 +3211,7 @@ cjc.mainProgram(arg)
|
||||
- modified implementation_of_Blas_hotspot_function_in_Intrinsics.patch
|
||||
|
||||
* Tue Feb 15 2022 eapen <zhangyipeng7@huawei.com> - 1:1.8.0.322-b06.1
|
||||
- fix makes failure when gcc version is lower than 8
|
||||
- fix makes failure when gcc version is lower than 8
|
||||
|
||||
* Thu Feb 10 2022 eapen <zhangyipeng7@huawei.com> - 1:1.8.0.322-b06.0
|
||||
- upgrade to 8u322-b06(ga)
|
||||
@ -3442,7 +3487,7 @@ cjc.mainProgram(arg)
|
||||
|
||||
* Tue Nov 10 2020 ow_wo <fengshijie2@huawei.com> - 1:1.8.0.272-b10.6
|
||||
- add 8236512-PKCS11-Connection-closed-after-Cipher.doFinal-and-NoPadding.patch
|
||||
- add 8250861-Crash-in-MinINode-Ideal-PhaseGVN-bool.patch
|
||||
- add 8250861-Crash-in-MinINode-Ideal-PhaseGVN-bool.patch
|
||||
|
||||
* Mon Nov 09 2020 ow_wo <fengshijie2@huawei.com> - 1:1.8.0.272-b10.5
|
||||
- add 8223940-Private-key-not-supported-by-chosen-signature.patch
|
||||
@ -3520,7 +3565,7 @@ cjc.mainProgram(arg)
|
||||
- Add Ddot-intrinsic-implement.patch
|
||||
- Add 8234003-Improve-IndexSet-iteration.patch
|
||||
- Add 8220159-Optimize-various-RegMask-operations-by-introducing-watermarks.patch
|
||||
- Remove prohibition-of-irreducible-loop-in-mergers.patch
|
||||
- Remove prohibition-of-irreducible-loop-in-mergers.patch
|
||||
|
||||
* Tue Aug 25 2020 noah <hedongbo@huawei.com> - 1:1.8.0.265-b10.0
|
||||
- Update to aarch64-shenandoah-jdk8u-8u265-b01
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user