diff --git a/8014628-Support-AES-Encryption-with-HMAC-SHA2-for-Ke.patch b/8014628-Support-AES-Encryption-with-HMAC-SHA2-for-Ke.patch index 08411fd6f00c8cf19db13e61916c1528e037fbc9..df447e6a35706a27fdfbd2349e2c4258a4914258 100644 --- a/8014628-Support-AES-Encryption-with-HMAC-SHA2-for-Ke.patch +++ b/8014628-Support-AES-Encryption-with-HMAC-SHA2-for-Ke.patch @@ -1957,9 +1957,9 @@ index 6413e155b..b59832f73 100644 - * @bug 7152176 8168518 + * @bug 7152176 8168518 8014628 * @summary More krb5 tests - * @library ../../../../java/security/testlibrary/ + * @library ../../../../java/security/testlibrary/ /test/lib * @compile -XDignore.symbol.file ReplayCacheTestProc.java -@@ -126,8 +126,13 @@ public class ReplayCacheTestProc { +@@ -139,8 +139,13 @@ public class ReplayCacheTestProc { kdc.addPrincipalRandKey(service(i)); } @@ -1971,9 +1971,9 @@ index 6413e155b..b59832f73 100644 + // Write KTAB after krb5.conf so it contains no aes-sha2 keys kdc.writeKtab(OneKDC.KTAB); - KDC.saveConfig(OneKDC.KRB5_CONF, kdc); - - // User-provided libs - String userLibs = System.getProperty("test.libs"); + + pi = Proc.create("ReplayCacheTestProc").debug("C") + .args("initiator") diff --git a/jdk/test/sun/security/krb5/etype/ETypeOrder.java b/jdk/test/sun/security/krb5/etype/ETypeOrder.java index 9437b16ed..be36d6372 100644 --- a/jdk/test/sun/security/krb5/etype/ETypeOrder.java diff --git a/8136577_Make_AbortVMOnException_available_in_product_builds.patch b/8136577_Make_AbortVMOnException_available_in_product_builds.patch index 1aa04c7bc9b4677cd2536ad44905707ee88616df..1b13af19532753e32e6a9f3c55ea29944f59ad65 100755 --- a/8136577_Make_AbortVMOnException_available_in_product_builds.patch +++ b/8136577_Make_AbortVMOnException_available_in_product_builds.patch @@ -2,8 +2,8 @@ diff --git a/hotspot/src/share/vm/c1/c1_Runtime1.cpp b/hotspot/src/share/vm/c1/c index 3c1ea7280..b8d866786 100644 --- a/hotspot/src/share/vm/c1/c1_Runtime1.cpp +++ b/hotspot/src/share/vm/c1/c1_Runtime1.cpp -@@ -542,7 +542,7 @@ JRT_ENTRY_NO_ASYNC(static address, exception_handler_for_pc_helper(JavaThread* t - exception->print_value_string(), p2i((address)exception()), nm->method()->print_value_string(), p2i(pc), p2i(thread)); +@@ -544,7 +544,7 @@ JRT_ENTRY_NO_ASYNC(static address, exception_handler_for_pc_helper(JavaThread* t + p2i((address)exception()), nm->method()->print_value_string(), p2i(pc), p2i(thread)); } // for AbortVMOnException flag - NOT_PRODUCT(Exceptions::debug_check_abort(exception)); diff --git a/8137165-Tests-fail-in-SR_Handler-because-thread-is-n.patch b/8137165-Tests-fail-in-SR_Handler-because-thread-is-n.patch new file mode 100644 index 0000000000000000000000000000000000000000..0eb257dca5b1764f287371e2fef0f5bc2fb4adf8 --- /dev/null +++ b/8137165-Tests-fail-in-SR_Handler-because-thread-is-n.patch @@ -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 + diff --git a/Backport-6956385-URLConnection.getLastModified-leaks-file-han.patch b/Backport-6956385-URLConnection.getLastModified-leaks-file-han.patch new file mode 100644 index 0000000000000000000000000000000000000000..d05b7ff7eae5ade774ed6192303350f978148bf9 --- /dev/null +++ b/Backport-6956385-URLConnection.getLastModified-leaks-file-han.patch @@ -0,0 +1,168 @@ +From b9649e772450f25e3c5d47ce1a15b3e1afa12017 Mon Sep 17 00:00:00 2001 +Date: Wed, 17 Apr 2024 10:43:54 +0000 +Subject: [PATCH] [Backport]6956385: URLConnection.getLastModified() leaks file handles + for jar:file and file: URLs +--- + .../www/protocol/file/FileURLConnection.java | 6 ++ + .../www/protocol/jar/JarURLConnection.java | 13 ++- + .../protocol/jar/FileURLConnectionLeak.java | 100 ++++++++++++++++++ + 3 files changed, 117 insertions(+), 2 deletions(-) + create mode 100644 jdk/test/sun/net/www/protocol/jar/FileURLConnectionLeak.java + +diff --git a/jdk/src/share/classes/sun/net/www/protocol/file/FileURLConnection.java b/jdk/src/share/classes/sun/net/www/protocol/file/FileURLConnection.java +index 1997cb08c..16f404988 100644 +--- a/jdk/src/share/classes/sun/net/www/protocol/file/FileURLConnection.java ++++ b/jdk/src/share/classes/sun/net/www/protocol/file/FileURLConnection.java +@@ -103,6 +103,12 @@ public class FileURLConnection extends URLConnection { + } + } + ++ public synchronized void closeInputStream() throws IOException { ++ if (is != null) { ++ is.close(); ++ } ++ } ++ + private boolean initializedHeaders = false; + + private void initializeHeaders() { +diff --git a/jdk/src/share/classes/sun/net/www/protocol/jar/JarURLConnection.java b/jdk/src/share/classes/sun/net/www/protocol/jar/JarURLConnection.java +index d7c442442..f1757da78 100644 +--- a/jdk/src/share/classes/sun/net/www/protocol/jar/JarURLConnection.java ++++ b/jdk/src/share/classes/sun/net/www/protocol/jar/JarURLConnection.java +@@ -25,6 +25,8 @@ + + package sun.net.www.protocol.jar; + ++import sun.net.www.protocol.file.FileURLConnection; ++ + import java.io.InputStream; + import java.io.IOException; + import java.io.FileNotFoundException; +@@ -107,8 +109,15 @@ public class JarURLConnection extends java.net.JarURLConnection { + try { + super.close(); + } finally { +- if (!getUseCaches()) { +- jarFile.close(); ++ try { ++ if (!getUseCaches()) { ++ jarFile.close(); ++ } ++ } finally { ++ if (jarFileURLConnection instanceof FileURLConnection) { ++ FileURLConnection fileURLConnection = (FileURLConnection) jarFileURLConnection; ++ fileURLConnection.closeInputStream(); ++ } + } + } + } +diff --git a/jdk/test/sun/net/www/protocol/jar/FileURLConnectionLeak.java b/jdk/test/sun/net/www/protocol/jar/FileURLConnectionLeak.java +new file mode 100644 +index 000000000..4a5f9d7e2 +--- /dev/null ++++ b/jdk/test/sun/net/www/protocol/jar/FileURLConnectionLeak.java +@@ -0,0 +1,100 @@ ++/* ++ * Copyright (c) 2023, 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 ++ * @bug 6956385 ++ * @summary JarURLConnection may fail to close its underlying FileURLConnection ++ * @run main/othervm FileURLConnectionLeak ++ */ ++ ++import java.io.InputStream; ++import java.io.OutputStream; ++import java.lang.management.ManagementFactory; ++import java.lang.management.RuntimeMXBean; ++import java.net.URI; ++import java.net.URL; ++import java.net.URLConnection; ++import java.nio.file.Files; ++import java.nio.file.Path; ++import java.nio.file.Paths; ++import java.util.jar.Attributes; ++import java.util.jar.JarOutputStream; ++import java.util.jar.Manifest; ++ ++public class FileURLConnectionLeak { ++ public static void main(String[] args) throws Exception { ++ Path jar = Paths.get("x.jar").toAbsolutePath(); ++ Manifest mani = new Manifest(); ++ mani.getMainAttributes().put(Attributes.Name.MANIFEST_VERSION, "1.0"); ++ try (OutputStream os = Files.newOutputStream(jar); OutputStream jos = new JarOutputStream(os, mani)) {} ++ URL u = URI.create("jar:" + jar.toUri() + "!/META-INF/MANIFEST.MF").toURL(); ++ URLConnection urlConnection = u.openConnection(); ++ urlConnection.setDefaultUseCaches(false); ++ // FileURLConnection.is not used, so was always fine: ++ try (InputStream is = u.openStream()) { ++ byte[] buffer = new byte[1024]; ++ int bytesRead; ++ while ((bytesRead = is.read(buffer)) != -1) { ++ System.out.write(buffer, 0, bytesRead); ++ } ++ } ++ // FileURLConnection.is opened implicitly: ++ URLConnection conn = u.openConnection(); ++ conn.getLastModified(); ++ // Idiom to close URLConnection (cf. JDK-8224095), which must also close the other stream: ++ conn.getInputStream().close(); ++ Path fds = Paths.get("/proc/" + getPid() + "/fd"); ++ if (Files.isDirectory(fds)) { ++ // Linux: verify that x.jar is not open ++ for (Path fd : (Iterable) Files.list(fds)::iterator) { ++ if (Files.isSymbolicLink(fd)) { ++ Path file = Files.readSymbolicLink(fd); ++ if (file.equals(jar)) { ++ throw new IllegalStateException("Still held open " + jar + " from " + fd); ++ } ++ } ++ } ++ } ++ // Windows: verify that mandatory file locks do not prevent deletion ++ Files.delete(jar); ++ } ++ ++ private static int getPid() { ++ try { ++ // get runtime MXBean ++ RuntimeMXBean runtime = ManagementFactory.getRuntimeMXBean(); ++ // get pid ++ String name = runtime.getName(); ++ int index = name.indexOf('@'); ++ if (index != -1) { ++ return Integer.parseInt(name.substring(0, index)); ++ } ++ } catch (Exception e) { ++ e.printStackTrace(); ++ } ++ return -1; ++ } ++ ++ ++} +-- +2.23.0 + diff --git a/Backport-7036144-GZIPInputStream-readTrailer-uses-faulty-avai.patch b/Backport-7036144-GZIPInputStream-readTrailer-uses-faulty-avai.patch new file mode 100644 index 0000000000000000000000000000000000000000..f7ec9900fcbeaad2198169e78c1bb0e79a9f82be --- /dev/null +++ b/Backport-7036144-GZIPInputStream-readTrailer-uses-faulty-avai.patch @@ -0,0 +1,169 @@ +From 8f3c271e9d34a1105f069fb9d3081c72e1c48180 Mon Sep 17 00:00:00 2001 +Date: Tue, 28 May 2024 02:31:27 +0000 +Subject: [PATCH] [Backport]7036144:GZIPInputStream readTrailer uses faulty available() + test for end-of-stream +--- + .../java/util/zip/GZIPInputStream.java | 24 ++-- + .../zip/GZIP/GZIPInputStreamAvailable.java | 112 ++++++++++++++++++ + 2 files changed, 121 insertions(+), 15 deletions(-) + create mode 100644 jdk/test/java/util/zip/GZIP/GZIPInputStreamAvailable.java + +diff --git a/jdk/src/share/classes/java/util/zip/GZIPInputStream.java b/jdk/src/share/classes/java/util/zip/GZIPInputStream.java +index b3d9240ba..0d57e8ab3 100644 +--- a/jdk/src/share/classes/java/util/zip/GZIPInputStream.java ++++ b/jdk/src/share/classes/java/util/zip/GZIPInputStream.java +@@ -224,23 +224,17 @@ class GZIPInputStream extends InflaterInputStream { + (readUInt(in) != (inf.getBytesWritten() & 0xffffffffL))) + throw new ZipException("Corrupt GZIP trailer"); + +- // If there are more bytes available in "in" or +- // the leftover in the "inf" is > 26 bytes: +- // this.trailer(8) + next.header.min(10) + next.trailer(8) + // try concatenated case +- if (this.in.available() > 0 || n > 26) { +- int m = 8; // this.trailer +- try { +- m += readHeader(in); // next.header +- } catch (IOException ze) { +- return true; // ignore any malformed, do nothing +- } +- inf.reset(); +- if (n > m) +- inf.setInput(buf, len - n + m, n - m); +- return false; ++ int m = 8; // this.trailer ++ try { ++ m += readHeader(in); // next.header ++ } catch (IOException ze) { ++ return true; // ignore any malformed, do nothing + } +- return true; ++ inf.reset(); ++ if (n > m) ++ inf.setInput(buf, len - n + m, n - m); ++ return false; + } + + /* +diff --git a/jdk/test/java/util/zip/GZIP/GZIPInputStreamAvailable.java b/jdk/test/java/util/zip/GZIP/GZIPInputStreamAvailable.java +new file mode 100644 +index 000000000..265050b17 +--- /dev/null ++++ b/jdk/test/java/util/zip/GZIP/GZIPInputStreamAvailable.java +@@ -0,0 +1,112 @@ ++/* ++ * Copyright (c) 2023, 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 ++ * @bug 7036144 ++ * @summary Test concatenated gz streams when available() returns zero ++ */ ++ ++import java.io.*; ++import java.util.*; ++import java.util.zip.*; ++ ++public class GZIPInputStreamAvailable { ++ ++ public static final int NUM_COPIES = 100; ++ public static void main(String[] args) throws Throwable { ++ testZeroAvailable(); ++ } ++ ++ public static void testZeroAvailable() throws IOException { ++ ++ // Create some uncompressed data and then repeat it NUM_COPIES times ++ byte[] uncompressed1 = "this is a test".getBytes("ASCII"); ++ byte[] uncompressedN = repeat(uncompressed1, NUM_COPIES); ++ ++ // Compress the original data and then repeat that NUM_COPIES times ++ byte[] compressed1 = deflate(uncompressed1); ++ byte[] compressedN = repeat(compressed1, NUM_COPIES); ++ ++ // (a) Read back inflated data from a stream where available() is accurate and verify ++ byte[] readback1 = inflate(new ByteArrayInputStream(compressedN), uncompressedN.length); ++ assertArrayEquals(uncompressedN, readback1); ++ ++ // (b) Read back inflated data from a stream where available() always returns zero and verify ++ byte[] readback2 = inflate(new ZeroAvailableStream(new ByteArrayInputStream(compressedN)), uncompressedN.length); ++ assertArrayEquals(uncompressedN, readback2); ++ } ++ ++ public static byte[] repeat(byte[] data, int count) { ++ byte[] repeat = new byte[data.length * count]; ++ int off = 0; ++ for (int i = 0; i < count; i++) { ++ System.arraycopy(data, 0, repeat, off, data.length); ++ off += data.length; ++ } ++ return repeat; ++ } ++ ++ public static byte[] deflate(byte[] data) throws IOException { ++ ByteArrayOutputStream buf = new ByteArrayOutputStream(); ++ try (GZIPOutputStream out = new GZIPOutputStream(buf)) { ++ out.write(data); ++ } ++ return buf.toByteArray(); ++ } ++ ++ public static byte[] inflate(InputStream in, int bufferLen) throws IOException { ++ GZIPInputStream gzipInputStream = new GZIPInputStream(in); ++ ByteArrayOutputStream bos = new ByteArrayOutputStream(); ++ byte[] buffer = new byte[bufferLen]; ++ int len; ++ while ((len = gzipInputStream.read(buffer)) != -1) { ++ bos.write(buffer, 0, len); ++ } ++ gzipInputStream.close(); ++ bos.close(); ++ return bos.toByteArray(); ++ } ++ ++ public static class ZeroAvailableStream extends FilterInputStream { ++ public ZeroAvailableStream(InputStream in) { ++ super(in); ++ } ++ @Override ++ public int available() { ++ return 0; ++ } ++ } ++ ++ public static void assertArrayEquals(byte[] arr1, byte[] arr2) { ++ if (arr1 == null && arr2 == null) return; ++ if (arr1 != null && arr2 != null && arr1.length == arr2.length) { ++ for (int i = 0; i < arr1.length; i++) { ++ if (arr1[i] != arr2[i]) { ++ throw new AssertionError(Arrays.toString(arr1) + " != " + Arrays.toString(arr2)); ++ } ++ } ++ return; ++ } ++ throw new AssertionError(Arrays.toString(arr1) + " != " + Arrays.toString(arr2)); ++ } ++} +\ No newline at end of file +-- +2.23.0 + diff --git a/Backport-8068864-C2-failed-modified-node-is-not-on-IGVN._work.patch b/Backport-8068864-C2-failed-modified-node-is-not-on-IGVN._work.patch new file mode 100644 index 0000000000000000000000000000000000000000..8ca64dec638048a8d02bb7231e931b8fdcdcc7c3 --- /dev/null +++ b/Backport-8068864-C2-failed-modified-node-is-not-on-IGVN._work.patch @@ -0,0 +1,27 @@ +From 7af1eca9cf66942bf9e54a582f3046ae9b96a8eb Mon Sep 17 00:00:00 2001 +Date: Thu, 23 May 2024 11:28:10 +0800 +Subject: [PATCH] [Backport]8068864: C2 failed: modified node is not on + IGVN._worklist +--- + hotspot/src/share/vm/opto/loopTransform.cpp | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/hotspot/src/share/vm/opto/loopTransform.cpp b/hotspot/src/share/vm/opto/loopTransform.cpp +index 414edc26b..0aca095ce 100644 +--- a/hotspot/src/share/vm/opto/loopTransform.cpp ++++ b/hotspot/src/share/vm/opto/loopTransform.cpp +@@ -2006,10 +2006,9 @@ void PhaseIdealLoop::do_range_check( IdealLoopTree *loop, Node_List &old_new ) { + } + Node *main_cmp = main_bol->in(1); + if( main_cmp->outcnt() > 1 ) { // CmpNode shared? +- _igvn.hash_delete(main_bol); + main_cmp = main_cmp->clone();// Clone a private CmpNode + register_new_node( main_cmp, main_cle->in(0) ); +- main_bol->set_req(1,main_cmp); ++ _igvn.replace_input_of(main_bol, 1, main_cmp); + } + // Hack the now-private loop bounds + _igvn.replace_input_of(main_cmp, 2, main_limit); +-- +2.19.1 + diff --git a/Backport-8151845-Comment-in-globals.hpp-for-MetaspaceSize-is-.patch b/Backport-8151845-Comment-in-globals.hpp-for-MetaspaceSize-is-.patch new file mode 100644 index 0000000000000000000000000000000000000000..e0638156a16827ddea03904c162c2cf08b016f96 --- /dev/null +++ b/Backport-8151845-Comment-in-globals.hpp-for-MetaspaceSize-is-.patch @@ -0,0 +1,39 @@ +From 005d0a4e518c2f41aa1d5fc76110214001532df8 Mon Sep 17 00:00:00 2001 +Date: Wed, 29 May 2024 14:52:13 +0800 +Subject: [PATCH] [Backport]8151845: Comment in globals.hpp for MetaspaceSize is + incorrect. +--- + hotspot/src/share/vm/memory/metaspace.cpp | 2 +- + hotspot/src/share/vm/runtime/globals.hpp | 3 ++- + 2 files changed, 3 insertions(+), 2 deletions(-) + +diff --git a/hotspot/src/share/vm/memory/metaspace.cpp b/hotspot/src/share/vm/memory/metaspace.cpp +index d08bfba84..1df9eb606 100644 +--- a/hotspot/src/share/vm/memory/metaspace.cpp ++++ b/hotspot/src/share/vm/memory/metaspace.cpp +@@ -2599,7 +2599,7 @@ void MetaspaceGC::compute_new_size() { + if (PrintGCDetails && Verbose) { + gclog_or_tty->print_cr(" " + " shrinking:" +- " initSize: %.1fK" ++ " initThreshold: %.1fK" + " maximum_desired_capacity: %.1fK", + MetaspaceSize / (double) K, + maximum_desired_capacity / (double) K); +diff --git a/hotspot/src/share/vm/runtime/globals.hpp b/hotspot/src/share/vm/runtime/globals.hpp +index 6aa53d2d2..f3daa12a6 100644 +--- a/hotspot/src/share/vm/runtime/globals.hpp ++++ b/hotspot/src/share/vm/runtime/globals.hpp +@@ -3332,7 +3332,8 @@ class CommandLineFlags { + "non-daemon thread (in bytes)") \ + \ + product_pd(uintx, MetaspaceSize, \ +- "Initial size of Metaspaces (in bytes)") \ ++ "Initial threshold (in bytes) at which a garbage collection " \ ++ "is done to reduce Metaspace usage") \ + \ + product(uintx, MaxMetaspaceSize, max_uintx, \ + "Maximum size of Metaspaces (in bytes)") \ +-- +2.23.0 + diff --git a/Backport-8209362-sun-security-ssl-SSLSocketImpl-ReuseAddr.jav.patch b/Backport-8209362-sun-security-ssl-SSLSocketImpl-ReuseAddr.jav.patch new file mode 100644 index 0000000000000000000000000000000000000000..30b6c933a076edb71729d1c4915383f9095e05f7 --- /dev/null +++ b/Backport-8209362-sun-security-ssl-SSLSocketImpl-ReuseAddr.jav.patch @@ -0,0 +1,305 @@ +From 50df8472137e95ff6f64fe4136bbad64db8b46e7 Mon Sep 17 00:00:00 2001 +Date: Mon, 27 May 2024 15:12:37 +0800 +Subject: [PATCH] 8209362: sun/security/ssl/SSLSocketImpl/ReuseAddr.java failed + due to "BindException: Address already in use (Bind failed)" +--- + .../net/ssl/templates/SSLSocketTemplate.java | 6 +- + .../security/ssl/SSLSocketImpl/ReuseAddr.java | 237 ++---------------- + 2 files changed, 17 insertions(+), 226 deletions(-) + +diff --git a/jdk/test/javax/net/ssl/templates/SSLSocketTemplate.java b/jdk/test/javax/net/ssl/templates/SSLSocketTemplate.java +index 9e09a0e35..e62f57eba 100644 +--- a/jdk/test/javax/net/ssl/templates/SSLSocketTemplate.java ++++ b/jdk/test/javax/net/ssl/templates/SSLSocketTemplate.java +@@ -224,12 +224,12 @@ public class SSLSocketTemplate { + /* + * What's the server port? Use any free port by default + */ +- private volatile int serverPort = 0; ++ protected volatile int serverPort = 0; + + /* + * Define the server side of the test. + */ +- private void doServerSide() throws Exception { ++ protected void doServerSide() throws Exception { + // kick start the server side service + SSLContext context = createServerSSLContext(); + SSLServerSocketFactory sslssf = context.getServerSocketFactory(); +@@ -290,7 +290,7 @@ public class SSLSocketTemplate { + /* + * Define the client side of the test. + */ +- private void doClientSide() throws Exception { ++ protected void doClientSide() throws Exception { + + // Wait for server to get started. + // +diff --git a/jdk/test/sun/security/ssl/SSLSocketImpl/ReuseAddr.java b/jdk/test/sun/security/ssl/SSLSocketImpl/ReuseAddr.java +index 650c30988..abad01099 100644 +--- a/jdk/test/sun/security/ssl/SSLSocketImpl/ReuseAddr.java ++++ b/jdk/test/sun/security/ssl/SSLSocketImpl/ReuseAddr.java +@@ -1,5 +1,5 @@ + /* +- * Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 2001, 2018, 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 +@@ -25,240 +25,31 @@ + * @test + * @bug 4482446 + * @summary java.net.SocketTimeoutException on 98, NT, 2000 for JSSE +- * @run main/othervm ReuseAddr ++ * @library /javax/net/ssl/templates ++ * @run main ReuseAddr + * + * SunJSSE does not support dynamic system properties, no way to re-use + * system properties in samevm/agentvm mode. + * @author Brad Wetmore + */ + +-import java.io.*; +-import java.net.*; +-import javax.net.ssl.*; ++import java.net.ServerSocket; + +-public class ReuseAddr { ++public class ReuseAddr extends SSLSocketTemplate { + +- /* +- * ============================================================= +- * Set the various variables needed for the tests, then +- * specify what tests to run on each side. +- */ ++ @Override ++ protected void doServerSide() throws Exception { ++ super.doServerSide(); + +- /* +- * Should we run the client or server in a separate thread? +- * Both sides can throw exceptions, but do you have a preference +- * as to which side should be the main thread. +- */ +- static boolean separateServerThread = true; +- +- /* +- * Where do we find the keystores? +- */ +- private final static String pathToStores = "../../../../javax/net/ssl/etc"; +- static String keyStoreFile = "keystore"; +- static String trustStoreFile = "truststore"; +- static String passwd = "passphrase"; +- +- /* +- * Is the server ready to serve? +- */ +- volatile static boolean serverReady = false; +- +- /* +- * Turn on SSL debugging? +- */ +- static boolean debug = false; +- +- /* +- * If the client or server is doing some kind of object creation +- * that the other side depends on, and that thread prematurely +- * exits, you may experience a hang. The test harness will +- * terminate all hung threads after its timeout has expired, +- * currently 3 minutes by default, but you might try to be +- * smart about it.... +- */ +- +- /* +- * Define the server side of the test. +- * +- * If the server prematurely exits, serverReady will be set to true +- * to avoid infinite hangs. +- */ +- void doServerSide() throws Exception { +- SSLServerSocketFactory sslssf = +- (SSLServerSocketFactory) SSLServerSocketFactory.getDefault(); +- SSLServerSocket sslServerSocket = +- (SSLServerSocket) sslssf.createServerSocket(serverPort); +- serverPort = sslServerSocket.getLocalPort(); +- +- /* +- * Signal Client, we're ready for his connect. +- */ +- serverReady = true; +- +- SSLSocket sslSocket = (SSLSocket) sslServerSocket.accept(); +- InputStream sslIS = sslSocket.getInputStream(); +- OutputStream sslOS = sslSocket.getOutputStream(); +- +- sslIS.read(); +- sslOS.write(85); +- sslOS.flush(); +- +- sslSocket.close(); +- +- // Close original server socket +- sslServerSocket.close(); +- +- // Try rebinding to same port +- sslServerSocket = +- (SSLServerSocket) sslssf.createServerSocket(serverPort); +- sslServerSocket.close(); +- } +- +- /* +- * Define the client side of the test. +- * +- * If the server prematurely exits, serverReady will be set to true +- * to avoid infinite hangs. +- */ +- void doClientSide() throws Exception { +- +- /* +- * Wait for server to get started. +- */ +- while (!serverReady) { +- Thread.sleep(50); ++ // Note that if this port is already used by another test, ++ // this test will fail. ++ System.out.println("Try rebinding to same port: " + serverPort); ++ try (ServerSocket server = new ServerSocket(serverPort)) { ++ System.out.println("Server port: " + server.getLocalPort()); + } +- +- SSLSocketFactory sslsf = +- (SSLSocketFactory) SSLSocketFactory.getDefault(); +- SSLSocket sslSocket = (SSLSocket) +- sslsf.createSocket("localhost", serverPort); +- +- InputStream sslIS = sslSocket.getInputStream(); +- OutputStream sslOS = sslSocket.getOutputStream(); +- +- sslOS.write(280); +- sslOS.flush(); +- sslIS.read(); +- +- sslSocket.close(); + } + +- /* +- * ============================================================= +- * The remainder is just support stuff +- */ +- +- // use any free port by default +- volatile int serverPort = 0; +- +- volatile Exception serverException = null; +- volatile Exception clientException = null; +- + public static void main(String[] args) throws Exception { +- String keyFilename = +- System.getProperty("test.src", "./") + "/" + pathToStores + +- "/" + keyStoreFile; +- String trustFilename = +- System.getProperty("test.src", "./") + "/" + pathToStores + +- "/" + trustStoreFile; +- +- System.setProperty("javax.net.ssl.keyStore", keyFilename); +- System.setProperty("javax.net.ssl.keyStorePassword", passwd); +- System.setProperty("javax.net.ssl.trustStore", trustFilename); +- System.setProperty("javax.net.ssl.trustStorePassword", passwd); +- +- if (debug) +- System.setProperty("javax.net.debug", "all"); +- +- /* +- * Start the tests. +- */ +- new ReuseAddr(); +- } +- +- Thread clientThread = null; +- Thread serverThread = null; +- +- /* +- * Primary constructor, used to drive remainder of the test. +- * +- * Fork off the other side, then do your work. +- */ +- ReuseAddr() throws Exception { +- if (separateServerThread) { +- startServer(true); +- startClient(false); +- } else { +- startClient(true); +- startServer(false); +- } +- +- /* +- * Wait for other side to close down. +- */ +- if (separateServerThread) { +- serverThread.join(); +- } else { +- clientThread.join(); +- } +- +- /* +- * When we get here, the test is pretty much over. +- * +- * If the main thread excepted, that propagates back +- * immediately. If the other thread threw an exception, we +- * should report back. +- */ +- if (serverException != null) +- throw serverException; +- if (clientException != null) +- throw clientException; +- } +- +- void startServer(boolean newThread) throws Exception { +- if (newThread) { +- serverThread = new Thread() { +- public void run() { +- try { +- doServerSide(); +- } catch (Exception e) { +- /* +- * Our server thread just died. +- * +- * Release the client, if not active already... +- */ +- System.err.println("Server died..."); +- serverReady = true; +- serverException = e; +- } +- } +- }; +- serverThread.start(); +- } else { +- doServerSide(); +- } +- } +- +- void startClient(boolean newThread) throws Exception { +- if (newThread) { +- clientThread = new Thread() { +- public void run() { +- try { +- doClientSide(); +- } catch (Exception e) { +- /* +- * Our client thread just died. +- */ +- System.err.println("Client died..."); +- clientException = e; +- } +- } +- }; +- clientThread.start(); +- } else { +- doClientSide(); +- } ++ new ReuseAddr().run(); + } + } +-- +2.19.1 + diff --git a/Backport-8210706-G1-may-deadlock-when-starting-a-concurrent-c.patch b/Backport-8210706-G1-may-deadlock-when-starting-a-concurrent-c.patch new file mode 100644 index 0000000000000000000000000000000000000000..c5b688c088f58066b253b8f32b58ef176ec97d28 --- /dev/null +++ b/Backport-8210706-G1-may-deadlock-when-starting-a-concurrent-c.patch @@ -0,0 +1,171 @@ +From 8e53927b6739a935dc833f7e9527dacb71bae1a8 Mon Sep 17 00:00:00 2001 +Date: Thu, 30 May 2024 07:02:40 +0000 +Subject: [PATCH] [Backport]8210706: G1 may deadlock when starting a concurrent cycle at + shutdown +--- + .../gc_implementation/g1/concurrentMark.cpp | 20 +++++++++++-------- + .../gc_implementation/g1/concurrentMark.hpp | 4 ++++ + .../g1/concurrentMarkThread.cpp | 8 +++++++- + .../gc_implementation/g1/g1CollectedHeap.cpp | 14 +++++++------ + .../shared/concurrentGCThread.hpp | 2 ++ + 5 files changed, 33 insertions(+), 15 deletions(-) + +diff --git a/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp b/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp +index 1347a7e16..cad474b83 100644 +--- a/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp ++++ b/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp +@@ -477,6 +477,16 @@ HeapRegion* CMRootRegions::claim_next() { + return res; + } + ++void CMRootRegions::notify_scan_done() { ++ MutexLockerEx x(RootRegionScan_lock, Mutex::_no_safepoint_check_flag); ++ _scan_in_progress = false; ++ RootRegionScan_lock->notify_all(); ++} ++ ++void CMRootRegions::cancel_scan() { ++ notify_scan_done(); ++} ++ + void CMRootRegions::scan_finished() { + assert(scan_in_progress(), "pre-condition"); + +@@ -486,11 +496,7 @@ void CMRootRegions::scan_finished() { + } + _next_survivor = NULL; + +- { +- MutexLockerEx x(RootRegionScan_lock, Mutex::_no_safepoint_check_flag); +- _scan_in_progress = false; +- RootRegionScan_lock->notify_all(); +- } ++ notify_scan_done(); + } + + bool CMRootRegions::wait_until_scan_finished() { +@@ -1224,13 +1230,11 @@ public: + }; + + void ConcurrentMark::scanRootRegions() { +- // Start of concurrent marking. +- ClassLoaderDataGraph::clear_claimed_marks(); +- + // scan_in_progress() will have been set to true only if there was + // at least one root region to scan. So, if it's false, we + // should not attempt to do any further work. + if (root_regions()->scan_in_progress()) { ++ assert(!has_aborted(), "Aborting before root region scanning is finished not supported."); + _parallel_marking_threads = calc_parallel_marking_threads(); + assert(parallel_marking_threads() <= max_parallel_marking_threads(), + "Maximum number of marking threads exceeded"); +diff --git a/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.hpp b/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.hpp +index bbd5d590a..172caef29 100644 +--- a/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.hpp ++++ b/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.hpp +@@ -333,6 +333,8 @@ private: + volatile bool _should_abort; + HeapRegion* volatile _next_survivor; + ++ void notify_scan_done(); ++ + public: + CMRootRegions(); + // We actually do most of the initialization in this method. +@@ -352,6 +354,8 @@ public: + // all have been claimed. + HeapRegion* claim_next(); + ++ void cancel_scan(); ++ + // Flag that we're done with root region scanning and notify anyone + // who's waiting on it. If aborted is false, assume that all regions + // have been claimed. +diff --git a/hotspot/src/share/vm/gc_implementation/g1/concurrentMarkThread.cpp b/hotspot/src/share/vm/gc_implementation/g1/concurrentMarkThread.cpp +index 9b0452f92..3c4553bf7 100644 +--- a/hotspot/src/share/vm/gc_implementation/g1/concurrentMarkThread.cpp ++++ b/hotspot/src/share/vm/gc_implementation/g1/concurrentMarkThread.cpp +@@ -23,6 +23,7 @@ + */ + + #include "precompiled.hpp" ++#include "classfile/classLoaderData.hpp" + #include "gc_implementation/g1/concurrentMarkThread.inline.hpp" + #include "gc_implementation/g1/g1CollectedHeap.inline.hpp" + #include "gc_implementation/g1/g1CollectorPolicy.hpp" +@@ -100,6 +101,10 @@ void ConcurrentMarkThread::run() { + HandleMark hm; + double cycle_start = os::elapsedVTime(); + ++ { ++ ClassLoaderDataGraph::clear_claimed_marks(); ++ } ++ + // We have to ensure that we finish scanning the root regions + // before the next GC takes place. To ensure this we have to + // make sure that we do not join the STS until the root regions +@@ -109,7 +114,7 @@ void ConcurrentMarkThread::run() { + // correctness issue. + + double scan_start = os::elapsedTime(); +- if (!cm()->has_aborted()) { ++ { + if (G1Log::fine()) { + gclog_or_tty->gclog_stamp(cm()->concurrent_gc_id()); + gclog_or_tty->print_cr("[GC concurrent-root-region-scan-start]"); +@@ -297,6 +302,7 @@ void ConcurrentMarkThread::run() { + } + } + assert(_should_terminate, "just checking"); ++ _cm->root_regions()->cancel_scan(); + + terminate(); + } +diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp +index 5b156f99d..3ff5586c1 100644 +--- a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp ++++ b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp +@@ -1346,8 +1346,7 @@ bool G1CollectedHeap::do_collection(bool explicit_gc, + ref_processor_cm()->verify_no_references_recorded(); + + // Abandon current iterations of concurrent marking and concurrent +- // refinement, if any are in progress. We have to do this before +- // wait_until_scan_finished() below. ++ // refinement, if any are in progress. + concurrent_mark()->abort(); + + // Make sure we'll choose a new allocation region afterwards. +@@ -4032,10 +4031,13 @@ G1CollectedHeap::do_collection_pause_at_safepoint(double target_pause_time_ms) { + verify_region_sets_optional(); + verify_dirty_young_regions(); + +- // This call will decide whether this pause is an initial-mark +- // pause. If it is, during_initial_mark_pause() will return true +- // for the duration of this pause. +- g1_policy()->decide_on_conc_mark_initiation(); ++ // We should not be doing initial mark unless the conc mark thread is running ++ if (!_cmThread->should_terminate()) { ++ // This call will decide whether this pause is an initial-mark ++ // pause. If it is, during_initial_mark_pause() will return true ++ // for the duration of this pause. ++ g1_policy()->decide_on_conc_mark_initiation(); ++ } + + // We do not allow initial-mark to be piggy-backed on a mixed GC. + assert(!g1_policy()->during_initial_mark_pause() || +diff --git a/hotspot/src/share/vm/gc_implementation/shared/concurrentGCThread.hpp b/hotspot/src/share/vm/gc_implementation/shared/concurrentGCThread.hpp +index 1e16bf726..ceb65b029 100644 +--- a/hotspot/src/share/vm/gc_implementation/shared/concurrentGCThread.hpp ++++ b/hotspot/src/share/vm/gc_implementation/shared/concurrentGCThread.hpp +@@ -71,6 +71,8 @@ public: + + // Tester + bool is_ConcurrentGC_thread() const { return true; } ++ ++ bool should_terminate() { return _should_terminate; } + }; + + // The SurrogateLockerThread is used by concurrent GC threads for +-- +2.23.0 + diff --git a/Backport-8318889-Backport-Important-Fixed-Issues-in-Later-Ver.patch b/Backport-8318889-Backport-Important-Fixed-Issues-in-Later-Ver.patch new file mode 100644 index 0000000000000000000000000000000000000000..38c47b873035d7be7f5cb5c5c15c37f0fe687162 --- /dev/null +++ b/Backport-8318889-Backport-Important-Fixed-Issues-in-Later-Ver.patch @@ -0,0 +1,524 @@ +From d9cb35d747e5f38210a3207d6821e333dcf45a8b Mon Sep 17 00:00:00 2001 +Date: Fri, 31 May 2024 15:39:38 +0800 +Subject: [PATCH] [Backport]8318889: Backport Important Fixed Issues in Later Versions + 2024_5_30 +--- + hotspot/src/os/linux/vm/os_perf_linux.cpp | 2 +- + hotspot/src/share/vm/opto/loopnode.cpp | 8 +- + hotspot/src/share/vm/prims/jni.cpp | 5 + + .../abstractMethod/AbstractMethodClass.jasm | 43 ++++++ + .../abstractMethod/TestJNIAbstractMethod.java | 68 +++++++++ + .../jni/abstractMethod/libJNIAbstractMethod.c | 43 ++++++ + .../media/sound/StandardMidiFileReader.java | 13 +- + .../classes/javax/swing/text/html/CSS.java | 6 +- + jdk/src/share/native/java/util/zip/zip_util.c | 2 +- + .../native/sun/awt/image/jpeg/imageioJPEG.c | 4 + + .../native/sun/awt/image/jpeg/jpegdecoder.c | 4 + + .../File/SMFInterruptedRunningStatus.java | 143 ++++++++++++++++++ + 12 files changed, 331 insertions(+), 10 deletions(-) + create mode 100644 hotspot/test/runtime/jni/abstractMethod/AbstractMethodClass.jasm + create mode 100644 hotspot/test/runtime/jni/abstractMethod/TestJNIAbstractMethod.java + create mode 100644 hotspot/test/runtime/jni/abstractMethod/libJNIAbstractMethod.c + create mode 100644 jdk/test/javax/sound/midi/File/SMFInterruptedRunningStatus.java + +diff --git a/hotspot/src/os/linux/vm/os_perf_linux.cpp b/hotspot/src/os/linux/vm/os_perf_linux.cpp +index 0d1f75810..6a92675a6 100644 +--- a/hotspot/src/os/linux/vm/os_perf_linux.cpp ++++ b/hotspot/src/os/linux/vm/os_perf_linux.cpp +@@ -941,7 +941,7 @@ SystemProcessInterface::SystemProcesses::ProcessIterator::ProcessIterator() { + bool SystemProcessInterface::SystemProcesses::ProcessIterator::initialize() { + _dir = os::opendir("/proc"); + _entry = NULL; +- _valid = true; ++ _valid = _dir != NULL; // May be null if /proc is not accessible. + next_process(); + + return true; +diff --git a/hotspot/src/share/vm/opto/loopnode.cpp b/hotspot/src/share/vm/opto/loopnode.cpp +index 5e6d53a48..351e6888b 100644 +--- a/hotspot/src/share/vm/opto/loopnode.cpp ++++ b/hotspot/src/share/vm/opto/loopnode.cpp +@@ -2571,6 +2571,7 @@ void PhaseIdealLoop::build_and_optimize(bool do_split_ifs, bool skip_loop_opts) + NOT_PRODUCT( C->verify_graph_edges(); ) + worklist.push( C->top() ); + build_loop_late( visited, worklist, nstack ); ++ if (C->failing()) { return; } + + if (_verify_only) { + // restore major progress flag +@@ -3781,6 +3782,7 @@ void PhaseIdealLoop::build_loop_late( VectorSet &visited, Node_List &worklist, N + } else { + // All of n's children have been processed, complete post-processing. + build_loop_late_post(n); ++ if (C->failing()) { return; } + if (nstack.is_empty()) { + // Finished all nodes on stack. + // Process next node on the worklist. +@@ -3884,13 +3886,15 @@ void PhaseIdealLoop::build_loop_late_post( Node *n ) { + Node *legal = LCA; // Walk 'legal' up the IDOM chain + Node *least = legal; // Best legal position so far + while( early != legal ) { // While not at earliest legal +-#ifdef ASSERT + if (legal->is_Start() && !early->is_Root()) { ++#ifdef ASSERT + // Bad graph. Print idom path and fail. + dump_bad_graph("Bad graph detected in build_loop_late", n, early, LCA); + assert(false, "Bad graph detected in build_loop_late"); +- } + #endif ++ C->record_method_not_compilable("Bad graph detected in build_loop_late"); ++ return; ++ } + // Find least loop nesting depth + legal = idom(legal); // Bump up the IDOM tree + // Check for lower nesting depth +diff --git a/hotspot/src/share/vm/prims/jni.cpp b/hotspot/src/share/vm/prims/jni.cpp +index de0aae9b4..cccb578ea 100644 +--- a/hotspot/src/share/vm/prims/jni.cpp ++++ b/hotspot/src/share/vm/prims/jni.cpp +@@ -1380,6 +1380,11 @@ static void jni_invoke_nonstatic(JNIEnv *env, JavaValue* result, jobject receive + } + } + ++ if (selected_method->is_abstract()) { ++ ResourceMark rm(THREAD); ++ THROW_MSG(vmSymbols::java_lang_AbstractMethodError(), selected_method->name()->as_C_string()); ++ } ++ + methodHandle method(THREAD, selected_method); + + // Create object to hold arguments for the JavaCall, and associate it with +diff --git a/hotspot/test/runtime/jni/abstractMethod/AbstractMethodClass.jasm b/hotspot/test/runtime/jni/abstractMethod/AbstractMethodClass.jasm +new file mode 100644 +index 000000000..24c53f203 +--- /dev/null ++++ b/hotspot/test/runtime/jni/abstractMethod/AbstractMethodClass.jasm +@@ -0,0 +1,43 @@ ++/* ++ * Copyright (c) 2024, 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. ++ * ++ */ ++/* ++ * This is a non-abstract class with an abstract method. ++ * ++ */ ++super public class AbstractMethodClass ++ extends java/lang/Object ++ version 51:0 // Java 7 version ++{ ++ ++ public Method "":"()V" ++ stack 1 locals 1 ++ { ++ aload_0; ++ invokespecial Method java/lang/Object."":"()V"; ++ return; ++ } ++ ++ public abstract Method "abstractM":"()V"; ++ ++} +diff --git a/hotspot/test/runtime/jni/abstractMethod/TestJNIAbstractMethod.java b/hotspot/test/runtime/jni/abstractMethod/TestJNIAbstractMethod.java +new file mode 100644 +index 000000000..2384f6d5a +--- /dev/null ++++ b/hotspot/test/runtime/jni/abstractMethod/TestJNIAbstractMethod.java +@@ -0,0 +1,68 @@ ++/* ++ * Copyright (c) 2024, 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 ++ * @bug 8323243 ++ * @summary Test that invocation of an abstract method from JNI works correctly ++ * @compile AbstractMethodClass.jasm ++ * @run main/othervm/native TestJNIAbstractMethod ++ */ ++ ++/** ++ * We are testing invocation of an abstract method from JNI - which should ++ * simply result in throwning AbstractMethodError. To invoke an abstract method ++ * we must have an instance method (as abstract static methods are illegal), ++ * but instantiating an abstract class is also illegal at the Java language ++ * level, so we have to use a custom jasm class that contains an abstract method ++ * declaration, but which is not itself declared as an abstract class. ++ */ ++public class TestJNIAbstractMethod { ++ ++ // Invokes an abstract method from JNI and throws AbstractMethodError. ++ private static native void invokeAbstractM(Class AMclass, ++ AbstractMethodClass receiver); ++ ++ static { ++ System.loadLibrary("JNIAbstractMethod"); ++ } ++ ++ public static void main(String[] args) { ++ AbstractMethodClass obj = new AbstractMethodClass(); ++ try { ++ System.out.println("Attempting direct invocation via Java"); ++ obj.abstractM(); ++ throw new RuntimeException("Did not get AbstractMethodError from Java!"); ++ } catch (AbstractMethodError expected) { ++ System.out.println("ok - got expected exception: " + expected); ++ } ++ try { ++ System.out.println("Attempting direct invocation via JNI"); ++ invokeAbstractM(obj.getClass(), obj); ++ throw new RuntimeException("Did not get AbstractMethodError from JNI!"); ++ } catch (AbstractMethodError expected) { ++ System.out.println("ok - got expected exception: " + expected); ++ } ++ } ++} +diff --git a/hotspot/test/runtime/jni/abstractMethod/libJNIAbstractMethod.c b/hotspot/test/runtime/jni/abstractMethod/libJNIAbstractMethod.c +new file mode 100644 +index 000000000..35a28f702 +--- /dev/null ++++ b/hotspot/test/runtime/jni/abstractMethod/libJNIAbstractMethod.c +@@ -0,0 +1,43 @@ ++/* ++ * Copyright (c) 2024, 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. ++ * ++ */ ++#include ++#include ++#include ++ ++JNIEXPORT void JNICALL Java_TestJNIAbstractMethod_invokeAbstractM(JNIEnv* env, ++ jclass this_cls, ++ jclass target_cls, ++ jobject receiver) { ++ ++ jmethodID mid = (*env)->GetMethodID(env, target_cls, "abstractM", "()V"); ++ if (mid == NULL) { ++ fprintf(stderr, "Error looking up method abstractM\n"); ++ (*env)->ExceptionDescribe(env); ++ exit(1); ++ } ++ ++ printf("Invoking abstract method ...\n"); ++ (*env)->CallVoidMethod(env, receiver, mid); // Should raise exception ++ ++} +diff --git a/jdk/src/share/classes/com/sun/media/sound/StandardMidiFileReader.java b/jdk/src/share/classes/com/sun/media/sound/StandardMidiFileReader.java +index 20ebe4f06..ba7f344a4 100644 +--- a/jdk/src/share/classes/com/sun/media/sound/StandardMidiFileReader.java ++++ b/jdk/src/share/classes/com/sun/media/sound/StandardMidiFileReader.java +@@ -326,10 +326,10 @@ final class SMFParser { + // reset current tick to 0 + long tick = 0; + +- // reset current status byte to 0 (invalid value). ++ // reset current running status byte to 0 (invalid value). + // this should cause us to throw an InvalidMidiDataException if we don't + // get a valid status byte from the beginning of the track. +- int status = 0; ++ int runningStatus = 0; + boolean endOfTrackFound = false; + + while (!trackFinished() && !endOfTrackFound) { +@@ -346,10 +346,17 @@ final class SMFParser { + // check for new status + int byteValue = readUnsigned(); + ++ int status; + if (byteValue >= 0x80) { + status = byteValue; ++ ++ // update running status (only for channel messages) ++ if ((status & 0xF0) != 0xF0) { ++ runningStatus = status; ++ } + } else { +- data1 = byteValue; ++ status = runningStatus; ++ data1 = byteValue; + } + + switch (status & 0xF0) { +diff --git a/jdk/src/share/classes/javax/swing/text/html/CSS.java b/jdk/src/share/classes/javax/swing/text/html/CSS.java +index 4a944d381..4713bcd60 100644 +--- a/jdk/src/share/classes/javax/swing/text/html/CSS.java ++++ b/jdk/src/share/classes/javax/swing/text/html/CSS.java +@@ -2581,8 +2581,8 @@ public class CSS implements Serializable { + * Used for BackgroundImages. + */ + static class BackgroundImage extends CssValue { +- private boolean loadedImage; +- private ImageIcon image; ++ private volatile boolean loadedImage; ++ private ImageIcon image; + + Object parseCssValue(String value) { + BackgroundImage retValue = new BackgroundImage(); +@@ -2600,7 +2600,6 @@ public class CSS implements Serializable { + synchronized(this) { + if (!loadedImage) { + URL url = CSS.getURL(base, svalue); +- loadedImage = true; + if (url != null) { + image = new ImageIcon(); + Image tmpImg = Toolkit.getDefaultToolkit().createImage(url); +@@ -2608,6 +2607,7 @@ public class CSS implements Serializable { + image.setImage(tmpImg); + } + } ++ loadedImage = true; + } + } + } +diff --git a/jdk/src/share/native/java/util/zip/zip_util.c b/jdk/src/share/native/java/util/zip/zip_util.c +index ff59c5ecc..8b0c08909 100644 +--- a/jdk/src/share/native/java/util/zip/zip_util.c ++++ b/jdk/src/share/native/java/util/zip/zip_util.c +@@ -443,7 +443,7 @@ hash(const char *s) + static unsigned int + hashN(const char *s, int length) + { +- int h = 0; ++ unsigned int h = 0; + while (length-- > 0) + h = 31*h + *s++; + return h; +diff --git a/jdk/src/share/native/sun/awt/image/jpeg/imageioJPEG.c b/jdk/src/share/native/sun/awt/image/jpeg/imageioJPEG.c +index 7e1d8c99d..1cd9e8bdb 100644 +--- a/jdk/src/share/native/sun/awt/image/jpeg/imageioJPEG.c ++++ b/jdk/src/share/native/sun/awt/image/jpeg/imageioJPEG.c +@@ -1131,6 +1131,10 @@ imageio_skip_input_data(j_decompress_ptr cinfo, long num_bytes) + return; + } + num_bytes += sb->remaining_skip; ++ // Check for overflow if remaining_skip value is too large ++ if (num_bytes < 0) { ++ return; ++ } + sb->remaining_skip = 0; + + /* First the easy case where we are skipping <= the current contents. */ +diff --git a/jdk/src/share/native/sun/awt/image/jpeg/jpegdecoder.c b/jdk/src/share/native/sun/awt/image/jpeg/jpegdecoder.c +index cea158e17..2f64d33cc 100644 +--- a/jdk/src/share/native/sun/awt/image/jpeg/jpegdecoder.c ++++ b/jdk/src/share/native/sun/awt/image/jpeg/jpegdecoder.c +@@ -406,6 +406,10 @@ sun_jpeg_skip_input_data(j_decompress_ptr cinfo, long num_bytes) + return; + } + num_bytes += src->remaining_skip; ++ // Check for overflow if remaining_skip value is too large ++ if (num_bytes < 0) { ++ return; ++ } + src->remaining_skip = 0; + ret = (int)src->pub.bytes_in_buffer; /* this conversion is safe, because capacity of the buffer is limited by jnit */ + if (ret >= num_bytes) { +diff --git a/jdk/test/javax/sound/midi/File/SMFInterruptedRunningStatus.java b/jdk/test/javax/sound/midi/File/SMFInterruptedRunningStatus.java +new file mode 100644 +index 000000000..1b82e2f73 +--- /dev/null ++++ b/jdk/test/javax/sound/midi/File/SMFInterruptedRunningStatus.java +@@ -0,0 +1,143 @@ ++/* ++ * Copyright (c) 2023, 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. ++ */ ++ ++import java.io.ByteArrayInputStream; ++ ++import javax.sound.midi.MidiSystem; ++import javax.sound.midi.Sequence; ++import javax.sound.midi.Track; ++ ++/** ++ * @test ++ * @bug 8319598 ++ * @summary SMFParser bug with running status, interrupted by Meta or SysEx messages ++ */ ++public class SMFInterruptedRunningStatus { ++ ++ public static void main(String[] args) throws Exception { ++ ++ byte[][] files = new byte[][] {SMF_1, SMF_2, SMF_3}; ++ for (int i = 0; i < files.length; i++) { ++ Sequence seq = MidiSystem.getSequence( ++ new ByteArrayInputStream(files[i])); ++ testSequence(seq, i + 1); ++ } ++ ++ // no exception thrown, all files have been parsed correctly ++ System.out.println("Test passed"); ++ } ++ ++ private static void testSequence(Sequence seq, int fileNumber) { ++ ++ // check number of tracks and number of events ++ Track[] tracks = seq.getTracks(); ++ if (1 != tracks.length) { ++ throw new RuntimeException("file number " ++ + fileNumber + " fails (incorrect number of tracks: " ++ + tracks.length + ")"); ++ } ++ Track track = tracks[0]; ++ if (7 != track.size()) { ++ throw new RuntimeException("file number " + fileNumber ++ + " fails (incorrect number of events: " ++ + track.size() + ")"); ++ } ++ ++ // check status byte of each message ++ int[] expectedStatusBytes = new int[] { ++ 0x90, 0xFF, 0x90, 0x90, 0x90, 0xFF, 0xFF}; ++ for (int i = 0; i < expectedStatusBytes.length; i++) { ++ int expected = expectedStatusBytes[i]; ++ if (expected != track.get(i).getMessage().getStatus()) { ++ throw new RuntimeException("file number " + fileNumber ++ + " fails (wrong status byte in event " + i + ")"); ++ } ++ } ++ } ++ ++ // MIDI file without running status - should work equally before ++ // and after the bugfix ++ private static final byte[] SMF_1 = { ++ 0x4D, 0x54, 0x68, 0x64, 0x00, 0x00, 0x00, 0x06, // file header (start) ++ 0x00, 0x01, 0x00, 0x01, 0x00, (byte) 0x80, // file header (end) ++ 0x4D, 0x54, 0x72, 0x6B, 0x00, 0x00, 0x00, 0x24, // track header ++ 0x00, // delta time ++ (byte) 0x90, 0x3C, 0x7F, // Note-ON (C) ++ 0x40, // delta time ++ (byte) 0xFF, 0x01, 0x04, 0x54, 0x65, 0x73, 0x74, // META (text) ++ 0x20, // delta time ++ (byte) 0x90, 0x3C, 0x00, // Note-OFF (C) ++ 0x20, // delta time ++ (byte) 0x90, 0x3E, 0x7F, // Note-ON (D) ++ 0x60, // delta time ++ (byte) 0x90, 0x3E, 0x00, // Note-OFF (D) ++ 0x20, // delta time ++ (byte) 0xFF, 0x01, 0x04, 0x54, 0x65, 0x73, 0x74, // META (text) ++ 0x00, // delta time ++ (byte) 0xFF, 0x2F, 0x00 // META (end of track) ++ }; ++ ++ // MIDI file with running status, interrupted by a META message ++ // - failed before the bugfix ++ private static final byte[] SMF_2 = { ++ 0x4D, 0x54, 0x68, 0x64, 0x00, 0x00, 0x00, 0x06, // file header (start) ++ 0x00, 0x01, 0x00, 0x01, 0x00, (byte) 0x80, // file header (end) ++ 0x4D, 0x54, 0x72, 0x6B, 0x00, 0x00, 0x00, 0x21, // track header ++ 0x00, // delta time ++ (byte) 0x90, 0x3C, 0x7F, // Note-ON (C) ++ 0x40, // delta time ++ (byte) 0xFF, 0x01, 0x04, 0x54, 0x65, 0x73, 0x74, // META (interruptor) ++ 0x20, // delta time ++ 0x3C, 0x00, // Note-OFF (C) - running status ++ 0x20, // delta time ++ 0x3E, 0x7F, // Note-ON (D) - running status ++ 0x60, // delta time ++ 0x3E, 0x00, // Note-OFF (D) - running status ++ 0x20, // delta time ++ (byte) 0xFF, 0x01, 0x04, 0x54, 0x65, 0x73, 0x74, // META (text) ++ 0x00, // delta time ++ (byte) 0xFF, 0x2F, 0x00 // META (end of track) ++ }; ++ ++ // MIDI file with running status, interrupted by a META message ++ // - succeeded before the bugfix but with wrong interpretation of the data ++ private static final byte[] SMF_3 = { ++ 0x4D, 0x54, 0x68, 0x64, 0x00, 0x00, 0x00, 0x06, // file header (start) ++ 0x00, 0x01, 0x00, 0x01, 0x00, (byte) 0x80, // file header (end) ++ 0x4D, 0x54, 0x72, 0x6B, 0x00, 0x00, 0x00, 0x21, // track header ++ 0x00, // delta time ++ (byte) 0x90, 0x3C, 0x7F, // Note-ON (C) ++ 0x40, // delta time ++ (byte) 0xFF, 0x01, 0x04, 0x54, 0x65, 0x73, 0x74, // META (interruptor) ++ 0x20, // delta time ++ 0x3C, 0x00, // Note-OFF (C) - running status ++ 0x0D, // delta time ++ 0x3E, 0x7F, // Note-ON (D) - running status ++ 0x60, // delta time ++ 0x3E, 0x00, // Note-OFF (D) - running status ++ 0x20, // delta time ++ (byte) 0xFF, 0x01, 0x04, 0x54, 0x65, 0x73, 0x74, // META (text) ++ 0x00, // delta time ++ (byte) 0xFF, 0x2F, 0x00 // META (end of track) ++ }; ++} +-- +2.23.0 + diff --git a/Dynamic-CDS-Archive.patch b/Dynamic-CDS-Archive.patch index 30a6ff8169def8d3ed47633f5431a0b3a19d72dd..ebeb75b4dc1d0728436d76fb24b392d380f8f398 100644 --- a/Dynamic-CDS-Archive.patch +++ b/Dynamic-CDS-Archive.patch @@ -3070,12 +3070,13 @@ index 8dd4e6b21..6a2d8077f 100644 // We take care not to be blocking while holding the // SymbolTable_lock. Otherwise, the system might deadlock, since the // symboltable is used during compilation (VM_thread) The lock free -@@ -236,12 +267,32 @@ unsigned int SymbolTable::hash_symbol(const char* s, int len) { - // entries in the symbol table during normal execution (only during - // safepoints). +@@ -251,13 +282,33 @@ unsigned int SymbolTable::hash_symbol(const char* s, int len) { + return len; + } -Symbol* SymbolTable::lookup(const char* name, int len, TRAPS) { +Symbol* SymbolTable::lookup_common(const char* name, int len) { + len = check_length(name, len); unsigned int hashValue = hash_symbol(name, len); int index = the_table()->hash_to_index(hashValue); + Symbol* s; diff --git a/Enhance-SIGBUS-and-rlimit-information-in-errlog.patch b/Enhance-SIGBUS-and-rlimit-information-in-errlog.patch new file mode 100644 index 0000000000000000000000000000000000000000..368d0e477968c9f5c358e4b3d8deef7800660ac5 --- /dev/null +++ b/Enhance-SIGBUS-and-rlimit-information-in-errlog.patch @@ -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 + diff --git a/Extending-the-IV-Length-Supported-by-KAEProvider-AES.patch b/Extending-the-IV-Length-Supported-by-KAEProvider-AES.patch new file mode 100644 index 0000000000000000000000000000000000000000..03e949a677b51dbcac637e123b27f2cd08158248 --- /dev/null +++ b/Extending-the-IV-Length-Supported-by-KAEProvider-AES.patch @@ -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 + diff --git a/Huawei-Add-Aggressive-CDS.patch b/Huawei-Add-Aggressive-CDS.patch new file mode 100644 index 0000000000000000000000000000000000000000..b6085e33d4f2d9d972b214dd0b34a1b6d1f92924 --- /dev/null +++ b/Huawei-Add-Aggressive-CDS.patch @@ -0,0 +1,1316 @@ +From a7acbdd7c7885a92e3e62d485c0ceaa95923806f Mon Sep 17 00:00:00 2001 +Date: Mon, 27 May 2024 16:14:55 +0800 +Subject: [PATCH] [Huawei]Add Aggressive CDS +--- + hotspot/make/bsd/makefiles/mapfile-vers-debug | 1 + + .../make/bsd/makefiles/mapfile-vers-product | 1 + + .../make/linux/makefiles/mapfile-vers-debug | 1 + + .../make/linux/makefiles/mapfile-vers-product | 1 + + hotspot/src/share/vm/cds/archiveBuilder.cpp | 5 + + hotspot/src/share/vm/cds/dynamicArchive.cpp | 20 + + .../share/vm/classfile/classFileParser.cpp | 32 ++ + .../vm/classfile/systemDictionaryShared.cpp | 375 ++++++++++++++++++ + .../vm/classfile/systemDictionaryShared.hpp | 13 + + hotspot/src/share/vm/classfile/vmSymbols.hpp | 2 + + hotspot/src/share/vm/memory/filemap.cpp | 53 ++- + hotspot/src/share/vm/memory/filemap.hpp | 11 + + hotspot/src/share/vm/prims/jvm.cpp | 30 ++ + hotspot/src/share/vm/prims/jvm.h | 6 + + hotspot/src/share/vm/runtime/arguments.cpp | 16 + + hotspot/src/share/vm/runtime/arguments.hpp | 4 + + hotspot/src/share/vm/runtime/globals.hpp | 8 + + hotspot/src/share/vm/utilities/macros.hpp | 9 + + jdk/make/mapfiles/libjava/mapfile-linux | 1 + + jdk/make/mapfiles/libjava/mapfile-vers | 1 + + .../share/classes/java/lang/ClassLoader.java | 35 ++ + .../classes/java/net/AggressiveCDSPlugin.java | 45 +++ + .../classes/java/net/URLClassLoader.java | 27 ++ + .../java/security/ProtectionDomain.java | 16 + + .../java/security/SecureClassLoader.java | 12 + + .../share/classes/sun/misc/URLClassPath.java | 18 + + jdk/src/share/javavm/export/jvm.h | 5 + + jdk/src/share/native/java/lang/ClassLoader.c | 25 ++ + 28 files changed, 772 insertions(+), 1 deletion(-) + create mode 100644 jdk/src/share/classes/java/net/AggressiveCDSPlugin.java + +diff --git a/hotspot/make/bsd/makefiles/mapfile-vers-debug b/hotspot/make/bsd/makefiles/mapfile-vers-debug +index c60ad3e00..86af8a1be 100644 +--- a/hotspot/make/bsd/makefiles/mapfile-vers-debug ++++ b/hotspot/make/bsd/makefiles/mapfile-vers-debug +@@ -233,6 +233,7 @@ + _JVM_AdaptiveHeapGetG1PeriodicGCInterval + _JVM_AdaptiveHeapSetG1PeriodicGCLoadThreshold + _JVM_AdaptiveHeapGetG1PeriodicGCLoadThreshold ++ _JVM_DefineTrustedSharedClass + _JVM_Sleep + _JVM_Socket + _JVM_SocketAvailable +diff --git a/hotspot/make/bsd/makefiles/mapfile-vers-product b/hotspot/make/bsd/makefiles/mapfile-vers-product +index 94d123c9f..69cd3f962 100644 +--- a/hotspot/make/bsd/makefiles/mapfile-vers-product ++++ b/hotspot/make/bsd/makefiles/mapfile-vers-product +@@ -233,6 +233,7 @@ + _JVM_AdaptiveHeapGetG1PeriodicGCLoadThreshold + _JVM_AdaptiveHeapSetG1PeriodicGCInterval + _JVM_AdaptiveHeapSetG1PeriodicGCLoadThreshold ++ _JVM_DefineTrustedSharedClass + _JVM_Sleep + _JVM_Socket + _JVM_SocketAvailable +diff --git a/hotspot/make/linux/makefiles/mapfile-vers-debug b/hotspot/make/linux/makefiles/mapfile-vers-debug +index 1ebe436cb..b006a84c2 100644 +--- a/hotspot/make/linux/makefiles/mapfile-vers-debug ++++ b/hotspot/make/linux/makefiles/mapfile-vers-debug +@@ -237,6 +237,7 @@ SUNWprivate_1.1 { + JVM_AdaptiveHeapGetG1PeriodicGCInterval; + JVM_AdaptiveHeapSetG1PeriodicGCLoadThreshold; + JVM_AdaptiveHeapGetG1PeriodicGCLoadThreshold; ++ JVM_DefineTrustedSharedClass; + JVM_Sleep; + JVM_Socket; + JVM_SocketAvailable; +diff --git a/hotspot/make/linux/makefiles/mapfile-vers-product b/hotspot/make/linux/makefiles/mapfile-vers-product +index 75e527894..64ccc47fb 100644 +--- a/hotspot/make/linux/makefiles/mapfile-vers-product ++++ b/hotspot/make/linux/makefiles/mapfile-vers-product +@@ -237,6 +237,7 @@ SUNWprivate_1.1 { + JVM_AdaptiveHeapGetG1PeriodicGCInterval; + JVM_AdaptiveHeapSetG1PeriodicGCLoadThreshold; + JVM_AdaptiveHeapGetG1PeriodicGCLoadThreshold; ++ JVM_DefineTrustedSharedClass; + JVM_Sleep; + JVM_Socket; + JVM_SocketAvailable; +diff --git a/hotspot/src/share/vm/cds/archiveBuilder.cpp b/hotspot/src/share/vm/cds/archiveBuilder.cpp +index 13a620028..decd638e0 100644 +--- a/hotspot/src/share/vm/cds/archiveBuilder.cpp ++++ b/hotspot/src/share/vm/cds/archiveBuilder.cpp +@@ -772,7 +772,12 @@ void ArchiveBuilder::clean_up_src_obj_table() { + } + + void ArchiveBuilder::write_archive(FileMapInfo* mapinfo) { ++#if INCLUDE_AGGRESSIVE_CDS ++ assert(mapinfo->header()->magic() == (UseAggressiveCDS ? ++ CDS_AGGRESSIVE_ARCHIVE_MAGIC : CDS_DYNAMIC_ARCHIVE_MAGIC), "Dynamic CDS or Aggressive CDS calls only"); ++#else + assert(mapinfo->header()->magic() == CDS_DYNAMIC_ARCHIVE_MAGIC, "Dynamic CDS calls only"); ++#endif // INCLUDE_AGGRESSIVE_CDS + + mapinfo->write_dynamic_header(); + +diff --git a/hotspot/src/share/vm/cds/dynamicArchive.cpp b/hotspot/src/share/vm/cds/dynamicArchive.cpp +index a623c5b00..2e5ab9385 100644 +--- a/hotspot/src/share/vm/cds/dynamicArchive.cpp ++++ b/hotspot/src/share/vm/cds/dynamicArchive.cpp +@@ -165,6 +165,16 @@ void DynamicArchiveBuilder::init_header() { + + FileMapInfo* base_info = FileMapInfo::current_info(); + _header->set_base_header_crc(base_info->header()->crc()); ++ ++#if INCLUDE_AGGRESSIVE_CDS ++ if (UseAggressiveCDS) { ++ int crc = FileMapInfo::DynamicArchiveHeader::get_current_program_crc(); ++ _header->set_program_crc(crc); ++ } else { ++ _header->set_program_crc(0); ++ } ++#endif // INCLUDE_AGGRESSIVE_CDS ++ + for (int i = 0; i < MetaspaceShared::n_regions; i++) { + _header->set_base_region_crc(i, base_info->header()->space_crc(i)); + } +@@ -401,6 +411,16 @@ bool DynamicArchive::validate(FileMapInfo* dynamic_info) { + return false; + } + ++#if INCLUDE_AGGRESSIVE_CDS ++ // Check the program crc ++ if (UseAggressiveCDS) { ++ if (dynamic_header->program_crc() != FileMapInfo::DynamicArchiveHeader::get_current_program_crc()) { ++ FileMapInfo::fail_continue("Aggressive Dynamic archive cannot be used: program crc verification failed."); ++ return false; ++ } ++ } ++#endif // INCLUDE_AGGRESSIVE_CDS ++ + // Check each space's crc + for (int i = 0; i < MetaspaceShared::n_regions; i++) { + if (dynamic_header->base_region_crc(i) != base_info->space_crc(i)) { +diff --git a/hotspot/src/share/vm/classfile/classFileParser.cpp b/hotspot/src/share/vm/classfile/classFileParser.cpp +index b9fde38dc..8f1b2d47a 100644 +--- a/hotspot/src/share/vm/classfile/classFileParser.cpp ++++ b/hotspot/src/share/vm/classfile/classFileParser.cpp +@@ -4416,6 +4416,38 @@ instanceKlassHandle ClassFileParser::parseClassFile(Symbol* name, + if (DynamicDumpSharedSpaces && !SystemDictionary::is_builtin_loader(class_loader)) { + this_klass->set_shared_classpath_index(UNREGISTERED_INDEX); + SystemDictionaryShared::set_shared_class_misc_info(this_klass(), cfs); ++#if INCLUDE_AGGRESSIVE_CDS ++ if (UseAggressiveCDS && protection_domain() != NULL) { ++ ResourceMark rm(THREAD); ++ KlassHandle protectionDomain_klass(THREAD, SystemDictionary::ProtectionDomain_klass()); ++ JavaValue result(T_OBJECT); ++ JavaCalls::call_virtual(&result, ++ protection_domain, ++ protectionDomain_klass, ++ vmSymbols::getLocationNoFragString_name(), ++ vmSymbols::void_string_signature(), ++ THREAD); ++ if (!HAS_PENDING_EXCEPTION) { ++ oop res_oop = (oop) result.get_jobject(); ++ if (res_oop != NULL) { ++ char* string_value = java_lang_String::as_utf8_string(res_oop); ++ if (strlen(string_value) != 0) { ++ SystemDictionaryShared::set_url_string(this_klass(), string_value); ++ SystemDictionaryShared::save_timestamp(this_klass(), string_value); ++ } ++ } ++ } else { ++ char* ex_msg = const_cast(""); ++ oop message = java_lang_Throwable::message(PENDING_EXCEPTION); ++ if (message != NULL) { ++ ex_msg = java_lang_String::as_utf8_string(message); ++ } ++ dynamic_cds_log->print_cr("get LocationNoFragString from protection_domain has encountered exception: %s %s", ++ PENDING_EXCEPTION->klass()->external_name(), ex_msg); ++ CLEAR_PENDING_EXCEPTION; ++ } ++ } ++#endif // INCLUDE_AGGRESSIVE_CDS + } + #endif // INCLUDE_CDS + +diff --git a/hotspot/src/share/vm/classfile/systemDictionaryShared.cpp b/hotspot/src/share/vm/classfile/systemDictionaryShared.cpp +index 3a601ee37..7707d6ac6 100644 +--- a/hotspot/src/share/vm/classfile/systemDictionaryShared.cpp ++++ b/hotspot/src/share/vm/classfile/systemDictionaryShared.cpp +@@ -35,6 +35,10 @@ + #include "utilities/resourceHash.hpp" + #include "runtime/mutexLocker.hpp" + #include "utilities/ostream.hpp" ++#if INCLUDE_AGGRESSIVE_CDS ++#include "memory/oopFactory.hpp" ++#include "runtime/javaCalls.hpp" ++#endif // INCLUDE_AGGRESSIVE_CDS + + DEBUG_ONLY(bool SystemDictionaryShared::_no_class_loading_should_happen = false;) + bool SystemDictionaryShared::_dump_in_progress = false; +@@ -68,6 +72,14 @@ public: + } + }; + ++#if INCLUDE_AGGRESSIVE_CDS ++ struct DTSharedClassFile { ++ int length; ++ u1 data[1]; ++ int obj_size() { return ((int)sizeof(length)) + length; } ++ }; ++#endif // INCLUDE_AGGRESSIVE_CDS ++ + InstanceKlass* _klass; + InstanceKlass* _nest_host; + bool _failed_verification; +@@ -78,6 +90,10 @@ public: + GrowableArray* _verifier_constraints; + GrowableArray* _verifier_constraint_flags; + GrowableArray* _loader_constraints; ++#if INCLUDE_AGGRESSIVE_CDS ++ DTSharedClassFile* _url_string; ++ int64_t _classfile_timestamp; ++#endif // INCLUDE_AGGRESSIVE_CDS + + DumpTimeSharedClassInfo() { + _klass = NULL; +@@ -92,6 +108,10 @@ public: + _verifier_constraints = NULL; + _verifier_constraint_flags = NULL; + _loader_constraints = NULL; ++#if INCLUDE_AGGRESSIVE_CDS ++ _url_string = NULL; ++ _classfile_timestamp = 0; ++#endif // INCLUDE_AGGRESSIVE_CDS + } + + void add_verification_constraint(InstanceKlass* k, Symbol* name, +@@ -149,6 +169,44 @@ public: + void set_failed_verification() { _failed_verification = true; } + InstanceKlass* nest_host() const { return _nest_host; } + void set_nest_host(InstanceKlass* nest_host) { _nest_host = nest_host; } ++ ++#if INCLUDE_AGGRESSIVE_CDS ++ DTSharedClassFile* url_string() { ++ return _url_string; ++ } ++ ++ size_t url_string_size() { ++ if (_url_string != NULL) { ++ return (size_t)(_url_string->obj_size()); ++ } ++ return (size_t)0; ++ } ++ ++ void copy_url_string(char* string_value) { ++ assert(strlen(string_value) != 0, "sanity"); ++ size_t string_len = strlen(string_value) + (size_t)1; ++ size_t size = offset_of(DTSharedClassFile, data) + string_len; ++ _url_string = (DTSharedClassFile*) NEW_C_HEAP_ARRAY(u1, size, mtInternal); ++ _url_string->length = (int)string_len; ++ memcpy(_url_string->data, string_value, string_len); ++ assert((int)size == _url_string->obj_size(), "sanity"); ++ } ++ ++ void free_url_string() { ++ if (_url_string != NULL) { ++ FREE_C_HEAP_ARRAY(u1, _url_string, mtInternal); ++ _url_string = NULL; ++ } ++ } ++ ++ int64_t classfile_timestamp() { ++ return _classfile_timestamp; ++ } ++ ++ void set_classfile_timestamp(int64_t classfile_timestamp) { ++ _classfile_timestamp = classfile_timestamp; ++ } ++#endif // INCLUDE_AGGRESSIVE_CDS + }; + + inline unsigned DumpTimeSharedClassTable_hash(InstanceKlass* const& k) { +@@ -245,7 +303,18 @@ public: + } + }; + ++#if INCLUDE_AGGRESSIVE_CDS ++ struct RTSharedClassFile { ++ int length; ++ u1 data[1]; ++ }; ++#endif // INCLUDE_AGGRESSIVE_CDS ++ + InstanceKlass* _klass; ++#if INCLUDE_AGGRESSIVE_CDS ++ RTSharedClassFile* _url_string; ++ int64_t _classfile_timestamp; ++#endif // INCLUDE_AGGRESSIVE_CDS + int _num_verifier_constraints; + int _num_loader_constraints; + +@@ -294,6 +363,17 @@ public: + verifier_constraint_flags_size(num_verifier_constraints); + } + ++#if INCLUDE_AGGRESSIVE_CDS ++ static size_t byte_size(DumpTimeSharedClassInfo& info) { ++ size_t previous_size = byte_size(info._klass, info.num_verifier_constraints(), info.num_loader_constraints()); ++ if (UseAggressiveCDS) { ++ size_t cf_size = info.url_string_size(); ++ if (cf_size != 0) return align_up(previous_size, sizeof(int)) + cf_size; ++ } ++ return previous_size; ++ } ++#endif // INCLUDE_AGGRESSIVE_CDS ++ + private: + size_t crc_offset() const { + return header_size_size(); +@@ -321,6 +401,13 @@ private: + assert(0 <= i && i < _num_loader_constraints, "sanity"); + } + ++#if INCLUDE_AGGRESSIVE_CDS ++ size_t url_string_offset() const { ++ return align_up(verifier_constraint_flags_offset() + verifier_constraint_flags_size(_num_verifier_constraints), ++ sizeof(int)); ++ } ++#endif // INCLUDE_AGGRESSIVE_CDS ++ + public: + CrcInfo* crc() const { + assert(crc_size(_klass) > 0, "must be"); +@@ -350,6 +437,20 @@ public: + return loader_constraints() + i; + } + ++#if INCLUDE_AGGRESSIVE_CDS ++ RTSharedClassFile* url_string() { ++ return (RTSharedClassFile*)(address(this) + url_string_offset()); ++ } ++ ++ int64_t classfile_timestamp() { ++ return _classfile_timestamp; ++ } ++ ++ void set_classfile_timestamp(int64_t classfile_timestamp) { ++ _classfile_timestamp = classfile_timestamp; ++ } ++#endif // INCLUDE_AGGRESSIVE_CDS ++ + void init(DumpTimeSharedClassInfo& info) { + ArchiveBuilder* builder = ArchiveBuilder::current(); + assert(builder->is_in_buffer_space(info._klass), "must be"); +@@ -383,6 +484,18 @@ public: + } + } + ++#if INCLUDE_AGGRESSIVE_CDS ++ if (info.url_string_size() != 0) { ++ _url_string = url_string(); ++ memcpy(_url_string, info.url_string(), info.url_string_size()); ++ ArchivePtrMarker::mark_pointer(&_url_string); ++ info.free_url_string(); ++ } else { ++ _url_string = NULL; ++ } ++ set_classfile_timestamp(info.classfile_timestamp()); ++#endif // INCLUDE_AGGRESSIVE_CDS ++ + ArchivePtrMarker::mark_pointer(&_klass); + } + +@@ -426,6 +539,69 @@ public: + const RunTimeSharedClassInfo* value, Symbol* key, int len_unused) { + return (value->_klass->name() == key); + } ++ ++#if INCLUDE_AGGRESSIVE_CDS ++ // check timestamp in the load time when UseAggressiveCDS. ++ // regular_file(*.class): need to check timestamp. ++ // jar_file(*.jar): no need to check timestamp here,already check programe_crc ++ // somewhere else, see DynamicArchive::validate. ++ // other_file: not supported when UseAggressiveCDS. ++ bool check_classfile_timestamp(char* url_string, TRAPS) { ++ if (SystemDictionaryShared::is_regular_file(url_string)) { ++ ResourceMark rm(THREAD); ++ char* dir = SystemDictionaryShared::get_filedir(url_string); ++ if (dir == NULL) { ++ return false; ++ } ++ int64_t timestamp = SystemDictionaryShared::get_timestamp(dir, _klass->name()); ++ if (timestamp != _classfile_timestamp) { ++ dynamic_cds_log->print_cr("%s, timestamp mismatch: " INT64_FORMAT " -> " INT64_FORMAT, _klass->name()->as_C_string(), _classfile_timestamp, timestamp); ++ return false; ++ } ++ } else if (!SystemDictionaryShared::is_jar_file(url_string)) { ++ dynamic_cds_log->print_cr("Unsupported URL:%s", url_string); ++ return false; ++ } ++ return true; ++ } ++ ++ Handle get_protection_domain(Handle class_loader, TRAPS) { ++ if (_url_string == NULL) { ++ return Handle(); ++ } ++ char* data_ptr = (char*)(_url_string->data); ++ ++ if (CheckClassFileTimeStamp) { ++ if (!check_classfile_timestamp(data_ptr, THREAD)) { ++ return Handle(); ++ } ++ } ++ ++ Handle url_string = java_lang_String::create_from_str(data_ptr, THREAD); ++ JavaValue result(T_OBJECT); ++ JavaCalls::call_virtual(&result, ++ class_loader, ++ class_loader->klass(), ++ vmSymbols::getProtectionDomainByURLString_name(), ++ vmSymbols::getProtectionDomainInternal_signature(), ++ url_string, THREAD); ++ if (!HAS_PENDING_EXCEPTION) { ++ oop pd = (oop) result.get_jobject(); ++ return Handle(THREAD, pd); ++ } else { ++ ResourceMark rm(THREAD); ++ char* ex_msg = const_cast(""); ++ oop message = java_lang_Throwable::message(PENDING_EXCEPTION); ++ if (message != NULL) { ++ ex_msg = java_lang_String::as_utf8_string(message); ++ } ++ dynamic_cds_log->print_cr("get protection_domain has encountered exception: %s %s", ++ PENDING_EXCEPTION->klass()->external_name(), ex_msg); ++ CLEAR_PENDING_EXCEPTION; ++ } ++ return Handle(); ++ } ++#endif // INCLUDE_AGGRESSIVE_CDS + }; + + class RunTimeSharedDictionary : public OffsetCompactHashtable< +@@ -710,7 +886,11 @@ public: + + bool do_entry(InstanceKlass* k, DumpTimeSharedClassInfo& info) { + if (!info.is_excluded()) { ++#if INCLUDE_AGGRESSIVE_CDS ++ size_t byte_size = RunTimeSharedClassInfo::byte_size(info); ++#else + size_t byte_size = RunTimeSharedClassInfo::byte_size(info._klass, info.num_verifier_constraints(), info.num_loader_constraints()); ++#endif // INCLUDE_AGGRESSIVE_CDS + _shared_class_info_size += align_up(byte_size, KlassAlignmentInBytes); + } + return true; // keep on iterating +@@ -746,6 +926,38 @@ unsigned int SystemDictionaryShared::hash_for_shared_dictionary(address ptr) { + } + } + ++#if INCLUDE_AGGRESSIVE_CDS ++class ExcludeDuplicateKlass : StackObj { ++public: ++ static const int INITIAL_TABLE_SIZE = 15889; ++ ++ ExcludeDuplicateKlass(int size) : _has_been_visited(size) {} ++ ++ bool do_entry(InstanceKlass* k, DumpTimeSharedClassInfo& info) { ++ if (!info.is_excluded()) { ++ bool created; ++ Symbol* name = info._klass->name(); ++ address* info_ptr = _has_been_visited.add_if_absent((address)name, (address)&info, &created); ++ if (!created) { ++ info.set_excluded(); ++ DumpTimeSharedClassInfo* first_info = (DumpTimeSharedClassInfo*)(*info_ptr); ++ if (!first_info->is_excluded()) { ++ first_info->set_excluded(); ++ } ++ if (TraceDynamicCDS) { ++ ResourceMark rm; ++ dynamic_cds_log->print_cr("[AggressiveCDS] Skipping duplicate class (excluded): %s", name->as_C_string()); ++ } ++ } ++ } ++ return true; ++ } ++ ++private: ++ KVHashtable _has_been_visited; ++}; ++#endif // INCLUDE_AGGRESSIVE_CDS ++ + class CopySharedClassInfoToArchive : StackObj { + CompactHashtableWriter* _writer; + bool _is_builtin; +@@ -757,7 +969,11 @@ public: + + bool do_entry(InstanceKlass* k, DumpTimeSharedClassInfo& info) { + if (!info.is_excluded() && info.is_builtin() == _is_builtin) { ++#if INCLUDE_AGGRESSIVE_CDS ++ size_t byte_size = RunTimeSharedClassInfo::byte_size(info); ++#else + size_t byte_size = RunTimeSharedClassInfo::byte_size(info._klass, info.num_verifier_constraints(), info.num_loader_constraints()); ++#endif // INCLUDE_AGGRESSIVE_CDS + RunTimeSharedClassInfo* record; + record = (RunTimeSharedClassInfo*)ArchiveBuilder::ro_region_alloc(byte_size); + record->init(info); +@@ -787,6 +1003,12 @@ void SystemDictionaryShared::write_dictionary(RunTimeSharedDictionary* dictionar + bool is_builtin) { + CompactHashtableStats stats; + dictionary->reset(); ++#if INCLUDE_AGGRESSIVE_CDS ++ if (UseAggressiveCDS && !is_builtin) { ++ ExcludeDuplicateKlass dup(ExcludeDuplicateKlass::INITIAL_TABLE_SIZE); ++ _dumptime_table->iterate(&dup); ++ } ++#endif // INCLUDE_AGGRESSIVE_CDS + CompactHashtableWriter writer(_dumptime_table->count_of(is_builtin), &stats); + CopySharedClassInfoToArchive copy(&writer, is_builtin); + assert_lock_strong(DumpTimeTable_lock); +@@ -909,3 +1131,156 @@ InstanceKlass* SystemDictionaryShared::find_dynamic_builtin_class(Symbol* name) + return NULL; + } + } ++ ++#if INCLUDE_AGGRESSIVE_CDS ++static const char* JAR_FILE_PREFIX = "jar://file:"; ++static const char* FILE_SEPARATOR = "file://"; ++static const char* CLASSFILE_SUFFIX = ".class"; ++ ++static bool start_with(char* str, const char* prefix) { ++ if (str == NULL || prefix == NULL || strlen(str) < strlen(prefix)) { ++ return false; ++ } ++ if (strncmp(str, prefix, strlen(prefix)) == 0) { ++ return true; ++ } ++ return false; ++} ++ ++bool SystemDictionaryShared::is_jar_file(char* url_string) { ++ if (start_with(url_string, JAR_FILE_PREFIX)) { ++ return true; ++ } ++ return false; ++} ++ ++bool SystemDictionaryShared::is_regular_file(char* url_string) { ++ if (start_with(url_string, FILE_SEPARATOR)) { ++ return true; ++ } ++ return false; ++} ++ ++char* SystemDictionaryShared::get_filedir(char* url_string) { ++ if (!is_regular_file(url_string)) { ++ return NULL; ++ } ++ char* dir = url_string + strlen(FILE_SEPARATOR); ++ struct stat st; ++ if (os::stat(dir, &st) == 0) { ++ if ((st.st_mode & S_IFDIR) == S_IFDIR) { ++ return dir; ++ } ++ } ++ return NULL; ++} ++ ++int64_t SystemDictionaryShared::get_timestamp(char* dir, Symbol* class_name) { ++ char* name = class_name->as_C_string(); ++ size_t name_len = strlen(name); ++ size_t dir_len = strlen(dir); ++ size_t classfile_suffix_len = strlen(CLASSFILE_SUFFIX); ++ char* file_path = NEW_RESOURCE_ARRAY(char, dir_len + name_len + classfile_suffix_len + 1); ++ memcpy(file_path, dir, dir_len); ++ memcpy(file_path + dir_len, name, name_len); ++ memcpy(file_path + dir_len + name_len, CLASSFILE_SUFFIX, classfile_suffix_len + 1); ++ assert(strlen(file_path) == dir_len + name_len + classfile_suffix_len, "sanity"); ++ struct stat st; ++ if (os::stat(file_path, &st) == 0) { ++ return st.st_mtime; ++ } ++ dynamic_cds_log->print_cr("get timestamp failed:%s", file_path); ++ return 0; ++} ++ ++Handle SystemDictionaryShared::get_protection_domain(InstanceKlass* k, Handle class_loader, TRAPS) { ++ assert(UseAggressiveCDS, "sanity"); ++ RunTimeSharedClassInfo* info = RunTimeSharedClassInfo::get_for(k); ++ assert(!is_builtin_loader(class_loader), "sanity"); ++ return info->get_protection_domain(class_loader, THREAD); ++} ++ ++void SystemDictionaryShared::set_url_string(InstanceKlass* k, char* string_value) { ++ assert(UseAggressiveCDS, "sanity"); ++ Arguments::assert_is_dumping_archive(); ++ assert(!is_builtin(k), "must be unregistered class"); ++ DumpTimeSharedClassInfo* info = find_or_allocate_info_for(k); ++ if (info != NULL && info->_url_string == NULL) { ++ info->copy_url_string(string_value); ++ } ++} ++ ++void SystemDictionaryShared::save_timestamp(InstanceKlass* k, char* string_value) { ++ if (SystemDictionaryShared::is_regular_file(string_value)) { ++ char* dir = SystemDictionaryShared::get_filedir(string_value); ++ if (dir != NULL) { ++ int64_t timestamp = SystemDictionaryShared::get_timestamp(dir, k->name()); ++ SystemDictionaryShared::set_classfile_timestamp(k, timestamp); ++ } ++ } else if (!SystemDictionaryShared::is_jar_file(string_value)) { ++ dynamic_cds_log->print_cr("Unsupported URL:%s", string_value); ++ } ++} ++ ++void SystemDictionaryShared::set_classfile_timestamp(InstanceKlass* k, int64_t classfile_timestamp) { ++ assert(UseAggressiveCDS, "sanity"); ++ Arguments::assert_is_dumping_archive(); ++ assert(!is_builtin(k), "must be unregistered class"); ++ DumpTimeSharedClassInfo* info = find_or_allocate_info_for(k); ++ if (info != NULL) { ++ info->set_classfile_timestamp(classfile_timestamp); ++ } ++} ++ ++InstanceKlass* SystemDictionaryShared::lookup_trusted_share_class(Symbol* class_name, ++ Handle class_loader, ++ TRAPS) { ++ assert(UseAggressiveCDS, "sanity"); ++ if (!UseSharedSpaces) { ++ return NULL; ++ } ++ if (class_name == NULL) { // don't do this for hidden classes ++ return NULL; ++ } ++ if (SystemDictionary::is_builtin_loader(class_loader)) { ++ // Do nothing for the BUILTIN loaders. ++ return NULL; ++ } ++ ++ // Classloaders that support parallelism, e.g. bootstrap classloader, ++ // or all classloaders with UnsyncloadClass do not acquire lock here ++ bool DoObjectLock = true; ++ if (is_parallelCapable(class_loader)) { ++ DoObjectLock = false; ++ } ++ ++ register_loader(class_loader, CHECK_NULL); ++ ++ // Make sure we are synchronized on the class loader before we proceed ++ Handle lockObject = compute_loader_lock_object(class_loader, THREAD); ++ check_loader_lock_contention(lockObject, THREAD); ++ ObjectLocker ol(lockObject, THREAD, DoObjectLock); ++ ++ const RunTimeSharedClassInfo* record = find_record(&_dynamic_unregistered_dictionary, class_name); ++ if (record == NULL) { ++ return NULL; ++ } ++ ++ Handle protection_domain = SystemDictionaryShared::get_protection_domain(record->_klass, class_loader, CHECK_NULL); ++ ++ if (protection_domain.is_null()) { ++ // URL not matched, which means should not be loaded by this classloader ++ return NULL; ++ } ++ ++ instanceKlassHandle k = acquire_class_for_current_thread(record->_klass, class_loader, protection_domain, NULL, THREAD); ++ if (!HAS_PENDING_EXCEPTION && k() != NULL) { ++ if (is_parallelCapable(class_loader)) { ++ k = find_or_define_instance_class(class_name, class_loader, k, THREAD); ++ } else { ++ define_instance_class(k, THREAD); ++ } ++ } ++ return k(); ++} ++#endif // INCLUDE_AGGRESSIVE_CDS +\ No newline at end of file +diff --git a/hotspot/src/share/vm/classfile/systemDictionaryShared.hpp b/hotspot/src/share/vm/classfile/systemDictionaryShared.hpp +index fb9583d4e..3025e7350 100644 +--- a/hotspot/src/share/vm/classfile/systemDictionaryShared.hpp ++++ b/hotspot/src/share/vm/classfile/systemDictionaryShared.hpp +@@ -238,6 +238,19 @@ public: + TRAPS); + + static InstanceKlass* find_dynamic_builtin_class(Symbol* name); ++ ++#if INCLUDE_AGGRESSIVE_CDS ++ static bool is_jar_file(char* url_string); ++ static bool is_regular_file(char* url_string); ++ static char* get_filedir(char* url_string); ++ static int64_t get_timestamp(char* dir, Symbol* class_name); ++ static Handle get_protection_domain(InstanceKlass* k, Handle class_loader, TRAPS); ++ static void set_url_string(InstanceKlass* k, char* string_value); ++ static void save_timestamp(InstanceKlass* k, char* string_value); ++ static void set_classfile_timestamp(InstanceKlass* k, int64_t classfile_timestamp); ++ static int64_t get_classfile_timestamp(InstanceKlass* k); ++ static InstanceKlass* lookup_trusted_share_class(Symbol* class_name, Handle class_loader, TRAPS); ++#endif // INCLUDE_AGGRESSIVE_CDS + }; + + #endif // SHARE_VM_CLASSFILE_SYSTEMDICTIONARYSHARED_HPP +diff --git a/hotspot/src/share/vm/classfile/vmSymbols.hpp b/hotspot/src/share/vm/classfile/vmSymbols.hpp +index 79f15589f..2ddc6581e 100644 +--- a/hotspot/src/share/vm/classfile/vmSymbols.hpp ++++ b/hotspot/src/share/vm/classfile/vmSymbols.hpp +@@ -421,6 +421,8 @@ + template(definePackageInternal_signature, "(Ljava/lang/String;Ljava/util/jar/Manifest;Ljava/net/URL;)V") \ + template(getProtectionDomainInternal_name, "getProtectionDomainInternal") \ + template(getProtectionDomainInternal_signature, "(Ljava/lang/String;)Ljava/security/ProtectionDomain;") \ ++ template(getProtectionDomainByURLString_name, "getProtectionDomainByURLString") \ ++ template(getLocationNoFragString_name, "getLocationNoFragString") \ + template(url_code_signer_array_void_signature, "(Ljava/net/URL;[Ljava/security/CodeSigner;)V") \ + template(resolved_references_name, "") \ + template(referencequeue_null_name, "NULL") \ +diff --git a/hotspot/src/share/vm/memory/filemap.cpp b/hotspot/src/share/vm/memory/filemap.cpp +index 166fe2b80..b60d77be6 100644 +--- a/hotspot/src/share/vm/memory/filemap.cpp ++++ b/hotspot/src/share/vm/memory/filemap.cpp +@@ -208,7 +208,11 @@ size_t FileMapInfo::DynamicArchiveHeader::data_size() { + } + + bool FileMapInfo::DynamicArchiveHeader::validate() { ++#if INCLUDE_AGGRESSIVE_CDS ++ if (_magic != (UseAggressiveCDS ? CDS_AGGRESSIVE_ARCHIVE_MAGIC : CDS_DYNAMIC_ARCHIVE_MAGIC)) { ++#else + if (_magic != CDS_DYNAMIC_ARCHIVE_MAGIC) { ++#endif // INCLUDE_AGGRESSIVE_CDS + FileMapInfo::fail_continue("The shared archive file has a bad magic number."); + return false; + } +@@ -243,9 +247,48 @@ bool FileMapInfo::DynamicArchiveHeader::validate() { + return true; + } + ++#if INCLUDE_AGGRESSIVE_CDS ++int FileMapInfo::DynamicArchiveHeader::get_current_program_crc() { ++ int cur_crc = 0; ++ const char* full_cmd = Arguments::java_command(); ++ if (full_cmd == NULL) { ++ return 0; ++ } ++ const char* main_path = Arguments::get_appclasspath(); ++ int main_path_len = strlen(main_path); ++ bool is_jar_file = strncmp(full_cmd, main_path, main_path_len) == 0; ++ if (is_jar_file) { ++ fio_fd fd = os::open(main_path, O_RDONLY | O_BINARY, 0); ++ assert(fd >= 0, "sanity"); ++ ++ uint32_t file_size = (uint32_t) os::lseek(fd, 0, SEEK_END); ++ os::lseek(fd, 0, SEEK_SET); ++ uint32_t max_size = 40 * 1024 * 1024; // 40M ++ ++ ResourceMark rm; ++ char* buf = NEW_RESOURCE_ARRAY(char, max_size); ++ ++ while(file_size) { ++ uint32_t size = MIN2(max_size, file_size); ++ size_t n = os::read(fd, buf, (unsigned int)size); ++ file_size -= n; ++ cur_crc = ClassLoader::crc32(cur_crc, buf, n); ++ } ++ } ++ return cur_crc; ++} ++#endif // INCLUDE_AGGRESSIVE_CDS ++ + void FileMapInfo::FileMapHeader::populate(FileMapInfo* mapinfo, size_t alignment) { + if (DynamicDumpSharedSpaces) { +- _magic = CDS_DYNAMIC_ARCHIVE_MAGIC; ++#if INCLUDE_AGGRESSIVE_CDS ++ if (UseAggressiveCDS) { ++ _magic = CDS_AGGRESSIVE_ARCHIVE_MAGIC; ++ } else ++#endif // INCLUDE_AGGRESSIVE_CDS ++ { ++ _magic = CDS_DYNAMIC_ARCHIVE_MAGIC; ++ } + } else { + _magic = CDS_ARCHIVE_MAGIC; + } +@@ -434,7 +477,11 @@ bool FileMapInfo::get_base_archive_name_from_header(const char* archive_name, + os::close(fd); + return false; + } ++#if INCLUDE_AGGRESSIVE_CDS ++ if (dynamic_header->magic() != (UseAggressiveCDS ? CDS_AGGRESSIVE_ARCHIVE_MAGIC : CDS_DYNAMIC_ARCHIVE_MAGIC)) { ++#else + if (dynamic_header->magic() != CDS_DYNAMIC_ARCHIVE_MAGIC) { ++#endif // INCLUDE_AGGRESSIVE_CDS + // Not a dynamic header, no need to proceed further. + *size = 0; + delete dynamic_header; +@@ -499,7 +546,11 @@ bool FileMapInfo::check_archive(const char* archive_name, bool is_static) { + } + } else { + DynamicArchiveHeader* dynamic_header = (DynamicArchiveHeader*)header; ++#if INCLUDE_AGGRESSIVE_CDS ++ if (dynamic_header->magic() != (UseAggressiveCDS ? CDS_AGGRESSIVE_ARCHIVE_MAGIC : CDS_DYNAMIC_ARCHIVE_MAGIC)) { ++#else + if (dynamic_header->magic() != CDS_DYNAMIC_ARCHIVE_MAGIC) { ++#endif // INCLUDE_AGGRESSIVE_CDS + delete header; + os::close(fd); + vm_exit_during_initialization("Not a top shared archive", archive_name); +diff --git a/hotspot/src/share/vm/memory/filemap.hpp b/hotspot/src/share/vm/memory/filemap.hpp +index f6cf43a64..c246f0367 100644 +--- a/hotspot/src/share/vm/memory/filemap.hpp ++++ b/hotspot/src/share/vm/memory/filemap.hpp +@@ -41,6 +41,7 @@ + + #define CDS_ARCHIVE_MAGIC 0xf00baba2 + #define CDS_DYNAMIC_ARCHIVE_MAGIC 0xf00baba8 ++#define CDS_AGGRESSIVE_ARCHIVE_MAGIC 0xf00baba4 + + static const int JVM_IDENT_MAX = 256; + +@@ -168,6 +169,9 @@ public: + struct DynamicArchiveHeader : FileMapHeader { + private: + int _base_header_crc; ++#if INCLUDE_AGGRESSIVE_CDS ++ int _program_crc; ++#endif // INCLUDE_AGGRESSIVE_CDS + int _base_region_crc[MetaspaceShared::n_regions]; + char* _requested_base_address; // Archive relocation is not necessary if we map with this base address. + size_t _ptrmap_size_in_bits; // Size of pointer relocation bitmap +@@ -186,6 +190,11 @@ public: + _base_region_crc[i] = c; + } + ++#if INCLUDE_AGGRESSIVE_CDS ++ int program_crc() const { return _program_crc; } ++ void set_program_crc(int c) { _program_crc = c; } ++#endif // INCLUDE_AGGRESSIVE_CDS ++ + void set_requested_base(char* b) { + _requested_base_address = b; + } +@@ -199,6 +208,8 @@ public: + char* serialized_data() const { return from_mapped_offset(_serialized_data_offset); } + + virtual bool validate(); ++ ++ static int get_current_program_crc(); + }; + + FileMapHeader * _header; +diff --git a/hotspot/src/share/vm/prims/jvm.cpp b/hotspot/src/share/vm/prims/jvm.cpp +index 55667ac32..2cc38cf66 100644 +--- a/hotspot/src/share/vm/prims/jvm.cpp ++++ b/hotspot/src/share/vm/prims/jvm.cpp +@@ -3321,6 +3321,36 @@ JVM_ENTRY(jint, JVM_AdaptiveHeapGetG1PeriodicGCLoadThreshold(JNIEnv *env, jclass + #endif + JVM_END + ++JVM_ENTRY(jclass, JVM_DefineTrustedSharedClass(JNIEnv *env, const char *name, jobject loader)) ++#if INCLUDE_AGGRESSIVE_CDS ++ assert(UseAggressiveCDS, "sanity"); ++ ++ TempNewSymbol class_name = NULL; ++ if (name != NULL) { ++ const int str_len = (int)strlen(name); ++ if (str_len > Symbol::max_length()) { ++ // It's impossible to create this class; the name cannot fit ++ // into the constant pool. ++ THROW_MSG_0(vmSymbols::java_lang_NoClassDefFoundError(), name); ++ } ++ class_name = SymbolTable::new_symbol(name, str_len, CHECK_NULL); ++ } ++ ++ ResourceMark rm(THREAD); ++ Handle class_loader (THREAD, JNIHandles::resolve(loader)); ++ InstanceKlass* k = SystemDictionaryShared::lookup_trusted_share_class(class_name, ++ class_loader, ++ CHECK_NULL); ++ if (k == NULL) { ++ return NULL; ++ } ++ ++ return (jclass) JNIHandles::make_local(THREAD, k->java_mirror()); ++#else ++ return NULL; ++#endif // INCLUDE_AGGRESSIVE_CDS ++JVM_END ++ + JVM_ENTRY(void, JVM_Yield(JNIEnv *env, jclass threadClass)) + JVMWrapper("JVM_Yield"); + if (os::dont_yield()) return; +diff --git a/hotspot/src/share/vm/prims/jvm.h b/hotspot/src/share/vm/prims/jvm.h +index 0f22f7b12..46a65604c 100644 +--- a/hotspot/src/share/vm/prims/jvm.h ++++ b/hotspot/src/share/vm/prims/jvm.h +@@ -1598,6 +1598,12 @@ JNIEXPORT jint JNICALL + JVM_AdaptiveHeapGetG1PeriodicGCLoadThreshold(JNIEnv *env, jclass clazz); + + ++/** ++ * Define the trusted shared class. ++ */ ++JNIEXPORT jclass JNICALL ++JVM_DefineTrustedSharedClass(JNIEnv *env, const char *name, jobject loader); ++ + /* ========================================================================= + * The following defines a private JVM interface that the JDK can query + * for the JVM version and capabilities. sun.misc.Version defines +diff --git a/hotspot/src/share/vm/runtime/arguments.cpp b/hotspot/src/share/vm/runtime/arguments.cpp +index 45fbc1423..557695791 100644 +--- a/hotspot/src/share/vm/runtime/arguments.cpp ++++ b/hotspot/src/share/vm/runtime/arguments.cpp +@@ -4356,6 +4356,11 @@ jint Arguments::apply_ergo() { + + ArgumentsExt::set_gc_specific_flags(); + ++#if INCLUDE_AGGRESSIVE_CDS ++ result = init_aggressive_cds_properties(); ++ if (result != JNI_OK) return result; ++#endif // INCLUDE_AGGRESSIVE_CDS ++ + // Initialize Metaspace flags and alignments. + Metaspace::ergo_initialize(); + +@@ -4640,3 +4645,14 @@ bool Arguments::copy_expand_pid(const char* src, size_t srclen, + *b = '\0'; + return (p == src_end); // return false if not all of the source was copied + } ++ ++#if INCLUDE_AGGRESSIVE_CDS ++jint Arguments::init_aggressive_cds_properties() { ++ if (!is_dumping_archive() && SharedDynamicArchivePath != NULL && UseAggressiveCDS) { ++ bool added = false; ++ added = add_property("jdk.jbooster.aggressivecds.load=true"); ++ if (!added) return JNI_ENOMEM; ++ } ++ return JNI_OK; ++} ++#endif // INCLUDE_AGGRESSIVE_CDS +\ No newline at end of file +diff --git a/hotspot/src/share/vm/runtime/arguments.hpp b/hotspot/src/share/vm/runtime/arguments.hpp +index 4f7232e48..fdd1d14b0 100644 +--- a/hotspot/src/share/vm/runtime/arguments.hpp ++++ b/hotspot/src/share/vm/runtime/arguments.hpp +@@ -576,6 +576,10 @@ class Arguments : AllStatic { + assert(Arguments::is_dumping_archive(), "dump time only"); + } + ++#if INCLUDE_AGGRESSIVE_CDS ++ static jint init_aggressive_cds_properties(); ++#endif // INCLUDE_AGGRESSIVE_CDS ++ + static bool CompileMethod(char* className, char* methodName) { + return + methodExists( +diff --git a/hotspot/src/share/vm/runtime/globals.hpp b/hotspot/src/share/vm/runtime/globals.hpp +index 77a4ff0b2..6aa53d2d2 100644 +--- a/hotspot/src/share/vm/runtime/globals.hpp ++++ b/hotspot/src/share/vm/runtime/globals.hpp +@@ -4119,6 +4119,14 @@ class CommandLineFlags { + product(bool, UseAppCDS, false, \ + "Enable Application Class Data Sharing (AppCDS)") \ + \ ++ experimental(bool, UseAggressiveCDS, false, \ ++ "An aggressive stratage to improve start-up " \ ++ "because we avoid decoding the classfile.") \ ++ \ ++ experimental(bool, CheckClassFileTimeStamp, true, \ ++ "Check whether the modification time of the" \ ++ "class file is changed during UseAggressiveCDS.") \ ++ \ + product(bool, EnableSplitVerifierForAppCDS, false, \ + "Enable Type Check (AppCDS)") \ + \ +diff --git a/hotspot/src/share/vm/utilities/macros.hpp b/hotspot/src/share/vm/utilities/macros.hpp +index 599e1074d..f631c94c4 100644 +--- a/hotspot/src/share/vm/utilities/macros.hpp ++++ b/hotspot/src/share/vm/utilities/macros.hpp +@@ -106,6 +106,7 @@ + + #ifndef INCLUDE_CDS + #define INCLUDE_CDS 1 ++#define INCLUDE_AGGRESSIVE_CDS 1 + #endif + + #if INCLUDE_CDS +@@ -120,6 +121,14 @@ + #define NOT_CDS_RETURN_(code) { return code; } + #endif // INCLUDE_CDS + ++#if INCLUDE_AGGRESSIVE_CDS ++#define AGGRESSIVE_CDS_ONLY(x) x ++#define NOT_AGGRESSIVE_CDS(x) ++#else ++#define AGGRESSIVE_CDS_ONLY(x) ++#define NOT_AGGRESSIVE_CDS(x) x ++#endif // INCLUDE_AGGRESSIVE_CDS ++ + #ifndef INCLUDE_MANAGEMENT + #define INCLUDE_MANAGEMENT 1 + #endif // INCLUDE_MANAGEMENT +diff --git a/jdk/make/mapfiles/libjava/mapfile-linux b/jdk/make/mapfiles/libjava/mapfile-linux +index ae118af70..61ec28513 100644 +--- a/jdk/make/mapfiles/libjava/mapfile-linux ++++ b/jdk/make/mapfiles/libjava/mapfile-linux +@@ -129,6 +129,7 @@ SUNWprivate_1.1 { + Java_java_lang_ClassLoader_defineClass0; + Java_java_lang_ClassLoader_defineClass1; + Java_java_lang_ClassLoader_defineClass2; ++ Java_java_lang_ClassLoader_defineClass3; + Java_java_lang_ClassLoader_findBuiltinLib; + Java_java_lang_ClassLoader_findLoadedClass0; + Java_java_lang_ClassLoader_resolveClass0; +diff --git a/jdk/make/mapfiles/libjava/mapfile-vers b/jdk/make/mapfiles/libjava/mapfile-vers +index 896db04f2..abfde04a9 100644 +--- a/jdk/make/mapfiles/libjava/mapfile-vers ++++ b/jdk/make/mapfiles/libjava/mapfile-vers +@@ -129,6 +129,7 @@ SUNWprivate_1.1 { + Java_java_lang_ClassLoader_defineClass0; + Java_java_lang_ClassLoader_defineClass1; + Java_java_lang_ClassLoader_defineClass2; ++ Java_java_lang_ClassLoader_defineClass3; + Java_java_lang_ClassLoader_findBuiltinLib; + Java_java_lang_ClassLoader_findLoadedClass0; + Java_java_lang_ClassLoader_resolveClass0; +diff --git a/jdk/src/share/classes/java/lang/ClassLoader.java b/jdk/src/share/classes/java/lang/ClassLoader.java +index f305c1e36..d659eff0f 100644 +--- a/jdk/src/share/classes/java/lang/ClassLoader.java ++++ b/jdk/src/share/classes/java/lang/ClassLoader.java +@@ -682,6 +682,20 @@ public abstract class ClassLoader { + } + } + ++ /** ++ * Determine protection domain, and check it. ++ * This method is only for AggressiveCDS. ++ * ++ * @param name the name of the class ++ * @param c the class ++ * @param pd the ProtectionDomain of the class ++ */ ++ private void defineClassProtectionDomain(String name, Class c, ProtectionDomain pd) ++ { ++ pd = preDefineClass(name, pd); ++ postDefineClass(c, pd); ++ } ++ + /** + * Converts an array of bytes into an instance of class Class, + * with an optional ProtectionDomain. If the domain is +@@ -857,6 +871,27 @@ public abstract class ClassLoader { + int off, int len, ProtectionDomain pd, + String source); + ++ /** ++ * This method is only invoked when java.net.AggressiveCDSPlugin enabled. ++ */ ++ private native Class defineClass3(String name); ++ ++ protected final Class defineClass(String name) { ++ Class trustedClass = defineClass3(name); ++ if (trustedClass != null) { ++ ProtectionDomain pd = AccessController.doPrivileged( ++ new PrivilegedAction() { ++ @Override ++ public ProtectionDomain run() { ++ return trustedClass.getProtectionDomain(); ++ } ++ } ++ ); ++ defineClassProtectionDomain(name, trustedClass, pd); ++ } ++ return trustedClass; ++ } ++ + // true if the name is null or has the potential to be a valid binary name + private boolean checkName(String name) { + if ((name == null) || (name.length() == 0)) +diff --git a/jdk/src/share/classes/java/net/AggressiveCDSPlugin.java b/jdk/src/share/classes/java/net/AggressiveCDSPlugin.java +new file mode 100644 +index 000000000..90d1cd78a +--- /dev/null ++++ b/jdk/src/share/classes/java/net/AggressiveCDSPlugin.java +@@ -0,0 +1,45 @@ ++/* ++ * Copyright (c) 2020, 2023, Huawei Technologies Co., Ltd. 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. ++ */ ++ ++package java.net; ++ ++import java.security.AccessController; ++import sun.security.action.GetBooleanAction; ++ ++/** ++ * The Aggressive CDS plugin for {@link java.net.URLClassLoader}. ++ */ ++final class AggressiveCDSPlugin { ++ private static final boolean IS_ENABLED = ++ AccessController.doPrivileged( ++ new GetBooleanAction("jdk.jbooster.aggressivecds.load")); ++ ++ /** ++ * Check whether Aggressive CDS is enabled. ++ * ++ * @return Is Aggressive CDS enabled ++ */ ++ public static boolean isEnabled() { ++ return IS_ENABLED; ++ } ++} +\ No newline at end of file +diff --git a/jdk/src/share/classes/java/net/URLClassLoader.java b/jdk/src/share/classes/java/net/URLClassLoader.java +index 876a88842..495964ee7 100644 +--- a/jdk/src/share/classes/java/net/URLClassLoader.java ++++ b/jdk/src/share/classes/java/net/URLClassLoader.java +@@ -382,6 +382,17 @@ public class URLClassLoader extends SecureClassLoader implements Closeable { + result = AccessController.doPrivileged( + new PrivilegedExceptionAction>() { + public Class run() throws ClassNotFoundException { ++ if (AggressiveCDSPlugin.isEnabled()) { ++ Class trustedClass = defineClass(name); ++ if (trustedClass != null) { ++ int i = name.lastIndexOf('.'); ++ if (i != -1) { ++ String pkgname = name.substring(0, i); ++ definePackageInternal(pkgname, null, null); ++ } ++ return trustedClass; ++ } ++ } + String path = name.replace('.', '/').concat(".class"); + Resource res = ucp.getResource(path, false); + if (res != null) { +@@ -409,6 +420,22 @@ public class URLClassLoader extends SecureClassLoader implements Closeable { + return result; + } + ++ /** ++ * get ProtectionDomain By URL String. ++ * This method is invoked only in C++ for AggressiveCDS. ++ * ++ * @param urlNoFragString the URL String. ++ * ++ * @return ProtectionDomain create from URL. ++ */ ++ protected ProtectionDomain getProtectionDomainByURLString(String urlNoFragString) { ++ URL url = ucp.getURL(urlNoFragString); ++ if (url != null) { ++ return getProtectionDomainFromURL(url); ++ } ++ return null; ++ } ++ + /* + * Retrieve the package using the specified package name. + * If non-null, verify the package using the specified code +diff --git a/jdk/src/share/classes/java/security/ProtectionDomain.java b/jdk/src/share/classes/java/security/ProtectionDomain.java +index 7a86115e2..727dc4427 100644 +--- a/jdk/src/share/classes/java/security/ProtectionDomain.java ++++ b/jdk/src/share/classes/java/security/ProtectionDomain.java +@@ -25,6 +25,7 @@ + + package java.security; + ++import java.net.URL; + import java.util.ArrayList; + import java.util.Collections; + import java.util.Enumeration; +@@ -35,6 +36,7 @@ import sun.misc.JavaSecurityAccess; + import sun.misc.JavaSecurityProtectionDomainAccess; + import static sun.misc.JavaSecurityProtectionDomainAccess.ProtectionDomainCache; + import sun.misc.SharedSecrets; ++import sun.net.util.URLUtil; + import sun.security.util.Debug; + import sun.security.util.SecurityConstants; + +@@ -206,6 +208,20 @@ public class ProtectionDomain { + return this.codesource; + } + ++ /** ++ * Returns a URL String. ++ * ++ * @return URL String. ++ */ ++ public String getLocationNoFragString() { ++ if (codesource != null) { ++ URL url = codesource.getLocation(); ++ if (url != null) { ++ return URLUtil.urlNoFragString(url); ++ } ++ } ++ return null; ++ } + + /** + * Returns the ClassLoader of this domain. +diff --git a/jdk/src/share/classes/java/security/SecureClassLoader.java b/jdk/src/share/classes/java/security/SecureClassLoader.java +index cb5f017ba..4b0570104 100644 +--- a/jdk/src/share/classes/java/security/SecureClassLoader.java ++++ b/jdk/src/share/classes/java/security/SecureClassLoader.java +@@ -215,6 +215,18 @@ public class SecureClassLoader extends ClassLoader { + return pd; + } + ++ /** ++ * get ProtectionDomain From URL. ++ * This method is only for AggressiveCDS. ++ * ++ * @param url the URL. ++ * ++ * @return ProtectionDomain create from URL. ++ */ ++ protected ProtectionDomain getProtectionDomainFromURL(URL url) { ++ CodeSource cs = new CodeSource(url, (CodeSigner[]) null); ++ return getProtectionDomain(cs); ++ } + + /* + * Check to make sure the class loader has been initialized. +diff --git a/jdk/src/share/classes/sun/misc/URLClassPath.java b/jdk/src/share/classes/sun/misc/URLClassPath.java +index 70a194f50..6b4987cf3 100644 +--- a/jdk/src/share/classes/sun/misc/URLClassPath.java ++++ b/jdk/src/share/classes/sun/misc/URLClassPath.java +@@ -255,6 +255,24 @@ public class URLClassPath { + return null; + } + ++ /** ++ * Finds the URL which has the specified name. ++ * This method is only for AggressiveCDS. ++ * ++ * @param urlNoFragString the name of URL ++ * @return the URL, or null if not found ++ */ ++ public URL getURL(String urlNoFragString) { ++ if (!urls.isEmpty()) { ++ int index = loaders.size(); ++ while(getLoader(index) != null) { ++ index++; ++ } ++ } ++ Loader loader = lmap.get(urlNoFragString); ++ return loader != null ? loader.getBaseURL() : null; ++ } ++ + /** + * Finds all resources on the URL search path with the given name. + * Returns an enumeration of the URL objects. +diff --git a/jdk/src/share/javavm/export/jvm.h b/jdk/src/share/javavm/export/jvm.h +index d27055622..c37f2ad34 100644 +--- a/jdk/src/share/javavm/export/jvm.h ++++ b/jdk/src/share/javavm/export/jvm.h +@@ -1441,6 +1441,11 @@ JVM_AdaptiveHeapSetG1PeriodicGCLoadThreshold(JNIEnv *env, jclass clazz, jint loa + JNIEXPORT jint JNICALL + JVM_AdaptiveHeapGetG1PeriodicGCLoadThreshold(JNIEnv *env, jclass clazz); + ++/** ++ * Define the trusted shared class. ++ */ ++JNIEXPORT jclass JNICALL ++JVM_DefineTrustedSharedClass(JNIEnv *env, const char *name, jobject loader); + + /* ========================================================================= + * The following defines a private JVM interface that the JDK can query +diff --git a/jdk/src/share/native/java/lang/ClassLoader.c b/jdk/src/share/native/java/lang/ClassLoader.c +index 40b0b85bc..a5515f72f 100644 +--- a/jdk/src/share/native/java/lang/ClassLoader.c ++++ b/jdk/src/share/native/java/lang/ClassLoader.c +@@ -224,6 +224,31 @@ Java_java_lang_ClassLoader_defineClass2(JNIEnv *env, + return result; + } + ++JNIEXPORT jclass JNICALL ++Java_java_lang_ClassLoader_defineClass3(JNIEnv *env, ++ jobject loader, ++ jstring name) ++{ ++ char *utfName; ++ jclass result = 0; ++ char buf[128]; ++ ++ if (name != NULL) { ++ utfName = getUTF(env, name, buf, sizeof(buf)); ++ if (utfName == NULL) { ++ JNU_ThrowOutOfMemoryError(env, NULL); ++ return result; ++ } ++ VerifyFixClassname(utfName); ++ } else { ++ utfName = NULL; ++ } ++ ++ result = JVM_DefineTrustedSharedClass(env, utfName, loader); ++ ++ return result; ++} ++ + JNIEXPORT void JNICALL + Java_java_lang_ClassLoader_resolveClass0(JNIEnv *env, jobject this, + jclass cls) +-- +2.23.0 + diff --git a/Huawei-Keep-objects-when-remove-unshareable-info.patch b/Huawei-Keep-objects-when-remove-unshareable-info.patch new file mode 100644 index 0000000000000000000000000000000000000000..a6be5d65cec746c71616456ce6d3599365b2db8b --- /dev/null +++ b/Huawei-Keep-objects-when-remove-unshareable-info.patch @@ -0,0 +1,97 @@ +From 844511f2b4b6a4be079fc5ac2f2d5b56826df85a Mon Sep 17 00:00:00 2001 +Date: Tue, 4 Jun 2024 19:09:40 +0800 +Subject: [PATCH] [Huawei]Keep objects when remove unshareable info +--- + hotspot/src/share/vm/oops/instanceKlass.cpp | 18 +++--------------- + .../Thread/TestThreadDumpClassInitMonitor.java | 15 +++++++++++---- + 2 files changed, 14 insertions(+), 19 deletions(-) + +diff --git a/hotspot/src/share/vm/oops/instanceKlass.cpp b/hotspot/src/share/vm/oops/instanceKlass.cpp +index 833cf9afe..df9aaabfb 100644 +--- a/hotspot/src/share/vm/oops/instanceKlass.cpp ++++ b/hotspot/src/share/vm/oops/instanceKlass.cpp +@@ -2467,21 +2467,6 @@ void InstanceKlass::remove_unshareable_info() { + m->remove_unshareable_info(); + } + +- if (UseAppCDS || DynamicDumpSharedSpaces) { +- if (_oop_map_cache != NULL) { +- delete _oop_map_cache; +- _oop_map_cache = NULL; +- } +- +- JNIid::deallocate(jni_ids()); +- set_jni_ids(NULL); +- +- jmethodID* jmeths = methods_jmethod_ids_acquire(); +- if (jmeths != (jmethodID*)NULL) { +- release_set_methods_jmethod_ids(NULL); +- FreeHeap(jmeths); +- } +- } + // do array classes also. + array_klasses_do(remove_unshareable_in_class); + // These are not allocated from metaspace. They are safe to set to NULL. +@@ -2489,6 +2474,9 @@ void InstanceKlass::remove_unshareable_info() { + _member_names = NULL; + _osr_nmethods_head = NULL; + _init_thread = NULL; ++ _oop_map_cache = NULL; ++ _jni_ids = NULL; ++ _methods_jmethod_ids = NULL; + } + + void InstanceKlass::remove_java_mirror() { +diff --git a/hotspot/test/runtime/Thread/TestThreadDumpClassInitMonitor.java b/hotspot/test/runtime/Thread/TestThreadDumpClassInitMonitor.java +index 8aa218efb..a2111c362 100644 +--- a/hotspot/test/runtime/Thread/TestThreadDumpClassInitMonitor.java ++++ b/hotspot/test/runtime/Thread/TestThreadDumpClassInitMonitor.java +@@ -148,34 +148,41 @@ public class TestThreadDumpClassInitMonitor { + throw new Error("Unexpected thread state line: " + line); + } + if (isProduct) { +- foundLines += 3; ++ foundLines += 4; + } else { + foundLines++; + } + continue; + } + case 2: { // Debug build ++ if (!line.trim().equals(JAVATHREAD_STATE)) { ++ throw new Error("Unexpected JavaThread state line: " + line); ++ } ++ foundLines++; ++ continue; ++ } ++ case 3: { // Debug build + if (!line.startsWith(THREAD_INFO)) { + throw new Error("Unexpected thread info line: " + line); + } + foundLines++; + continue; + } +- case 3: { // Debug build ++ case 4: { // Debug build + if (!line.trim().equals(JAVATHREAD_STATE)) { + throw new Error("Unexpected JavaThread state line: " + line); + } + foundLines++; + continue; + } +- case 4: { ++ case 5: { + if (!line.trim().startsWith(CURRENT_METHOD)) { + throw new Error("Unexpected current method line: " + line); + } + foundLines++; + continue; + } +- case 5: { ++ case 6: { + if (!line.trim().equals(WAIT_INFO)) { + throw new Error("Unexpected monitor information line: " + line); + } +-- +2.23.0 + diff --git a/Huawei-improve-GCTR-performance.patch b/Huawei-improve-GCTR-performance.patch new file mode 100644 index 0000000000000000000000000000000000000000..cbd1992ed09b1e753190af22e5d175bbd739f458 --- /dev/null +++ b/Huawei-improve-GCTR-performance.patch @@ -0,0 +1,62 @@ +From ac1502ff943911bd4d7332bd6531ed0a2454cf05 Mon Sep 17 00:00:00 2001 +Date: Mon, 27 May 2024 12:06:03 +0800 +Subject: [PATCH 2/2] improve GCTR performance +--- + .../classes/com/sun/crypto/provider/GCTR.java | 21 +++++++++++++++++-- + 1 file changed, 19 insertions(+), 2 deletions(-) + +diff --git a/jdk/src/share/classes/com/sun/crypto/provider/GCTR.java b/jdk/src/share/classes/com/sun/crypto/provider/GCTR.java +index 1ab0f63db..12af359b0 100644 +--- a/jdk/src/share/classes/com/sun/crypto/provider/GCTR.java ++++ b/jdk/src/share/classes/com/sun/crypto/provider/GCTR.java +@@ -29,6 +29,10 @@ + + package com.sun.crypto.provider; + ++import com.sun.management.HotSpotDiagnosticMXBean; ++import com.sun.management.VMOption; ++import sun.management.ManagementFactoryHelper; ++ + import java.nio.ByteBuffer; + import java.nio.ByteOrder; + import javax.crypto.IllegalBlockSizeException; +@@ -54,13 +58,26 @@ import static com.sun.crypto.provider.AESConstants.AES_BLOCK_SIZE; + */ + final class GCTR extends CounterMode { + ++ private static final String AES_CTR_INTRINSICS_PARAM = "UseAESCTRIntrinsics"; ++ private static boolean aesctrIntrinsicEnabled = false; ++ ++ static { ++ HotSpotDiagnosticMXBean diagnostic ++ = ManagementFactoryHelper.getDiagnosticMXBean(); ++ VMOption vmOption; ++ try { ++ vmOption = diagnostic.getVMOption(AES_CTR_INTRINSICS_PARAM); ++ } catch (IllegalArgumentException e) { ++ vmOption = null; ++ } ++ aesctrIntrinsicEnabled = Boolean.valueOf(vmOption == null ? null : vmOption.getValue()); ++ } + GCTR(SymmetricCipher cipher, byte[] initialCounterBlk) { + super(cipher); + if (initialCounterBlk.length != AES_BLOCK_SIZE) { + throw new RuntimeException("length of initial counter block (" + initialCounterBlk.length + + ") not equal to AES_BLOCK_SIZE (" + AES_BLOCK_SIZE + ")"); + } +- + iv = initialCounterBlk; + reset(); + } +@@ -93,7 +110,7 @@ final class GCTR extends CounterMode { + + long blocksLeft = blocksUntilRollover(); + int numOfCompleteBlocks = inLen / AES_BLOCK_SIZE; +- if (numOfCompleteBlocks >= blocksLeft) { ++ if (!aesctrIntrinsicEnabled || numOfCompleteBlocks >= blocksLeft) { + // Counter Mode encryption cannot be used because counter will + // roll over incorrectly. Use GCM-specific code instead. + byte[] encryptedCntr = new byte[AES_BLOCK_SIZE]; +-- +2.19.1 + diff --git a/KAE-zip-support-streaming-data-decompression.patch b/KAE-zip-support-streaming-data-decompression.patch new file mode 100644 index 0000000000000000000000000000000000000000..4e011116bbb0a8eb5c34ffef832d81544cb66428 --- /dev/null +++ b/KAE-zip-support-streaming-data-decompression.patch @@ -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 mark and + * reset methods. The markSupported +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 + diff --git a/LoongArch64-support.patch b/LoongArch64-support.patch index 6be43aca669dbb53b47d3d2b8021669afbd05995..c68ef38fbcb92e844d33d713a14a16b19f856dc5 100644 --- a/LoongArch64-support.patch +++ b/LoongArch64-support.patch @@ -1,659 +1,5 @@ -From f762ff2634a7140bc295b98676f1db9602b15dcd Mon Sep 17 00:00:00 2001 -From: songliyang -Date: Mon, 20 May 2024 09:51:57 +0800 -Subject: [PATCH] add loongarch support - ---- - .../autoconf/build-aux/autoconf-config.guess | 3 + - common/autoconf/build-aux/autoconf-config.sub | 1 + - common/autoconf/build-aux/config.guess | 11 + - common/autoconf/configure.ac | 7 + - common/autoconf/generated-configure.sh | 95 +- - common/autoconf/jdk-options.m4 | 12 + - common/autoconf/platform.m4 | 65 + - common/autoconf/spec.gmk.in | 23 + - hotspot/agent/make/saenv.sh | 14 + - .../agent/src/os/linux/LinuxDebuggerLocal.c | 72 +- - hotspot/agent/src/os/linux/Makefile | 10 +- - hotspot/agent/src/os/linux/libproc.h | 15 +- - hotspot/agent/src/os/linux/ps_proc.c | 8 +- - .../classes/sun/jvm/hotspot/HotSpotAgent.java | 12 + - .../sun/jvm/hotspot/asm/Disassembler.java | 6 + - .../MachineDescriptionLOONGARCH64.java | 41 + - .../debugger/MachineDescriptionMIPS64.java | 41 + - .../debugger/linux/LinuxCDebugger.java | 18 + - .../linux/LinuxThreadContextFactory.java | 6 + - .../loongarch64/LinuxLOONGARCH64CFrame.java | 80 + - .../LinuxLOONGARCH64ThreadContext.java | 47 + - .../linux/mips64/LinuxMIPS64CFrame.java | 80 + - .../mips64/LinuxMIPS64ThreadContext.java | 47 + - .../loongarch64/LOONGARCH64ThreadContext.java | 123 + - .../debugger/mips64/MIPS64ThreadContext.java | 123 + - .../hotspot/debugger/posix/elf/ELFHeader.java | 2 + - .../debugger/proc/ProcDebuggerLocal.java | 12 + - .../loongarch64/ProcLOONGARCH64Thread.java | 92 + - .../ProcLOONGARCH64ThreadContext.java | 47 + - .../ProcLOONGARCH64ThreadFactory.java | 45 + - .../proc/mips64/ProcMIPS64Thread.java | 92 + - .../proc/mips64/ProcMIPS64ThreadContext.java | 47 + - .../proc/mips64/ProcMIPS64ThreadFactory.java | 45 + - .../debugger/remote/RemoteDebuggerClient.java | 12 + - .../loongarch64/RemoteLOONGARCH64Thread.java | 54 + - .../RemoteLOONGARCH64ThreadContext.java | 51 + - .../RemoteLOONGARCH64ThreadFactory.java | 45 + - .../remote/mips64/RemoteMIPS64Thread.java | 54 + - .../mips64/RemoteMIPS64ThreadContext.java | 51 + - .../mips64/RemoteMIPS64ThreadFactory.java | 45 + - .../sun/jvm/hotspot/runtime/Threads.java | 6 + - .../LinuxLOONGARCH64JavaThreadPDAccess.java | 133 + - .../LinuxMIPS64JavaThreadPDAccess.java | 132 + - .../LOONGARCH64CurrentFrameGuess.java | 217 + - .../runtime/loongarch64/LOONGARCH64Frame.java | 534 + - .../LOONGARCH64JavaCallWrapper.java | 57 + - .../loongarch64/LOONGARCH64RegisterMap.java | 52 + - .../mips64/MIPS64CurrentFrameGuess.java | 217 + - .../hotspot/runtime/mips64/MIPS64Frame.java | 547 + - .../runtime/mips64/MIPS64JavaCallWrapper.java | 57 + - .../runtime/mips64/MIPS64RegisterMap.java | 52 + - .../jvm/hotspot/utilities/PlatformInfo.java | 11 + - hotspot/make/defs.make | 37 +- - hotspot/make/linux/Makefile | 4 + - hotspot/make/linux/makefiles/defs.make | 56 + - hotspot/make/linux/makefiles/gcc.make | 11 +- - hotspot/make/linux/makefiles/loongarch64.make | 43 + - hotspot/make/linux/makefiles/mips64.make | 43 + - hotspot/make/linux/makefiles/sa.make | 8 + - hotspot/make/linux/makefiles/saproc.make | 12 + - hotspot/make/linux/makefiles/sparcWorks.make | 7 + - hotspot/make/linux/makefiles/vm.make | 28 + - hotspot/make/linux/platform_loongarch64 | 17 + - hotspot/make/linux/platform_mips64 | 17 + - hotspot/make/sa.files | 16 + - .../aarch64/vm/c1_LIRAssembler_aarch64.cpp | 17 +- - .../aarch64/vm/c1_LIRGenerator_aarch64.cpp | 19 +- - .../cpu/loongarch/vm/assembler_loongarch.cpp | 855 + - .../cpu/loongarch/vm/assembler_loongarch.hpp | 2810 ++++ - .../vm/assembler_loongarch.inline.hpp | 33 + - .../vm/bytecodeInterpreter_loongarch.hpp | 110 + - .../bytecodeInterpreter_loongarch.inline.hpp | 286 + - .../cpu/loongarch/vm/bytecodes_loongarch.cpp | 38 + - .../cpu/loongarch/vm/bytecodes_loongarch.hpp | 31 + - .../src/cpu/loongarch/vm/bytes_loongarch.hpp | 75 + - .../vm/c1_CodeStubs_loongarch_64.cpp | 387 + - .../cpu/loongarch/vm/c1_Defs_loongarch.hpp | 79 + - .../loongarch/vm/c1_FpuStackSim_loongarch.hpp | 32 + - .../vm/c1_FpuStackSim_loongarch_64.cpp | 31 + - .../loongarch/vm/c1_FrameMap_loongarch.hpp | 143 + - .../loongarch/vm/c1_FrameMap_loongarch_64.cpp | 362 + - .../vm/c1_LIRAssembler_loongarch.hpp | 83 + - .../vm/c1_LIRAssembler_loongarch_64.cpp | 3377 ++++ - .../vm/c1_LIRGenerator_loongarch_64.cpp | 1442 ++ - .../loongarch/vm/c1_LinearScan_loongarch.hpp | 70 + - .../vm/c1_LinearScan_loongarch_64.cpp | 33 + - .../vm/c1_MacroAssembler_loongarch.hpp | 112 + - .../vm/c1_MacroAssembler_loongarch_64.cpp | 346 + - .../loongarch/vm/c1_Runtime1_loongarch_64.cpp | 1252 ++ - .../cpu/loongarch/vm/c1_globals_loongarch.hpp | 69 + - .../cpu/loongarch/vm/c2_globals_loongarch.hpp | 87 + - .../cpu/loongarch/vm/c2_init_loongarch.cpp | 34 + - .../cpu/loongarch/vm/codeBuffer_loongarch.hpp | 35 + - .../cpu/loongarch/vm/compiledIC_loongarch.cpp | 167 + - .../src/cpu/loongarch/vm/copy_loongarch.hpp | 90 + - .../vm/cppInterpreterGenerator_loongarch.hpp | 53 + - .../loongarch/vm/cppInterpreter_loongarch.cpp | 215 + - .../src/cpu/loongarch/vm/debug_loongarch.cpp | 51 + - .../cpu/loongarch/vm/depChecker_loongarch.cpp | 30 + - .../cpu/loongarch/vm/depChecker_loongarch.hpp | 31 + - .../loongarch/vm/disassembler_loongarch.hpp | 37 + - .../src/cpu/loongarch/vm/frame_loongarch.cpp | 711 + - .../src/cpu/loongarch/vm/frame_loongarch.hpp | 229 + - .../loongarch/vm/frame_loongarch.inline.hpp | 312 + - .../vm/globalDefinitions_loongarch.hpp | 41 + - .../cpu/loongarch/vm/globals_loongarch.hpp | 103 + - .../cpu/loongarch/vm/icBuffer_loongarch.cpp | 101 + - .../src/cpu/loongarch/vm/icache_loongarch.cpp | 42 + - .../src/cpu/loongarch/vm/icache_loongarch.hpp | 41 + - .../loongarch/vm/interp_masm_loongarch_64.cpp | 1960 +++ - .../loongarch/vm/interp_masm_loongarch_64.hpp | 269 + - .../vm/interpreterGenerator_loongarch.hpp | 51 + - .../loongarch/vm/interpreterRT_loongarch.hpp | 66 + - .../vm/interpreterRT_loongarch_64.cpp | 274 + - .../loongarch/vm/interpreter_loongarch.hpp | 50 + - .../loongarch/vm/interpreter_loongarch_64.cpp | 277 + - .../vm/javaFrameAnchor_loongarch.hpp | 87 + - .../vm/jniFastGetField_loongarch_64.cpp | 169 + - .../cpu/loongarch/vm/jniTypes_loongarch.hpp | 144 + - hotspot/src/cpu/loongarch/vm/jni_loongarch.h | 51 + - hotspot/src/cpu/loongarch/vm/loongarch.ad | 24 + - hotspot/src/cpu/loongarch/vm/loongarch_64.ad | 12861 ++++++++++++++ - .../loongarch/vm/macroAssembler_loongarch.cpp | 3895 +++++ - .../loongarch/vm/macroAssembler_loongarch.hpp | 771 + - .../vm/macroAssembler_loongarch.inline.hpp | 34 + - .../vm/metaspaceShared_loongarch_64.cpp | 120 + - .../loongarch/vm/methodHandles_loongarch.cpp | 566 + - .../loongarch/vm/methodHandles_loongarch.hpp | 62 + - .../cpu/loongarch/vm/nativeInst_loongarch.cpp | 485 + - .../cpu/loongarch/vm/nativeInst_loongarch.hpp | 513 + - .../loongarch/vm/registerMap_loongarch.hpp | 45 + - .../vm/register_definitions_loongarch.cpp | 103 + - .../cpu/loongarch/vm/register_loongarch.cpp | 59 + - .../cpu/loongarch/vm/register_loongarch.hpp | 436 + - .../cpu/loongarch/vm/relocInfo_loongarch.cpp | 130 + - .../cpu/loongarch/vm/relocInfo_loongarch.hpp | 40 + - .../cpu/loongarch/vm/runtime_loongarch_64.cpp | 199 + - .../vm/sharedRuntime_loongarch_64.cpp | 3453 ++++ - .../vm/stubGenerator_loongarch_64.cpp | 3445 ++++ - .../vm/stubRoutines_loongarch_64.cpp | 264 + - .../vm/stubRoutines_loongarch_64.hpp | 60 + - ...templateInterpreterGenerator_loongarch.hpp | 35 + - .../vm/templateInterpreter_loongarch.hpp | 41 + - .../vm/templateInterpreter_loongarch_64.cpp | 2335 +++ - .../vm/templateTable_loongarch_64.cpp | 4024 +++++ - .../vm/templateTable_loongarch_64.hpp | 44 + - .../cpu/loongarch/vm/vmStructs_loongarch.hpp | 68 + - .../loongarch/vm/vm_version_ext_loongarch.cpp | 84 + - .../loongarch/vm/vm_version_ext_loongarch.hpp | 54 + - .../cpu/loongarch/vm/vm_version_loongarch.cpp | 443 + - .../cpu/loongarch/vm/vm_version_loongarch.hpp | 299 + - .../src/cpu/loongarch/vm/vmreg_loongarch.cpp | 51 + - .../src/cpu/loongarch/vm/vmreg_loongarch.hpp | 35 + - .../loongarch/vm/vmreg_loongarch.inline.hpp | 66 + - .../loongarch/vm/vtableStubs_loongarch_64.cpp | 300 + - hotspot/src/cpu/mips/vm/assembler_mips.cpp | 774 + - hotspot/src/cpu/mips/vm/assembler_mips.hpp | 1789 ++ - .../src/cpu/mips/vm/assembler_mips.inline.hpp | 33 + - .../cpu/mips/vm/bytecodeInterpreter_mips.cpp | 53 + - .../cpu/mips/vm/bytecodeInterpreter_mips.hpp | 110 + - .../vm/bytecodeInterpreter_mips.inline.hpp | 286 + - hotspot/src/cpu/mips/vm/bytecodes_mips.cpp | 38 + - hotspot/src/cpu/mips/vm/bytecodes_mips.hpp | 31 + - hotspot/src/cpu/mips/vm/bytes_mips.hpp | 193 + - hotspot/src/cpu/mips/vm/c2_globals_mips.hpp | 100 + - hotspot/src/cpu/mips/vm/c2_init_mips.cpp | 34 + - hotspot/src/cpu/mips/vm/codeBuffer_mips.hpp | 35 + - hotspot/src/cpu/mips/vm/compiledIC_mips.cpp | 173 + - hotspot/src/cpu/mips/vm/copy_mips.hpp | 90 + - .../mips/vm/cppInterpreterGenerator_mips.hpp | 53 + - .../src/cpu/mips/vm/cppInterpreter_mips.cpp | 215 + - .../src/cpu/mips/vm/cppInterpreter_mips.hpp | 40 + - hotspot/src/cpu/mips/vm/debug_mips.cpp | 51 + - hotspot/src/cpu/mips/vm/depChecker_mips.cpp | 30 + - hotspot/src/cpu/mips/vm/depChecker_mips.hpp | 31 + - hotspot/src/cpu/mips/vm/disassembler_mips.hpp | 37 + - hotspot/src/cpu/mips/vm/frame_mips.cpp | 711 + - hotspot/src/cpu/mips/vm/frame_mips.hpp | 229 + - hotspot/src/cpu/mips/vm/frame_mips.inline.hpp | 312 + - .../cpu/mips/vm/globalDefinitions_mips.hpp | 41 + - hotspot/src/cpu/mips/vm/globals_mips.hpp | 124 + - hotspot/src/cpu/mips/vm/icBuffer_mips.cpp | 97 + - hotspot/src/cpu/mips/vm/icache_mips.cpp | 41 + - hotspot/src/cpu/mips/vm/icache_mips.hpp | 41 + - .../src/cpu/mips/vm/interp_masm_mips_64.cpp | 2084 +++ - .../src/cpu/mips/vm/interp_masm_mips_64.hpp | 269 + - .../cpu/mips/vm/interpreterGenerator_mips.hpp | 49 + - .../src/cpu/mips/vm/interpreterRT_mips.hpp | 61 + - .../src/cpu/mips/vm/interpreterRT_mips_64.cpp | 259 + - hotspot/src/cpu/mips/vm/interpreter_mips.hpp | 50 + - .../src/cpu/mips/vm/interpreter_mips_64.cpp | 286 + - .../src/cpu/mips/vm/javaFrameAnchor_mips.hpp | 87 + - .../cpu/mips/vm/jniFastGetField_mips_64.cpp | 172 + - hotspot/src/cpu/mips/vm/jniTypes_mips.hpp | 144 + - hotspot/src/cpu/mips/vm/jni_mips.h | 51 + - .../src/cpu/mips/vm/macroAssembler_mips.cpp | 4332 +++++ - .../src/cpu/mips/vm/macroAssembler_mips.hpp | 701 + - .../mips/vm/macroAssembler_mips.inline.hpp | 34 + - .../cpu/mips/vm/metaspaceShared_mips_64.cpp | 123 + - .../src/cpu/mips/vm/methodHandles_mips.cpp | 576 + - .../src/cpu/mips/vm/methodHandles_mips.hpp | 62 + - hotspot/src/cpu/mips/vm/mips.ad | 25 + - hotspot/src/cpu/mips/vm/mips_64.ad | 14036 ++++++++++++++++ - hotspot/src/cpu/mips/vm/nativeInst_mips.cpp | 1829 ++ - hotspot/src/cpu/mips/vm/nativeInst_mips.hpp | 735 + - hotspot/src/cpu/mips/vm/registerMap_mips.hpp | 47 + - .../cpu/mips/vm/register_definitions_mips.cpp | 103 + - hotspot/src/cpu/mips/vm/register_mips.cpp | 52 + - hotspot/src/cpu/mips/vm/register_mips.hpp | 346 + - hotspot/src/cpu/mips/vm/relocInfo_mips.cpp | 156 + - hotspot/src/cpu/mips/vm/relocInfo_mips.hpp | 40 + - hotspot/src/cpu/mips/vm/runtime_mips_64.cpp | 206 + - .../src/cpu/mips/vm/sharedRuntime_mips_64.cpp | 3816 +++++ - .../src/cpu/mips/vm/stubGenerator_mips_64.cpp | 2147 +++ - .../src/cpu/mips/vm/stubRoutines_mips_64.cpp | 35 + - .../src/cpu/mips/vm/stubRoutines_mips_64.hpp | 59 + - .../vm/templateInterpreterGenerator_mips.hpp | 35 + - .../cpu/mips/vm/templateInterpreter_mips.hpp | 41 + - .../mips/vm/templateInterpreter_mips_64.cpp | 2306 +++ - .../src/cpu/mips/vm/templateTable_mips.hpp | 34 + - .../src/cpu/mips/vm/templateTable_mips_64.cpp | 4623 +++++ - .../src/cpu/mips/vm/templateTable_mips_64.hpp | 44 + - hotspot/src/cpu/mips/vm/vmStructs_mips.hpp | 68 + - .../src/cpu/mips/vm/vm_version_ext_mips.cpp | 89 + - .../src/cpu/mips/vm/vm_version_ext_mips.hpp | 54 + - hotspot/src/cpu/mips/vm/vm_version_mips.cpp | 510 + - hotspot/src/cpu/mips/vm/vm_version_mips.hpp | 221 + - hotspot/src/cpu/mips/vm/vmreg_mips.cpp | 51 + - hotspot/src/cpu/mips/vm/vmreg_mips.hpp | 35 + - hotspot/src/cpu/mips/vm/vmreg_mips.inline.hpp | 68 + - .../src/cpu/mips/vm/vtableStubs_mips_64.cpp | 301 + - .../src/cpu/x86/vm/c1_LIRAssembler_x86.cpp | 10 + - .../src/cpu/x86/vm/c1_LIRGenerator_x86.cpp | 21 +- - hotspot/src/os/linux/vm/os_linux.cpp | 27 +- - hotspot/src/os/linux/vm/os_perf_linux.cpp | 6 + - .../vm/assembler_linux_loongarch.cpp | 92 + - .../vm/atomic_linux_loongarch.inline.hpp | 206 + - .../vm/bytes_linux_loongarch.inline.hpp | 37 + - .../vm/copy_linux_loongarch.inline.hpp | 125 + - .../vm/globals_linux_loongarch.hpp | 43 + - .../vm/orderAccess_linux_loongarch.inline.hpp | 115 + - .../linux_loongarch/vm/os_linux_loongarch.cpp | 750 + - .../linux_loongarch/vm/os_linux_loongarch.hpp | 39 + - .../vm/prefetch_linux_loongarch.inline.hpp | 56 + - .../vm/threadLS_linux_loongarch.cpp | 84 + - .../vm/threadLS_linux_loongarch.hpp | 61 + - .../vm/thread_linux_loongarch.cpp | 99 + - .../vm/thread_linux_loongarch.hpp | 75 + - .../vm/vmStructs_linux_loongarch.hpp | 55 + - .../vm/vm_version_linux_loongarch.cpp | 29 + - .../linux_mips/vm/assembler_linux_mips.cpp | 111 + - .../vm/atomic_linux_mips.inline.hpp | 258 + - .../linux_mips/vm/bytes_linux_mips.inline.hpp | 37 + - .../linux_mips/vm/copy_linux_mips.inline.hpp | 125 + - .../linux_mips/vm/globals_linux_mips.hpp | 51 + - .../src/os_cpu/linux_mips/vm/linux_mips.ad | 153 + - hotspot/src/os_cpu/linux_mips/vm/linux_mips.s | 25 + - .../src/os_cpu/linux_mips/vm/linux_mips_64.ad | 50 + - .../vm/orderAccess_linux_mips.inline.hpp | 115 + - .../os_cpu/linux_mips/vm/os_linux_mips.cpp | 1015 ++ - .../os_cpu/linux_mips/vm/os_linux_mips.hpp | 39 + - .../vm/prefetch_linux_mips.inline.hpp | 58 + - .../linux_mips/vm/threadLS_linux_mips.cpp | 84 + - .../linux_mips/vm/threadLS_linux_mips.hpp | 61 + - .../linux_mips/vm/thread_linux_mips.cpp | 99 + - .../linux_mips/vm/thread_linux_mips.hpp | 75 + - .../linux_mips/vm/vmStructs_linux_mips.hpp | 55 + - .../linux_mips/vm/vm_version_linux_mips.cpp | 28 + - hotspot/src/share/tools/hsdis/Makefile | 13 + - hotspot/src/share/tools/hsdis/hsdis.c | 10 + - hotspot/src/share/vm/adlc/main.cpp | 14 + - hotspot/src/share/vm/asm/assembler.hpp | 20 + - hotspot/src/share/vm/asm/assembler.inline.hpp | 12 + - hotspot/src/share/vm/asm/codeBuffer.cpp | 7 + - hotspot/src/share/vm/asm/codeBuffer.hpp | 12 + - hotspot/src/share/vm/asm/macroAssembler.hpp | 13 +- - .../share/vm/asm/macroAssembler.inline.hpp | 12 + - hotspot/src/share/vm/asm/register.hpp | 12 + - hotspot/src/share/vm/c1/c1_Defs.hpp | 12 + - hotspot/src/share/vm/c1/c1_FpuStackSim.hpp | 9 + - hotspot/src/share/vm/c1/c1_FrameMap.cpp | 9 + - hotspot/src/share/vm/c1/c1_FrameMap.hpp | 9 + - hotspot/src/share/vm/c1/c1_LIR.cpp | 220 +- - hotspot/src/share/vm/c1/c1_LIR.hpp | 199 +- - hotspot/src/share/vm/c1/c1_LIRAssembler.cpp | 22 + - hotspot/src/share/vm/c1/c1_LIRAssembler.hpp | 12 + - hotspot/src/share/vm/c1/c1_LIRGenerator.cpp | 114 +- - hotspot/src/share/vm/c1/c1_LIRGenerator.hpp | 17 +- - hotspot/src/share/vm/c1/c1_LinearScan.cpp | 81 +- - hotspot/src/share/vm/c1/c1_LinearScan.hpp | 9 + - hotspot/src/share/vm/c1/c1_MacroAssembler.hpp | 9 + - hotspot/src/share/vm/c1/c1_Runtime1.cpp | 48 + - hotspot/src/share/vm/c1/c1_globals.hpp | 9 + - .../share/vm/classfile/bytecodeAssembler.cpp | 12 + - .../share/vm/classfile/classFileStream.hpp | 12 + - .../src/share/vm/classfile/stackMapTable.hpp | 12 + - hotspot/src/share/vm/classfile/verifier.cpp | 12 + - hotspot/src/share/vm/code/codeBlob.cpp | 12 + - hotspot/src/share/vm/code/compiledIC.hpp | 12 + - hotspot/src/share/vm/code/relocInfo.hpp | 45 +- - hotspot/src/share/vm/code/vmreg.hpp | 18 + - .../src/share/vm/compiler/disassembler.cpp | 12 + - .../src/share/vm/compiler/disassembler.hpp | 12 + - .../parallelScavenge/cardTableExtension.hpp | 3 + - .../parallelScavenge/parMarkBitMap.cpp | 3 + - .../psCompactionManager.inline.hpp | 6 + - .../parallelScavenge/psParallelCompact.cpp | 9 + - .../parallelScavenge/psParallelCompact.hpp | 6 + - .../psPromotionManager.inline.hpp | 24 +- - .../parallelScavenge/psScavenge.inline.hpp | 21 +- - .../vm/interpreter/abstractInterpreter.hpp | 10 + - hotspot/src/share/vm/interpreter/bytecode.hpp | 12 + - .../vm/interpreter/bytecodeInterpreter.hpp | 15 + - .../bytecodeInterpreter.inline.hpp | 12 + - .../share/vm/interpreter/bytecodeStream.hpp | 12 + - .../src/share/vm/interpreter/bytecodes.cpp | 12 + - .../src/share/vm/interpreter/bytecodes.hpp | 12 + - .../share/vm/interpreter/cppInterpreter.hpp | 12 + - .../interpreter/cppInterpreterGenerator.hpp | 12 + - .../src/share/vm/interpreter/interpreter.hpp | 12 + - .../vm/interpreter/interpreterGenerator.hpp | 12 + - .../vm/interpreter/interpreterRuntime.cpp | 14 +- - .../vm/interpreter/interpreterRuntime.hpp | 14 +- - .../vm/interpreter/templateInterpreter.hpp | 12 + - .../templateInterpreterGenerator.hpp | 12 + - .../share/vm/interpreter/templateTable.hpp | 14 + - .../share/vm/jfr/utilities/jfrBigEndian.hpp | 2 +- - .../src/share/vm/jfr/writers/jfrEncoders.hpp | 12 + - hotspot/src/share/vm/memory/barrierSet.hpp | 25 +- - .../src/share/vm/memory/cardTableModRefBS.hpp | 12 +- - hotspot/src/share/vm/memory/cardTableRS.cpp | 10 +- - hotspot/src/share/vm/memory/cardTableRS.hpp | 9 +- - hotspot/src/share/vm/memory/metaspace.cpp | 13 +- - hotspot/src/share/vm/oops/constantPool.hpp | 13 + - hotspot/src/share/vm/oops/klass.hpp | 17 +- - hotspot/src/share/vm/oops/oop.hpp | 8 +- - hotspot/src/share/vm/oops/oop.inline.hpp | 12 + - hotspot/src/share/vm/oops/oop.pcgc.inline.hpp | 8 +- - hotspot/src/share/vm/opto/buildOopMap.cpp | 12 + - hotspot/src/share/vm/opto/bytecodeInfo.cpp | 11 + - hotspot/src/share/vm/opto/c2_globals.hpp | 12 + - hotspot/src/share/vm/opto/c2compiler.cpp | 10 + - hotspot/src/share/vm/opto/chaitin.hpp | 14 + - hotspot/src/share/vm/opto/compile.cpp | 10 + - hotspot/src/share/vm/opto/compile.hpp | 2 +- - hotspot/src/share/vm/opto/gcm.cpp | 10 + - hotspot/src/share/vm/opto/lcm.cpp | 10 + - hotspot/src/share/vm/opto/locknode.hpp | 10 + - hotspot/src/share/vm/opto/matcher.cpp | 10 + - hotspot/src/share/vm/opto/output.cpp | 43 + - hotspot/src/share/vm/opto/output.hpp | 10 + - hotspot/src/share/vm/opto/regmask.cpp | 10 + - hotspot/src/share/vm/opto/regmask.hpp | 10 + - hotspot/src/share/vm/opto/runtime.cpp | 10 + - hotspot/src/share/vm/opto/type.cpp | 16 + - hotspot/src/share/vm/prims/jniCheck.cpp | 12 + - hotspot/src/share/vm/prims/jni_md.h | 12 + - .../vm/prims/jvmtiClassFileReconstituter.cpp | 12 + - hotspot/src/share/vm/prims/methodHandles.hpp | 13 + - .../src/share/vm/runtime/atomic.inline.hpp | 12 + - .../src/share/vm/runtime/deoptimization.cpp | 18 + - hotspot/src/share/vm/runtime/dtraceJSDT.hpp | 12 + - hotspot/src/share/vm/runtime/frame.cpp | 13 + - hotspot/src/share/vm/runtime/frame.hpp | 16 + - hotspot/src/share/vm/runtime/frame.inline.hpp | 18 + - hotspot/src/share/vm/runtime/globals.hpp | 26 +- - hotspot/src/share/vm/runtime/icache.hpp | 13 +- - hotspot/src/share/vm/runtime/java.cpp | 12 + - hotspot/src/share/vm/runtime/javaCalls.hpp | 12 + - .../src/share/vm/runtime/javaFrameAnchor.hpp | 12 + - hotspot/src/share/vm/runtime/os.cpp | 3 +- - hotspot/src/share/vm/runtime/os.hpp | 12 + - .../src/share/vm/runtime/prefetch.inline.hpp | 6 + - hotspot/src/share/vm/runtime/registerMap.hpp | 18 + - hotspot/src/share/vm/runtime/relocator.hpp | 12 + - hotspot/src/share/vm/runtime/safepoint.cpp | 14 + - .../src/share/vm/runtime/sharedRuntime.cpp | 16 +- - .../share/vm/runtime/sharedRuntimeTrig.cpp | 15 + - .../share/vm/runtime/stackValueCollection.cpp | 12 + - hotspot/src/share/vm/runtime/statSampler.cpp | 12 + - hotspot/src/share/vm/runtime/stubRoutines.hpp | 16 + - hotspot/src/share/vm/runtime/thread.cpp | 6 + - hotspot/src/share/vm/runtime/thread.hpp | 12 + - .../share/vm/runtime/threadLocalStorage.hpp | 12 + - hotspot/src/share/vm/runtime/virtualspace.cpp | 16 + - hotspot/src/share/vm/runtime/vmStructs.cpp | 22 + - hotspot/src/share/vm/runtime/vm_version.cpp | 20 + - hotspot/src/share/vm/utilities/copy.hpp | 13 + - hotspot/src/share/vm/utilities/debug.cpp | 1 + - .../share/vm/utilities/globalDefinitions.hpp | 12 + - hotspot/src/share/vm/utilities/macros.hpp | 30 + - hotspot/src/share/vm/utilities/taskqueue.hpp | 74 +- - hotspot/src/share/vm/utilities/vmError.cpp | 14 +- - .../argumentcorruption/Test8167409.sh | 18 + - .../testcases/GenericTestCaseForOtherCPU.java | 5 +- - .../sha/predicate/IntrinsicPredicates.java | 10 +- - hotspot/test/runtime/6929067/Test6929067.sh | 4 + - hotspot/test/runtime/Unsafe/RangeCheck.java | 3 + - hotspot/test/test_env.sh | 23 + - .../com/oracle/java/testlibrary/Platform.java | 8 + - ...stMutuallyExclusivePlatformPredicates.java | 2 +- - jdk/make/Images.gmk | 20 + - jdk/make/gensrc/GensrcMisc.gmk | 13 + - jdk/make/lib/SoundLibraries.gmk | 14 + - .../classes/sun/misc/Version.java.template | 22 +- - jdk/src/solaris/bin/loongarch64/jvm.cfg | 36 + - jdk/src/solaris/bin/mips64/jvm.cfg | 36 + - .../jdk/jfr/event/os/TestCPUInformation.java | 4 +- - .../bootstrap/linux-loongarch64/launcher | 0 - .../bootstrap/linux-mips64el/launcher | 0 - jdk/test/sun/security/pkcs11/PKCS11Test.java | 8 + - 411 files changed, 111201 insertions(+), 216 deletions(-) - create mode 100644 hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionLOONGARCH64.java - create mode 100644 hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionMIPS64.java - create mode 100644 hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/loongarch64/LinuxLOONGARCH64CFrame.java - create mode 100644 hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/loongarch64/LinuxLOONGARCH64ThreadContext.java - create mode 100644 hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/mips64/LinuxMIPS64CFrame.java - create mode 100644 hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/mips64/LinuxMIPS64ThreadContext.java - create mode 100644 hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/loongarch64/LOONGARCH64ThreadContext.java - create mode 100644 hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/mips64/MIPS64ThreadContext.java - create mode 100644 hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/loongarch64/ProcLOONGARCH64Thread.java - create mode 100644 hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/loongarch64/ProcLOONGARCH64ThreadContext.java - create mode 100644 hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/loongarch64/ProcLOONGARCH64ThreadFactory.java - create mode 100644 hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/mips64/ProcMIPS64Thread.java - create mode 100644 hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/mips64/ProcMIPS64ThreadContext.java - create mode 100644 hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/mips64/ProcMIPS64ThreadFactory.java - create mode 100644 hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/loongarch64/RemoteLOONGARCH64Thread.java - create mode 100644 hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/loongarch64/RemoteLOONGARCH64ThreadContext.java - create mode 100644 hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/loongarch64/RemoteLOONGARCH64ThreadFactory.java - create mode 100644 hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/mips64/RemoteMIPS64Thread.java - create mode 100644 hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/mips64/RemoteMIPS64ThreadContext.java - create mode 100644 hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/mips64/RemoteMIPS64ThreadFactory.java - create mode 100644 hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/linux_loongarch64/LinuxLOONGARCH64JavaThreadPDAccess.java - create mode 100644 hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/linux_mips64/LinuxMIPS64JavaThreadPDAccess.java - create mode 100644 hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/loongarch64/LOONGARCH64CurrentFrameGuess.java - create mode 100644 hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/loongarch64/LOONGARCH64Frame.java - create mode 100644 hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/loongarch64/LOONGARCH64JavaCallWrapper.java - create mode 100644 hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/loongarch64/LOONGARCH64RegisterMap.java - create mode 100644 hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/mips64/MIPS64CurrentFrameGuess.java - create mode 100644 hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/mips64/MIPS64Frame.java - create mode 100644 hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/mips64/MIPS64JavaCallWrapper.java - create mode 100644 hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/mips64/MIPS64RegisterMap.java - create mode 100644 hotspot/make/linux/makefiles/loongarch64.make - create mode 100644 hotspot/make/linux/makefiles/mips64.make - create mode 100644 hotspot/make/linux/platform_loongarch64 - create mode 100644 hotspot/make/linux/platform_mips64 - create mode 100644 hotspot/src/cpu/loongarch/vm/assembler_loongarch.cpp - create mode 100644 hotspot/src/cpu/loongarch/vm/assembler_loongarch.hpp - create mode 100644 hotspot/src/cpu/loongarch/vm/assembler_loongarch.inline.hpp - create mode 100644 hotspot/src/cpu/loongarch/vm/bytecodeInterpreter_loongarch.hpp - create mode 100644 hotspot/src/cpu/loongarch/vm/bytecodeInterpreter_loongarch.inline.hpp - create mode 100644 hotspot/src/cpu/loongarch/vm/bytecodes_loongarch.cpp - create mode 100644 hotspot/src/cpu/loongarch/vm/bytecodes_loongarch.hpp - create mode 100644 hotspot/src/cpu/loongarch/vm/bytes_loongarch.hpp - create mode 100644 hotspot/src/cpu/loongarch/vm/c1_CodeStubs_loongarch_64.cpp - create mode 100644 hotspot/src/cpu/loongarch/vm/c1_Defs_loongarch.hpp - create mode 100644 hotspot/src/cpu/loongarch/vm/c1_FpuStackSim_loongarch.hpp - create mode 100644 hotspot/src/cpu/loongarch/vm/c1_FpuStackSim_loongarch_64.cpp - create mode 100644 hotspot/src/cpu/loongarch/vm/c1_FrameMap_loongarch.hpp - create mode 100644 hotspot/src/cpu/loongarch/vm/c1_FrameMap_loongarch_64.cpp - create mode 100644 hotspot/src/cpu/loongarch/vm/c1_LIRAssembler_loongarch.hpp - create mode 100644 hotspot/src/cpu/loongarch/vm/c1_LIRAssembler_loongarch_64.cpp - create mode 100644 hotspot/src/cpu/loongarch/vm/c1_LIRGenerator_loongarch_64.cpp - create mode 100644 hotspot/src/cpu/loongarch/vm/c1_LinearScan_loongarch.hpp - create mode 100644 hotspot/src/cpu/loongarch/vm/c1_LinearScan_loongarch_64.cpp - create mode 100644 hotspot/src/cpu/loongarch/vm/c1_MacroAssembler_loongarch.hpp - create mode 100644 hotspot/src/cpu/loongarch/vm/c1_MacroAssembler_loongarch_64.cpp - create mode 100644 hotspot/src/cpu/loongarch/vm/c1_Runtime1_loongarch_64.cpp - create mode 100644 hotspot/src/cpu/loongarch/vm/c1_globals_loongarch.hpp - create mode 100644 hotspot/src/cpu/loongarch/vm/c2_globals_loongarch.hpp - create mode 100644 hotspot/src/cpu/loongarch/vm/c2_init_loongarch.cpp - create mode 100644 hotspot/src/cpu/loongarch/vm/codeBuffer_loongarch.hpp - create mode 100644 hotspot/src/cpu/loongarch/vm/compiledIC_loongarch.cpp - create mode 100644 hotspot/src/cpu/loongarch/vm/copy_loongarch.hpp - create mode 100644 hotspot/src/cpu/loongarch/vm/cppInterpreterGenerator_loongarch.hpp - create mode 100644 hotspot/src/cpu/loongarch/vm/cppInterpreter_loongarch.cpp - create mode 100644 hotspot/src/cpu/loongarch/vm/debug_loongarch.cpp - create mode 100644 hotspot/src/cpu/loongarch/vm/depChecker_loongarch.cpp - create mode 100644 hotspot/src/cpu/loongarch/vm/depChecker_loongarch.hpp - create mode 100644 hotspot/src/cpu/loongarch/vm/disassembler_loongarch.hpp - create mode 100644 hotspot/src/cpu/loongarch/vm/frame_loongarch.cpp - create mode 100644 hotspot/src/cpu/loongarch/vm/frame_loongarch.hpp - create mode 100644 hotspot/src/cpu/loongarch/vm/frame_loongarch.inline.hpp - create mode 100644 hotspot/src/cpu/loongarch/vm/globalDefinitions_loongarch.hpp - create mode 100644 hotspot/src/cpu/loongarch/vm/globals_loongarch.hpp - create mode 100644 hotspot/src/cpu/loongarch/vm/icBuffer_loongarch.cpp - create mode 100644 hotspot/src/cpu/loongarch/vm/icache_loongarch.cpp - create mode 100644 hotspot/src/cpu/loongarch/vm/icache_loongarch.hpp - create mode 100644 hotspot/src/cpu/loongarch/vm/interp_masm_loongarch_64.cpp - create mode 100644 hotspot/src/cpu/loongarch/vm/interp_masm_loongarch_64.hpp - create mode 100644 hotspot/src/cpu/loongarch/vm/interpreterGenerator_loongarch.hpp - create mode 100644 hotspot/src/cpu/loongarch/vm/interpreterRT_loongarch.hpp - create mode 100644 hotspot/src/cpu/loongarch/vm/interpreterRT_loongarch_64.cpp - create mode 100644 hotspot/src/cpu/loongarch/vm/interpreter_loongarch.hpp - create mode 100644 hotspot/src/cpu/loongarch/vm/interpreter_loongarch_64.cpp - create mode 100644 hotspot/src/cpu/loongarch/vm/javaFrameAnchor_loongarch.hpp - create mode 100644 hotspot/src/cpu/loongarch/vm/jniFastGetField_loongarch_64.cpp - create mode 100644 hotspot/src/cpu/loongarch/vm/jniTypes_loongarch.hpp - create mode 100644 hotspot/src/cpu/loongarch/vm/jni_loongarch.h - create mode 100644 hotspot/src/cpu/loongarch/vm/loongarch.ad - create mode 100644 hotspot/src/cpu/loongarch/vm/loongarch_64.ad - create mode 100644 hotspot/src/cpu/loongarch/vm/macroAssembler_loongarch.cpp - create mode 100644 hotspot/src/cpu/loongarch/vm/macroAssembler_loongarch.hpp - create mode 100644 hotspot/src/cpu/loongarch/vm/macroAssembler_loongarch.inline.hpp - create mode 100644 hotspot/src/cpu/loongarch/vm/metaspaceShared_loongarch_64.cpp - create mode 100644 hotspot/src/cpu/loongarch/vm/methodHandles_loongarch.cpp - create mode 100644 hotspot/src/cpu/loongarch/vm/methodHandles_loongarch.hpp - create mode 100644 hotspot/src/cpu/loongarch/vm/nativeInst_loongarch.cpp - create mode 100644 hotspot/src/cpu/loongarch/vm/nativeInst_loongarch.hpp - create mode 100644 hotspot/src/cpu/loongarch/vm/registerMap_loongarch.hpp - create mode 100644 hotspot/src/cpu/loongarch/vm/register_definitions_loongarch.cpp - create mode 100644 hotspot/src/cpu/loongarch/vm/register_loongarch.cpp - create mode 100644 hotspot/src/cpu/loongarch/vm/register_loongarch.hpp - create mode 100644 hotspot/src/cpu/loongarch/vm/relocInfo_loongarch.cpp - create mode 100644 hotspot/src/cpu/loongarch/vm/relocInfo_loongarch.hpp - create mode 100644 hotspot/src/cpu/loongarch/vm/runtime_loongarch_64.cpp - create mode 100644 hotspot/src/cpu/loongarch/vm/sharedRuntime_loongarch_64.cpp - create mode 100644 hotspot/src/cpu/loongarch/vm/stubGenerator_loongarch_64.cpp - create mode 100644 hotspot/src/cpu/loongarch/vm/stubRoutines_loongarch_64.cpp - create mode 100644 hotspot/src/cpu/loongarch/vm/stubRoutines_loongarch_64.hpp - create mode 100644 hotspot/src/cpu/loongarch/vm/templateInterpreterGenerator_loongarch.hpp - create mode 100644 hotspot/src/cpu/loongarch/vm/templateInterpreter_loongarch.hpp - create mode 100644 hotspot/src/cpu/loongarch/vm/templateInterpreter_loongarch_64.cpp - create mode 100644 hotspot/src/cpu/loongarch/vm/templateTable_loongarch_64.cpp - create mode 100644 hotspot/src/cpu/loongarch/vm/templateTable_loongarch_64.hpp - create mode 100644 hotspot/src/cpu/loongarch/vm/vmStructs_loongarch.hpp - create mode 100644 hotspot/src/cpu/loongarch/vm/vm_version_ext_loongarch.cpp - create mode 100644 hotspot/src/cpu/loongarch/vm/vm_version_ext_loongarch.hpp - create mode 100644 hotspot/src/cpu/loongarch/vm/vm_version_loongarch.cpp - create mode 100644 hotspot/src/cpu/loongarch/vm/vm_version_loongarch.hpp - create mode 100644 hotspot/src/cpu/loongarch/vm/vmreg_loongarch.cpp - create mode 100644 hotspot/src/cpu/loongarch/vm/vmreg_loongarch.hpp - create mode 100644 hotspot/src/cpu/loongarch/vm/vmreg_loongarch.inline.hpp - create mode 100644 hotspot/src/cpu/loongarch/vm/vtableStubs_loongarch_64.cpp - create mode 100644 hotspot/src/cpu/mips/vm/assembler_mips.cpp - create mode 100644 hotspot/src/cpu/mips/vm/assembler_mips.hpp - create mode 100644 hotspot/src/cpu/mips/vm/assembler_mips.inline.hpp - create mode 100644 hotspot/src/cpu/mips/vm/bytecodeInterpreter_mips.cpp - create mode 100644 hotspot/src/cpu/mips/vm/bytecodeInterpreter_mips.hpp - create mode 100644 hotspot/src/cpu/mips/vm/bytecodeInterpreter_mips.inline.hpp - create mode 100644 hotspot/src/cpu/mips/vm/bytecodes_mips.cpp - create mode 100644 hotspot/src/cpu/mips/vm/bytecodes_mips.hpp - create mode 100644 hotspot/src/cpu/mips/vm/bytes_mips.hpp - create mode 100644 hotspot/src/cpu/mips/vm/c2_globals_mips.hpp - create mode 100644 hotspot/src/cpu/mips/vm/c2_init_mips.cpp - create mode 100644 hotspot/src/cpu/mips/vm/codeBuffer_mips.hpp - create mode 100644 hotspot/src/cpu/mips/vm/compiledIC_mips.cpp - create mode 100644 hotspot/src/cpu/mips/vm/copy_mips.hpp - create mode 100644 hotspot/src/cpu/mips/vm/cppInterpreterGenerator_mips.hpp - create mode 100644 hotspot/src/cpu/mips/vm/cppInterpreter_mips.cpp - create mode 100644 hotspot/src/cpu/mips/vm/cppInterpreter_mips.hpp - create mode 100644 hotspot/src/cpu/mips/vm/debug_mips.cpp - create mode 100644 hotspot/src/cpu/mips/vm/depChecker_mips.cpp - create mode 100644 hotspot/src/cpu/mips/vm/depChecker_mips.hpp - create mode 100644 hotspot/src/cpu/mips/vm/disassembler_mips.hpp - create mode 100644 hotspot/src/cpu/mips/vm/frame_mips.cpp - create mode 100644 hotspot/src/cpu/mips/vm/frame_mips.hpp - create mode 100644 hotspot/src/cpu/mips/vm/frame_mips.inline.hpp - create mode 100644 hotspot/src/cpu/mips/vm/globalDefinitions_mips.hpp - create mode 100644 hotspot/src/cpu/mips/vm/globals_mips.hpp - create mode 100644 hotspot/src/cpu/mips/vm/icBuffer_mips.cpp - create mode 100644 hotspot/src/cpu/mips/vm/icache_mips.cpp - create mode 100644 hotspot/src/cpu/mips/vm/icache_mips.hpp - create mode 100644 hotspot/src/cpu/mips/vm/interp_masm_mips_64.cpp - create mode 100644 hotspot/src/cpu/mips/vm/interp_masm_mips_64.hpp - create mode 100644 hotspot/src/cpu/mips/vm/interpreterGenerator_mips.hpp - create mode 100644 hotspot/src/cpu/mips/vm/interpreterRT_mips.hpp - create mode 100644 hotspot/src/cpu/mips/vm/interpreterRT_mips_64.cpp - create mode 100644 hotspot/src/cpu/mips/vm/interpreter_mips.hpp - create mode 100644 hotspot/src/cpu/mips/vm/interpreter_mips_64.cpp - create mode 100644 hotspot/src/cpu/mips/vm/javaFrameAnchor_mips.hpp - create mode 100644 hotspot/src/cpu/mips/vm/jniFastGetField_mips_64.cpp - create mode 100644 hotspot/src/cpu/mips/vm/jniTypes_mips.hpp - create mode 100644 hotspot/src/cpu/mips/vm/jni_mips.h - create mode 100644 hotspot/src/cpu/mips/vm/macroAssembler_mips.cpp - create mode 100644 hotspot/src/cpu/mips/vm/macroAssembler_mips.hpp - create mode 100644 hotspot/src/cpu/mips/vm/macroAssembler_mips.inline.hpp - create mode 100644 hotspot/src/cpu/mips/vm/metaspaceShared_mips_64.cpp - create mode 100644 hotspot/src/cpu/mips/vm/methodHandles_mips.cpp - create mode 100644 hotspot/src/cpu/mips/vm/methodHandles_mips.hpp - create mode 100644 hotspot/src/cpu/mips/vm/mips.ad - create mode 100644 hotspot/src/cpu/mips/vm/mips_64.ad - create mode 100644 hotspot/src/cpu/mips/vm/nativeInst_mips.cpp - create mode 100644 hotspot/src/cpu/mips/vm/nativeInst_mips.hpp - create mode 100644 hotspot/src/cpu/mips/vm/registerMap_mips.hpp - create mode 100644 hotspot/src/cpu/mips/vm/register_definitions_mips.cpp - create mode 100644 hotspot/src/cpu/mips/vm/register_mips.cpp - create mode 100644 hotspot/src/cpu/mips/vm/register_mips.hpp - create mode 100644 hotspot/src/cpu/mips/vm/relocInfo_mips.cpp - create mode 100644 hotspot/src/cpu/mips/vm/relocInfo_mips.hpp - create mode 100644 hotspot/src/cpu/mips/vm/runtime_mips_64.cpp - create mode 100644 hotspot/src/cpu/mips/vm/sharedRuntime_mips_64.cpp - create mode 100644 hotspot/src/cpu/mips/vm/stubGenerator_mips_64.cpp - create mode 100644 hotspot/src/cpu/mips/vm/stubRoutines_mips_64.cpp - create mode 100644 hotspot/src/cpu/mips/vm/stubRoutines_mips_64.hpp - create mode 100644 hotspot/src/cpu/mips/vm/templateInterpreterGenerator_mips.hpp - create mode 100644 hotspot/src/cpu/mips/vm/templateInterpreter_mips.hpp - create mode 100644 hotspot/src/cpu/mips/vm/templateInterpreter_mips_64.cpp - create mode 100644 hotspot/src/cpu/mips/vm/templateTable_mips.hpp - create mode 100644 hotspot/src/cpu/mips/vm/templateTable_mips_64.cpp - create mode 100644 hotspot/src/cpu/mips/vm/templateTable_mips_64.hpp - create mode 100644 hotspot/src/cpu/mips/vm/vmStructs_mips.hpp - create mode 100644 hotspot/src/cpu/mips/vm/vm_version_ext_mips.cpp - create mode 100644 hotspot/src/cpu/mips/vm/vm_version_ext_mips.hpp - create mode 100644 hotspot/src/cpu/mips/vm/vm_version_mips.cpp - create mode 100644 hotspot/src/cpu/mips/vm/vm_version_mips.hpp - create mode 100644 hotspot/src/cpu/mips/vm/vmreg_mips.cpp - create mode 100644 hotspot/src/cpu/mips/vm/vmreg_mips.hpp - create mode 100644 hotspot/src/cpu/mips/vm/vmreg_mips.inline.hpp - create mode 100644 hotspot/src/cpu/mips/vm/vtableStubs_mips_64.cpp - create mode 100644 hotspot/src/os_cpu/linux_loongarch/vm/assembler_linux_loongarch.cpp - create mode 100644 hotspot/src/os_cpu/linux_loongarch/vm/atomic_linux_loongarch.inline.hpp - create mode 100644 hotspot/src/os_cpu/linux_loongarch/vm/bytes_linux_loongarch.inline.hpp - create mode 100644 hotspot/src/os_cpu/linux_loongarch/vm/copy_linux_loongarch.inline.hpp - create mode 100644 hotspot/src/os_cpu/linux_loongarch/vm/globals_linux_loongarch.hpp - create mode 100644 hotspot/src/os_cpu/linux_loongarch/vm/orderAccess_linux_loongarch.inline.hpp - create mode 100644 hotspot/src/os_cpu/linux_loongarch/vm/os_linux_loongarch.cpp - create mode 100644 hotspot/src/os_cpu/linux_loongarch/vm/os_linux_loongarch.hpp - create mode 100644 hotspot/src/os_cpu/linux_loongarch/vm/prefetch_linux_loongarch.inline.hpp - create mode 100644 hotspot/src/os_cpu/linux_loongarch/vm/threadLS_linux_loongarch.cpp - create mode 100644 hotspot/src/os_cpu/linux_loongarch/vm/threadLS_linux_loongarch.hpp - create mode 100644 hotspot/src/os_cpu/linux_loongarch/vm/thread_linux_loongarch.cpp - create mode 100644 hotspot/src/os_cpu/linux_loongarch/vm/thread_linux_loongarch.hpp - create mode 100644 hotspot/src/os_cpu/linux_loongarch/vm/vmStructs_linux_loongarch.hpp - create mode 100644 hotspot/src/os_cpu/linux_loongarch/vm/vm_version_linux_loongarch.cpp - create mode 100644 hotspot/src/os_cpu/linux_mips/vm/assembler_linux_mips.cpp - create mode 100644 hotspot/src/os_cpu/linux_mips/vm/atomic_linux_mips.inline.hpp - create mode 100644 hotspot/src/os_cpu/linux_mips/vm/bytes_linux_mips.inline.hpp - create mode 100644 hotspot/src/os_cpu/linux_mips/vm/copy_linux_mips.inline.hpp - create mode 100644 hotspot/src/os_cpu/linux_mips/vm/globals_linux_mips.hpp - create mode 100644 hotspot/src/os_cpu/linux_mips/vm/linux_mips.ad - create mode 100644 hotspot/src/os_cpu/linux_mips/vm/linux_mips.s - create mode 100644 hotspot/src/os_cpu/linux_mips/vm/linux_mips_64.ad - create mode 100644 hotspot/src/os_cpu/linux_mips/vm/orderAccess_linux_mips.inline.hpp - create mode 100644 hotspot/src/os_cpu/linux_mips/vm/os_linux_mips.cpp - create mode 100644 hotspot/src/os_cpu/linux_mips/vm/os_linux_mips.hpp - create mode 100644 hotspot/src/os_cpu/linux_mips/vm/prefetch_linux_mips.inline.hpp - create mode 100644 hotspot/src/os_cpu/linux_mips/vm/threadLS_linux_mips.cpp - create mode 100644 hotspot/src/os_cpu/linux_mips/vm/threadLS_linux_mips.hpp - create mode 100644 hotspot/src/os_cpu/linux_mips/vm/thread_linux_mips.cpp - create mode 100644 hotspot/src/os_cpu/linux_mips/vm/thread_linux_mips.hpp - create mode 100644 hotspot/src/os_cpu/linux_mips/vm/vmStructs_linux_mips.hpp - create mode 100644 hotspot/src/os_cpu/linux_mips/vm/vm_version_linux_mips.cpp - create mode 100644 jdk/src/solaris/bin/loongarch64/jvm.cfg - create mode 100644 jdk/src/solaris/bin/mips64/jvm.cfg - create mode 100644 jdk/test/sun/management/jmxremote/bootstrap/linux-loongarch64/launcher - create mode 100644 jdk/test/sun/management/jmxremote/bootstrap/linux-mips64el/launcher - diff --git a/common/autoconf/build-aux/autoconf-config.guess b/common/autoconf/build-aux/autoconf-config.guess -index 15ee4389..3d7555b5 100644 +index 15ee438926..3d7555b52d 100644 --- a/common/autoconf/build-aux/autoconf-config.guess +++ b/common/autoconf/build-aux/autoconf-config.guess @@ -977,6 +977,9 @@ EOF @@ -667,7 +13,7 @@ index 15ee4389..3d7555b5 100644 echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; diff --git a/common/autoconf/build-aux/autoconf-config.sub b/common/autoconf/build-aux/autoconf-config.sub -index 1aab2b30..bd910bdd 100644 +index 1aab2b303e..bd910bddbe 100644 --- a/common/autoconf/build-aux/autoconf-config.sub +++ b/common/autoconf/build-aux/autoconf-config.sub @@ -275,6 +275,7 @@ case $basic_machine in @@ -679,10 +25,10 @@ index 1aab2b30..bd910bdd 100644 | maxq | mb | microblaze | mcore | mep \ | mips | mipsbe | mipseb | mipsel | mipsle \ diff --git a/common/autoconf/build-aux/config.guess b/common/autoconf/build-aux/config.guess -index 288edb6e..ca6d5871 100644 +index 288edb6e0e..13cd94bf1d 100644 --- a/common/autoconf/build-aux/config.guess +++ b/common/autoconf/build-aux/config.guess -@@ -95,4 +95,15 @@ if [ "x$OUT" = x ]; then +@@ -86,6 +86,17 @@ if [ "x$OUT" = x ]; then fi fi @@ -697,9 +43,11 @@ index 288edb6e..ca6d5871 100644 + fi +fi + - echo $OUT + # Test and fix LoongArch64. + if [ "x$OUT" = x ]; then + if [ `uname -s` = Linux ]; then diff --git a/common/autoconf/configure.ac b/common/autoconf/configure.ac -index 151e5a10..5072409d 100644 +index 151e5a109f..5072409dd4 100644 --- a/common/autoconf/configure.ac +++ b/common/autoconf/configure.ac @@ -23,6 +23,12 @@ @@ -724,7 +72,7 @@ index 151e5a10..5072409d 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 85eb8a16..cf57b89f 100644 +index 6f17436eff..aedd82e614 100644 --- a/common/autoconf/generated-configure.sh +++ b/common/autoconf/generated-configure.sh @@ -716,6 +716,9 @@ SET_EXECUTABLE_ORIGIN @@ -737,23 +85,7 @@ index 85eb8a16..cf57b89f 100644 SYSROOT_LDFLAGS SYSROOT_CFLAGS RC_FLAGS -@@ -1069,6 +1072,7 @@ with_milestone - with_update_version - with_user_release_suffix - with_build_number -+with_company_name - with_vendor_name - with_vendor_url - with_vendor_bug_url -@@ -1922,6 +1926,7 @@ Optional Packages: - Add a custom string to the version string if build - number isn't set.[username_builddateb00] - --with-build-number Set build number value for build [b00] -+ --with-company-name Set company name. - --with-vendor-name Set vendor name. Among others, used to set the - 'java.vendor' and 'java.vm.vendor' system - properties. [not specified] -@@ -4081,6 +4086,12 @@ fi +@@ -4081,6 +4084,12 @@ fi # questions. # @@ -766,7 +98,7 @@ index 85eb8a16..cf57b89f 100644 # Support macro for PLATFORM_EXTRACT_TARGET_AND_BUILD. # Converts autoconf style CPU name to OpenJDK style, into # VAR_CPU, VAR_CPU_ARCH, VAR_CPU_BITS and VAR_CPU_ENDIAN. -@@ -13930,6 +13941,12 @@ test -n "$target_alias" && +@@ -13930,6 +13939,12 @@ test -n "$target_alias" && VAR_CPU_BITS=64 VAR_CPU_ENDIAN=big ;; @@ -779,7 +111,7 @@ index 85eb8a16..cf57b89f 100644 loongarch64) VAR_CPU=loongarch64 VAR_CPU_ARCH=loongarch -@@ -14074,6 +14091,12 @@ $as_echo "$OPENJDK_BUILD_OS-$OPENJDK_BUILD_CPU" >&6; } +@@ -14074,6 +14089,12 @@ $as_echo "$OPENJDK_BUILD_OS-$OPENJDK_BUILD_CPU" >&6; } VAR_CPU_BITS=64 VAR_CPU_ENDIAN=big ;; @@ -792,7 +124,7 @@ index 85eb8a16..cf57b89f 100644 loongarch64) VAR_CPU=loongarch64 VAR_CPU_ARCH=loongarch -@@ -14202,6 +14225,8 @@ $as_echo "$COMPILE_TYPE" >&6; } +@@ -14202,6 +14223,8 @@ $as_echo "$COMPILE_TYPE" >&6; } OPENJDK_TARGET_CPU_LEGACY_LIB="i386" elif test "x$OPENJDK_TARGET_CPU" = xx86_64; then OPENJDK_TARGET_CPU_LEGACY_LIB="amd64" @@ -801,7 +133,7 @@ index 85eb8a16..cf57b89f 100644 fi -@@ -14235,6 +14260,9 @@ $as_echo "$COMPILE_TYPE" >&6; } +@@ -14235,6 +14258,9 @@ $as_echo "$COMPILE_TYPE" >&6; } elif test "x$OPENJDK_TARGET_OS" != xmacosx && test "x$OPENJDK_TARGET_CPU" = xx86_64; then # On all platforms except macosx, we replace x86_64 with amd64. OPENJDK_TARGET_CPU_OSARCH="amd64" @@ -811,7 +143,7 @@ index 85eb8a16..cf57b89f 100644 fi -@@ -14244,6 +14272,8 @@ $as_echo "$COMPILE_TYPE" >&6; } +@@ -14244,6 +14270,8 @@ $as_echo "$COMPILE_TYPE" >&6; } elif test "x$OPENJDK_TARGET_OS" != xmacosx && test "x$OPENJDK_TARGET_CPU" = xx86_64; then # On all platforms except macosx, we replace x86_64 with amd64. OPENJDK_TARGET_CPU_JLI="amd64" @@ -820,7 +152,7 @@ index 85eb8a16..cf57b89f 100644 fi # Now setup the -D flags for building libjli. OPENJDK_TARGET_CPU_JLI_CFLAGS="-DLIBARCHNAME='\"$OPENJDK_TARGET_CPU_JLI\"'" -@@ -14256,6 +14286,9 @@ $as_echo "$COMPILE_TYPE" >&6; } +@@ -14256,6 +14284,9 @@ $as_echo "$COMPILE_TYPE" >&6; } elif test "x$OPENJDK_TARGET_OS" = xmacosx && test "x$TOOLCHAIN_TYPE" = xclang ; then OPENJDK_TARGET_CPU_JLI_CFLAGS="$OPENJDK_TARGET_CPU_JLI_CFLAGS -stdlib=libc++ -mmacosx-version-min=\$(MACOSX_VERSION_MIN)" fi @@ -830,38 +162,7 @@ index 85eb8a16..cf57b89f 100644 # Setup OPENJDK_TARGET_OS_API_DIR, used in source paths. -@@ -20409,18 +20442,21 @@ fi - - # Now set the JDK version, milestone, build number etc. - -+ # The company name, if any - -+# Check whether --with-company-name was given. -+if test "${with_company_name+set}" = set; then : -+ withval=$with_company_name; -+fi - - -- -- -- -- -- -- -- -- -- -+ if test "x$with_company_name" = xyes; then -+ as_fn_error $? "--with-company-name must have a value" "$LINENO" 5 -+ elif ! [[ $with_company_name =~ ^[[:print:]]*$ ]] ; then -+ as_fn_error $? "--with-company-name contains non-printing characters: $with_company_name" "$LINENO" 5 -+ elif test "x$with_company_name" != x; then -+ COMPANY_NAME="$with_company_name" -+ fi - - # The vendor name, if any - -@@ -42436,6 +42472,47 @@ $as_echo "$ac_cv_c_bigendian" >&6; } +@@ -42429,6 +42460,47 @@ $as_echo "$ac_cv_c_bigendian" >&6; } fi @@ -909,31 +210,8 @@ index 85eb8a16..cf57b89f 100644 # Configure flags for the tools ############################################################################### -diff --git a/common/autoconf/jdk-options.m4 b/common/autoconf/jdk-options.m4 -index 18ba5852..42aeb7bd 100644 ---- a/common/autoconf/jdk-options.m4 -+++ b/common/autoconf/jdk-options.m4 -@@ -539,6 +539,18 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_JDK_VERSION_NUMBERS], - AC_SUBST(MACOSX_BUNDLE_NAME_BASE) - AC_SUBST(MACOSX_BUNDLE_ID_BASE) - -+ # The company name, if any -+ AC_ARG_WITH(company-name, [AS_HELP_STRING([--with-company-name], -+ [Set company name.])]) -+ if test "x$with_company_name" = xyes; then -+ AC_MSG_ERROR([--with-company-name must have a value]) -+ elif [ ! [[ $with_company_name =~ ^[[:print:]]*$ ]] ]; then -+ AC_MSG_ERROR([--with-company-name contains non-printing characters: $with_company_name]) -+ elif test "x$with_company_name" != x; then -+ COMPANY_NAME="$with_company_name" -+ fi -+ AC_SUBST(COMPANY_NAME) -+ - # The vendor name, if any - AC_ARG_WITH(vendor-name, [AS_HELP_STRING([--with-vendor-name], - [Set vendor name. Among others, used to set the 'java.vendor' diff --git a/common/autoconf/platform.m4 b/common/autoconf/platform.m4 -index f54942ac..51cc28c3 100644 +index f54942acf2..51cc28c312 100644 --- a/common/autoconf/platform.m4 +++ b/common/autoconf/platform.m4 @@ -23,6 +23,12 @@ @@ -1048,7 +326,7 @@ index f54942ac..51cc28c3 100644 +AC_SUBST(HOST_NAME) +]) diff --git a/common/autoconf/spec.gmk.in b/common/autoconf/spec.gmk.in -index 9573bb2c..1b034770 100644 +index 9573bb2cbd..ad85aa346f 100644 --- a/common/autoconf/spec.gmk.in +++ b/common/autoconf/spec.gmk.in @@ -23,6 +23,12 @@ @@ -1056,8 +334,8 @@ index 9573bb2c..1b034770 100644 # +# -+# This file has been modified by Loongson Technology in 2023. These -+# modifications are Copyright (c) 2018, 2023, Loongson Technology, and are made ++# This file has been modified by Loongson Technology in 2024. These ++# modifications are Copyright (c) 2018, 2024, Loongson Technology, and are made +# available on the same license terms set forth above. +# + @@ -1074,7 +352,7 @@ index 9573bb2c..1b034770 100644 +HOST_NAME:=@HOST_NAME@ + +# Loongson OpenJDK Version info -+VER=8.1.18 ++VER=8.1.20 +ifeq ($(HOST_NAME), ) + HOST_NAME=unknown +endif @@ -1089,7 +367,7 @@ index 9573bb2c..1b034770 100644 DEBUG_LEVEL:=@DEBUG_LEVEL@ diff --git a/hotspot/agent/make/saenv.sh b/hotspot/agent/make/saenv.sh -index ab9a0a43..a2de3fc3 100644 +index ab9a0a431c..a2de3fc329 100644 --- a/hotspot/agent/make/saenv.sh +++ b/hotspot/agent/make/saenv.sh @@ -23,6 +23,12 @@ @@ -1121,7 +399,7 @@ index ab9a0a43..a2de3fc3 100644 SA_LIBPATH=$STARTDIR/../src/os/linux/i386:$STARTDIR/linux/i386 OPTIONS="-Dsa.library.path=$SA_LIBPATH" diff --git a/hotspot/agent/src/os/linux/LinuxDebuggerLocal.c b/hotspot/agent/src/os/linux/LinuxDebuggerLocal.c -index d6a0c7d9..b3b1380b 100644 +index d6a0c7d9a9..b3b1380b29 100644 --- a/hotspot/agent/src/os/linux/LinuxDebuggerLocal.c +++ b/hotspot/agent/src/os/linux/LinuxDebuggerLocal.c @@ -22,6 +22,13 @@ @@ -1236,7 +514,7 @@ index d6a0c7d9..b3b1380b 100644 (*env)->ReleaseLongArrayElements(env, array, regs, JNI_COMMIT); return array; diff --git a/hotspot/agent/src/os/linux/Makefile b/hotspot/agent/src/os/linux/Makefile -index c0b5c869..2cc50b6f 100644 +index c0b5c869c1..2cc50b6fab 100644 --- a/hotspot/agent/src/os/linux/Makefile +++ b/hotspot/agent/src/os/linux/Makefile @@ -22,7 +22,13 @@ @@ -1264,7 +542,7 @@ index c0b5c869..2cc50b6f 100644 sun.jvm.hotspot.debugger.aarch64.AARCH64ThreadContext $(GCC) $(CFLAGS) $< -o $@ diff --git a/hotspot/agent/src/os/linux/libproc.h b/hotspot/agent/src/os/linux/libproc.h -index 6b6e41ca..5eb8211a 100644 +index 6b6e41cab4..5eb8211aa9 100644 --- a/hotspot/agent/src/os/linux/libproc.h +++ b/hotspot/agent/src/os/linux/libproc.h @@ -22,6 +22,12 @@ @@ -1304,7 +582,7 @@ index 6b6e41ca..5eb8211a 100644 #endif diff --git a/hotspot/agent/src/os/linux/ps_proc.c b/hotspot/agent/src/os/linux/ps_proc.c -index c4d6a9ec..7000e927 100644 +index c4d6a9ecc5..7000e92723 100644 --- a/hotspot/agent/src/os/linux/ps_proc.c +++ b/hotspot/agent/src/os/linux/ps_proc.c @@ -22,6 +22,12 @@ @@ -1330,7 +608,7 @@ index c4d6a9ec..7000e927 100644 print_debug("ptrace(PTRACE_GETREGS, ...) failed for lwp %d\n", pid); return false; diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/HotSpotAgent.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/HotSpotAgent.java -index c9633505..20e6f35b 100644 +index c963350591..20e6f35b9c 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/HotSpotAgent.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/HotSpotAgent.java @@ -22,6 +22,12 @@ @@ -1367,7 +645,7 @@ index c9633505..20e6f35b 100644 try { machDesc = (MachineDescription) diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/Disassembler.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/Disassembler.java -index 993bf7bb..1e075aa5 100644 +index 993bf7bb47..1e075aa57e 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/Disassembler.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/Disassembler.java @@ -94,6 +94,12 @@ public class Disassembler { @@ -1385,7 +663,7 @@ index 993bf7bb..1e075aa5 100644 libname += "-" + arch + ".so"; diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionLOONGARCH64.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionLOONGARCH64.java new file mode 100644 -index 00000000..0531427d +index 0000000000..0531427dab --- /dev/null +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionLOONGARCH64.java @@ -0,0 +1,41 @@ @@ -1432,7 +710,7 @@ index 00000000..0531427d +} diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionMIPS64.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionMIPS64.java new file mode 100644 -index 00000000..1b49efd2 +index 0000000000..1b49efd201 --- /dev/null +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionMIPS64.java @@ -0,0 +1,41 @@ @@ -1478,7 +756,7 @@ index 00000000..1b49efd2 + } +} diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/LinuxCDebugger.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/LinuxCDebugger.java -index f178d6a6..019e794b 100644 +index f178d6a6e7..019e794bbb 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/LinuxCDebugger.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/LinuxCDebugger.java @@ -32,11 +32,15 @@ import sun.jvm.hotspot.debugger.cdbg.*; @@ -1519,7 +797,7 @@ index f178d6a6..019e794b 100644 // Runtime exception thrown by LinuxThreadContextFactory if unknown cpu ThreadContext context = (ThreadContext) thread.getContext(); diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/LinuxThreadContextFactory.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/LinuxThreadContextFactory.java -index 44c2265d..3b6747ac 100644 +index 44c2265d7a..3b6747ac0a 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/LinuxThreadContextFactory.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/LinuxThreadContextFactory.java @@ -30,6 +30,8 @@ import sun.jvm.hotspot.debugger.linux.amd64.*; @@ -1544,7 +822,7 @@ index 44c2265d..3b6747ac 100644 Class tcc = Class.forName("sun.jvm.hotspot.debugger.linux." + diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/loongarch64/LinuxLOONGARCH64CFrame.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/loongarch64/LinuxLOONGARCH64CFrame.java new file mode 100644 -index 00000000..3b20dbbd +index 0000000000..3b20dbbd87 --- /dev/null +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/loongarch64/LinuxLOONGARCH64CFrame.java @@ -0,0 +1,80 @@ @@ -1630,7 +908,7 @@ index 00000000..3b20dbbd +} diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/loongarch64/LinuxLOONGARCH64ThreadContext.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/loongarch64/LinuxLOONGARCH64ThreadContext.java new file mode 100644 -index 00000000..9f22133e +index 0000000000..9f22133eaf --- /dev/null +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/loongarch64/LinuxLOONGARCH64ThreadContext.java @@ -0,0 +1,47 @@ @@ -1683,7 +961,7 @@ index 00000000..9f22133e +} diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/mips64/LinuxMIPS64CFrame.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/mips64/LinuxMIPS64CFrame.java new file mode 100644 -index 00000000..2e3eb564 +index 0000000000..2e3eb564da --- /dev/null +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/mips64/LinuxMIPS64CFrame.java @@ -0,0 +1,80 @@ @@ -1769,7 +1047,7 @@ index 00000000..2e3eb564 +} diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/mips64/LinuxMIPS64ThreadContext.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/mips64/LinuxMIPS64ThreadContext.java new file mode 100644 -index 00000000..98e0f3f0 +index 0000000000..98e0f3f0bc --- /dev/null +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/mips64/LinuxMIPS64ThreadContext.java @@ -0,0 +1,47 @@ @@ -1822,7 +1100,7 @@ index 00000000..98e0f3f0 +} diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/loongarch64/LOONGARCH64ThreadContext.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/loongarch64/LOONGARCH64ThreadContext.java new file mode 100644 -index 00000000..90b0cf97 +index 0000000000..90b0cf97e3 --- /dev/null +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/loongarch64/LOONGARCH64ThreadContext.java @@ -0,0 +1,123 @@ @@ -1951,7 +1229,7 @@ index 00000000..90b0cf97 +} diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/mips64/MIPS64ThreadContext.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/mips64/MIPS64ThreadContext.java new file mode 100644 -index 00000000..c57ee9df +index 0000000000..c57ee9dfc9 --- /dev/null +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/mips64/MIPS64ThreadContext.java @@ -0,0 +1,123 @@ @@ -2079,7 +1357,7 @@ index 00000000..c57ee9df + public abstract Address getRegisterAsAddress(int index); +} diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/posix/elf/ELFHeader.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/posix/elf/ELFHeader.java -index 7113a3a4..24273888 100644 +index 7113a3a497..24273888c2 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/posix/elf/ELFHeader.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/posix/elf/ELFHeader.java @@ -63,6 +63,8 @@ public interface ELFHeader { @@ -2092,7 +1370,7 @@ index 7113a3a4..24273888 100644 /** Returns a file type which is defined by the file type constants. */ public short getFileType(); diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/ProcDebuggerLocal.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/ProcDebuggerLocal.java -index ca1a2575..2afa6c55 100644 +index ca1a2575ff..2afa6c55f8 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/ProcDebuggerLocal.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/ProcDebuggerLocal.java @@ -34,10 +34,14 @@ import sun.jvm.hotspot.debugger.proc.amd64.*; @@ -2127,7 +1405,7 @@ index ca1a2575..2afa6c55 100644 Class tfc = Class.forName("sun.jvm.hotspot.debugger.proc." + diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/loongarch64/ProcLOONGARCH64Thread.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/loongarch64/ProcLOONGARCH64Thread.java new file mode 100644 -index 00000000..42a31e34 +index 0000000000..42a31e3486 --- /dev/null +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/loongarch64/ProcLOONGARCH64Thread.java @@ -0,0 +1,92 @@ @@ -2225,7 +1503,7 @@ index 00000000..42a31e34 +} diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/loongarch64/ProcLOONGARCH64ThreadContext.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/loongarch64/ProcLOONGARCH64ThreadContext.java new file mode 100644 -index 00000000..9054f165 +index 0000000000..9054f16506 --- /dev/null +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/loongarch64/ProcLOONGARCH64ThreadContext.java @@ -0,0 +1,47 @@ @@ -2278,7 +1556,7 @@ index 00000000..9054f165 +} diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/loongarch64/ProcLOONGARCH64ThreadFactory.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/loongarch64/ProcLOONGARCH64ThreadFactory.java new file mode 100644 -index 00000000..bc643351 +index 0000000000..bc64335124 --- /dev/null +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/loongarch64/ProcLOONGARCH64ThreadFactory.java @@ -0,0 +1,45 @@ @@ -2329,7 +1607,7 @@ index 00000000..bc643351 +} diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/mips64/ProcMIPS64Thread.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/mips64/ProcMIPS64Thread.java new file mode 100644 -index 00000000..5c1e0be8 +index 0000000000..5c1e0be893 --- /dev/null +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/mips64/ProcMIPS64Thread.java @@ -0,0 +1,92 @@ @@ -2427,7 +1705,7 @@ index 00000000..5c1e0be8 +} diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/mips64/ProcMIPS64ThreadContext.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/mips64/ProcMIPS64ThreadContext.java new file mode 100644 -index 00000000..d44223d7 +index 0000000000..d44223d768 --- /dev/null +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/mips64/ProcMIPS64ThreadContext.java @@ -0,0 +1,47 @@ @@ -2480,7 +1758,7 @@ index 00000000..d44223d7 +} diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/mips64/ProcMIPS64ThreadFactory.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/mips64/ProcMIPS64ThreadFactory.java new file mode 100644 -index 00000000..bad478fc +index 0000000000..bad478fc5c --- /dev/null +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/mips64/ProcMIPS64ThreadFactory.java @@ -0,0 +1,45 @@ @@ -2530,7 +1808,7 @@ index 00000000..bad478fc + } +} diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/RemoteDebuggerClient.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/RemoteDebuggerClient.java -index ffa61b54..9cf3ee2d 100644 +index ffa61b548e..9cf3ee2da3 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/RemoteDebuggerClient.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/RemoteDebuggerClient.java @@ -33,6 +33,8 @@ import sun.jvm.hotspot.debugger.cdbg.*; @@ -2561,7 +1839,7 @@ index ffa61b54..9cf3ee2d 100644 Class tf = Class.forName("sun.jvm.hotspot.debugger.remote." + diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/loongarch64/RemoteLOONGARCH64Thread.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/loongarch64/RemoteLOONGARCH64Thread.java new file mode 100644 -index 00000000..01e3f895 +index 0000000000..01e3f8954b --- /dev/null +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/loongarch64/RemoteLOONGARCH64Thread.java @@ -0,0 +1,54 @@ @@ -2621,7 +1899,7 @@ index 00000000..01e3f895 +} diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/loongarch64/RemoteLOONGARCH64ThreadContext.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/loongarch64/RemoteLOONGARCH64ThreadContext.java new file mode 100644 -index 00000000..ad25bccc +index 0000000000..ad25bccc8d --- /dev/null +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/loongarch64/RemoteLOONGARCH64ThreadContext.java @@ -0,0 +1,51 @@ @@ -2678,7 +1956,7 @@ index 00000000..ad25bccc +} diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/loongarch64/RemoteLOONGARCH64ThreadFactory.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/loongarch64/RemoteLOONGARCH64ThreadFactory.java new file mode 100644 -index 00000000..d8bf50ea +index 0000000000..d8bf50ea5b --- /dev/null +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/loongarch64/RemoteLOONGARCH64ThreadFactory.java @@ -0,0 +1,45 @@ @@ -2729,7 +2007,7 @@ index 00000000..d8bf50ea +} diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/mips64/RemoteMIPS64Thread.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/mips64/RemoteMIPS64Thread.java new file mode 100644 -index 00000000..a9285a3b +index 0000000000..a9285a3b94 --- /dev/null +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/mips64/RemoteMIPS64Thread.java @@ -0,0 +1,54 @@ @@ -2789,7 +2067,7 @@ index 00000000..a9285a3b +} diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/mips64/RemoteMIPS64ThreadContext.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/mips64/RemoteMIPS64ThreadContext.java new file mode 100644 -index 00000000..4d711f9b +index 0000000000..4d711f9ba7 --- /dev/null +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/mips64/RemoteMIPS64ThreadContext.java @@ -0,0 +1,51 @@ @@ -2846,7 +2124,7 @@ index 00000000..4d711f9b +} diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/mips64/RemoteMIPS64ThreadFactory.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/mips64/RemoteMIPS64ThreadFactory.java new file mode 100644 -index 00000000..020a2f1f +index 0000000000..020a2f1ff9 --- /dev/null +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/mips64/RemoteMIPS64ThreadFactory.java @@ -0,0 +1,45 @@ @@ -2896,7 +2174,7 @@ index 00000000..020a2f1f + } +} diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/Threads.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/Threads.java -index 842a3b35..81efdd02 100644 +index 842a3b357d..81efdd02f8 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/Threads.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/Threads.java @@ -34,6 +34,8 @@ import sun.jvm.hotspot.runtime.win32_amd64.Win32AMD64JavaThreadPDAccess; @@ -2921,7 +2199,7 @@ index 842a3b35..81efdd02 100644 access = (JavaThreadPDAccess) diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/linux_loongarch64/LinuxLOONGARCH64JavaThreadPDAccess.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/linux_loongarch64/LinuxLOONGARCH64JavaThreadPDAccess.java new file mode 100644 -index 00000000..77c45c2e +index 0000000000..77c45c2e99 --- /dev/null +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/linux_loongarch64/LinuxLOONGARCH64JavaThreadPDAccess.java @@ -0,0 +1,133 @@ @@ -3060,7 +2338,7 @@ index 00000000..77c45c2e +} diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/linux_mips64/LinuxMIPS64JavaThreadPDAccess.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/linux_mips64/LinuxMIPS64JavaThreadPDAccess.java new file mode 100644 -index 00000000..a0fd73fa +index 0000000000..a0fd73fa67 --- /dev/null +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/linux_mips64/LinuxMIPS64JavaThreadPDAccess.java @@ -0,0 +1,132 @@ @@ -3198,7 +2476,7 @@ index 00000000..a0fd73fa +} diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/loongarch64/LOONGARCH64CurrentFrameGuess.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/loongarch64/LOONGARCH64CurrentFrameGuess.java new file mode 100644 -index 00000000..0208e6e2 +index 0000000000..0208e6e224 --- /dev/null +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/loongarch64/LOONGARCH64CurrentFrameGuess.java @@ -0,0 +1,217 @@ @@ -3421,7 +2699,7 @@ index 00000000..0208e6e2 +} diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/loongarch64/LOONGARCH64Frame.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/loongarch64/LOONGARCH64Frame.java new file mode 100644 -index 00000000..fdf0c79c +index 0000000000..fdf0c79c1a --- /dev/null +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/loongarch64/LOONGARCH64Frame.java @@ -0,0 +1,534 @@ @@ -3961,7 +3239,7 @@ index 00000000..fdf0c79c +} diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/loongarch64/LOONGARCH64JavaCallWrapper.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/loongarch64/LOONGARCH64JavaCallWrapper.java new file mode 100644 -index 00000000..f7dbbcaa +index 0000000000..f7dbbcaacd --- /dev/null +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/loongarch64/LOONGARCH64JavaCallWrapper.java @@ -0,0 +1,57 @@ @@ -4024,7 +3302,7 @@ index 00000000..f7dbbcaa +} diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/loongarch64/LOONGARCH64RegisterMap.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/loongarch64/LOONGARCH64RegisterMap.java new file mode 100644 -index 00000000..021ef523 +index 0000000000..021ef523e3 --- /dev/null +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/loongarch64/LOONGARCH64RegisterMap.java @@ -0,0 +1,52 @@ @@ -4082,7 +3360,7 @@ index 00000000..021ef523 +} diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/mips64/MIPS64CurrentFrameGuess.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/mips64/MIPS64CurrentFrameGuess.java new file mode 100644 -index 00000000..21259a4d +index 0000000000..21259a4d32 --- /dev/null +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/mips64/MIPS64CurrentFrameGuess.java @@ -0,0 +1,217 @@ @@ -4305,7 +3583,7 @@ index 00000000..21259a4d +} diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/mips64/MIPS64Frame.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/mips64/MIPS64Frame.java new file mode 100644 -index 00000000..0cc5cf4e +index 0000000000..0cc5cf4e7c --- /dev/null +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/mips64/MIPS64Frame.java @@ -0,0 +1,547 @@ @@ -4858,7 +4136,7 @@ index 00000000..0cc5cf4e +} diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/mips64/MIPS64JavaCallWrapper.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/mips64/MIPS64JavaCallWrapper.java new file mode 100644 -index 00000000..81fcb5b5 +index 0000000000..81fcb5b568 --- /dev/null +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/mips64/MIPS64JavaCallWrapper.java @@ -0,0 +1,57 @@ @@ -4921,7 +4199,7 @@ index 00000000..81fcb5b5 +} diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/mips64/MIPS64RegisterMap.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/mips64/MIPS64RegisterMap.java new file mode 100644 -index 00000000..64850379 +index 0000000000..648503792d --- /dev/null +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/mips64/MIPS64RegisterMap.java @@ -0,0 +1,52 @@ @@ -4978,7 +4256,7 @@ index 00000000..64850379 + protected Address getLocationPD(VMReg reg) { return null; } +} diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/PlatformInfo.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/PlatformInfo.java -index aa692578..9c97d09b 100644 +index aa69257866..9c97d09bc3 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/PlatformInfo.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/PlatformInfo.java @@ -22,6 +22,13 @@ @@ -5007,7 +4285,7 @@ index aa692578..9c97d09b 100644 try { Class pic = Class.forName("sun.jvm.hotspot.utilities.PlatformInfoClosed"); diff --git a/hotspot/make/defs.make b/hotspot/make/defs.make -index a3573da5..6e93182c 100644 +index a3573da56f..6e93182c92 100644 --- a/hotspot/make/defs.make +++ b/hotspot/make/defs.make @@ -22,6 +22,12 @@ @@ -5085,7 +4363,7 @@ index a3573da5..6e93182c 100644 # Required make macro settings for all platforms diff --git a/hotspot/make/linux/Makefile b/hotspot/make/linux/Makefile -index e8f20104..5aff01e8 100644 +index e8f2010412..5aff01e87d 100644 --- a/hotspot/make/linux/Makefile +++ b/hotspot/make/linux/Makefile @@ -74,6 +74,10 @@ ifneq (,$(findstring $(ARCH), ppc ppc64)) @@ -5100,7 +4378,7 @@ index e8f20104..5aff01e8 100644 ifdef LP64 ifeq ("$(filter $(LP64_ARCH),$(BUILDARCH))","") diff --git a/hotspot/make/linux/makefiles/defs.make b/hotspot/make/linux/makefiles/defs.make -index ec414639..9ade73ab 100644 +index ec414639d2..9ade73ab34 100644 --- a/hotspot/make/linux/makefiles/defs.make +++ b/hotspot/make/linux/makefiles/defs.make @@ -22,6 +22,12 @@ @@ -5198,7 +4476,7 @@ index ec414639..9ade73ab 100644 endif endif diff --git a/hotspot/make/linux/makefiles/gcc.make b/hotspot/make/linux/makefiles/gcc.make -index 7dde7f09..94c6d1d0 100644 +index 7dde7f0963..94c6d1d015 100644 --- a/hotspot/make/linux/makefiles/gcc.make +++ b/hotspot/make/linux/makefiles/gcc.make @@ -22,6 +22,12 @@ @@ -5235,7 +4513,7 @@ index 7dde7f09..94c6d1d0 100644 # However we need to clean the code up before we can unrestrictedly enable this option with Clang diff --git a/hotspot/make/linux/makefiles/loongarch64.make b/hotspot/make/linux/makefiles/loongarch64.make new file mode 100644 -index 00000000..9e3cdb6f +index 0000000000..9e3cdb6f23 --- /dev/null +++ b/hotspot/make/linux/makefiles/loongarch64.make @@ -0,0 +1,43 @@ @@ -5284,7 +4562,7 @@ index 00000000..9e3cdb6f +OPT_CFLAGS/compactingPermGenGen.o = -O1 diff --git a/hotspot/make/linux/makefiles/mips64.make b/hotspot/make/linux/makefiles/mips64.make new file mode 100644 -index 00000000..d9af3b13 +index 0000000000..d9af3b13ab --- /dev/null +++ b/hotspot/make/linux/makefiles/mips64.make @@ -0,0 +1,43 @@ @@ -5332,7 +4610,7 @@ index 00000000..d9af3b13 + +OPT_CFLAGS/compactingPermGenGen.o = -O1 diff --git a/hotspot/make/linux/makefiles/sa.make b/hotspot/make/linux/makefiles/sa.make -index cdcb16a1..34c71bd6 100644 +index cdcb16a1a3..34c71bd666 100644 --- a/hotspot/make/linux/makefiles/sa.make +++ b/hotspot/make/linux/makefiles/sa.make @@ -22,6 +22,12 @@ @@ -5358,7 +4636,7 @@ index cdcb16a1..34c71bd6 100644 $(QUIETLY) $(REMOTE) $(RUN.JAVAH) -classpath $(SA_CLASSDIR) -d $(GENERATED) -jni sun.jvm.hotspot.asm.Disassembler diff --git a/hotspot/make/linux/makefiles/saproc.make b/hotspot/make/linux/makefiles/saproc.make -index ffc0ec5c..c04a6765 100644 +index ffc0ec5ce5..c04a6765df 100644 --- a/hotspot/make/linux/makefiles/saproc.make +++ b/hotspot/make/linux/makefiles/saproc.make @@ -21,6 +21,13 @@ @@ -5389,7 +4667,7 @@ index ffc0ec5c..c04a6765 100644 $(LIBSAPROC): $(SASRCFILES) $(SAMAPFILE) $(QUIETLY) if [ "$(BOOT_JAVA_HOME)" = "" ]; then \ diff --git a/hotspot/make/linux/makefiles/sparcWorks.make b/hotspot/make/linux/makefiles/sparcWorks.make -index e3911602..dbc2ace8 100644 +index e39116023c..dbc2ace825 100644 --- a/hotspot/make/linux/makefiles/sparcWorks.make +++ b/hotspot/make/linux/makefiles/sparcWorks.make @@ -22,6 +22,12 @@ @@ -5414,7 +4692,7 @@ index e3911602..dbc2ace8 100644 CFLAGS += $(ARCHFLAG) AOUT_FLAGS += $(ARCHFLAG) diff --git a/hotspot/make/linux/makefiles/vm.make b/hotspot/make/linux/makefiles/vm.make -index 04b7c202..5e428538 100644 +index 04b7c20287..5e428538a0 100644 --- a/hotspot/make/linux/makefiles/vm.make +++ b/hotspot/make/linux/makefiles/vm.make @@ -22,6 +22,12 @@ @@ -5471,7 +4749,7 @@ index 04b7c202..5e428538 100644 # This has to be included here to allow changes to the source diff --git a/hotspot/make/linux/platform_loongarch64 b/hotspot/make/linux/platform_loongarch64 new file mode 100644 -index 00000000..d704cf38 +index 0000000000..d704cf389a --- /dev/null +++ b/hotspot/make/linux/platform_loongarch64 @@ -0,0 +1,17 @@ @@ -5494,7 +4772,7 @@ index 00000000..d704cf38 +sysdefs = -DLINUX -D_GNU_SOURCE -DLOONGARCH64 diff --git a/hotspot/make/linux/platform_mips64 b/hotspot/make/linux/platform_mips64 new file mode 100644 -index 00000000..c283671f +index 0000000000..c283671f82 --- /dev/null +++ b/hotspot/make/linux/platform_mips64 @@ -0,0 +1,17 @@ @@ -5516,7 +4794,7 @@ index 00000000..c283671f + +sysdefs = -DLINUX -D_GNU_SOURCE -DMIPS64 diff --git a/hotspot/make/sa.files b/hotspot/make/sa.files -index d6e728a9..43b08e3a 100644 +index d6e728a9a8..43b08e3ad1 100644 --- a/hotspot/make/sa.files +++ b/hotspot/make/sa.files @@ -22,6 +22,12 @@ @@ -5567,7 +4845,7 @@ index d6e728a9..43b08e3a 100644 $(AGENT_SRC_DIR)/sun/jvm/hotspot/runtime/solaris_amd64/*.java \ $(AGENT_SRC_DIR)/sun/jvm/hotspot/runtime/solaris_sparc/*.java \ diff --git a/hotspot/src/cpu/aarch64/vm/c1_LIRAssembler_aarch64.cpp b/hotspot/src/cpu/aarch64/vm/c1_LIRAssembler_aarch64.cpp -index 35d34a08..3b8cf4a1 100644 +index 35d34a08ea..3b8cf4a11d 100644 --- a/hotspot/src/cpu/aarch64/vm/c1_LIRAssembler_aarch64.cpp +++ b/hotspot/src/cpu/aarch64/vm/c1_LIRAssembler_aarch64.cpp @@ -1177,7 +1177,9 @@ void LIR_Assembler::emit_opBranch(LIR_OpBranch* op) { @@ -5630,7 +4908,7 @@ index 35d34a08..3b8cf4a1 100644 assert(info == NULL, "should never be used, idiv/irem and ldiv/lrem not handled by this method"); diff --git a/hotspot/src/cpu/aarch64/vm/c1_LIRGenerator_aarch64.cpp b/hotspot/src/cpu/aarch64/vm/c1_LIRGenerator_aarch64.cpp -index 4f694b17..c0520983 100644 +index 4f694b1775..c052098323 100644 --- a/hotspot/src/cpu/aarch64/vm/c1_LIRGenerator_aarch64.cpp +++ b/hotspot/src/cpu/aarch64/vm/c1_LIRGenerator_aarch64.cpp @@ -279,18 +279,29 @@ void LIRGenerator::increment_counter(LIR_Address* addr, int step) { @@ -5669,7 +4947,7 @@ index 4f694b17..c0520983 100644 diff --git a/hotspot/src/cpu/loongarch/vm/assembler_loongarch.cpp b/hotspot/src/cpu/loongarch/vm/assembler_loongarch.cpp new file mode 100644 -index 00000000..2996ef7a +index 0000000000..2996ef7aa7 --- /dev/null +++ b/hotspot/src/cpu/loongarch/vm/assembler_loongarch.cpp @@ -0,0 +1,855 @@ @@ -6530,7 +5808,7 @@ index 00000000..2996ef7a +} diff --git a/hotspot/src/cpu/loongarch/vm/assembler_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/assembler_loongarch.hpp new file mode 100644 -index 00000000..46b57cfe +index 0000000000..46b57cfe76 --- /dev/null +++ b/hotspot/src/cpu/loongarch/vm/assembler_loongarch.hpp @@ -0,0 +1,2810 @@ @@ -9346,7 +8624,7 @@ index 00000000..46b57cfe +#endif // CPU_LOONGARCH_VM_ASSEMBLER_LOONGARCH_HPP diff --git a/hotspot/src/cpu/loongarch/vm/assembler_loongarch.inline.hpp b/hotspot/src/cpu/loongarch/vm/assembler_loongarch.inline.hpp new file mode 100644 -index 00000000..601f4afe +index 0000000000..601f4afe6f --- /dev/null +++ b/hotspot/src/cpu/loongarch/vm/assembler_loongarch.inline.hpp @@ -0,0 +1,33 @@ @@ -9385,7 +8663,7 @@ index 00000000..601f4afe +#endif // CPU_LOONGARCH_VM_ASSEMBLER_LOONGARCH_INLINE_HPP diff --git a/hotspot/src/cpu/loongarch/vm/bytecodeInterpreter_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/bytecodeInterpreter_loongarch.hpp new file mode 100644 -index 00000000..32775e9b +index 0000000000..32775e9bc3 --- /dev/null +++ b/hotspot/src/cpu/loongarch/vm/bytecodeInterpreter_loongarch.hpp @@ -0,0 +1,110 @@ @@ -9501,7 +8779,7 @@ index 00000000..32775e9b +#endif // CPU_LOONGARCH_VM_BYTECODEINTERPRETER_LOONGARCH_HPP diff --git a/hotspot/src/cpu/loongarch/vm/bytecodeInterpreter_loongarch.inline.hpp b/hotspot/src/cpu/loongarch/vm/bytecodeInterpreter_loongarch.inline.hpp new file mode 100644 -index 00000000..07df527e +index 0000000000..07df527e94 --- /dev/null +++ b/hotspot/src/cpu/loongarch/vm/bytecodeInterpreter_loongarch.inline.hpp @@ -0,0 +1,286 @@ @@ -9793,7 +9071,7 @@ index 00000000..07df527e +#endif // CPU_LOONGARCH_VM_BYTECODEINTERPRETER_LOONGARCH_INLINE_HPP diff --git a/hotspot/src/cpu/loongarch/vm/bytecodes_loongarch.cpp b/hotspot/src/cpu/loongarch/vm/bytecodes_loongarch.cpp new file mode 100644 -index 00000000..86410905 +index 0000000000..8641090584 --- /dev/null +++ b/hotspot/src/cpu/loongarch/vm/bytecodes_loongarch.cpp @@ -0,0 +1,38 @@ @@ -9837,7 +9115,7 @@ index 00000000..86410905 +} diff --git a/hotspot/src/cpu/loongarch/vm/bytecodes_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/bytecodes_loongarch.hpp new file mode 100644 -index 00000000..fbdf5319 +index 0000000000..fbdf531996 --- /dev/null +++ b/hotspot/src/cpu/loongarch/vm/bytecodes_loongarch.hpp @@ -0,0 +1,31 @@ @@ -9874,7 +9152,7 @@ index 00000000..fbdf5319 +#endif // CPU_LOONGARCH_VM_BYTECODES_LOONGARCH_HPP diff --git a/hotspot/src/cpu/loongarch/vm/bytes_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/bytes_loongarch.hpp new file mode 100644 -index 00000000..8f766a61 +index 0000000000..8f766a617e --- /dev/null +++ b/hotspot/src/cpu/loongarch/vm/bytes_loongarch.hpp @@ -0,0 +1,75 @@ @@ -9955,7 +9233,7 @@ index 00000000..8f766a61 +#endif // CPU_LOONGARCH_VM_BYTES_LOONGARCH_HPP diff --git a/hotspot/src/cpu/loongarch/vm/c1_CodeStubs_loongarch_64.cpp b/hotspot/src/cpu/loongarch/vm/c1_CodeStubs_loongarch_64.cpp new file mode 100644 -index 00000000..5166acfa +index 0000000000..5166acfa2b --- /dev/null +++ b/hotspot/src/cpu/loongarch/vm/c1_CodeStubs_loongarch_64.cpp @@ -0,0 +1,387 @@ @@ -10348,7 +9626,7 @@ index 00000000..5166acfa +#undef __ diff --git a/hotspot/src/cpu/loongarch/vm/c1_Defs_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/c1_Defs_loongarch.hpp new file mode 100644 -index 00000000..1140e444 +index 0000000000..1140e44431 --- /dev/null +++ b/hotspot/src/cpu/loongarch/vm/c1_Defs_loongarch.hpp @@ -0,0 +1,79 @@ @@ -10433,7 +9711,7 @@ index 00000000..1140e444 +#endif // CPU_LOONGARCH_C1_DEFS_LOONGARCH_HPP diff --git a/hotspot/src/cpu/loongarch/vm/c1_FpuStackSim_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/c1_FpuStackSim_loongarch.hpp new file mode 100644 -index 00000000..bd8578c7 +index 0000000000..bd8578c72a --- /dev/null +++ b/hotspot/src/cpu/loongarch/vm/c1_FpuStackSim_loongarch.hpp @@ -0,0 +1,32 @@ @@ -10471,7 +9749,7 @@ index 00000000..bd8578c7 +#endif // CPU_LOONGARCH_C1_FPUSTACKSIM_LOONGARCH_HPP diff --git a/hotspot/src/cpu/loongarch/vm/c1_FpuStackSim_loongarch_64.cpp b/hotspot/src/cpu/loongarch/vm/c1_FpuStackSim_loongarch_64.cpp new file mode 100644 -index 00000000..1a89c437 +index 0000000000..1a89c437a8 --- /dev/null +++ b/hotspot/src/cpu/loongarch/vm/c1_FpuStackSim_loongarch_64.cpp @@ -0,0 +1,31 @@ @@ -10508,7 +9786,7 @@ index 00000000..1a89c437 +#include "precompiled.hpp" diff --git a/hotspot/src/cpu/loongarch/vm/c1_FrameMap_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/c1_FrameMap_loongarch.hpp new file mode 100644 -index 00000000..4f0cf053 +index 0000000000..4f0cf05361 --- /dev/null +++ b/hotspot/src/cpu/loongarch/vm/c1_FrameMap_loongarch.hpp @@ -0,0 +1,143 @@ @@ -10657,7 +9935,7 @@ index 00000000..4f0cf053 +#endif // CPU_LOONGARCH_C1_FRAMEMAP_LOONGARCH_HPP diff --git a/hotspot/src/cpu/loongarch/vm/c1_FrameMap_loongarch_64.cpp b/hotspot/src/cpu/loongarch/vm/c1_FrameMap_loongarch_64.cpp new file mode 100644 -index 00000000..25c90bcf +index 0000000000..25c90bcf98 --- /dev/null +++ b/hotspot/src/cpu/loongarch/vm/c1_FrameMap_loongarch_64.cpp @@ -0,0 +1,362 @@ @@ -11025,7 +10303,7 @@ index 00000000..25c90bcf +} diff --git a/hotspot/src/cpu/loongarch/vm/c1_LIRAssembler_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/c1_LIRAssembler_loongarch.hpp new file mode 100644 -index 00000000..38b0daa0 +index 0000000000..38b0daa025 --- /dev/null +++ b/hotspot/src/cpu/loongarch/vm/c1_LIRAssembler_loongarch.hpp @@ -0,0 +1,83 @@ @@ -11114,7 +10392,7 @@ index 00000000..38b0daa0 +#endif // CPU_LOONGARCH_C1_LIRASSEMBLER_LOONGARCH_HPP diff --git a/hotspot/src/cpu/loongarch/vm/c1_LIRAssembler_loongarch_64.cpp b/hotspot/src/cpu/loongarch/vm/c1_LIRAssembler_loongarch_64.cpp new file mode 100644 -index 00000000..ee48326b +index 0000000000..ee48326bec --- /dev/null +++ b/hotspot/src/cpu/loongarch/vm/c1_LIRAssembler_loongarch_64.cpp @@ -0,0 +1,3377 @@ @@ -14497,13 +13775,13 @@ index 00000000..ee48326b +#undef __ diff --git a/hotspot/src/cpu/loongarch/vm/c1_LIRGenerator_loongarch_64.cpp b/hotspot/src/cpu/loongarch/vm/c1_LIRGenerator_loongarch_64.cpp new file mode 100644 -index 00000000..7cb15f68 +index 0000000000..e170bee525 --- /dev/null +++ b/hotspot/src/cpu/loongarch/vm/c1_LIRGenerator_loongarch_64.cpp -@@ -0,0 +1,1442 @@ +@@ -0,0 +1,1444 @@ +/* + * Copyright (c) 2005, 2021, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2021, Loongson Technology. All rights reserved. ++ * Copyright (c) 2021, 2024, Loongson Technology. 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 @@ -14658,8 +13936,10 @@ index 00000000..7cb15f68 + if (index->is_register()) { + // apply the shift and accumulate the displacement + if (shift > 0) { -+ LIR_Opr tmp = new_pointer_register(); -+ __ shift_left(index, shift, tmp); ++ // Use long register to avoid overflow when shifting large index values left. ++ LIR_Opr tmp = new_register(T_LONG); ++ __ convert(Bytecodes::_i2l, index, tmp); ++ __ shift_left(tmp, shift, tmp); + index = tmp; + } + if (large_disp != 0) { @@ -15945,7 +15225,7 @@ index 00000000..7cb15f68 +} diff --git a/hotspot/src/cpu/loongarch/vm/c1_LinearScan_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/c1_LinearScan_loongarch.hpp new file mode 100644 -index 00000000..f15dacaf +index 0000000000..f15dacafeb --- /dev/null +++ b/hotspot/src/cpu/loongarch/vm/c1_LinearScan_loongarch.hpp @@ -0,0 +1,70 @@ @@ -16021,7 +15301,7 @@ index 00000000..f15dacaf +#endif // CPU_LOONGARCH_C1_LINEARSCAN_LOONGARCH_HPP diff --git a/hotspot/src/cpu/loongarch/vm/c1_LinearScan_loongarch_64.cpp b/hotspot/src/cpu/loongarch/vm/c1_LinearScan_loongarch_64.cpp new file mode 100644 -index 00000000..219b2e36 +index 0000000000..219b2e3671 --- /dev/null +++ b/hotspot/src/cpu/loongarch/vm/c1_LinearScan_loongarch_64.cpp @@ -0,0 +1,33 @@ @@ -16060,7 +15340,7 @@ index 00000000..219b2e36 +} diff --git a/hotspot/src/cpu/loongarch/vm/c1_MacroAssembler_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/c1_MacroAssembler_loongarch.hpp new file mode 100644 -index 00000000..38ff4c58 +index 0000000000..38ff4c5836 --- /dev/null +++ b/hotspot/src/cpu/loongarch/vm/c1_MacroAssembler_loongarch.hpp @@ -0,0 +1,112 @@ @@ -16178,7 +15458,7 @@ index 00000000..38ff4c58 +#endif // CPU_LOONGARCH_C1_MACROASSEMBLER_LOONGARCH_HPP diff --git a/hotspot/src/cpu/loongarch/vm/c1_MacroAssembler_loongarch_64.cpp b/hotspot/src/cpu/loongarch/vm/c1_MacroAssembler_loongarch_64.cpp new file mode 100644 -index 00000000..b75126fb +index 0000000000..b75126fba4 --- /dev/null +++ b/hotspot/src/cpu/loongarch/vm/c1_MacroAssembler_loongarch_64.cpp @@ -0,0 +1,346 @@ @@ -16530,7 +15810,7 @@ index 00000000..b75126fb +#endif // ifndef PRODUCT diff --git a/hotspot/src/cpu/loongarch/vm/c1_Runtime1_loongarch_64.cpp b/hotspot/src/cpu/loongarch/vm/c1_Runtime1_loongarch_64.cpp new file mode 100644 -index 00000000..a750dca3 +index 0000000000..a750dca323 --- /dev/null +++ b/hotspot/src/cpu/loongarch/vm/c1_Runtime1_loongarch_64.cpp @@ -0,0 +1,1252 @@ @@ -17788,7 +17068,7 @@ index 00000000..a750dca3 +} diff --git a/hotspot/src/cpu/loongarch/vm/c1_globals_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/c1_globals_loongarch.hpp new file mode 100644 -index 00000000..df052a05 +index 0000000000..df052a058c --- /dev/null +++ b/hotspot/src/cpu/loongarch/vm/c1_globals_loongarch.hpp @@ -0,0 +1,69 @@ @@ -17863,7 +17143,7 @@ index 00000000..df052a05 +#endif // CPU_LOONGARCH_C1_GLOBALS_LOONGARCH_HPP diff --git a/hotspot/src/cpu/loongarch/vm/c2_globals_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/c2_globals_loongarch.hpp new file mode 100644 -index 00000000..044b0d25 +index 0000000000..044b0d2536 --- /dev/null +++ b/hotspot/src/cpu/loongarch/vm/c2_globals_loongarch.hpp @@ -0,0 +1,87 @@ @@ -17956,7 +17236,7 @@ index 00000000..044b0d25 +#endif // CPU_LOONGARCH_VM_C2_GLOBALS_LOONGARCH_HPP diff --git a/hotspot/src/cpu/loongarch/vm/c2_init_loongarch.cpp b/hotspot/src/cpu/loongarch/vm/c2_init_loongarch.cpp new file mode 100644 -index 00000000..c7bf590b +index 0000000000..c7bf590b60 --- /dev/null +++ b/hotspot/src/cpu/loongarch/vm/c2_init_loongarch.cpp @@ -0,0 +1,34 @@ @@ -17996,7 +17276,7 @@ index 00000000..c7bf590b +} diff --git a/hotspot/src/cpu/loongarch/vm/codeBuffer_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/codeBuffer_loongarch.hpp new file mode 100644 -index 00000000..652f6c10 +index 0000000000..652f6c1092 --- /dev/null +++ b/hotspot/src/cpu/loongarch/vm/codeBuffer_loongarch.hpp @@ -0,0 +1,35 @@ @@ -18037,7 +17317,7 @@ index 00000000..652f6c10 +#endif // CPU_LOONGARCH_VM_CODEBUFFER_LOONGARCH_HPP diff --git a/hotspot/src/cpu/loongarch/vm/compiledIC_loongarch.cpp b/hotspot/src/cpu/loongarch/vm/compiledIC_loongarch.cpp new file mode 100644 -index 00000000..70a47fc7 +index 0000000000..70a47fc772 --- /dev/null +++ b/hotspot/src/cpu/loongarch/vm/compiledIC_loongarch.cpp @@ -0,0 +1,167 @@ @@ -18210,7 +17490,7 @@ index 00000000..70a47fc7 +#endif // !PRODUCT diff --git a/hotspot/src/cpu/loongarch/vm/copy_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/copy_loongarch.hpp new file mode 100644 -index 00000000..cb655401 +index 0000000000..cb65540139 --- /dev/null +++ b/hotspot/src/cpu/loongarch/vm/copy_loongarch.hpp @@ -0,0 +1,90 @@ @@ -18306,7 +17586,7 @@ index 00000000..cb655401 +#endif //CPU_LOONGARCH_VM_COPY_LOONGARCH_HPP diff --git a/hotspot/src/cpu/loongarch/vm/cppInterpreterGenerator_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/cppInterpreterGenerator_loongarch.hpp new file mode 100644 -index 00000000..45d86f5b +index 0000000000..45d86f5bfe --- /dev/null +++ b/hotspot/src/cpu/loongarch/vm/cppInterpreterGenerator_loongarch.hpp @@ -0,0 +1,53 @@ @@ -18365,7 +17645,7 @@ index 00000000..45d86f5b +#endif // CPU_LOONGARCH_VM_CPPINTERPRETERGENERATOR_LOONGARCH_HPP diff --git a/hotspot/src/cpu/loongarch/vm/cppInterpreter_loongarch.cpp b/hotspot/src/cpu/loongarch/vm/cppInterpreter_loongarch.cpp new file mode 100644 -index 00000000..d6c0df3b +index 0000000000..d6c0df3b77 --- /dev/null +++ b/hotspot/src/cpu/loongarch/vm/cppInterpreter_loongarch.cpp @@ -0,0 +1,215 @@ @@ -18586,7 +17866,7 @@ index 00000000..d6c0df3b +#endif // CC_INTERP diff --git a/hotspot/src/cpu/loongarch/vm/debug_loongarch.cpp b/hotspot/src/cpu/loongarch/vm/debug_loongarch.cpp new file mode 100644 -index 00000000..50de0365 +index 0000000000..50de03653b --- /dev/null +++ b/hotspot/src/cpu/loongarch/vm/debug_loongarch.cpp @@ -0,0 +1,51 @@ @@ -18643,7 +17923,7 @@ index 00000000..50de0365 +#endif // PRODUCT diff --git a/hotspot/src/cpu/loongarch/vm/depChecker_loongarch.cpp b/hotspot/src/cpu/loongarch/vm/depChecker_loongarch.cpp new file mode 100644 -index 00000000..62478be3 +index 0000000000..62478be3dc --- /dev/null +++ b/hotspot/src/cpu/loongarch/vm/depChecker_loongarch.cpp @@ -0,0 +1,30 @@ @@ -18679,7 +17959,7 @@ index 00000000..62478be3 +// Nothing to do on LoongArch diff --git a/hotspot/src/cpu/loongarch/vm/depChecker_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/depChecker_loongarch.hpp new file mode 100644 -index 00000000..598be0ee +index 0000000000..598be0ee6f --- /dev/null +++ b/hotspot/src/cpu/loongarch/vm/depChecker_loongarch.hpp @@ -0,0 +1,31 @@ @@ -18716,7 +17996,7 @@ index 00000000..598be0ee +#endif // CPU_LOONGARCH_VM_DEPCHECKER_LOONGARCH_HPP diff --git a/hotspot/src/cpu/loongarch/vm/disassembler_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/disassembler_loongarch.hpp new file mode 100644 -index 00000000..ccd89e8d +index 0000000000..ccd89e8d6d --- /dev/null +++ b/hotspot/src/cpu/loongarch/vm/disassembler_loongarch.hpp @@ -0,0 +1,37 @@ @@ -18759,7 +18039,7 @@ index 00000000..ccd89e8d +#endif // CPU_LOONGARCH_VM_DISASSEMBLER_LOONGARCH_HPP diff --git a/hotspot/src/cpu/loongarch/vm/frame_loongarch.cpp b/hotspot/src/cpu/loongarch/vm/frame_loongarch.cpp new file mode 100644 -index 00000000..0f50a571 +index 0000000000..0f50a5715d --- /dev/null +++ b/hotspot/src/cpu/loongarch/vm/frame_loongarch.cpp @@ -0,0 +1,711 @@ @@ -19476,7 +18756,7 @@ index 00000000..0f50a571 +#endif diff --git a/hotspot/src/cpu/loongarch/vm/frame_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/frame_loongarch.hpp new file mode 100644 -index 00000000..964026e6 +index 0000000000..964026e621 --- /dev/null +++ b/hotspot/src/cpu/loongarch/vm/frame_loongarch.hpp @@ -0,0 +1,229 @@ @@ -19711,7 +18991,7 @@ index 00000000..964026e6 +#endif // CPU_LOONGARCH_VM_FRAME_LOONGARCH_HPP diff --git a/hotspot/src/cpu/loongarch/vm/frame_loongarch.inline.hpp b/hotspot/src/cpu/loongarch/vm/frame_loongarch.inline.hpp new file mode 100644 -index 00000000..3d22339a +index 0000000000..3d22339ad7 --- /dev/null +++ b/hotspot/src/cpu/loongarch/vm/frame_loongarch.inline.hpp @@ -0,0 +1,312 @@ @@ -20029,7 +19309,7 @@ index 00000000..3d22339a +#endif // CPU_LOONGARCH_VM_FRAME_LOONGARCH_INLINE_HPP diff --git a/hotspot/src/cpu/loongarch/vm/globalDefinitions_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/globalDefinitions_loongarch.hpp new file mode 100644 -index 00000000..f9f93b9e +index 0000000000..f9f93b9e65 --- /dev/null +++ b/hotspot/src/cpu/loongarch/vm/globalDefinitions_loongarch.hpp @@ -0,0 +1,41 @@ @@ -20076,7 +19356,7 @@ index 00000000..f9f93b9e +#endif // CPU_LOONGARCH_VM_GLOBALDEFINITIONS_LOONGARCH_HPP diff --git a/hotspot/src/cpu/loongarch/vm/globals_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/globals_loongarch.hpp new file mode 100644 -index 00000000..182be608 +index 0000000000..182be608a3 --- /dev/null +++ b/hotspot/src/cpu/loongarch/vm/globals_loongarch.hpp @@ -0,0 +1,103 @@ @@ -20185,7 +19465,7 @@ index 00000000..182be608 +#endif // CPU_LOONGARCH_VM_GLOBALS_LOONGARCH_HPP diff --git a/hotspot/src/cpu/loongarch/vm/icBuffer_loongarch.cpp b/hotspot/src/cpu/loongarch/vm/icBuffer_loongarch.cpp new file mode 100644 -index 00000000..8c782253 +index 0000000000..8c78225346 --- /dev/null +++ b/hotspot/src/cpu/loongarch/vm/icBuffer_loongarch.cpp @@ -0,0 +1,101 @@ @@ -20292,7 +19572,7 @@ index 00000000..8c782253 +} diff --git a/hotspot/src/cpu/loongarch/vm/icache_loongarch.cpp b/hotspot/src/cpu/loongarch/vm/icache_loongarch.cpp new file mode 100644 -index 00000000..d577e41f +index 0000000000..d577e41f59 --- /dev/null +++ b/hotspot/src/cpu/loongarch/vm/icache_loongarch.cpp @@ -0,0 +1,42 @@ @@ -20340,7 +19620,7 @@ index 00000000..d577e41f +} diff --git a/hotspot/src/cpu/loongarch/vm/icache_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/icache_loongarch.hpp new file mode 100644 -index 00000000..15e45cb3 +index 0000000000..15e45cb350 --- /dev/null +++ b/hotspot/src/cpu/loongarch/vm/icache_loongarch.hpp @@ -0,0 +1,41 @@ @@ -20387,7 +19667,7 @@ index 00000000..15e45cb3 +#endif // CPU_LOONGARCH_VM_ICACHE_LOONGARCH_HPP diff --git a/hotspot/src/cpu/loongarch/vm/interp_masm_loongarch_64.cpp b/hotspot/src/cpu/loongarch/vm/interp_masm_loongarch_64.cpp new file mode 100644 -index 00000000..8c84f215 +index 0000000000..8c84f21511 --- /dev/null +++ b/hotspot/src/cpu/loongarch/vm/interp_masm_loongarch_64.cpp @@ -0,0 +1,1960 @@ @@ -22353,7 +21633,7 @@ index 00000000..8c84f215 +} diff --git a/hotspot/src/cpu/loongarch/vm/interp_masm_loongarch_64.hpp b/hotspot/src/cpu/loongarch/vm/interp_masm_loongarch_64.hpp new file mode 100644 -index 00000000..9113da54 +index 0000000000..9113da54ff --- /dev/null +++ b/hotspot/src/cpu/loongarch/vm/interp_masm_loongarch_64.hpp @@ -0,0 +1,269 @@ @@ -22628,7 +21908,7 @@ index 00000000..9113da54 +#endif // CPU_LOONGARCH_VM_INTERP_MASM_LOONGARCH_64_HPP diff --git a/hotspot/src/cpu/loongarch/vm/interpreterGenerator_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/interpreterGenerator_loongarch.hpp new file mode 100644 -index 00000000..7f253b2d +index 0000000000..7f253b2d51 --- /dev/null +++ b/hotspot/src/cpu/loongarch/vm/interpreterGenerator_loongarch.hpp @@ -0,0 +1,51 @@ @@ -22685,7 +21965,7 @@ index 00000000..7f253b2d +#endif // CPU_LOONGARCH_VM_INTERPRETERGENERATOR_LOONGARCH_HPP diff --git a/hotspot/src/cpu/loongarch/vm/interpreterRT_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/interpreterRT_loongarch.hpp new file mode 100644 -index 00000000..052eb997 +index 0000000000..052eb997e4 --- /dev/null +++ b/hotspot/src/cpu/loongarch/vm/interpreterRT_loongarch.hpp @@ -0,0 +1,66 @@ @@ -22757,7 +22037,7 @@ index 00000000..052eb997 +#endif // CPU_LOONGARCH_VM_INTERPRETERRT_LOONGARCH_HPP diff --git a/hotspot/src/cpu/loongarch/vm/interpreterRT_loongarch_64.cpp b/hotspot/src/cpu/loongarch/vm/interpreterRT_loongarch_64.cpp new file mode 100644 -index 00000000..0c9df4aa +index 0000000000..0c9df4aa71 --- /dev/null +++ b/hotspot/src/cpu/loongarch/vm/interpreterRT_loongarch_64.cpp @@ -0,0 +1,274 @@ @@ -23037,7 +22317,7 @@ index 00000000..0c9df4aa +IRT_END diff --git a/hotspot/src/cpu/loongarch/vm/interpreter_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/interpreter_loongarch.hpp new file mode 100644 -index 00000000..c83afbda +index 0000000000..c83afbdaf0 --- /dev/null +++ b/hotspot/src/cpu/loongarch/vm/interpreter_loongarch.hpp @@ -0,0 +1,50 @@ @@ -23093,7 +22373,7 @@ index 00000000..c83afbda +#endif // CPU_LOONGARCH_VM_INTERPRETER_LOONGARCH_HPP diff --git a/hotspot/src/cpu/loongarch/vm/interpreter_loongarch_64.cpp b/hotspot/src/cpu/loongarch/vm/interpreter_loongarch_64.cpp new file mode 100644 -index 00000000..5a4f102c +index 0000000000..5a4f102cfd --- /dev/null +++ b/hotspot/src/cpu/loongarch/vm/interpreter_loongarch_64.cpp @@ -0,0 +1,277 @@ @@ -23376,7 +22656,7 @@ index 00000000..5a4f102c +} diff --git a/hotspot/src/cpu/loongarch/vm/javaFrameAnchor_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/javaFrameAnchor_loongarch.hpp new file mode 100644 -index 00000000..de97de58 +index 0000000000..de97de5804 --- /dev/null +++ b/hotspot/src/cpu/loongarch/vm/javaFrameAnchor_loongarch.hpp @@ -0,0 +1,87 @@ @@ -23469,7 +22749,7 @@ index 00000000..de97de58 +#endif // CPU_LOONGARCH_VM_JAVAFRAMEANCHOR_LOONGARCH_HPP diff --git a/hotspot/src/cpu/loongarch/vm/jniFastGetField_loongarch_64.cpp b/hotspot/src/cpu/loongarch/vm/jniFastGetField_loongarch_64.cpp new file mode 100644 -index 00000000..5b52e54e +index 0000000000..5b52e54e08 --- /dev/null +++ b/hotspot/src/cpu/loongarch/vm/jniFastGetField_loongarch_64.cpp @@ -0,0 +1,169 @@ @@ -23644,7 +22924,7 @@ index 00000000..5b52e54e +} diff --git a/hotspot/src/cpu/loongarch/vm/jniTypes_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/jniTypes_loongarch.hpp new file mode 100644 -index 00000000..554ff216 +index 0000000000..554ff216ac --- /dev/null +++ b/hotspot/src/cpu/loongarch/vm/jniTypes_loongarch.hpp @@ -0,0 +1,144 @@ @@ -23794,7 +23074,7 @@ index 00000000..554ff216 +#endif // CPU_LOONGARCH_VM_JNITYPES_LOONGARCH_HPP diff --git a/hotspot/src/cpu/loongarch/vm/jni_loongarch.h b/hotspot/src/cpu/loongarch/vm/jni_loongarch.h new file mode 100644 -index 00000000..eb25cbc3 +index 0000000000..eb25cbc354 --- /dev/null +++ b/hotspot/src/cpu/loongarch/vm/jni_loongarch.h @@ -0,0 +1,51 @@ @@ -23851,7 +23131,7 @@ index 00000000..eb25cbc3 +#endif diff --git a/hotspot/src/cpu/loongarch/vm/loongarch.ad b/hotspot/src/cpu/loongarch/vm/loongarch.ad new file mode 100644 -index 00000000..48c44779 +index 0000000000..48c44779e7 --- /dev/null +++ b/hotspot/src/cpu/loongarch/vm/loongarch.ad @@ -0,0 +1,24 @@ @@ -23881,7 +23161,7 @@ index 00000000..48c44779 +// diff --git a/hotspot/src/cpu/loongarch/vm/loongarch_64.ad b/hotspot/src/cpu/loongarch/vm/loongarch_64.ad new file mode 100644 -index 00000000..fa4bf6e1 +index 0000000000..fa4bf6e170 --- /dev/null +++ b/hotspot/src/cpu/loongarch/vm/loongarch_64.ad @@ -0,0 +1,12861 @@ @@ -36748,7 +36028,7 @@ index 00000000..fa4bf6e1 + diff --git a/hotspot/src/cpu/loongarch/vm/macroAssembler_loongarch.cpp b/hotspot/src/cpu/loongarch/vm/macroAssembler_loongarch.cpp new file mode 100644 -index 00000000..89295343 +index 0000000000..89295343ce --- /dev/null +++ b/hotspot/src/cpu/loongarch/vm/macroAssembler_loongarch.cpp @@ -0,0 +1,3895 @@ @@ -40649,7 +39929,7 @@ index 00000000..89295343 +} diff --git a/hotspot/src/cpu/loongarch/vm/macroAssembler_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/macroAssembler_loongarch.hpp new file mode 100644 -index 00000000..8b123c29 +index 0000000000..8b123c2906 --- /dev/null +++ b/hotspot/src/cpu/loongarch/vm/macroAssembler_loongarch.hpp @@ -0,0 +1,771 @@ @@ -41426,7 +40706,7 @@ index 00000000..8b123c29 +#endif // CPU_LOONGARCH_VM_MACROASSEMBLER_LOONGARCH_HPP diff --git a/hotspot/src/cpu/loongarch/vm/macroAssembler_loongarch.inline.hpp b/hotspot/src/cpu/loongarch/vm/macroAssembler_loongarch.inline.hpp new file mode 100644 -index 00000000..0b265a4d +index 0000000000..0b265a4def --- /dev/null +++ b/hotspot/src/cpu/loongarch/vm/macroAssembler_loongarch.inline.hpp @@ -0,0 +1,34 @@ @@ -41466,7 +40746,7 @@ index 00000000..0b265a4d +#endif // CPU_LOONGARCH_VM_MACROASSEMBLER_LOONGARCH_INLINE_HPP diff --git a/hotspot/src/cpu/loongarch/vm/metaspaceShared_loongarch_64.cpp b/hotspot/src/cpu/loongarch/vm/metaspaceShared_loongarch_64.cpp new file mode 100644 -index 00000000..b36216c5 +index 0000000000..b36216c533 --- /dev/null +++ b/hotspot/src/cpu/loongarch/vm/metaspaceShared_loongarch_64.cpp @@ -0,0 +1,120 @@ @@ -41592,7 +40872,7 @@ index 00000000..b36216c5 +} diff --git a/hotspot/src/cpu/loongarch/vm/methodHandles_loongarch.cpp b/hotspot/src/cpu/loongarch/vm/methodHandles_loongarch.cpp new file mode 100644 -index 00000000..cb31ca5a +index 0000000000..cb31ca5ad5 --- /dev/null +++ b/hotspot/src/cpu/loongarch/vm/methodHandles_loongarch.cpp @@ -0,0 +1,566 @@ @@ -42164,7 +41444,7 @@ index 00000000..cb31ca5a +#endif //PRODUCT diff --git a/hotspot/src/cpu/loongarch/vm/methodHandles_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/methodHandles_loongarch.hpp new file mode 100644 -index 00000000..f8433742 +index 0000000000..f84337424b --- /dev/null +++ b/hotspot/src/cpu/loongarch/vm/methodHandles_loongarch.hpp @@ -0,0 +1,62 @@ @@ -42232,7 +41512,7 @@ index 00000000..f8433742 + } diff --git a/hotspot/src/cpu/loongarch/vm/nativeInst_loongarch.cpp b/hotspot/src/cpu/loongarch/vm/nativeInst_loongarch.cpp new file mode 100644 -index 00000000..639ac6cd +index 0000000000..639ac6cd3e --- /dev/null +++ b/hotspot/src/cpu/loongarch/vm/nativeInst_loongarch.cpp @@ -0,0 +1,485 @@ @@ -42723,7 +42003,7 @@ index 00000000..639ac6cd +} diff --git a/hotspot/src/cpu/loongarch/vm/nativeInst_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/nativeInst_loongarch.hpp new file mode 100644 -index 00000000..49323992 +index 0000000000..493239923b --- /dev/null +++ b/hotspot/src/cpu/loongarch/vm/nativeInst_loongarch.hpp @@ -0,0 +1,513 @@ @@ -43242,7 +42522,7 @@ index 00000000..49323992 +#endif // CPU_LOONGARCH_VM_NATIVEINST_LOONGARCH_HPP diff --git a/hotspot/src/cpu/loongarch/vm/registerMap_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/registerMap_loongarch.hpp new file mode 100644 -index 00000000..5ff7555d +index 0000000000..5ff7555d2f --- /dev/null +++ b/hotspot/src/cpu/loongarch/vm/registerMap_loongarch.hpp @@ -0,0 +1,45 @@ @@ -43293,7 +42573,7 @@ index 00000000..5ff7555d +#endif // CPU_LOONGARCH_VM_REGISTERMAP_LOONGARCH_HPP diff --git a/hotspot/src/cpu/loongarch/vm/register_definitions_loongarch.cpp b/hotspot/src/cpu/loongarch/vm/register_definitions_loongarch.cpp new file mode 100644 -index 00000000..c6424c32 +index 0000000000..c6424c321f --- /dev/null +++ b/hotspot/src/cpu/loongarch/vm/register_definitions_loongarch.cpp @@ -0,0 +1,103 @@ @@ -43402,7 +42682,7 @@ index 00000000..c6424c32 +REGISTER_DEFINITION(FloatRegister, f31); diff --git a/hotspot/src/cpu/loongarch/vm/register_loongarch.cpp b/hotspot/src/cpu/loongarch/vm/register_loongarch.cpp new file mode 100644 -index 00000000..3104cd1c +index 0000000000..3104cd1cc5 --- /dev/null +++ b/hotspot/src/cpu/loongarch/vm/register_loongarch.cpp @@ -0,0 +1,59 @@ @@ -43467,7 +42747,7 @@ index 00000000..3104cd1c +} diff --git a/hotspot/src/cpu/loongarch/vm/register_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/register_loongarch.hpp new file mode 100644 -index 00000000..37b39f91 +index 0000000000..37b39f9129 --- /dev/null +++ b/hotspot/src/cpu/loongarch/vm/register_loongarch.hpp @@ -0,0 +1,436 @@ @@ -43909,7 +43189,7 @@ index 00000000..37b39f91 +#endif //CPU_LOONGARCH_VM_REGISTER_LOONGARCH_HPP diff --git a/hotspot/src/cpu/loongarch/vm/relocInfo_loongarch.cpp b/hotspot/src/cpu/loongarch/vm/relocInfo_loongarch.cpp new file mode 100644 -index 00000000..bf4498dc +index 0000000000..bf4498dc62 --- /dev/null +++ b/hotspot/src/cpu/loongarch/vm/relocInfo_loongarch.cpp @@ -0,0 +1,130 @@ @@ -44045,7 +43325,7 @@ index 00000000..bf4498dc +} diff --git a/hotspot/src/cpu/loongarch/vm/relocInfo_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/relocInfo_loongarch.hpp new file mode 100644 -index 00000000..211242f3 +index 0000000000..211242f3fb --- /dev/null +++ b/hotspot/src/cpu/loongarch/vm/relocInfo_loongarch.hpp @@ -0,0 +1,40 @@ @@ -44091,7 +43371,7 @@ index 00000000..211242f3 +#endif // CPU_LOONGARCH_VM_RELOCINFO_LOONGARCH_HPP diff --git a/hotspot/src/cpu/loongarch/vm/runtime_loongarch_64.cpp b/hotspot/src/cpu/loongarch/vm/runtime_loongarch_64.cpp new file mode 100644 -index 00000000..e6ee65f3 +index 0000000000..e6ee65f367 --- /dev/null +++ b/hotspot/src/cpu/loongarch/vm/runtime_loongarch_64.cpp @@ -0,0 +1,199 @@ @@ -44296,7 +43576,7 @@ index 00000000..e6ee65f3 +} diff --git a/hotspot/src/cpu/loongarch/vm/sharedRuntime_loongarch_64.cpp b/hotspot/src/cpu/loongarch/vm/sharedRuntime_loongarch_64.cpp new file mode 100644 -index 00000000..36786b53 +index 0000000000..36786b53bd --- /dev/null +++ b/hotspot/src/cpu/loongarch/vm/sharedRuntime_loongarch_64.cpp @@ -0,0 +1,3453 @@ @@ -47755,7 +47035,7 @@ index 00000000..36786b53 +extern "C" int SpinPause() {return 0;} diff --git a/hotspot/src/cpu/loongarch/vm/stubGenerator_loongarch_64.cpp b/hotspot/src/cpu/loongarch/vm/stubGenerator_loongarch_64.cpp new file mode 100644 -index 00000000..361b7751 +index 0000000000..361b775144 --- /dev/null +++ b/hotspot/src/cpu/loongarch/vm/stubGenerator_loongarch_64.cpp @@ -0,0 +1,3445 @@ @@ -51206,7 +50486,7 @@ index 00000000..361b7751 +} diff --git a/hotspot/src/cpu/loongarch/vm/stubRoutines_loongarch_64.cpp b/hotspot/src/cpu/loongarch/vm/stubRoutines_loongarch_64.cpp new file mode 100644 -index 00000000..f0f3d55a +index 0000000000..f0f3d55a4e --- /dev/null +++ b/hotspot/src/cpu/loongarch/vm/stubRoutines_loongarch_64.cpp @@ -0,0 +1,264 @@ @@ -51476,7 +50756,7 @@ index 00000000..f0f3d55a +}; diff --git a/hotspot/src/cpu/loongarch/vm/stubRoutines_loongarch_64.hpp b/hotspot/src/cpu/loongarch/vm/stubRoutines_loongarch_64.hpp new file mode 100644 -index 00000000..d020a527 +index 0000000000..d020a527e4 --- /dev/null +++ b/hotspot/src/cpu/loongarch/vm/stubRoutines_loongarch_64.hpp @@ -0,0 +1,60 @@ @@ -51542,7 +50822,7 @@ index 00000000..d020a527 +#endif // CPU_LOONGARCH_VM_STUBROUTINES_LOONGARCH_64_HPP diff --git a/hotspot/src/cpu/loongarch/vm/templateInterpreterGenerator_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/templateInterpreterGenerator_loongarch.hpp new file mode 100644 -index 00000000..213e69b0 +index 0000000000..213e69b0b2 --- /dev/null +++ b/hotspot/src/cpu/loongarch/vm/templateInterpreterGenerator_loongarch.hpp @@ -0,0 +1,35 @@ @@ -51583,7 +50863,7 @@ index 00000000..213e69b0 +#endif // CPU_LOONGARCH_VM_TEMPLATEINTERPRETERGENERATOR_LOONGARCH_HPP diff --git a/hotspot/src/cpu/loongarch/vm/templateInterpreter_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/templateInterpreter_loongarch.hpp new file mode 100644 -index 00000000..39e3ad7b +index 0000000000..39e3ad7bb5 --- /dev/null +++ b/hotspot/src/cpu/loongarch/vm/templateInterpreter_loongarch.hpp @@ -0,0 +1,41 @@ @@ -51630,7 +50910,7 @@ index 00000000..39e3ad7b +#endif // CPU_LOONGARCH_VM_TEMPLATEINTERPRETER_LOONGARCH_HPP diff --git a/hotspot/src/cpu/loongarch/vm/templateInterpreter_loongarch_64.cpp b/hotspot/src/cpu/loongarch/vm/templateInterpreter_loongarch_64.cpp new file mode 100644 -index 00000000..b25086a3 +index 0000000000..b25086a399 --- /dev/null +++ b/hotspot/src/cpu/loongarch/vm/templateInterpreter_loongarch_64.cpp @@ -0,0 +1,2335 @@ @@ -53971,7 +53251,7 @@ index 00000000..b25086a3 +#endif // ! CC_INTERP diff --git a/hotspot/src/cpu/loongarch/vm/templateTable_loongarch_64.cpp b/hotspot/src/cpu/loongarch/vm/templateTable_loongarch_64.cpp new file mode 100644 -index 00000000..228217f0 +index 0000000000..228217f001 --- /dev/null +++ b/hotspot/src/cpu/loongarch/vm/templateTable_loongarch_64.cpp @@ -0,0 +1,4024 @@ @@ -58001,7 +57281,7 @@ index 00000000..228217f0 +#endif // !CC_INTERP diff --git a/hotspot/src/cpu/loongarch/vm/templateTable_loongarch_64.hpp b/hotspot/src/cpu/loongarch/vm/templateTable_loongarch_64.hpp new file mode 100644 -index 00000000..c48d76e0 +index 0000000000..c48d76e0a2 --- /dev/null +++ b/hotspot/src/cpu/loongarch/vm/templateTable_loongarch_64.hpp @@ -0,0 +1,44 @@ @@ -58051,7 +57331,7 @@ index 00000000..c48d76e0 +#endif // CPU_LOONGARCH_VM_TEMPLATETABLE_LOONGARCH_64_HPP diff --git a/hotspot/src/cpu/loongarch/vm/vmStructs_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/vmStructs_loongarch.hpp new file mode 100644 -index 00000000..7c3ce680 +index 0000000000..7c3ce68010 --- /dev/null +++ b/hotspot/src/cpu/loongarch/vm/vmStructs_loongarch.hpp @@ -0,0 +1,68 @@ @@ -58125,7 +57405,7 @@ index 00000000..7c3ce680 +#endif // CPU_LOONGARCH_VM_VMSTRUCTS_LOONGARCH_HPP diff --git a/hotspot/src/cpu/loongarch/vm/vm_version_ext_loongarch.cpp b/hotspot/src/cpu/loongarch/vm/vm_version_ext_loongarch.cpp new file mode 100644 -index 00000000..c71f64e1 +index 0000000000..c71f64e132 --- /dev/null +++ b/hotspot/src/cpu/loongarch/vm/vm_version_ext_loongarch.cpp @@ -0,0 +1,84 @@ @@ -58215,7 +57495,7 @@ index 00000000..c71f64e1 +} diff --git a/hotspot/src/cpu/loongarch/vm/vm_version_ext_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/vm_version_ext_loongarch.hpp new file mode 100644 -index 00000000..682dd9c7 +index 0000000000..682dd9c78f --- /dev/null +++ b/hotspot/src/cpu/loongarch/vm/vm_version_ext_loongarch.hpp @@ -0,0 +1,54 @@ @@ -58275,7 +57555,7 @@ index 00000000..682dd9c7 +#endif // CPU_LOONGARCH_VM_VM_VERSION_EXT_LOONGARCH_HPP diff --git a/hotspot/src/cpu/loongarch/vm/vm_version_loongarch.cpp b/hotspot/src/cpu/loongarch/vm/vm_version_loongarch.cpp new file mode 100644 -index 00000000..81ea3b23 +index 0000000000..81ea3b230c --- /dev/null +++ b/hotspot/src/cpu/loongarch/vm/vm_version_loongarch.cpp @@ -0,0 +1,443 @@ @@ -58724,7 +58004,7 @@ index 00000000..81ea3b23 +} diff --git a/hotspot/src/cpu/loongarch/vm/vm_version_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/vm_version_loongarch.hpp new file mode 100644 -index 00000000..3b5f907a +index 0000000000..3b5f907a79 --- /dev/null +++ b/hotspot/src/cpu/loongarch/vm/vm_version_loongarch.hpp @@ -0,0 +1,299 @@ @@ -59029,7 +58309,7 @@ index 00000000..3b5f907a +#endif // CPU_LOONGARCH_VM_VM_VERSION_LOONGARCH_HPP diff --git a/hotspot/src/cpu/loongarch/vm/vmreg_loongarch.cpp b/hotspot/src/cpu/loongarch/vm/vmreg_loongarch.cpp new file mode 100644 -index 00000000..52bccfc1 +index 0000000000..52bccfc183 --- /dev/null +++ b/hotspot/src/cpu/loongarch/vm/vmreg_loongarch.cpp @@ -0,0 +1,51 @@ @@ -59086,7 +58366,7 @@ index 00000000..52bccfc1 +} diff --git a/hotspot/src/cpu/loongarch/vm/vmreg_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/vmreg_loongarch.hpp new file mode 100644 -index 00000000..80a1fc57 +index 0000000000..80a1fc57de --- /dev/null +++ b/hotspot/src/cpu/loongarch/vm/vmreg_loongarch.hpp @@ -0,0 +1,35 @@ @@ -59127,7 +58407,7 @@ index 00000000..80a1fc57 +#endif // CPU_LOONGARCH_VM_VMREG_LOONGARCH_HPP diff --git a/hotspot/src/cpu/loongarch/vm/vmreg_loongarch.inline.hpp b/hotspot/src/cpu/loongarch/vm/vmreg_loongarch.inline.hpp new file mode 100644 -index 00000000..f822d4c3 +index 0000000000..f822d4c355 --- /dev/null +++ b/hotspot/src/cpu/loongarch/vm/vmreg_loongarch.inline.hpp @@ -0,0 +1,66 @@ @@ -59199,7 +58479,7 @@ index 00000000..f822d4c3 +#endif // CPU_LOONGARCH_VM_VMREG_LOONGARCH_INLINE_HPP diff --git a/hotspot/src/cpu/loongarch/vm/vtableStubs_loongarch_64.cpp b/hotspot/src/cpu/loongarch/vm/vtableStubs_loongarch_64.cpp new file mode 100644 -index 00000000..df0d176b +index 0000000000..df0d176b8b --- /dev/null +++ b/hotspot/src/cpu/loongarch/vm/vtableStubs_loongarch_64.cpp @@ -0,0 +1,300 @@ @@ -59505,7 +58785,7 @@ index 00000000..df0d176b +} diff --git a/hotspot/src/cpu/mips/vm/assembler_mips.cpp b/hotspot/src/cpu/mips/vm/assembler_mips.cpp new file mode 100644 -index 00000000..6c720972 +index 0000000000..6c720972ad --- /dev/null +++ b/hotspot/src/cpu/mips/vm/assembler_mips.cpp @@ -0,0 +1,774 @@ @@ -60285,7 +59565,7 @@ index 00000000..6c720972 +} diff --git a/hotspot/src/cpu/mips/vm/assembler_mips.hpp b/hotspot/src/cpu/mips/vm/assembler_mips.hpp new file mode 100644 -index 00000000..e91b9db2 +index 0000000000..e91b9db222 --- /dev/null +++ b/hotspot/src/cpu/mips/vm/assembler_mips.hpp @@ -0,0 +1,1789 @@ @@ -62080,7 +61360,7 @@ index 00000000..e91b9db2 +#endif // CPU_MIPS_VM_ASSEMBLER_MIPS_HPP diff --git a/hotspot/src/cpu/mips/vm/assembler_mips.inline.hpp b/hotspot/src/cpu/mips/vm/assembler_mips.inline.hpp new file mode 100644 -index 00000000..39aeb550 +index 0000000000..39aeb5509a --- /dev/null +++ b/hotspot/src/cpu/mips/vm/assembler_mips.inline.hpp @@ -0,0 +1,33 @@ @@ -62119,7 +61399,7 @@ index 00000000..39aeb550 +#endif // CPU_MIPS_VM_ASSEMBLER_MIPS_INLINE_HPP diff --git a/hotspot/src/cpu/mips/vm/bytecodeInterpreter_mips.cpp b/hotspot/src/cpu/mips/vm/bytecodeInterpreter_mips.cpp new file mode 100644 -index 00000000..a4a1b28c +index 0000000000..a4a1b28c2d --- /dev/null +++ b/hotspot/src/cpu/mips/vm/bytecodeInterpreter_mips.cpp @@ -0,0 +1,53 @@ @@ -62178,7 +61458,7 @@ index 00000000..a4a1b28c +#endif // CC_INTERP (all) diff --git a/hotspot/src/cpu/mips/vm/bytecodeInterpreter_mips.hpp b/hotspot/src/cpu/mips/vm/bytecodeInterpreter_mips.hpp new file mode 100644 -index 00000000..aac8b7a2 +index 0000000000..aac8b7a2b7 --- /dev/null +++ b/hotspot/src/cpu/mips/vm/bytecodeInterpreter_mips.hpp @@ -0,0 +1,110 @@ @@ -62294,7 +61574,7 @@ index 00000000..aac8b7a2 +#endif // CPU_MIPS_VM_BYTECODEINTERPRETER_MIPS_HPP diff --git a/hotspot/src/cpu/mips/vm/bytecodeInterpreter_mips.inline.hpp b/hotspot/src/cpu/mips/vm/bytecodeInterpreter_mips.inline.hpp new file mode 100644 -index 00000000..8ce77ab9 +index 0000000000..8ce77ab92f --- /dev/null +++ b/hotspot/src/cpu/mips/vm/bytecodeInterpreter_mips.inline.hpp @@ -0,0 +1,286 @@ @@ -62586,7 +61866,7 @@ index 00000000..8ce77ab9 +#endif // CPU_MIPS_VM_BYTECODEINTERPRETER_MIPS_INLINE_HPP diff --git a/hotspot/src/cpu/mips/vm/bytecodes_mips.cpp b/hotspot/src/cpu/mips/vm/bytecodes_mips.cpp new file mode 100644 -index 00000000..61efd1f5 +index 0000000000..61efd1f561 --- /dev/null +++ b/hotspot/src/cpu/mips/vm/bytecodes_mips.cpp @@ -0,0 +1,38 @@ @@ -62630,7 +61910,7 @@ index 00000000..61efd1f5 +} diff --git a/hotspot/src/cpu/mips/vm/bytecodes_mips.hpp b/hotspot/src/cpu/mips/vm/bytecodes_mips.hpp new file mode 100644 -index 00000000..25a9562a +index 0000000000..25a9562acd --- /dev/null +++ b/hotspot/src/cpu/mips/vm/bytecodes_mips.hpp @@ -0,0 +1,31 @@ @@ -62667,7 +61947,7 @@ index 00000000..25a9562a +#endif // CPU_MIPS_VM_BYTECODES_MIPS_HPP diff --git a/hotspot/src/cpu/mips/vm/bytes_mips.hpp b/hotspot/src/cpu/mips/vm/bytes_mips.hpp new file mode 100644 -index 00000000..515ffad4 +index 0000000000..515ffad4b0 --- /dev/null +++ b/hotspot/src/cpu/mips/vm/bytes_mips.hpp @@ -0,0 +1,193 @@ @@ -62866,7 +62146,7 @@ index 00000000..515ffad4 +#endif // CPU_MIPS_VM_BYTES_MIPS_HPP diff --git a/hotspot/src/cpu/mips/vm/c2_globals_mips.hpp b/hotspot/src/cpu/mips/vm/c2_globals_mips.hpp new file mode 100644 -index 00000000..f254e07a +index 0000000000..f254e07abd --- /dev/null +++ b/hotspot/src/cpu/mips/vm/c2_globals_mips.hpp @@ -0,0 +1,100 @@ @@ -62972,7 +62252,7 @@ index 00000000..f254e07a +#endif // CPU_MIPS_VM_C2_GLOBALS_MIPS_HPP diff --git a/hotspot/src/cpu/mips/vm/c2_init_mips.cpp b/hotspot/src/cpu/mips/vm/c2_init_mips.cpp new file mode 100644 -index 00000000..e6d5815f +index 0000000000..e6d5815f42 --- /dev/null +++ b/hotspot/src/cpu/mips/vm/c2_init_mips.cpp @@ -0,0 +1,34 @@ @@ -63012,7 +62292,7 @@ index 00000000..e6d5815f +} diff --git a/hotspot/src/cpu/mips/vm/codeBuffer_mips.hpp b/hotspot/src/cpu/mips/vm/codeBuffer_mips.hpp new file mode 100644 -index 00000000..1836b7a9 +index 0000000000..1836b7a921 --- /dev/null +++ b/hotspot/src/cpu/mips/vm/codeBuffer_mips.hpp @@ -0,0 +1,35 @@ @@ -63053,7 +62333,7 @@ index 00000000..1836b7a9 +#endif // CPU_MIPS_VM_CODEBUFFER_MIPS_HPP diff --git a/hotspot/src/cpu/mips/vm/compiledIC_mips.cpp b/hotspot/src/cpu/mips/vm/compiledIC_mips.cpp new file mode 100644 -index 00000000..8ffaaaf8 +index 0000000000..8ffaaaf841 --- /dev/null +++ b/hotspot/src/cpu/mips/vm/compiledIC_mips.cpp @@ -0,0 +1,173 @@ @@ -63232,7 +62512,7 @@ index 00000000..8ffaaaf8 +#endif // !PRODUCT diff --git a/hotspot/src/cpu/mips/vm/copy_mips.hpp b/hotspot/src/cpu/mips/vm/copy_mips.hpp new file mode 100644 -index 00000000..4442e1dc +index 0000000000..4442e1dc71 --- /dev/null +++ b/hotspot/src/cpu/mips/vm/copy_mips.hpp @@ -0,0 +1,90 @@ @@ -63328,7 +62608,7 @@ index 00000000..4442e1dc +#endif //CPU_MIPS_VM_COPY_MIPS_HPP diff --git a/hotspot/src/cpu/mips/vm/cppInterpreterGenerator_mips.hpp b/hotspot/src/cpu/mips/vm/cppInterpreterGenerator_mips.hpp new file mode 100644 -index 00000000..37bd03b0 +index 0000000000..37bd03b00b --- /dev/null +++ b/hotspot/src/cpu/mips/vm/cppInterpreterGenerator_mips.hpp @@ -0,0 +1,53 @@ @@ -63387,7 +62667,7 @@ index 00000000..37bd03b0 +#endif // CPU_MIPS_VM_CPPINTERPRETERGENERATOR_MIPS_HPP diff --git a/hotspot/src/cpu/mips/vm/cppInterpreter_mips.cpp b/hotspot/src/cpu/mips/vm/cppInterpreter_mips.cpp new file mode 100644 -index 00000000..1f8d75d5 +index 0000000000..1f8d75d593 --- /dev/null +++ b/hotspot/src/cpu/mips/vm/cppInterpreter_mips.cpp @@ -0,0 +1,215 @@ @@ -63608,7 +62888,7 @@ index 00000000..1f8d75d5 +#endif // CC_INTERP diff --git a/hotspot/src/cpu/mips/vm/cppInterpreter_mips.hpp b/hotspot/src/cpu/mips/vm/cppInterpreter_mips.hpp new file mode 100644 -index 00000000..49c47330 +index 0000000000..49c4733049 --- /dev/null +++ b/hotspot/src/cpu/mips/vm/cppInterpreter_mips.hpp @@ -0,0 +1,40 @@ @@ -63654,7 +62934,7 @@ index 00000000..49c47330 +#endif // CPU_MIPS_VM_CPPINTERPRETER_MIPS_HPP diff --git a/hotspot/src/cpu/mips/vm/debug_mips.cpp b/hotspot/src/cpu/mips/vm/debug_mips.cpp new file mode 100644 -index 00000000..50de0365 +index 0000000000..50de03653b --- /dev/null +++ b/hotspot/src/cpu/mips/vm/debug_mips.cpp @@ -0,0 +1,51 @@ @@ -63711,7 +62991,7 @@ index 00000000..50de0365 +#endif // PRODUCT diff --git a/hotspot/src/cpu/mips/vm/depChecker_mips.cpp b/hotspot/src/cpu/mips/vm/depChecker_mips.cpp new file mode 100644 -index 00000000..756ccb68 +index 0000000000..756ccb68f9 --- /dev/null +++ b/hotspot/src/cpu/mips/vm/depChecker_mips.cpp @@ -0,0 +1,30 @@ @@ -63747,7 +63027,7 @@ index 00000000..756ccb68 +// Nothing to do on mips diff --git a/hotspot/src/cpu/mips/vm/depChecker_mips.hpp b/hotspot/src/cpu/mips/vm/depChecker_mips.hpp new file mode 100644 -index 00000000..11e52b4e +index 0000000000..11e52b4e8f --- /dev/null +++ b/hotspot/src/cpu/mips/vm/depChecker_mips.hpp @@ -0,0 +1,31 @@ @@ -63784,7 +63064,7 @@ index 00000000..11e52b4e +#endif // CPU_MIPS_VM_DEPCHECKER_MIPS_HPP diff --git a/hotspot/src/cpu/mips/vm/disassembler_mips.hpp b/hotspot/src/cpu/mips/vm/disassembler_mips.hpp new file mode 100644 -index 00000000..c5f3a888 +index 0000000000..c5f3a8888d --- /dev/null +++ b/hotspot/src/cpu/mips/vm/disassembler_mips.hpp @@ -0,0 +1,37 @@ @@ -63827,7 +63107,7 @@ index 00000000..c5f3a888 +#endif // CPU_MIPS_VM_DISASSEMBLER_MIPS_HPP diff --git a/hotspot/src/cpu/mips/vm/frame_mips.cpp b/hotspot/src/cpu/mips/vm/frame_mips.cpp new file mode 100644 -index 00000000..1c928976 +index 0000000000..1c928976fc --- /dev/null +++ b/hotspot/src/cpu/mips/vm/frame_mips.cpp @@ -0,0 +1,711 @@ @@ -64544,7 +63824,7 @@ index 00000000..1c928976 +#endif diff --git a/hotspot/src/cpu/mips/vm/frame_mips.hpp b/hotspot/src/cpu/mips/vm/frame_mips.hpp new file mode 100644 -index 00000000..9e684a8d +index 0000000000..9e684a8dc3 --- /dev/null +++ b/hotspot/src/cpu/mips/vm/frame_mips.hpp @@ -0,0 +1,229 @@ @@ -64779,7 +64059,7 @@ index 00000000..9e684a8d +#endif // CPU_MIPS_VM_FRAME_MIPS_HPP diff --git a/hotspot/src/cpu/mips/vm/frame_mips.inline.hpp b/hotspot/src/cpu/mips/vm/frame_mips.inline.hpp new file mode 100644 -index 00000000..60e56ac7 +index 0000000000..60e56ac7ab --- /dev/null +++ b/hotspot/src/cpu/mips/vm/frame_mips.inline.hpp @@ -0,0 +1,312 @@ @@ -65097,7 +64377,7 @@ index 00000000..60e56ac7 +#endif // CPU_MIPS_VM_FRAME_MIPS_INLINE_HPP diff --git a/hotspot/src/cpu/mips/vm/globalDefinitions_mips.hpp b/hotspot/src/cpu/mips/vm/globalDefinitions_mips.hpp new file mode 100644 -index 00000000..bd00a8d4 +index 0000000000..bd00a8d473 --- /dev/null +++ b/hotspot/src/cpu/mips/vm/globalDefinitions_mips.hpp @@ -0,0 +1,41 @@ @@ -65144,7 +64424,7 @@ index 00000000..bd00a8d4 +#endif // CPU_MIPS_VM_GLOBALDEFINITIONS_MIPS_HPP diff --git a/hotspot/src/cpu/mips/vm/globals_mips.hpp b/hotspot/src/cpu/mips/vm/globals_mips.hpp new file mode 100644 -index 00000000..988bc351 +index 0000000000..988bc35137 --- /dev/null +++ b/hotspot/src/cpu/mips/vm/globals_mips.hpp @@ -0,0 +1,124 @@ @@ -65274,7 +64554,7 @@ index 00000000..988bc351 +#endif // CPU_MIPS_VM_GLOBALS_MIPS_HPP diff --git a/hotspot/src/cpu/mips/vm/icBuffer_mips.cpp b/hotspot/src/cpu/mips/vm/icBuffer_mips.cpp new file mode 100644 -index 00000000..96ea3453 +index 0000000000..96ea345360 --- /dev/null +++ b/hotspot/src/cpu/mips/vm/icBuffer_mips.cpp @@ -0,0 +1,97 @@ @@ -65377,7 +64657,7 @@ index 00000000..96ea3453 +} diff --git a/hotspot/src/cpu/mips/vm/icache_mips.cpp b/hotspot/src/cpu/mips/vm/icache_mips.cpp new file mode 100644 -index 00000000..848964b6 +index 0000000000..848964b63f --- /dev/null +++ b/hotspot/src/cpu/mips/vm/icache_mips.cpp @@ -0,0 +1,41 @@ @@ -65424,7 +64704,7 @@ index 00000000..848964b6 +} diff --git a/hotspot/src/cpu/mips/vm/icache_mips.hpp b/hotspot/src/cpu/mips/vm/icache_mips.hpp new file mode 100644 -index 00000000..78ee11cc +index 0000000000..78ee11cc73 --- /dev/null +++ b/hotspot/src/cpu/mips/vm/icache_mips.hpp @@ -0,0 +1,41 @@ @@ -65471,7 +64751,7 @@ index 00000000..78ee11cc +#endif // CPU_MIPS_VM_ICACHE_MIPS_HPP diff --git a/hotspot/src/cpu/mips/vm/interp_masm_mips_64.cpp b/hotspot/src/cpu/mips/vm/interp_masm_mips_64.cpp new file mode 100644 -index 00000000..ed2d931e +index 0000000000..ed2d931e94 --- /dev/null +++ b/hotspot/src/cpu/mips/vm/interp_masm_mips_64.cpp @@ -0,0 +1,2084 @@ @@ -67561,7 +66841,7 @@ index 00000000..ed2d931e +} diff --git a/hotspot/src/cpu/mips/vm/interp_masm_mips_64.hpp b/hotspot/src/cpu/mips/vm/interp_masm_mips_64.hpp new file mode 100644 -index 00000000..a2ebdec3 +index 0000000000..a2ebdec3ad --- /dev/null +++ b/hotspot/src/cpu/mips/vm/interp_masm_mips_64.hpp @@ -0,0 +1,269 @@ @@ -67836,7 +67116,7 @@ index 00000000..a2ebdec3 +#endif // CPU_MIPS_VM_INTERP_MASM_MIPS_64_HPP diff --git a/hotspot/src/cpu/mips/vm/interpreterGenerator_mips.hpp b/hotspot/src/cpu/mips/vm/interpreterGenerator_mips.hpp new file mode 100644 -index 00000000..26fced49 +index 0000000000..26fced492a --- /dev/null +++ b/hotspot/src/cpu/mips/vm/interpreterGenerator_mips.hpp @@ -0,0 +1,49 @@ @@ -67891,7 +67171,7 @@ index 00000000..26fced49 +#endif // CPU_MIPS_VM_INTERPRETERGENERATOR_MIPS_HPP diff --git a/hotspot/src/cpu/mips/vm/interpreterRT_mips.hpp b/hotspot/src/cpu/mips/vm/interpreterRT_mips.hpp new file mode 100644 -index 00000000..8dec2007 +index 0000000000..8dec2007c6 --- /dev/null +++ b/hotspot/src/cpu/mips/vm/interpreterRT_mips.hpp @@ -0,0 +1,61 @@ @@ -67958,7 +67238,7 @@ index 00000000..8dec2007 +#endif // CPU_MIPS_VM_INTERPRETERRT_MIPS_HPP diff --git a/hotspot/src/cpu/mips/vm/interpreterRT_mips_64.cpp b/hotspot/src/cpu/mips/vm/interpreterRT_mips_64.cpp new file mode 100644 -index 00000000..14b7e39a +index 0000000000..14b7e39af7 --- /dev/null +++ b/hotspot/src/cpu/mips/vm/interpreterRT_mips_64.cpp @@ -0,0 +1,259 @@ @@ -68223,7 +67503,7 @@ index 00000000..14b7e39a +IRT_END diff --git a/hotspot/src/cpu/mips/vm/interpreter_mips.hpp b/hotspot/src/cpu/mips/vm/interpreter_mips.hpp new file mode 100644 -index 00000000..9a21d704 +index 0000000000..9a21d704fa --- /dev/null +++ b/hotspot/src/cpu/mips/vm/interpreter_mips.hpp @@ -0,0 +1,50 @@ @@ -68279,7 +67559,7 @@ index 00000000..9a21d704 +#endif // CPU_MIPS_VM_INTERPRETER_MIPS_HPP diff --git a/hotspot/src/cpu/mips/vm/interpreter_mips_64.cpp b/hotspot/src/cpu/mips/vm/interpreter_mips_64.cpp new file mode 100644 -index 00000000..014c8127 +index 0000000000..014c812713 --- /dev/null +++ b/hotspot/src/cpu/mips/vm/interpreter_mips_64.cpp @@ -0,0 +1,286 @@ @@ -68571,7 +67851,7 @@ index 00000000..014c8127 +} diff --git a/hotspot/src/cpu/mips/vm/javaFrameAnchor_mips.hpp b/hotspot/src/cpu/mips/vm/javaFrameAnchor_mips.hpp new file mode 100644 -index 00000000..dccdf6a0 +index 0000000000..dccdf6a019 --- /dev/null +++ b/hotspot/src/cpu/mips/vm/javaFrameAnchor_mips.hpp @@ -0,0 +1,87 @@ @@ -68664,7 +67944,7 @@ index 00000000..dccdf6a0 +#endif // CPU_MIPS_VM_JAVAFRAMEANCHOR_MIPS_HPP diff --git a/hotspot/src/cpu/mips/vm/jniFastGetField_mips_64.cpp b/hotspot/src/cpu/mips/vm/jniFastGetField_mips_64.cpp new file mode 100644 -index 00000000..0f7dd942 +index 0000000000..0f7dd9424a --- /dev/null +++ b/hotspot/src/cpu/mips/vm/jniFastGetField_mips_64.cpp @@ -0,0 +1,172 @@ @@ -68842,7 +68122,7 @@ index 00000000..0f7dd942 +} diff --git a/hotspot/src/cpu/mips/vm/jniTypes_mips.hpp b/hotspot/src/cpu/mips/vm/jniTypes_mips.hpp new file mode 100644 -index 00000000..dfcd47b4 +index 0000000000..dfcd47b478 --- /dev/null +++ b/hotspot/src/cpu/mips/vm/jniTypes_mips.hpp @@ -0,0 +1,144 @@ @@ -68992,7 +68272,7 @@ index 00000000..dfcd47b4 +#endif // CPU_MIPS_VM_JNITYPES_MIPS_HPP diff --git a/hotspot/src/cpu/mips/vm/jni_mips.h b/hotspot/src/cpu/mips/vm/jni_mips.h new file mode 100644 -index 00000000..6714f51d +index 0000000000..6714f51d5d --- /dev/null +++ b/hotspot/src/cpu/mips/vm/jni_mips.h @@ -0,0 +1,51 @@ @@ -69049,7 +68329,7 @@ index 00000000..6714f51d +#endif diff --git a/hotspot/src/cpu/mips/vm/macroAssembler_mips.cpp b/hotspot/src/cpu/mips/vm/macroAssembler_mips.cpp new file mode 100644 -index 00000000..2b8840ae +index 0000000000..2b8840ae10 --- /dev/null +++ b/hotspot/src/cpu/mips/vm/macroAssembler_mips.cpp @@ -0,0 +1,4332 @@ @@ -73387,7 +72667,7 @@ index 00000000..2b8840ae +} diff --git a/hotspot/src/cpu/mips/vm/macroAssembler_mips.hpp b/hotspot/src/cpu/mips/vm/macroAssembler_mips.hpp new file mode 100644 -index 00000000..ab972779 +index 0000000000..ab9727793f --- /dev/null +++ b/hotspot/src/cpu/mips/vm/macroAssembler_mips.hpp @@ -0,0 +1,701 @@ @@ -74094,7 +73374,7 @@ index 00000000..ab972779 +#endif // CPU_MIPS_VM_MACROASSEMBLER_MIPS_HPP diff --git a/hotspot/src/cpu/mips/vm/macroAssembler_mips.inline.hpp b/hotspot/src/cpu/mips/vm/macroAssembler_mips.inline.hpp new file mode 100644 -index 00000000..92c05fb7 +index 0000000000..92c05fb726 --- /dev/null +++ b/hotspot/src/cpu/mips/vm/macroAssembler_mips.inline.hpp @@ -0,0 +1,34 @@ @@ -74134,7 +73414,7 @@ index 00000000..92c05fb7 +#endif // CPU_MIPS_VM_MACROASSEMBLER_MIPS_INLINE_HPP diff --git a/hotspot/src/cpu/mips/vm/metaspaceShared_mips_64.cpp b/hotspot/src/cpu/mips/vm/metaspaceShared_mips_64.cpp new file mode 100644 -index 00000000..0c467df2 +index 0000000000..0c467df2f3 --- /dev/null +++ b/hotspot/src/cpu/mips/vm/metaspaceShared_mips_64.cpp @@ -0,0 +1,123 @@ @@ -74263,7 +73543,7 @@ index 00000000..0c467df2 +} diff --git a/hotspot/src/cpu/mips/vm/methodHandles_mips.cpp b/hotspot/src/cpu/mips/vm/methodHandles_mips.cpp new file mode 100644 -index 00000000..428c2713 +index 0000000000..428c271362 --- /dev/null +++ b/hotspot/src/cpu/mips/vm/methodHandles_mips.cpp @@ -0,0 +1,576 @@ @@ -74845,7 +74125,7 @@ index 00000000..428c2713 +#endif //PRODUCT diff --git a/hotspot/src/cpu/mips/vm/methodHandles_mips.hpp b/hotspot/src/cpu/mips/vm/methodHandles_mips.hpp new file mode 100644 -index 00000000..03b65fc8 +index 0000000000..03b65fc8ef --- /dev/null +++ b/hotspot/src/cpu/mips/vm/methodHandles_mips.hpp @@ -0,0 +1,62 @@ @@ -74913,7 +74193,7 @@ index 00000000..03b65fc8 + } diff --git a/hotspot/src/cpu/mips/vm/mips.ad b/hotspot/src/cpu/mips/vm/mips.ad new file mode 100644 -index 00000000..3563bbe0 +index 0000000000..3563bbe0e5 --- /dev/null +++ b/hotspot/src/cpu/mips/vm/mips.ad @@ -0,0 +1,25 @@ @@ -74944,7 +74224,7 @@ index 00000000..3563bbe0 + diff --git a/hotspot/src/cpu/mips/vm/mips_64.ad b/hotspot/src/cpu/mips/vm/mips_64.ad new file mode 100644 -index 00000000..29125913 +index 0000000000..29125913a4 --- /dev/null +++ b/hotspot/src/cpu/mips/vm/mips_64.ad @@ -0,0 +1,14036 @@ @@ -88986,7 +88266,7 @@ index 00000000..29125913 + diff --git a/hotspot/src/cpu/mips/vm/nativeInst_mips.cpp b/hotspot/src/cpu/mips/vm/nativeInst_mips.cpp new file mode 100644 -index 00000000..e1f7cd94 +index 0000000000..e1f7cd944d --- /dev/null +++ b/hotspot/src/cpu/mips/vm/nativeInst_mips.cpp @@ -0,0 +1,1829 @@ @@ -90821,7 +90101,7 @@ index 00000000..e1f7cd94 +} diff --git a/hotspot/src/cpu/mips/vm/nativeInst_mips.hpp b/hotspot/src/cpu/mips/vm/nativeInst_mips.hpp new file mode 100644 -index 00000000..13a4cb4e +index 0000000000..13a4cb4ef1 --- /dev/null +++ b/hotspot/src/cpu/mips/vm/nativeInst_mips.hpp @@ -0,0 +1,735 @@ @@ -91562,7 +90842,7 @@ index 00000000..13a4cb4e +#endif // CPU_MIPS_VM_NATIVEINST_MIPS_HPP diff --git a/hotspot/src/cpu/mips/vm/registerMap_mips.hpp b/hotspot/src/cpu/mips/vm/registerMap_mips.hpp new file mode 100644 -index 00000000..7f800eb1 +index 0000000000..7f800eb107 --- /dev/null +++ b/hotspot/src/cpu/mips/vm/registerMap_mips.hpp @@ -0,0 +1,47 @@ @@ -91615,7 +90895,7 @@ index 00000000..7f800eb1 +#endif // CPU_MIPS_VM_REGISTERMAP_MIPS_HPP diff --git a/hotspot/src/cpu/mips/vm/register_definitions_mips.cpp b/hotspot/src/cpu/mips/vm/register_definitions_mips.cpp new file mode 100644 -index 00000000..4af25318 +index 0000000000..4af2531834 --- /dev/null +++ b/hotspot/src/cpu/mips/vm/register_definitions_mips.cpp @@ -0,0 +1,103 @@ @@ -91724,7 +91004,7 @@ index 00000000..4af25318 +REGISTER_DEFINITION(FloatRegister, f31); diff --git a/hotspot/src/cpu/mips/vm/register_mips.cpp b/hotspot/src/cpu/mips/vm/register_mips.cpp new file mode 100644 -index 00000000..4a9b22bf +index 0000000000..4a9b22bfef --- /dev/null +++ b/hotspot/src/cpu/mips/vm/register_mips.cpp @@ -0,0 +1,52 @@ @@ -91782,7 +91062,7 @@ index 00000000..4a9b22bf + diff --git a/hotspot/src/cpu/mips/vm/register_mips.hpp b/hotspot/src/cpu/mips/vm/register_mips.hpp new file mode 100644 -index 00000000..88bf2d68 +index 0000000000..88bf2d68cc --- /dev/null +++ b/hotspot/src/cpu/mips/vm/register_mips.hpp @@ -0,0 +1,346 @@ @@ -92134,7 +91414,7 @@ index 00000000..88bf2d68 +#endif //CPU_MIPS_VM_REGISTER_MIPS_HPP diff --git a/hotspot/src/cpu/mips/vm/relocInfo_mips.cpp b/hotspot/src/cpu/mips/vm/relocInfo_mips.cpp new file mode 100644 -index 00000000..cae43b2d +index 0000000000..cae43b2d96 --- /dev/null +++ b/hotspot/src/cpu/mips/vm/relocInfo_mips.cpp @@ -0,0 +1,156 @@ @@ -92296,7 +91576,7 @@ index 00000000..cae43b2d +} diff --git a/hotspot/src/cpu/mips/vm/relocInfo_mips.hpp b/hotspot/src/cpu/mips/vm/relocInfo_mips.hpp new file mode 100644 -index 00000000..04ad5dac +index 0000000000..04ad5dac96 --- /dev/null +++ b/hotspot/src/cpu/mips/vm/relocInfo_mips.hpp @@ -0,0 +1,40 @@ @@ -92342,7 +91622,7 @@ index 00000000..04ad5dac +#endif // CPU_MIPS_VM_RELOCINFO_MIPS_HPP diff --git a/hotspot/src/cpu/mips/vm/runtime_mips_64.cpp b/hotspot/src/cpu/mips/vm/runtime_mips_64.cpp new file mode 100644 -index 00000000..bb9269b4 +index 0000000000..bb9269b423 --- /dev/null +++ b/hotspot/src/cpu/mips/vm/runtime_mips_64.cpp @@ -0,0 +1,206 @@ @@ -92554,7 +91834,7 @@ index 00000000..bb9269b4 +} diff --git a/hotspot/src/cpu/mips/vm/sharedRuntime_mips_64.cpp b/hotspot/src/cpu/mips/vm/sharedRuntime_mips_64.cpp new file mode 100644 -index 00000000..daf04c44 +index 0000000000..daf04c4422 --- /dev/null +++ b/hotspot/src/cpu/mips/vm/sharedRuntime_mips_64.cpp @@ -0,0 +1,3816 @@ @@ -96376,7 +95656,7 @@ index 00000000..daf04c44 +} diff --git a/hotspot/src/cpu/mips/vm/stubGenerator_mips_64.cpp b/hotspot/src/cpu/mips/vm/stubGenerator_mips_64.cpp new file mode 100644 -index 00000000..aeb797fa +index 0000000000..aeb797faf9 --- /dev/null +++ b/hotspot/src/cpu/mips/vm/stubGenerator_mips_64.cpp @@ -0,0 +1,2147 @@ @@ -98529,7 +97809,7 @@ index 00000000..aeb797fa +} diff --git a/hotspot/src/cpu/mips/vm/stubRoutines_mips_64.cpp b/hotspot/src/cpu/mips/vm/stubRoutines_mips_64.cpp new file mode 100644 -index 00000000..733a48b8 +index 0000000000..733a48b889 --- /dev/null +++ b/hotspot/src/cpu/mips/vm/stubRoutines_mips_64.cpp @@ -0,0 +1,35 @@ @@ -98570,7 +97850,7 @@ index 00000000..733a48b8 +address StubRoutines::gs2::_call_stub_compiled_return = NULL; diff --git a/hotspot/src/cpu/mips/vm/stubRoutines_mips_64.hpp b/hotspot/src/cpu/mips/vm/stubRoutines_mips_64.hpp new file mode 100644 -index 00000000..920c0884 +index 0000000000..920c08844e --- /dev/null +++ b/hotspot/src/cpu/mips/vm/stubRoutines_mips_64.hpp @@ -0,0 +1,59 @@ @@ -98635,7 +97915,7 @@ index 00000000..920c0884 +#endif // CPU_MIPS_VM_STUBROUTINES_MIPS_64_HPP diff --git a/hotspot/src/cpu/mips/vm/templateInterpreterGenerator_mips.hpp b/hotspot/src/cpu/mips/vm/templateInterpreterGenerator_mips.hpp new file mode 100644 -index 00000000..a83c3728 +index 0000000000..a83c3728f8 --- /dev/null +++ b/hotspot/src/cpu/mips/vm/templateInterpreterGenerator_mips.hpp @@ -0,0 +1,35 @@ @@ -98676,7 +97956,7 @@ index 00000000..a83c3728 +#endif // CPU_MIPS_VM_TEMPLATEINTERPRETERGENERATOR_MIPS_HPP diff --git a/hotspot/src/cpu/mips/vm/templateInterpreter_mips.hpp b/hotspot/src/cpu/mips/vm/templateInterpreter_mips.hpp new file mode 100644 -index 00000000..204f1b2f +index 0000000000..204f1b2f21 --- /dev/null +++ b/hotspot/src/cpu/mips/vm/templateInterpreter_mips.hpp @@ -0,0 +1,41 @@ @@ -98723,7 +98003,7 @@ index 00000000..204f1b2f +#endif // CPU_MIPS_VM_TEMPLATEINTERPRETER_MIPS_HPP diff --git a/hotspot/src/cpu/mips/vm/templateInterpreter_mips_64.cpp b/hotspot/src/cpu/mips/vm/templateInterpreter_mips_64.cpp new file mode 100644 -index 00000000..0cc5d330 +index 0000000000..0cc5d33070 --- /dev/null +++ b/hotspot/src/cpu/mips/vm/templateInterpreter_mips_64.cpp @@ -0,0 +1,2306 @@ @@ -101035,7 +100315,7 @@ index 00000000..0cc5d330 +#endif // ! CC_INTERP diff --git a/hotspot/src/cpu/mips/vm/templateTable_mips.hpp b/hotspot/src/cpu/mips/vm/templateTable_mips.hpp new file mode 100644 -index 00000000..d879e6dc +index 0000000000..d879e6dc92 --- /dev/null +++ b/hotspot/src/cpu/mips/vm/templateTable_mips.hpp @@ -0,0 +1,34 @@ @@ -101075,7 +100355,7 @@ index 00000000..d879e6dc + static void index_check_without_pop(Register array, Register index); diff --git a/hotspot/src/cpu/mips/vm/templateTable_mips_64.cpp b/hotspot/src/cpu/mips/vm/templateTable_mips_64.cpp new file mode 100644 -index 00000000..7415511b +index 0000000000..7415511b99 --- /dev/null +++ b/hotspot/src/cpu/mips/vm/templateTable_mips_64.cpp @@ -0,0 +1,4623 @@ @@ -105704,7 +104984,7 @@ index 00000000..7415511b +#endif // !CC_INTERP diff --git a/hotspot/src/cpu/mips/vm/templateTable_mips_64.hpp b/hotspot/src/cpu/mips/vm/templateTable_mips_64.hpp new file mode 100644 -index 00000000..b63274a2 +index 0000000000..b63274a206 --- /dev/null +++ b/hotspot/src/cpu/mips/vm/templateTable_mips_64.hpp @@ -0,0 +1,44 @@ @@ -105754,7 +105034,7 @@ index 00000000..b63274a2 +#endif // CPU_MIPS_VM_TEMPLATETABLE_MIPS_64_HPP diff --git a/hotspot/src/cpu/mips/vm/vmStructs_mips.hpp b/hotspot/src/cpu/mips/vm/vmStructs_mips.hpp new file mode 100644 -index 00000000..69399143 +index 0000000000..6939914356 --- /dev/null +++ b/hotspot/src/cpu/mips/vm/vmStructs_mips.hpp @@ -0,0 +1,68 @@ @@ -105828,7 +105108,7 @@ index 00000000..69399143 +#endif // CPU_MIPS_VM_VMSTRUCTS_MIPS_HPP diff --git a/hotspot/src/cpu/mips/vm/vm_version_ext_mips.cpp b/hotspot/src/cpu/mips/vm/vm_version_ext_mips.cpp new file mode 100644 -index 00000000..a98f70d9 +index 0000000000..a98f70d9ff --- /dev/null +++ b/hotspot/src/cpu/mips/vm/vm_version_ext_mips.cpp @@ -0,0 +1,89 @@ @@ -105923,7 +105203,7 @@ index 00000000..a98f70d9 +} diff --git a/hotspot/src/cpu/mips/vm/vm_version_ext_mips.hpp b/hotspot/src/cpu/mips/vm/vm_version_ext_mips.hpp new file mode 100644 -index 00000000..a240fcc2 +index 0000000000..a240fcc2e9 --- /dev/null +++ b/hotspot/src/cpu/mips/vm/vm_version_ext_mips.hpp @@ -0,0 +1,54 @@ @@ -105983,7 +105263,7 @@ index 00000000..a240fcc2 +#endif // CPU_MIPS_VM_VM_VERSION_EXT_MIPS_HPP diff --git a/hotspot/src/cpu/mips/vm/vm_version_mips.cpp b/hotspot/src/cpu/mips/vm/vm_version_mips.cpp new file mode 100644 -index 00000000..aef8f074 +index 0000000000..aef8f0746a --- /dev/null +++ b/hotspot/src/cpu/mips/vm/vm_version_mips.cpp @@ -0,0 +1,510 @@ @@ -106499,7 +105779,7 @@ index 00000000..aef8f074 +} diff --git a/hotspot/src/cpu/mips/vm/vm_version_mips.hpp b/hotspot/src/cpu/mips/vm/vm_version_mips.hpp new file mode 100644 -index 00000000..0de01e5f +index 0000000000..0de01e5f64 --- /dev/null +++ b/hotspot/src/cpu/mips/vm/vm_version_mips.hpp @@ -0,0 +1,221 @@ @@ -106726,7 +106006,7 @@ index 00000000..0de01e5f +#endif // CPU_MIPS_VM_VM_VERSION_MIPS_HPP diff --git a/hotspot/src/cpu/mips/vm/vmreg_mips.cpp b/hotspot/src/cpu/mips/vm/vmreg_mips.cpp new file mode 100644 -index 00000000..86bd74d4 +index 0000000000..86bd74d430 --- /dev/null +++ b/hotspot/src/cpu/mips/vm/vmreg_mips.cpp @@ -0,0 +1,51 @@ @@ -106783,7 +106063,7 @@ index 00000000..86bd74d4 +} diff --git a/hotspot/src/cpu/mips/vm/vmreg_mips.hpp b/hotspot/src/cpu/mips/vm/vmreg_mips.hpp new file mode 100644 -index 00000000..6a970ea9 +index 0000000000..6a970ea91a --- /dev/null +++ b/hotspot/src/cpu/mips/vm/vmreg_mips.hpp @@ -0,0 +1,35 @@ @@ -106824,7 +106104,7 @@ index 00000000..6a970ea9 +#endif // CPU_MIPS_VM_VMREG_MIPS_HPP diff --git a/hotspot/src/cpu/mips/vm/vmreg_mips.inline.hpp b/hotspot/src/cpu/mips/vm/vmreg_mips.inline.hpp new file mode 100644 -index 00000000..77e18ce5 +index 0000000000..77e18ce57d --- /dev/null +++ b/hotspot/src/cpu/mips/vm/vmreg_mips.inline.hpp @@ -0,0 +1,68 @@ @@ -106898,7 +106178,7 @@ index 00000000..77e18ce5 +#endif // CPU_MIPS_VM_VMREG_MIPS_INLINE_HPP diff --git a/hotspot/src/cpu/mips/vm/vtableStubs_mips_64.cpp b/hotspot/src/cpu/mips/vm/vtableStubs_mips_64.cpp new file mode 100644 -index 00000000..7779c58e +index 0000000000..7779c58e0a --- /dev/null +++ b/hotspot/src/cpu/mips/vm/vtableStubs_mips_64.cpp @@ -0,0 +1,301 @@ @@ -107204,7 +106484,7 @@ index 00000000..7779c58e + return wordSize; +} diff --git a/hotspot/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp b/hotspot/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp -index c1c053e6..5c90df10 100644 +index c1c053e66c..5c90df1079 100644 --- a/hotspot/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp +++ b/hotspot/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp @@ -1513,6 +1513,10 @@ void LIR_Assembler::emit_opBranch(LIR_OpBranch* op) { @@ -107232,7 +106512,7 @@ index c1c053e6..5c90df10 100644 assert(info == NULL, "should never be used, idiv/irem and ldiv/lrem not handled by this method"); diff --git a/hotspot/src/cpu/x86/vm/c1_LIRGenerator_x86.cpp b/hotspot/src/cpu/x86/vm/c1_LIRGenerator_x86.cpp -index 92b73e1c..45da327e 100644 +index 92b73e1c71..45da327efb 100644 --- a/hotspot/src/cpu/x86/vm/c1_LIRGenerator_x86.cpp +++ b/hotspot/src/cpu/x86/vm/c1_LIRGenerator_x86.cpp @@ -242,20 +242,27 @@ void LIRGenerator::increment_counter(LIR_Address* addr, int step) { @@ -107271,7 +106551,7 @@ index 92b73e1c..45da327e 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 54cfcdd1..c3d22ba5 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 @@ @@ -107308,8 +106588,8 @@ index 54cfcdd1..c3d22ba5 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 @@ -107358,7 +106638,7 @@ index 54cfcdd1..c3d22ba5 100644 "Specify at least %dk", os::Linux::min_stack_allowed/ K); diff --git a/hotspot/src/os/linux/vm/os_perf_linux.cpp b/hotspot/src/os/linux/vm/os_perf_linux.cpp -index 0d1f7581..cbc6c075 100644 +index 0d1f75810a..cbc6c0757c 100644 --- a/hotspot/src/os/linux/vm/os_perf_linux.cpp +++ b/hotspot/src/os/linux/vm/os_perf_linux.cpp @@ -50,6 +50,12 @@ @@ -107376,7 +106656,7 @@ index 0d1f7581..cbc6c075 100644 #include diff --git a/hotspot/src/os_cpu/linux_loongarch/vm/assembler_linux_loongarch.cpp b/hotspot/src/os_cpu/linux_loongarch/vm/assembler_linux_loongarch.cpp new file mode 100644 -index 00000000..5ee0965f +index 0000000000..5ee0965f42 --- /dev/null +++ b/hotspot/src/os_cpu/linux_loongarch/vm/assembler_linux_loongarch.cpp @@ -0,0 +1,92 @@ @@ -107474,7 +106754,7 @@ index 00000000..5ee0965f +} diff --git a/hotspot/src/os_cpu/linux_loongarch/vm/atomic_linux_loongarch.inline.hpp b/hotspot/src/os_cpu/linux_loongarch/vm/atomic_linux_loongarch.inline.hpp new file mode 100644 -index 00000000..69590ba5 +index 0000000000..69590ba582 --- /dev/null +++ b/hotspot/src/os_cpu/linux_loongarch/vm/atomic_linux_loongarch.inline.hpp @@ -0,0 +1,206 @@ @@ -107686,7 +106966,7 @@ index 00000000..69590ba5 +#endif // OS_CPU_LINUX_LOONGARCH_VM_ATOMIC_LINUX_LOONGARCH_INLINE_HPP diff --git a/hotspot/src/os_cpu/linux_loongarch/vm/bytes_linux_loongarch.inline.hpp b/hotspot/src/os_cpu/linux_loongarch/vm/bytes_linux_loongarch.inline.hpp new file mode 100644 -index 00000000..4e205c46 +index 0000000000..4e205c468e --- /dev/null +++ b/hotspot/src/os_cpu/linux_loongarch/vm/bytes_linux_loongarch.inline.hpp @@ -0,0 +1,37 @@ @@ -107729,7 +107009,7 @@ index 00000000..4e205c46 +#endif // OS_CPU_LINUX_LOONGARCH_VM_BYTES_LINUX_LOONGARCH_INLINE_HPP diff --git a/hotspot/src/os_cpu/linux_loongarch/vm/copy_linux_loongarch.inline.hpp b/hotspot/src/os_cpu/linux_loongarch/vm/copy_linux_loongarch.inline.hpp new file mode 100644 -index 00000000..7d6e11a9 +index 0000000000..7d6e11a935 --- /dev/null +++ b/hotspot/src/os_cpu/linux_loongarch/vm/copy_linux_loongarch.inline.hpp @@ -0,0 +1,125 @@ @@ -107860,7 +107140,7 @@ index 00000000..7d6e11a9 +#endif // OS_CPU_LINUX_LOONGARCH_VM_COPY_LINUX_LOONGARCH_INLINE_HPP diff --git a/hotspot/src/os_cpu/linux_loongarch/vm/globals_linux_loongarch.hpp b/hotspot/src/os_cpu/linux_loongarch/vm/globals_linux_loongarch.hpp new file mode 100644 -index 00000000..8ec3fa82 +index 0000000000..8ec3fa8239 --- /dev/null +++ b/hotspot/src/os_cpu/linux_loongarch/vm/globals_linux_loongarch.hpp @@ -0,0 +1,43 @@ @@ -107909,7 +107189,7 @@ index 00000000..8ec3fa82 +#endif // OS_CPU_LINUX_LOONGARCH_VM_GLOBALS_LINUX_LOONGARCH_HPP diff --git a/hotspot/src/os_cpu/linux_loongarch/vm/orderAccess_linux_loongarch.inline.hpp b/hotspot/src/os_cpu/linux_loongarch/vm/orderAccess_linux_loongarch.inline.hpp new file mode 100644 -index 00000000..3e050c8d +index 0000000000..3e050c8d09 --- /dev/null +++ b/hotspot/src/os_cpu/linux_loongarch/vm/orderAccess_linux_loongarch.inline.hpp @@ -0,0 +1,115 @@ @@ -108030,7 +107310,7 @@ index 00000000..3e050c8d +#endif // OS_CPU_LINUX_LOONGARCH_VM_ORDERACCESS_LINUX_LOONGARCH_INLINE_HPP diff --git a/hotspot/src/os_cpu/linux_loongarch/vm/os_linux_loongarch.cpp b/hotspot/src/os_cpu/linux_loongarch/vm/os_linux_loongarch.cpp new file mode 100644 -index 00000000..f2c3df84 +index 0000000000..f2c3df84a1 --- /dev/null +++ b/hotspot/src/os_cpu/linux_loongarch/vm/os_linux_loongarch.cpp @@ -0,0 +1,750 @@ @@ -108786,7 +108066,7 @@ index 00000000..f2c3df84 +} diff --git a/hotspot/src/os_cpu/linux_loongarch/vm/os_linux_loongarch.hpp b/hotspot/src/os_cpu/linux_loongarch/vm/os_linux_loongarch.hpp new file mode 100644 -index 00000000..a7321ae0 +index 0000000000..a7321ae025 --- /dev/null +++ b/hotspot/src/os_cpu/linux_loongarch/vm/os_linux_loongarch.hpp @@ -0,0 +1,39 @@ @@ -108831,7 +108111,7 @@ index 00000000..a7321ae0 +#endif // OS_CPU_LINUX_LOONGARCH_VM_OS_LINUX_LOONGARCH_HPP diff --git a/hotspot/src/os_cpu/linux_loongarch/vm/prefetch_linux_loongarch.inline.hpp b/hotspot/src/os_cpu/linux_loongarch/vm/prefetch_linux_loongarch.inline.hpp new file mode 100644 -index 00000000..a1cedcd8 +index 0000000000..a1cedcd8cf --- /dev/null +++ b/hotspot/src/os_cpu/linux_loongarch/vm/prefetch_linux_loongarch.inline.hpp @@ -0,0 +1,56 @@ @@ -108893,7 +108173,7 @@ index 00000000..a1cedcd8 +#endif // OS_CPU_LINUX_LOONGARCH_VM_PREFETCH_LINUX_LOONGARCH_INLINE_HPP diff --git a/hotspot/src/os_cpu/linux_loongarch/vm/threadLS_linux_loongarch.cpp b/hotspot/src/os_cpu/linux_loongarch/vm/threadLS_linux_loongarch.cpp new file mode 100644 -index 00000000..be28a562 +index 0000000000..be28a562a1 --- /dev/null +++ b/hotspot/src/os_cpu/linux_loongarch/vm/threadLS_linux_loongarch.cpp @@ -0,0 +1,84 @@ @@ -108983,7 +108263,7 @@ index 00000000..be28a562 +} diff --git a/hotspot/src/os_cpu/linux_loongarch/vm/threadLS_linux_loongarch.hpp b/hotspot/src/os_cpu/linux_loongarch/vm/threadLS_linux_loongarch.hpp new file mode 100644 -index 00000000..4fab788a +index 0000000000..4fab788a75 --- /dev/null +++ b/hotspot/src/os_cpu/linux_loongarch/vm/threadLS_linux_loongarch.hpp @@ -0,0 +1,61 @@ @@ -109050,7 +108330,7 @@ index 00000000..4fab788a +#endif // OS_CPU_LINUX_LOONGARCH_VM_THREADLS_LINUX_LOONGARCH_HPP diff --git a/hotspot/src/os_cpu/linux_loongarch/vm/thread_linux_loongarch.cpp b/hotspot/src/os_cpu/linux_loongarch/vm/thread_linux_loongarch.cpp new file mode 100644 -index 00000000..44f666d6 +index 0000000000..44f666d61f --- /dev/null +++ b/hotspot/src/os_cpu/linux_loongarch/vm/thread_linux_loongarch.cpp @@ -0,0 +1,99 @@ @@ -109155,7 +108435,7 @@ index 00000000..44f666d6 + diff --git a/hotspot/src/os_cpu/linux_loongarch/vm/thread_linux_loongarch.hpp b/hotspot/src/os_cpu/linux_loongarch/vm/thread_linux_loongarch.hpp new file mode 100644 -index 00000000..d6dd2521 +index 0000000000..d6dd2521f4 --- /dev/null +++ b/hotspot/src/os_cpu/linux_loongarch/vm/thread_linux_loongarch.hpp @@ -0,0 +1,75 @@ @@ -109236,7 +108516,7 @@ index 00000000..d6dd2521 +#endif // OS_CPU_LINUX_LOONGARCH_VM_THREAD_LINUX_LOONGARCH_HPP diff --git a/hotspot/src/os_cpu/linux_loongarch/vm/vmStructs_linux_loongarch.hpp b/hotspot/src/os_cpu/linux_loongarch/vm/vmStructs_linux_loongarch.hpp new file mode 100644 -index 00000000..0097cadc +index 0000000000..0097cadcb7 --- /dev/null +++ b/hotspot/src/os_cpu/linux_loongarch/vm/vmStructs_linux_loongarch.hpp @@ -0,0 +1,55 @@ @@ -109297,7 +108577,7 @@ index 00000000..0097cadc +#endif // OS_CPU_LINUX_LOONGARCH_VM_VMSTRUCTS_LINUX_LOONGARCH_HPP diff --git a/hotspot/src/os_cpu/linux_loongarch/vm/vm_version_linux_loongarch.cpp b/hotspot/src/os_cpu/linux_loongarch/vm/vm_version_linux_loongarch.cpp new file mode 100644 -index 00000000..80a1538d +index 0000000000..80a1538de9 --- /dev/null +++ b/hotspot/src/os_cpu/linux_loongarch/vm/vm_version_linux_loongarch.cpp @@ -0,0 +1,29 @@ @@ -109332,7 +108612,7 @@ index 00000000..80a1538d + diff --git a/hotspot/src/os_cpu/linux_mips/vm/assembler_linux_mips.cpp b/hotspot/src/os_cpu/linux_mips/vm/assembler_linux_mips.cpp new file mode 100644 -index 00000000..4ba53d93 +index 0000000000..4ba53d9341 --- /dev/null +++ b/hotspot/src/os_cpu/linux_mips/vm/assembler_linux_mips.cpp @@ -0,0 +1,111 @@ @@ -109449,7 +108729,7 @@ index 00000000..4ba53d93 +} diff --git a/hotspot/src/os_cpu/linux_mips/vm/atomic_linux_mips.inline.hpp b/hotspot/src/os_cpu/linux_mips/vm/atomic_linux_mips.inline.hpp new file mode 100644 -index 00000000..1c7ad605 +index 0000000000..1c7ad605e9 --- /dev/null +++ b/hotspot/src/os_cpu/linux_mips/vm/atomic_linux_mips.inline.hpp @@ -0,0 +1,258 @@ @@ -109713,7 +108993,7 @@ index 00000000..1c7ad605 +#endif // OS_CPU_LINUX_MIPS_VM_ATOMIC_LINUX_MIPS_INLINE_HPP diff --git a/hotspot/src/os_cpu/linux_mips/vm/bytes_linux_mips.inline.hpp b/hotspot/src/os_cpu/linux_mips/vm/bytes_linux_mips.inline.hpp new file mode 100644 -index 00000000..5b5cd10a +index 0000000000..5b5cd10aa5 --- /dev/null +++ b/hotspot/src/os_cpu/linux_mips/vm/bytes_linux_mips.inline.hpp @@ -0,0 +1,37 @@ @@ -109756,7 +109036,7 @@ index 00000000..5b5cd10a +#endif // OS_CPU_LINUX_MIPS_VM_BYTES_LINUX_MIPS_INLINE_HPP diff --git a/hotspot/src/os_cpu/linux_mips/vm/copy_linux_mips.inline.hpp b/hotspot/src/os_cpu/linux_mips/vm/copy_linux_mips.inline.hpp new file mode 100644 -index 00000000..73ac3450 +index 0000000000..73ac34501b --- /dev/null +++ b/hotspot/src/os_cpu/linux_mips/vm/copy_linux_mips.inline.hpp @@ -0,0 +1,125 @@ @@ -109887,7 +109167,7 @@ index 00000000..73ac3450 +#endif // OS_CPU_LINUX_MIPS_VM_COPY_LINUX_MIPS_INLINE_HPP diff --git a/hotspot/src/os_cpu/linux_mips/vm/globals_linux_mips.hpp b/hotspot/src/os_cpu/linux_mips/vm/globals_linux_mips.hpp new file mode 100644 -index 00000000..f1599ac5 +index 0000000000..f1599ac5f1 --- /dev/null +++ b/hotspot/src/os_cpu/linux_mips/vm/globals_linux_mips.hpp @@ -0,0 +1,51 @@ @@ -109944,7 +109224,7 @@ index 00000000..f1599ac5 +#endif // OS_CPU_LINUX_MIPS_VM_GLOBALS_LINUX_MIPS_HPP diff --git a/hotspot/src/os_cpu/linux_mips/vm/linux_mips.ad b/hotspot/src/os_cpu/linux_mips/vm/linux_mips.ad new file mode 100644 -index 00000000..5e38996f +index 0000000000..5e38996ffa --- /dev/null +++ b/hotspot/src/os_cpu/linux_mips/vm/linux_mips.ad @@ -0,0 +1,153 @@ @@ -110103,7 +109383,7 @@ index 00000000..5e38996f +%} diff --git a/hotspot/src/os_cpu/linux_mips/vm/linux_mips.s b/hotspot/src/os_cpu/linux_mips/vm/linux_mips.s new file mode 100644 -index 00000000..f87fbf26 +index 0000000000..f87fbf265d --- /dev/null +++ b/hotspot/src/os_cpu/linux_mips/vm/linux_mips.s @@ -0,0 +1,25 @@ @@ -110134,7 +109414,7 @@ index 00000000..f87fbf26 + diff --git a/hotspot/src/os_cpu/linux_mips/vm/linux_mips_64.ad b/hotspot/src/os_cpu/linux_mips/vm/linux_mips_64.ad new file mode 100644 -index 00000000..ca4d0947 +index 0000000000..ca4d094738 --- /dev/null +++ b/hotspot/src/os_cpu/linux_mips/vm/linux_mips_64.ad @@ -0,0 +1,50 @@ @@ -110190,7 +109470,7 @@ index 00000000..ca4d0947 +// specified. diff --git a/hotspot/src/os_cpu/linux_mips/vm/orderAccess_linux_mips.inline.hpp b/hotspot/src/os_cpu/linux_mips/vm/orderAccess_linux_mips.inline.hpp new file mode 100644 -index 00000000..c9bc169a +index 0000000000..c9bc169aa5 --- /dev/null +++ b/hotspot/src/os_cpu/linux_mips/vm/orderAccess_linux_mips.inline.hpp @@ -0,0 +1,115 @@ @@ -110311,7 +109591,7 @@ index 00000000..c9bc169a +#endif // OS_CPU_LINUX_MIPS_VM_ORDERACCESS_LINUX_MIPS_INLINE_HPP diff --git a/hotspot/src/os_cpu/linux_mips/vm/os_linux_mips.cpp b/hotspot/src/os_cpu/linux_mips/vm/os_linux_mips.cpp new file mode 100644 -index 00000000..43487dab +index 0000000000..43487dab98 --- /dev/null +++ b/hotspot/src/os_cpu/linux_mips/vm/os_linux_mips.cpp @@ -0,0 +1,1015 @@ @@ -111332,7 +110612,7 @@ index 00000000..43487dab +} diff --git a/hotspot/src/os_cpu/linux_mips/vm/os_linux_mips.hpp b/hotspot/src/os_cpu/linux_mips/vm/os_linux_mips.hpp new file mode 100644 -index 00000000..c07d0815 +index 0000000000..c07d08156f --- /dev/null +++ b/hotspot/src/os_cpu/linux_mips/vm/os_linux_mips.hpp @@ -0,0 +1,39 @@ @@ -111377,7 +110657,7 @@ index 00000000..c07d0815 +#endif // OS_CPU_LINUX_MIPS_VM_OS_LINUX_MIPS_HPP diff --git a/hotspot/src/os_cpu/linux_mips/vm/prefetch_linux_mips.inline.hpp b/hotspot/src/os_cpu/linux_mips/vm/prefetch_linux_mips.inline.hpp new file mode 100644 -index 00000000..93490345 +index 0000000000..93490345f0 --- /dev/null +++ b/hotspot/src/os_cpu/linux_mips/vm/prefetch_linux_mips.inline.hpp @@ -0,0 +1,58 @@ @@ -111441,7 +110721,7 @@ index 00000000..93490345 +#endif // OS_CPU_LINUX_MIPS_VM_PREFETCH_LINUX_MIPS_INLINE_HPP diff --git a/hotspot/src/os_cpu/linux_mips/vm/threadLS_linux_mips.cpp b/hotspot/src/os_cpu/linux_mips/vm/threadLS_linux_mips.cpp new file mode 100644 -index 00000000..be28a562 +index 0000000000..be28a562a1 --- /dev/null +++ b/hotspot/src/os_cpu/linux_mips/vm/threadLS_linux_mips.cpp @@ -0,0 +1,84 @@ @@ -111531,7 +110811,7 @@ index 00000000..be28a562 +} diff --git a/hotspot/src/os_cpu/linux_mips/vm/threadLS_linux_mips.hpp b/hotspot/src/os_cpu/linux_mips/vm/threadLS_linux_mips.hpp new file mode 100644 -index 00000000..e595195e +index 0000000000..e595195e21 --- /dev/null +++ b/hotspot/src/os_cpu/linux_mips/vm/threadLS_linux_mips.hpp @@ -0,0 +1,61 @@ @@ -111598,7 +110878,7 @@ index 00000000..e595195e +#endif // OS_CPU_LINUX_MIPS_VM_THREADLS_LINUX_MIPS_HPP diff --git a/hotspot/src/os_cpu/linux_mips/vm/thread_linux_mips.cpp b/hotspot/src/os_cpu/linux_mips/vm/thread_linux_mips.cpp new file mode 100644 -index 00000000..44f666d6 +index 0000000000..44f666d61f --- /dev/null +++ b/hotspot/src/os_cpu/linux_mips/vm/thread_linux_mips.cpp @@ -0,0 +1,99 @@ @@ -111703,7 +110983,7 @@ index 00000000..44f666d6 + diff --git a/hotspot/src/os_cpu/linux_mips/vm/thread_linux_mips.hpp b/hotspot/src/os_cpu/linux_mips/vm/thread_linux_mips.hpp new file mode 100644 -index 00000000..cb11c36a +index 0000000000..cb11c36ae5 --- /dev/null +++ b/hotspot/src/os_cpu/linux_mips/vm/thread_linux_mips.hpp @@ -0,0 +1,75 @@ @@ -111784,7 +111064,7 @@ index 00000000..cb11c36a +#endif // OS_CPU_LINUX_MIPS_VM_THREAD_LINUX_MIPS_HPP diff --git a/hotspot/src/os_cpu/linux_mips/vm/vmStructs_linux_mips.hpp b/hotspot/src/os_cpu/linux_mips/vm/vmStructs_linux_mips.hpp new file mode 100644 -index 00000000..b7454bf0 +index 0000000000..b7454bf045 --- /dev/null +++ b/hotspot/src/os_cpu/linux_mips/vm/vmStructs_linux_mips.hpp @@ -0,0 +1,55 @@ @@ -111845,7 +111125,7 @@ index 00000000..b7454bf0 +#endif // OS_CPU_LINUX_MIPS_VM_VMSTRUCTS_LINUX_MIPS_HPP diff --git a/hotspot/src/os_cpu/linux_mips/vm/vm_version_linux_mips.cpp b/hotspot/src/os_cpu/linux_mips/vm/vm_version_linux_mips.cpp new file mode 100644 -index 00000000..ce697823 +index 0000000000..ce697823b9 --- /dev/null +++ b/hotspot/src/os_cpu/linux_mips/vm/vm_version_linux_mips.cpp @@ -0,0 +1,28 @@ @@ -111878,7 +111158,7 @@ index 00000000..ce697823 +#include "runtime/os.hpp" +#include "vm_version_mips.hpp" diff --git a/hotspot/src/share/tools/hsdis/Makefile b/hotspot/src/share/tools/hsdis/Makefile -index 0d1b6089..a9754ce2 100644 +index 0d1b608944..a9754ce2ac 100644 --- a/hotspot/src/share/tools/hsdis/Makefile +++ b/hotspot/src/share/tools/hsdis/Makefile @@ -105,12 +105,25 @@ CFLAGS/sparc += -m32 @@ -111908,7 +111188,7 @@ index 0d1b6089..a9754ce2 100644 OUTFLAGS += -o $@ else diff --git a/hotspot/src/share/tools/hsdis/hsdis.c b/hotspot/src/share/tools/hsdis/hsdis.c -index 4fb49648..f6ef5bea 100644 +index 4fb4964870..f6ef5bea15 100644 --- a/hotspot/src/share/tools/hsdis/hsdis.c +++ b/hotspot/src/share/tools/hsdis/hsdis.c @@ -493,6 +493,16 @@ static const char* native_arch_name() { @@ -111929,7 +111209,7 @@ index 4fb49648..f6ef5bea 100644 res = "aarch64"; #endif diff --git a/hotspot/src/share/vm/adlc/main.cpp b/hotspot/src/share/vm/adlc/main.cpp -index 52044f12..50c58587 100644 +index 52044f12d4..50c585872e 100644 --- a/hotspot/src/share/vm/adlc/main.cpp +++ b/hotspot/src/share/vm/adlc/main.cpp @@ -22,6 +22,12 @@ @@ -111961,7 +111241,7 @@ index 52044f12..50c58587 100644 AD.addInclude(AD._CPP_file, "assembler_aarch64.inline.hpp"); AD.addInclude(AD._CPP_file, "nativeInst_aarch64.hpp"); diff --git a/hotspot/src/share/vm/asm/assembler.hpp b/hotspot/src/share/vm/asm/assembler.hpp -index f7f1ae1d..572aa997 100644 +index f7f1ae1d36..572aa997ca 100644 --- a/hotspot/src/share/vm/asm/assembler.hpp +++ b/hotspot/src/share/vm/asm/assembler.hpp @@ -22,6 +22,12 @@ @@ -112006,7 +111286,7 @@ index f7f1ae1d..572aa997 100644 #endif // SHARE_VM_ASM_ASSEMBLER_HPP diff --git a/hotspot/src/share/vm/asm/assembler.inline.hpp b/hotspot/src/share/vm/asm/assembler.inline.hpp -index 1a48cb31..8ac90e14 100644 +index 1a48cb3171..8ac90e1474 100644 --- a/hotspot/src/share/vm/asm/assembler.inline.hpp +++ b/hotspot/src/share/vm/asm/assembler.inline.hpp @@ -22,6 +22,12 @@ @@ -112036,7 +111316,7 @@ index 1a48cb31..8ac90e14 100644 # include "assembler_aarch64.inline.hpp" #endif diff --git a/hotspot/src/share/vm/asm/codeBuffer.cpp b/hotspot/src/share/vm/asm/codeBuffer.cpp -index d94ac406..f6b57811 100644 +index d94ac40655..f6b578111f 100644 --- a/hotspot/src/share/vm/asm/codeBuffer.cpp +++ b/hotspot/src/share/vm/asm/codeBuffer.cpp @@ -22,6 +22,12 @@ @@ -112061,7 +111341,7 @@ index d94ac406..f6b57811 100644 rtype == relocInfo::external_word_type, "code needs relocation information"); diff --git a/hotspot/src/share/vm/asm/codeBuffer.hpp b/hotspot/src/share/vm/asm/codeBuffer.hpp -index 02b619ad..c04560a0 100644 +index 02b619ad77..c04560a0bc 100644 --- a/hotspot/src/share/vm/asm/codeBuffer.hpp +++ b/hotspot/src/share/vm/asm/codeBuffer.hpp @@ -22,6 +22,12 @@ @@ -112091,7 +111371,7 @@ index 02b619ad..c04560a0 100644 }; diff --git a/hotspot/src/share/vm/asm/macroAssembler.hpp b/hotspot/src/share/vm/asm/macroAssembler.hpp -index 1482eb63..0be415b6 100644 +index 1482eb630b..0be415b6c5 100644 --- a/hotspot/src/share/vm/asm/macroAssembler.hpp +++ b/hotspot/src/share/vm/asm/macroAssembler.hpp @@ -22,6 +22,12 @@ @@ -112120,7 +111400,7 @@ index 1482eb63..0be415b6 100644 +#endif #endif // SHARE_VM_ASM_MACROASSEMBLER_HPP diff --git a/hotspot/src/share/vm/asm/macroAssembler.inline.hpp b/hotspot/src/share/vm/asm/macroAssembler.inline.hpp -index db3daa52..6f4e523c 100644 +index db3daa52e9..6f4e523c59 100644 --- a/hotspot/src/share/vm/asm/macroAssembler.inline.hpp +++ b/hotspot/src/share/vm/asm/macroAssembler.inline.hpp @@ -22,6 +22,12 @@ @@ -112150,7 +111430,7 @@ index db3daa52..6f4e523c 100644 # include "macroAssembler_aarch64.inline.hpp" #endif diff --git a/hotspot/src/share/vm/asm/register.hpp b/hotspot/src/share/vm/asm/register.hpp -index c5008901..6a20929e 100644 +index c500890181..6a20929e59 100644 --- a/hotspot/src/share/vm/asm/register.hpp +++ b/hotspot/src/share/vm/asm/register.hpp @@ -22,6 +22,12 @@ @@ -112180,7 +111460,7 @@ index c5008901..6a20929e 100644 # include "register_aarch64.hpp" #endif diff --git a/hotspot/src/share/vm/c1/c1_Defs.hpp b/hotspot/src/share/vm/c1/c1_Defs.hpp -index b0cd7637..b42b9de1 100644 +index b0cd763739..b42b9de1b5 100644 --- a/hotspot/src/share/vm/c1/c1_Defs.hpp +++ b/hotspot/src/share/vm/c1/c1_Defs.hpp @@ -22,6 +22,12 @@ @@ -112217,7 +111497,7 @@ index b0cd7637..b42b9de1 100644 # include "c1_Defs_aarch64.hpp" #endif diff --git a/hotspot/src/share/vm/c1/c1_FpuStackSim.hpp b/hotspot/src/share/vm/c1/c1_FpuStackSim.hpp -index f07e97a4..6bc367a8 100644 +index f07e97a4d3..6bc367a897 100644 --- a/hotspot/src/share/vm/c1/c1_FpuStackSim.hpp +++ b/hotspot/src/share/vm/c1/c1_FpuStackSim.hpp @@ -22,6 +22,12 @@ @@ -112244,7 +111524,7 @@ index f07e97a4..6bc367a8 100644 # include "c1_FpuStackSim_aarch64.hpp" #endif diff --git a/hotspot/src/share/vm/c1/c1_FrameMap.cpp b/hotspot/src/share/vm/c1/c1_FrameMap.cpp -index 1dac94d5..b1e37ec4 100644 +index 1dac94d58c..b1e37ec41c 100644 --- a/hotspot/src/share/vm/c1/c1_FrameMap.cpp +++ b/hotspot/src/share/vm/c1/c1_FrameMap.cpp @@ -22,6 +22,12 @@ @@ -112271,7 +111551,7 @@ index 1dac94d5..b1e37ec4 100644 # include "vmreg_aarch64.inline.hpp" #endif diff --git a/hotspot/src/share/vm/c1/c1_FrameMap.hpp b/hotspot/src/share/vm/c1/c1_FrameMap.hpp -index 41571e3d..c0e7b28e 100644 +index 41571e3d16..c0e7b28ea4 100644 --- a/hotspot/src/share/vm/c1/c1_FrameMap.hpp +++ b/hotspot/src/share/vm/c1/c1_FrameMap.hpp @@ -22,6 +22,12 @@ @@ -112298,7 +111578,7 @@ index 41571e3d..c0e7b28e 100644 # include "c1_FrameMap_aarch64.hpp" #endif diff --git a/hotspot/src/share/vm/c1/c1_LIR.cpp b/hotspot/src/share/vm/c1/c1_LIR.cpp -index fa37e7a0..5d33d3f7 100644 +index fa37e7a046..5d33d3f7a0 100644 --- a/hotspot/src/share/vm/c1/c1_LIR.cpp +++ b/hotspot/src/share/vm/c1/c1_LIR.cpp @@ -22,6 +22,12 @@ @@ -112680,7 +111960,7 @@ index fa37e7a0..5d33d3f7 100644 #endif diff --git a/hotspot/src/share/vm/c1/c1_LIR.hpp b/hotspot/src/share/vm/c1/c1_LIR.hpp -index 24b86202..aec77afe 100644 +index 24b8620211..aec77afe1f 100644 --- a/hotspot/src/share/vm/c1/c1_LIR.hpp +++ b/hotspot/src/share/vm/c1/c1_LIR.hpp @@ -22,6 +22,11 @@ @@ -113029,7 +112309,7 @@ index 24b86202..aec77afe 100644 void shift_right(LIR_Opr value, LIR_Opr count, LIR_Opr dst, LIR_Opr tmp); void unsigned_shift_right(LIR_Opr value, LIR_Opr count, LIR_Opr dst, LIR_Opr tmp); diff --git a/hotspot/src/share/vm/c1/c1_LIRAssembler.cpp b/hotspot/src/share/vm/c1/c1_LIRAssembler.cpp -index e5cd19f1..a18c5300 100644 +index e5cd19f17a..a18c53008b 100644 --- a/hotspot/src/share/vm/c1/c1_LIRAssembler.cpp +++ b/hotspot/src/share/vm/c1/c1_LIRAssembler.cpp @@ -22,6 +22,12 @@ @@ -113076,7 +112356,7 @@ index e5cd19f1..a18c5300 100644 _masm->build_frame(initial_frame_size_in_bytes(), bang_size_in_bytes()); } diff --git a/hotspot/src/share/vm/c1/c1_LIRAssembler.hpp b/hotspot/src/share/vm/c1/c1_LIRAssembler.hpp -index 1a68d458..ac0f4e7a 100644 +index 1a68d458d2..ac0f4e7a46 100644 --- a/hotspot/src/share/vm/c1/c1_LIRAssembler.hpp +++ b/hotspot/src/share/vm/c1/c1_LIRAssembler.hpp @@ -22,6 +22,12 @@ @@ -113121,7 +112401,7 @@ index 1a68d458..ac0f4e7a 100644 # include "c1_LIRAssembler_aarch64.hpp" #endif diff --git a/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp b/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp -index e98834d0..d1a987c6 100644 +index e98834d03a..d1a987c699 100644 --- a/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp +++ b/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp @@ -22,6 +22,12 @@ @@ -113418,7 +112698,7 @@ index e98834d0..d1a987c6 100644 } return value; diff --git a/hotspot/src/share/vm/c1/c1_LIRGenerator.hpp b/hotspot/src/share/vm/c1/c1_LIRGenerator.hpp -index 27be79fe..57c253db 100644 +index 27be79fee1..57c253db69 100644 --- a/hotspot/src/share/vm/c1/c1_LIRGenerator.hpp +++ b/hotspot/src/share/vm/c1/c1_LIRGenerator.hpp @@ -22,6 +22,12 @@ @@ -113467,7 +112747,7 @@ index 27be79fe..57c253db 100644 ciMethod *method, int frequency, int bci, bool backedge, bool notify); diff --git a/hotspot/src/share/vm/c1/c1_LinearScan.cpp b/hotspot/src/share/vm/c1/c1_LinearScan.cpp -index 1f6281bf..4549ff09 100644 +index 1f6281bf25..4549ff0928 100644 --- a/hotspot/src/share/vm/c1/c1_LinearScan.cpp +++ b/hotspot/src/share/vm/c1/c1_LinearScan.cpp @@ -22,6 +22,12 @@ @@ -113615,7 +112895,7 @@ index 1f6281bf..4549ff09 100644 case lir_add: case lir_sub: diff --git a/hotspot/src/share/vm/c1/c1_LinearScan.hpp b/hotspot/src/share/vm/c1/c1_LinearScan.hpp -index 96e6b3ba..576a07d7 100644 +index 96e6b3babf..576a07d73d 100644 --- a/hotspot/src/share/vm/c1/c1_LinearScan.hpp +++ b/hotspot/src/share/vm/c1/c1_LinearScan.hpp @@ -22,6 +22,12 @@ @@ -113642,7 +112922,7 @@ index 96e6b3ba..576a07d7 100644 # include "c1_LinearScan_aarch64.hpp" #endif diff --git a/hotspot/src/share/vm/c1/c1_MacroAssembler.hpp b/hotspot/src/share/vm/c1/c1_MacroAssembler.hpp -index 7e22bbaa..12aca7bf 100644 +index 7e22bbaa27..12aca7bf50 100644 --- a/hotspot/src/share/vm/c1/c1_MacroAssembler.hpp +++ b/hotspot/src/share/vm/c1/c1_MacroAssembler.hpp @@ -22,6 +22,12 @@ @@ -113669,7 +112949,7 @@ index 7e22bbaa..12aca7bf 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 aebc3775..f1253506 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 @@ @@ -113685,7 +112965,7 @@ index aebc3775..f1253506 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 @@ -113693,7 +112973,7 @@ index aebc3775..f1253506 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 @@ -113742,7 +113022,7 @@ index aebc3775..f1253506 100644 // Entry point for compiled code. We want to patch a nmethod. // We don't do a normal VM transition here because we want to diff --git a/hotspot/src/share/vm/c1/c1_globals.hpp b/hotspot/src/share/vm/c1/c1_globals.hpp -index 8f7f9f61..0e2d926b 100644 +index 8f7f9f61c9..0e2d926bdf 100644 --- a/hotspot/src/share/vm/c1/c1_globals.hpp +++ b/hotspot/src/share/vm/c1/c1_globals.hpp @@ -22,6 +22,12 @@ @@ -113769,7 +113049,7 @@ index 8f7f9f61..0e2d926b 100644 # include "c1_globals_aarch64.hpp" #endif diff --git a/hotspot/src/share/vm/classfile/bytecodeAssembler.cpp b/hotspot/src/share/vm/classfile/bytecodeAssembler.cpp -index f067419f..5aa19dc8 100644 +index f067419ffc..5aa19dc84f 100644 --- a/hotspot/src/share/vm/classfile/bytecodeAssembler.cpp +++ b/hotspot/src/share/vm/classfile/bytecodeAssembler.cpp @@ -22,6 +22,12 @@ @@ -113799,7 +113079,7 @@ index f067419f..5aa19dc8 100644 # include "bytes_sparc.hpp" #endif diff --git a/hotspot/src/share/vm/classfile/classFileStream.hpp b/hotspot/src/share/vm/classfile/classFileStream.hpp -index 9632c8c8..fad25c44 100644 +index 9632c8c8c2..fad25c44fc 100644 --- a/hotspot/src/share/vm/classfile/classFileStream.hpp +++ b/hotspot/src/share/vm/classfile/classFileStream.hpp @@ -22,6 +22,12 @@ @@ -113829,7 +113109,7 @@ index 9632c8c8..fad25c44 100644 # include "bytes_aarch64.hpp" #endif diff --git a/hotspot/src/share/vm/classfile/stackMapTable.hpp b/hotspot/src/share/vm/classfile/stackMapTable.hpp -index a36a7ba3..d7c1f086 100644 +index a36a7ba3cf..d7c1f08644 100644 --- a/hotspot/src/share/vm/classfile/stackMapTable.hpp +++ b/hotspot/src/share/vm/classfile/stackMapTable.hpp @@ -22,6 +22,12 @@ @@ -113859,7 +113139,7 @@ index a36a7ba3..d7c1f086 100644 # include "bytes_aarch64.hpp" #endif diff --git a/hotspot/src/share/vm/classfile/verifier.cpp b/hotspot/src/share/vm/classfile/verifier.cpp -index 2dddd1fd..4a20d15f 100644 +index 2dddd1fded..4a20d15f31 100644 --- a/hotspot/src/share/vm/classfile/verifier.cpp +++ b/hotspot/src/share/vm/classfile/verifier.cpp @@ -22,6 +22,12 @@ @@ -113889,7 +113169,7 @@ index 2dddd1fd..4a20d15f 100644 # include "bytes_aarch64.hpp" #endif diff --git a/hotspot/src/share/vm/code/codeBlob.cpp b/hotspot/src/share/vm/code/codeBlob.cpp -index aff2aaf0..9ba76007 100644 +index aff2aaf0ca..9ba76007cd 100644 --- a/hotspot/src/share/vm/code/codeBlob.cpp +++ b/hotspot/src/share/vm/code/codeBlob.cpp @@ -22,6 +22,12 @@ @@ -113919,7 +113199,7 @@ index aff2aaf0..9ba76007 100644 #include "c1/c1_Runtime1.hpp" #endif diff --git a/hotspot/src/share/vm/code/compiledIC.hpp b/hotspot/src/share/vm/code/compiledIC.hpp -index f910f118..e282a3f3 100644 +index f910f11886..e282a3f3af 100644 --- a/hotspot/src/share/vm/code/compiledIC.hpp +++ b/hotspot/src/share/vm/code/compiledIC.hpp @@ -22,6 +22,12 @@ @@ -113949,7 +113229,7 @@ index f910f118..e282a3f3 100644 //----------------------------------------------------------------------------- // The CompiledIC represents a compiled inline cache. diff --git a/hotspot/src/share/vm/code/relocInfo.hpp b/hotspot/src/share/vm/code/relocInfo.hpp -index ad55a2fd..81350482 100644 +index ad55a2fd93..813504821d 100644 --- a/hotspot/src/share/vm/code/relocInfo.hpp +++ b/hotspot/src/share/vm/code/relocInfo.hpp @@ -22,6 +22,12 @@ @@ -114043,7 +113323,7 @@ index ad55a2fd..81350482 100644 class virtual_call_Relocation : public CallRelocation { relocInfo::relocType type() { return relocInfo::virtual_call_type; } diff --git a/hotspot/src/share/vm/code/vmreg.hpp b/hotspot/src/share/vm/code/vmreg.hpp -index 07b595b6..5bc7131a 100644 +index 07b595b60a..5bc7131a8a 100644 --- a/hotspot/src/share/vm/code/vmreg.hpp +++ b/hotspot/src/share/vm/code/vmreg.hpp @@ -22,6 +22,12 @@ @@ -114086,7 +113366,7 @@ index 07b595b6..5bc7131a 100644 # include "vmreg_aarch64.hpp" #endif diff --git a/hotspot/src/share/vm/compiler/disassembler.cpp b/hotspot/src/share/vm/compiler/disassembler.cpp -index dfdd5f77..2dd0ff69 100644 +index dfdd5f77e7..2dd0ff69ac 100644 --- a/hotspot/src/share/vm/compiler/disassembler.cpp +++ b/hotspot/src/share/vm/compiler/disassembler.cpp @@ -22,6 +22,12 @@ @@ -114116,7 +113396,7 @@ index dfdd5f77..2dd0ff69 100644 #include "shark/sharkEntry.hpp" #endif diff --git a/hotspot/src/share/vm/compiler/disassembler.hpp b/hotspot/src/share/vm/compiler/disassembler.hpp -index 168851cc..8b632748 100644 +index 168851cc26..8b632748f2 100644 --- a/hotspot/src/share/vm/compiler/disassembler.hpp +++ b/hotspot/src/share/vm/compiler/disassembler.hpp @@ -22,6 +22,12 @@ @@ -114146,7 +113426,7 @@ index 168851cc..8b632748 100644 diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/cardTableExtension.hpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/cardTableExtension.hpp -index 733b5c91..678a1ee8 100644 +index 733b5c91ad..678a1ee836 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/cardTableExtension.hpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/cardTableExtension.hpp @@ -86,6 +86,9 @@ class CardTableExtension : public CardTableModRefBS { @@ -114160,7 +113440,7 @@ index 733b5c91..678a1ee8 100644 // Adaptive size policy support diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/parMarkBitMap.cpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/parMarkBitMap.cpp -index 1dde1074..8b800b31 100644 +index 1dde10746d..8b800b31c5 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/parMarkBitMap.cpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/parMarkBitMap.cpp @@ -105,6 +105,9 @@ ParMarkBitMap::mark_obj(HeapWord* addr, size_t size) @@ -114174,7 +113454,7 @@ index 1dde1074..8b800b31 100644 } return false; diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psCompactionManager.inline.hpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psCompactionManager.inline.hpp -index 6cf76353..4d34bc20 100644 +index 6cf76353d9..4d34bc209b 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psCompactionManager.inline.hpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psCompactionManager.inline.hpp @@ -33,6 +33,9 @@ void ParCompactionManager::push_objarray(oop obj, size_t index) @@ -114198,7 +113478,7 @@ index 6cf76353..4d34bc20 100644 #endif // SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSCOMPACTIONMANAGER_INLINE_HPP diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp -index 0fa980ef..2f66493e 100644 +index 0fa980ef83..2f66493e0a 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp @@ -499,6 +499,9 @@ void ParallelCompactData::add_obj(HeapWord* addr, size_t len) @@ -114232,7 +113512,7 @@ index 0fa980ef..2f66493e 100644 const size_t end_bit = bitmap->find_obj_end(beg_bit, range_end); diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.hpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.hpp -index 881f380c..461b8393 100644 +index 881f380cea..461b83930f 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.hpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.hpp @@ -1329,6 +1329,9 @@ inline bool PSParallelCompact::mark_obj(oop obj) { @@ -114256,7 +113536,7 @@ index 881f380c..461b8393 100644 } } diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.inline.hpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.inline.hpp -index a3313200..29101966 100644 +index a33132009c..291019660a 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.inline.hpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.inline.hpp @@ -41,8 +41,9 @@ template @@ -114324,7 +113604,7 @@ index a3313200..29101966 100644 assert(o->is_forwarded(), "Sanity"); new_obj = o->forwardee(); diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psScavenge.inline.hpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psScavenge.inline.hpp -index 1a722a7c..4980be39 100644 +index 1a722a7ca7..4980be3946 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psScavenge.inline.hpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psScavenge.inline.hpp @@ -71,14 +71,22 @@ inline void PSScavenge::copy_and_push_safe_barrier(PSPromotionManager* pm, @@ -114367,7 +113647,7 @@ index 1a722a7c..4980be39 100644 new_obj = _pm->copy_to_survivor_space(o); } diff --git a/hotspot/src/share/vm/interpreter/abstractInterpreter.hpp b/hotspot/src/share/vm/interpreter/abstractInterpreter.hpp -index e14c50bf..8b386007 100644 +index e14c50bf01..8b3860070c 100644 --- a/hotspot/src/share/vm/interpreter/abstractInterpreter.hpp +++ b/hotspot/src/share/vm/interpreter/abstractInterpreter.hpp @@ -22,6 +22,12 @@ @@ -114395,7 +113675,7 @@ index e14c50bf..8b386007 100644 // This file contains the platform-independent parts diff --git a/hotspot/src/share/vm/interpreter/bytecode.hpp b/hotspot/src/share/vm/interpreter/bytecode.hpp -index 7e55fd00..a06dcd58 100644 +index 7e55fd009a..a06dcd58bc 100644 --- a/hotspot/src/share/vm/interpreter/bytecode.hpp +++ b/hotspot/src/share/vm/interpreter/bytecode.hpp @@ -22,6 +22,12 @@ @@ -114425,7 +113705,7 @@ index 7e55fd00..a06dcd58 100644 # include "bytes_aarch64.hpp" #endif diff --git a/hotspot/src/share/vm/interpreter/bytecodeInterpreter.hpp b/hotspot/src/share/vm/interpreter/bytecodeInterpreter.hpp -index 28843715..c17fe8d7 100644 +index 28843715c7..c17fe8d7e0 100644 --- a/hotspot/src/share/vm/interpreter/bytecodeInterpreter.hpp +++ b/hotspot/src/share/vm/interpreter/bytecodeInterpreter.hpp @@ -22,6 +22,12 @@ @@ -114465,7 +113745,7 @@ index 28843715..c17fe8d7 100644 # include "bytecodeInterpreter_aarch64.hpp" #endif diff --git a/hotspot/src/share/vm/interpreter/bytecodeInterpreter.inline.hpp b/hotspot/src/share/vm/interpreter/bytecodeInterpreter.inline.hpp -index f5db0b4d..8adbf95a 100644 +index f5db0b4d9d..8adbf95acb 100644 --- a/hotspot/src/share/vm/interpreter/bytecodeInterpreter.inline.hpp +++ b/hotspot/src/share/vm/interpreter/bytecodeInterpreter.inline.hpp @@ -22,6 +22,12 @@ @@ -114495,7 +113775,7 @@ index f5db0b4d..8adbf95a 100644 # include "bytecodeInterpreter_aarch64.inline.hpp" #endif diff --git a/hotspot/src/share/vm/interpreter/bytecodeStream.hpp b/hotspot/src/share/vm/interpreter/bytecodeStream.hpp -index b814b88d..e1f24216 100644 +index b814b88d5d..e1f2421600 100644 --- a/hotspot/src/share/vm/interpreter/bytecodeStream.hpp +++ b/hotspot/src/share/vm/interpreter/bytecodeStream.hpp @@ -22,6 +22,12 @@ @@ -114525,7 +113805,7 @@ index b814b88d..e1f24216 100644 # include "bytes_aarch64.hpp" #endif diff --git a/hotspot/src/share/vm/interpreter/bytecodes.cpp b/hotspot/src/share/vm/interpreter/bytecodes.cpp -index ce5632ea..7f8e8801 100644 +index ce5632ea19..7f8e880199 100644 --- a/hotspot/src/share/vm/interpreter/bytecodes.cpp +++ b/hotspot/src/share/vm/interpreter/bytecodes.cpp @@ -22,6 +22,12 @@ @@ -114555,7 +113835,7 @@ index ce5632ea..7f8e8801 100644 # include "bytes_aarch64.hpp" #endif diff --git a/hotspot/src/share/vm/interpreter/bytecodes.hpp b/hotspot/src/share/vm/interpreter/bytecodes.hpp -index c3463cd7..bdf4c487 100644 +index c3463cd76d..bdf4c487f0 100644 --- a/hotspot/src/share/vm/interpreter/bytecodes.hpp +++ b/hotspot/src/share/vm/interpreter/bytecodes.hpp @@ -22,6 +22,12 @@ @@ -114585,7 +113865,7 @@ index c3463cd7..bdf4c487 100644 # include "bytecodes_aarch64.hpp" #endif diff --git a/hotspot/src/share/vm/interpreter/cppInterpreter.hpp b/hotspot/src/share/vm/interpreter/cppInterpreter.hpp -index 6a644750..f9c540fb 100644 +index 6a6447503c..f9c540fb4a 100644 --- a/hotspot/src/share/vm/interpreter/cppInterpreter.hpp +++ b/hotspot/src/share/vm/interpreter/cppInterpreter.hpp @@ -22,6 +22,12 @@ @@ -114615,7 +113895,7 @@ index 6a644750..f9c540fb 100644 # include "cppInterpreter_aarch64.hpp" #endif diff --git a/hotspot/src/share/vm/interpreter/cppInterpreterGenerator.hpp b/hotspot/src/share/vm/interpreter/cppInterpreterGenerator.hpp -index 6a08a3f4..1fd19994 100644 +index 6a08a3f43f..1fd19994d7 100644 --- a/hotspot/src/share/vm/interpreter/cppInterpreterGenerator.hpp +++ b/hotspot/src/share/vm/interpreter/cppInterpreterGenerator.hpp @@ -22,6 +22,12 @@ @@ -114645,7 +113925,7 @@ index 6a08a3f4..1fd19994 100644 # include "cppInterpreterGenerator_aarch64.hpp" #endif diff --git a/hotspot/src/share/vm/interpreter/interpreter.hpp b/hotspot/src/share/vm/interpreter/interpreter.hpp -index ebfb68d3..610949f3 100644 +index ebfb68d36b..610949f3f7 100644 --- a/hotspot/src/share/vm/interpreter/interpreter.hpp +++ b/hotspot/src/share/vm/interpreter/interpreter.hpp @@ -22,6 +22,12 @@ @@ -114675,7 +113955,7 @@ index ebfb68d3..610949f3 100644 # include "interpreter_aarch64.hpp" #endif diff --git a/hotspot/src/share/vm/interpreter/interpreterGenerator.hpp b/hotspot/src/share/vm/interpreter/interpreterGenerator.hpp -index 1dc7cb29..92bbe6b4 100644 +index 1dc7cb2983..92bbe6b440 100644 --- a/hotspot/src/share/vm/interpreter/interpreterGenerator.hpp +++ b/hotspot/src/share/vm/interpreter/interpreterGenerator.hpp @@ -22,6 +22,12 @@ @@ -114705,7 +113985,7 @@ index 1dc7cb29..92bbe6b4 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 cad9d290..85303e4b 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 @@ @@ -114721,7 +114001,7 @@ index cad9d290..85303e4b 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 @@ -114734,7 +114014,7 @@ index cad9d290..85303e4b 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 @@ -114744,7 +114024,7 @@ index cad9d290..85303e4b 100644 if (src_address == dest_address) { return; diff --git a/hotspot/src/share/vm/interpreter/interpreterRuntime.hpp b/hotspot/src/share/vm/interpreter/interpreterRuntime.hpp -index 472bf4d9..9a98d555 100644 +index 472bf4d94c..9a98d5559c 100644 --- a/hotspot/src/share/vm/interpreter/interpreterRuntime.hpp +++ b/hotspot/src/share/vm/interpreter/interpreterRuntime.hpp @@ -22,6 +22,12 @@ @@ -114783,7 +114063,7 @@ index 472bf4d9..9a98d555 100644 # include "interpreterRT_aarch64.hpp" #endif diff --git a/hotspot/src/share/vm/interpreter/templateInterpreter.hpp b/hotspot/src/share/vm/interpreter/templateInterpreter.hpp -index 5f76dca8..757860f4 100644 +index 5f76dca8a6..757860f43c 100644 --- a/hotspot/src/share/vm/interpreter/templateInterpreter.hpp +++ b/hotspot/src/share/vm/interpreter/templateInterpreter.hpp @@ -22,6 +22,12 @@ @@ -114813,7 +114093,7 @@ index 5f76dca8..757860f4 100644 # include "templateInterpreter_aarch64.hpp" #endif diff --git a/hotspot/src/share/vm/interpreter/templateInterpreterGenerator.hpp b/hotspot/src/share/vm/interpreter/templateInterpreterGenerator.hpp -index bd94bd02..28ca437e 100644 +index bd94bd02bc..28ca437eb2 100644 --- a/hotspot/src/share/vm/interpreter/templateInterpreterGenerator.hpp +++ b/hotspot/src/share/vm/interpreter/templateInterpreterGenerator.hpp @@ -22,6 +22,12 @@ @@ -114843,7 +114123,7 @@ index bd94bd02..28ca437e 100644 # include "templateInterpreterGenerator_aarch64.hpp" #endif diff --git a/hotspot/src/share/vm/interpreter/templateTable.hpp b/hotspot/src/share/vm/interpreter/templateTable.hpp -index 60d243c1..1b73822a 100644 +index 60d243c16a..1b73822abd 100644 --- a/hotspot/src/share/vm/interpreter/templateTable.hpp +++ b/hotspot/src/share/vm/interpreter/templateTable.hpp @@ -22,6 +22,12 @@ @@ -114882,7 +114162,7 @@ index 60d243c1..1b73822a 100644 }; diff --git a/hotspot/src/share/vm/jfr/utilities/jfrBigEndian.hpp b/hotspot/src/share/vm/jfr/utilities/jfrBigEndian.hpp -index 6d9ab39f..f4e9a4ca 100644 +index 6d9ab39fdd..f4e9a4ca69 100644 --- a/hotspot/src/share/vm/jfr/utilities/jfrBigEndian.hpp +++ b/hotspot/src/share/vm/jfr/utilities/jfrBigEndian.hpp @@ -116,7 +116,7 @@ inline T JfrBigEndian::read_unaligned(const address location) { @@ -114895,7 +114175,7 @@ index 6d9ab39f..f4e9a4ca 100644 #else #warning "Unconfigured platform" diff --git a/hotspot/src/share/vm/jfr/writers/jfrEncoders.hpp b/hotspot/src/share/vm/jfr/writers/jfrEncoders.hpp -index 42a8b719..f08f6ee1 100644 +index 42a8b719cd..f08f6ee13a 100644 --- a/hotspot/src/share/vm/jfr/writers/jfrEncoders.hpp +++ b/hotspot/src/share/vm/jfr/writers/jfrEncoders.hpp @@ -22,6 +22,12 @@ @@ -114925,7 +114205,7 @@ index 42a8b719..f08f6ee1 100644 // // The Encoding policy prescribes a template diff --git a/hotspot/src/share/vm/memory/barrierSet.hpp b/hotspot/src/share/vm/memory/barrierSet.hpp -index 13ff9b27..081b7074 100644 +index 13ff9b2738..081b70744d 100644 --- a/hotspot/src/share/vm/memory/barrierSet.hpp +++ b/hotspot/src/share/vm/memory/barrierSet.hpp @@ -27,6 +27,7 @@ @@ -114976,7 +114256,7 @@ index 13ff9b27..081b7074 100644 // at the address "start", which may not necessarily be HeapWord-aligned inline void write_ref_array(HeapWord* start, size_t count); diff --git a/hotspot/src/share/vm/memory/cardTableModRefBS.hpp b/hotspot/src/share/vm/memory/cardTableModRefBS.hpp -index 01e46888..80bd1518 100644 +index 01e4688836..80bd151873 100644 --- a/hotspot/src/share/vm/memory/cardTableModRefBS.hpp +++ b/hotspot/src/share/vm/memory/cardTableModRefBS.hpp @@ -316,6 +316,9 @@ public: @@ -115013,7 +114293,7 @@ index 01e46888..80bd1518 100644 // These are used by G1, when it uses the card table as a temporary data diff --git a/hotspot/src/share/vm/memory/cardTableRS.cpp b/hotspot/src/share/vm/memory/cardTableRS.cpp -index fb33a708..da22acba 100644 +index fb33a708ae..da22acba47 100644 --- a/hotspot/src/share/vm/memory/cardTableRS.cpp +++ b/hotspot/src/share/vm/memory/cardTableRS.cpp @@ -252,6 +252,9 @@ void ClearNoncleanCardWrapper::do_MemRegion(MemRegion mr) { @@ -115041,7 +114321,7 @@ index fb33a708..da22acba 100644 continue; } else { diff --git a/hotspot/src/share/vm/memory/cardTableRS.hpp b/hotspot/src/share/vm/memory/cardTableRS.hpp -index 25884fea..5d4e77f2 100644 +index 25884feac8..5d4e77f269 100644 --- a/hotspot/src/share/vm/memory/cardTableRS.hpp +++ b/hotspot/src/share/vm/memory/cardTableRS.hpp @@ -121,7 +121,14 @@ public: @@ -115061,7 +114341,7 @@ index 25884fea..5d4e77f2 100644 void write_ref_field_gc_work(void* field, oop new_val) { inline_write_ref_field_gc(field, new_val); diff --git a/hotspot/src/share/vm/memory/metaspace.cpp b/hotspot/src/share/vm/memory/metaspace.cpp -index fb0564ac..9cec7d43 100644 +index fb0564ac27..9cec7d4375 100644 --- a/hotspot/src/share/vm/memory/metaspace.cpp +++ b/hotspot/src/share/vm/memory/metaspace.cpp @@ -21,6 +21,13 @@ @@ -115103,7 +114383,7 @@ index fb0564ac..9cec7d43 100644 if (!metaspace_rs.is_reserved()) { #if INCLUDE_CDS diff --git a/hotspot/src/share/vm/oops/constantPool.hpp b/hotspot/src/share/vm/oops/constantPool.hpp -index 635bf6d1..18822d9f 100644 +index 635bf6d1bc..18822d9fcf 100644 --- a/hotspot/src/share/vm/oops/constantPool.hpp +++ b/hotspot/src/share/vm/oops/constantPool.hpp @@ -22,6 +22,12 @@ @@ -115134,7 +114414,7 @@ index 635bf6d1..18822d9f 100644 // A constantPool is an array containing class constants as described in the // class file. diff --git a/hotspot/src/share/vm/oops/klass.hpp b/hotspot/src/share/vm/oops/klass.hpp -index acef3348..23fc0b99 100644 +index acef334849..23fc0b9988 100644 --- a/hotspot/src/share/vm/oops/klass.hpp +++ b/hotspot/src/share/vm/oops/klass.hpp @@ -32,6 +32,9 @@ @@ -115169,7 +114449,7 @@ index acef3348..23fc0b99 100644 void accumulate_modified_oops() { if (has_modified_oops()) _accumulated_modified_oops = 1; } diff --git a/hotspot/src/share/vm/oops/oop.hpp b/hotspot/src/share/vm/oops/oop.hpp -index 0678c6b3..1cb20e35 100644 +index 0678c6b3fb..1cb20e351f 100644 --- a/hotspot/src/share/vm/oops/oop.hpp +++ b/hotspot/src/share/vm/oops/oop.hpp @@ -72,7 +72,13 @@ class oopDesc { @@ -115188,7 +114468,7 @@ index 0678c6b3..1cb20e35 100644 void release_set_mark(markOop m); markOop cas_set_mark(markOop new_mark, markOop old_mark); diff --git a/hotspot/src/share/vm/oops/oop.inline.hpp b/hotspot/src/share/vm/oops/oop.inline.hpp -index beec739d..8660c1e3 100644 +index beec739d38..8660c1e331 100644 --- a/hotspot/src/share/vm/oops/oop.inline.hpp +++ b/hotspot/src/share/vm/oops/oop.inline.hpp @@ -22,6 +22,12 @@ @@ -115218,7 +114498,7 @@ index beec739d..8660c1e3 100644 // Implementation of all inlined member functions defined in oop.hpp // We need a separate file to avoid circular references diff --git a/hotspot/src/share/vm/oops/oop.pcgc.inline.hpp b/hotspot/src/share/vm/oops/oop.pcgc.inline.hpp -index 8a460394..b28bb991 100644 +index 8a4603944e..b28bb99189 100644 --- a/hotspot/src/share/vm/oops/oop.pcgc.inline.hpp +++ b/hotspot/src/share/vm/oops/oop.pcgc.inline.hpp @@ -22,6 +22,12 @@ @@ -115244,7 +114524,7 @@ index 8a460394..b28bb991 100644 #endif // SHARE_VM_OOPS_OOP_PCGC_INLINE_HPP diff --git a/hotspot/src/share/vm/opto/buildOopMap.cpp b/hotspot/src/share/vm/opto/buildOopMap.cpp -index 91642f1d..5df185df 100644 +index 91642f1d7d..5df185df04 100644 --- a/hotspot/src/share/vm/opto/buildOopMap.cpp +++ b/hotspot/src/share/vm/opto/buildOopMap.cpp @@ -22,6 +22,12 @@ @@ -115274,7 +114554,7 @@ index 91642f1d..5df185df 100644 // The functions in this file builds OopMaps after all scheduling is done. // diff --git a/hotspot/src/share/vm/opto/bytecodeInfo.cpp b/hotspot/src/share/vm/opto/bytecodeInfo.cpp -index 7fd615d3..ad472e87 100644 +index 7fd615d35f..ad472e8722 100644 --- a/hotspot/src/share/vm/opto/bytecodeInfo.cpp +++ b/hotspot/src/share/vm/opto/bytecodeInfo.cpp @@ -361,9 +361,20 @@ bool InlineTree::try_to_inline(ciMethod* callee_method, ciMethod* caller_method, @@ -115299,7 +114579,7 @@ index 7fd615d3..ad472e87 100644 } diff --git a/hotspot/src/share/vm/opto/c2_globals.hpp b/hotspot/src/share/vm/opto/c2_globals.hpp -index 82d2efef..d373b204 100644 +index 82d2efef92..d373b20456 100644 --- a/hotspot/src/share/vm/opto/c2_globals.hpp +++ b/hotspot/src/share/vm/opto/c2_globals.hpp @@ -22,6 +22,12 @@ @@ -115329,7 +114609,7 @@ index 82d2efef..d373b204 100644 # include "c2_globals_arm.hpp" #endif diff --git a/hotspot/src/share/vm/opto/c2compiler.cpp b/hotspot/src/share/vm/opto/c2compiler.cpp -index 137f4960..f689d64a 100644 +index 137f49600d..f689d64a38 100644 --- a/hotspot/src/share/vm/opto/c2compiler.cpp +++ b/hotspot/src/share/vm/opto/c2compiler.cpp @@ -22,6 +22,12 @@ @@ -115357,7 +114637,7 @@ index 137f4960..f689d64a 100644 // register information defined by ADLC diff --git a/hotspot/src/share/vm/opto/chaitin.hpp b/hotspot/src/share/vm/opto/chaitin.hpp -index de6d443c..0b27dc93 100644 +index de6d443cd3..0b27dc9335 100644 --- a/hotspot/src/share/vm/opto/chaitin.hpp +++ b/hotspot/src/share/vm/opto/chaitin.hpp @@ -22,6 +22,12 @@ @@ -115399,7 +114679,7 @@ index de6d443c..0b27dc93 100644 void set_reg_pressure(int i) { _reg_pressure = i; } int reg_pressure() const { return _reg_pressure; } diff --git a/hotspot/src/share/vm/opto/compile.cpp b/hotspot/src/share/vm/opto/compile.cpp -index ae22ba84..9004dc0d 100644 +index ae22ba84d9..9004dc0d72 100644 --- a/hotspot/src/share/vm/opto/compile.cpp +++ b/hotspot/src/share/vm/opto/compile.cpp @@ -22,6 +22,12 @@ @@ -115427,7 +114707,7 @@ index ae22ba84..9004dc0d 100644 // -------------------- Compile::mach_constant_base_node ----------------------- diff --git a/hotspot/src/share/vm/opto/compile.hpp b/hotspot/src/share/vm/opto/compile.hpp -index b4f4cfef..d263ee2f 100644 +index b4f4cfefed..d263ee2fc4 100644 --- a/hotspot/src/share/vm/opto/compile.hpp +++ b/hotspot/src/share/vm/opto/compile.hpp @@ -1025,7 +1025,7 @@ class Compile : public Phase { @@ -115440,7 +114720,7 @@ index b4f4cfef..d263ee2f 100644 MAX_const_size = 128, MAX_stubs_size = 128 diff --git a/hotspot/src/share/vm/opto/gcm.cpp b/hotspot/src/share/vm/opto/gcm.cpp -index f51484ef..12457b7c 100644 +index f51484efb0..12457b7c34 100644 --- a/hotspot/src/share/vm/opto/gcm.cpp +++ b/hotspot/src/share/vm/opto/gcm.cpp @@ -22,6 +22,12 @@ @@ -115468,7 +114748,7 @@ index f51484ef..12457b7c 100644 diff --git a/hotspot/src/share/vm/opto/lcm.cpp b/hotspot/src/share/vm/opto/lcm.cpp -index c6178a71..2d492568 100644 +index c6178a715b..2d492568d9 100644 --- a/hotspot/src/share/vm/opto/lcm.cpp +++ b/hotspot/src/share/vm/opto/lcm.cpp @@ -22,6 +22,12 @@ @@ -115496,7 +114776,7 @@ index c6178a71..2d492568 100644 // Optimization - Graph Style diff --git a/hotspot/src/share/vm/opto/locknode.hpp b/hotspot/src/share/vm/opto/locknode.hpp -index b320f6bf..4bfb0ff0 100644 +index b320f6bfb2..4bfb0ff072 100644 --- a/hotspot/src/share/vm/opto/locknode.hpp +++ b/hotspot/src/share/vm/opto/locknode.hpp @@ -22,6 +22,12 @@ @@ -115524,7 +114804,7 @@ index b320f6bf..4bfb0ff0 100644 //------------------------------BoxLockNode------------------------------------ diff --git a/hotspot/src/share/vm/opto/matcher.cpp b/hotspot/src/share/vm/opto/matcher.cpp -index 6660b4b4..dec46861 100644 +index 6660b4b467..dec46861d3 100644 --- a/hotspot/src/share/vm/opto/matcher.cpp +++ b/hotspot/src/share/vm/opto/matcher.cpp @@ -22,6 +22,12 @@ @@ -115552,7 +114832,7 @@ index 6660b4b4..dec46861 100644 OptoReg::Name OptoReg::c_frame_pointer; diff --git a/hotspot/src/share/vm/opto/output.cpp b/hotspot/src/share/vm/opto/output.cpp -index 6032b72a..7fb4dea2 100644 +index 6032b72a9b..7fb4dea28e 100644 --- a/hotspot/src/share/vm/opto/output.cpp +++ b/hotspot/src/share/vm/opto/output.cpp @@ -22,6 +22,12 @@ @@ -115620,7 +114900,7 @@ index 6032b72a..7fb4dea2 100644 // Above we only verified that there is enough space in the instruction section. // However, the instruction may emit stubs that cause code buffer expansion. diff --git a/hotspot/src/share/vm/opto/output.hpp b/hotspot/src/share/vm/opto/output.hpp -index ba728413..37f954de 100644 +index ba72841363..37f954de9b 100644 --- a/hotspot/src/share/vm/opto/output.hpp +++ b/hotspot/src/share/vm/opto/output.hpp @@ -22,6 +22,12 @@ @@ -115648,7 +114928,7 @@ index ba728413..37f954de 100644 class Arena; diff --git a/hotspot/src/share/vm/opto/regmask.cpp b/hotspot/src/share/vm/opto/regmask.cpp -index 352ccfb9..9a656d03 100644 +index 352ccfb9d9..9a656d03ee 100644 --- a/hotspot/src/share/vm/opto/regmask.cpp +++ b/hotspot/src/share/vm/opto/regmask.cpp @@ -22,6 +22,12 @@ @@ -115676,7 +114956,7 @@ index 352ccfb9..9a656d03 100644 #define RM_SIZE _RM_SIZE /* a constant private to the class RegMask */ diff --git a/hotspot/src/share/vm/opto/regmask.hpp b/hotspot/src/share/vm/opto/regmask.hpp -index 5ceebb3f..6d08b687 100644 +index 5ceebb3fb8..6d08b68731 100644 --- a/hotspot/src/share/vm/opto/regmask.hpp +++ b/hotspot/src/share/vm/opto/regmask.hpp @@ -22,6 +22,12 @@ @@ -115704,7 +114984,7 @@ index 5ceebb3f..6d08b687 100644 // Some fun naming (textual) substitutions: diff --git a/hotspot/src/share/vm/opto/runtime.cpp b/hotspot/src/share/vm/opto/runtime.cpp -index a43b37f2..f2bcafa2 100644 +index a43b37f2c5..f2bcafa2c5 100644 --- a/hotspot/src/share/vm/opto/runtime.cpp +++ b/hotspot/src/share/vm/opto/runtime.cpp @@ -22,6 +22,12 @@ @@ -115732,7 +115012,7 @@ index a43b37f2..f2bcafa2 100644 diff --git a/hotspot/src/share/vm/opto/type.cpp b/hotspot/src/share/vm/opto/type.cpp -index 58572f13..299d48b1 100644 +index 58572f137d..299d48b12a 100644 --- a/hotspot/src/share/vm/opto/type.cpp +++ b/hotspot/src/share/vm/opto/type.cpp @@ -22,6 +22,12 @@ @@ -115766,7 +115046,7 @@ index 58572f13..299d48b1 100644 { Bad, T_ILLEGAL, "vectors:", false, 0, relocInfo::none }, // VectorS { Bad, T_ILLEGAL, "vectord:", false, Op_RegL, relocInfo::none }, // VectorD diff --git a/hotspot/src/share/vm/prims/jniCheck.cpp b/hotspot/src/share/vm/prims/jniCheck.cpp -index 593ca8a1..82813b71 100644 +index 593ca8a1e3..82813b71fe 100644 --- a/hotspot/src/share/vm/prims/jniCheck.cpp +++ b/hotspot/src/share/vm/prims/jniCheck.cpp @@ -22,6 +22,12 @@ @@ -115796,7 +115076,7 @@ index 593ca8a1..82813b71 100644 // Complain every extra number of unplanned local refs #define CHECK_JNI_LOCAL_REF_CAP_WARN_THRESHOLD 32 diff --git a/hotspot/src/share/vm/prims/jni_md.h b/hotspot/src/share/vm/prims/jni_md.h -index 6209a664..271715d4 100644 +index 6209a66449..271715d4a2 100644 --- a/hotspot/src/share/vm/prims/jni_md.h +++ b/hotspot/src/share/vm/prims/jni_md.h @@ -22,6 +22,12 @@ @@ -115826,7 +115106,7 @@ index 6209a664..271715d4 100644 /* diff --git a/hotspot/src/share/vm/prims/jvmtiClassFileReconstituter.cpp b/hotspot/src/share/vm/prims/jvmtiClassFileReconstituter.cpp -index ab31d0d9..0d8570b7 100644 +index ab31d0d91e..0d8570b764 100644 --- a/hotspot/src/share/vm/prims/jvmtiClassFileReconstituter.cpp +++ b/hotspot/src/share/vm/prims/jvmtiClassFileReconstituter.cpp @@ -22,6 +22,12 @@ @@ -115856,7 +115136,7 @@ index ab31d0d9..0d8570b7 100644 // FIXME: fix Synthetic attribute // FIXME: per Serguei, add error return handling for ConstantPool::copy_cpool_bytes() diff --git a/hotspot/src/share/vm/prims/methodHandles.hpp b/hotspot/src/share/vm/prims/methodHandles.hpp -index db6e0618..84108285 100644 +index db6e06180d..841082859a 100644 --- a/hotspot/src/share/vm/prims/methodHandles.hpp +++ b/hotspot/src/share/vm/prims/methodHandles.hpp @@ -22,6 +22,12 @@ @@ -115887,7 +115167,7 @@ index db6e0618..84108285 100644 // Tracing static void trace_method_handle(MacroAssembler* _masm, const char* adaptername) PRODUCT_RETURN; diff --git a/hotspot/src/share/vm/runtime/atomic.inline.hpp b/hotspot/src/share/vm/runtime/atomic.inline.hpp -index 222f29cb..7c7c6edb 100644 +index 222f29cbf4..7c7c6edb27 100644 --- a/hotspot/src/share/vm/runtime/atomic.inline.hpp +++ b/hotspot/src/share/vm/runtime/atomic.inline.hpp @@ -22,6 +22,12 @@ @@ -115917,7 +115197,7 @@ index 222f29cb..7c7c6edb 100644 # include "atomic_linux_sparc.inline.hpp" #endif diff --git a/hotspot/src/share/vm/runtime/deoptimization.cpp b/hotspot/src/share/vm/runtime/deoptimization.cpp -index f91afdc4..36a924fd 100644 +index f91afdc416..36a924fd4f 100644 --- a/hotspot/src/share/vm/runtime/deoptimization.cpp +++ b/hotspot/src/share/vm/runtime/deoptimization.cpp @@ -22,6 +22,12 @@ @@ -115960,7 +115240,7 @@ index f91afdc4..36a924fd 100644 PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC diff --git a/hotspot/src/share/vm/runtime/dtraceJSDT.hpp b/hotspot/src/share/vm/runtime/dtraceJSDT.hpp -index db568def..490c5f5a 100644 +index db568def34..490c5f5a4e 100644 --- a/hotspot/src/share/vm/runtime/dtraceJSDT.hpp +++ b/hotspot/src/share/vm/runtime/dtraceJSDT.hpp @@ -22,6 +22,12 @@ @@ -115990,7 +115270,7 @@ index db568def..490c5f5a 100644 class RegisteredProbes; typedef jlong OpaqueProbes; diff --git a/hotspot/src/share/vm/runtime/frame.cpp b/hotspot/src/share/vm/runtime/frame.cpp -index 338b7ad3..5a161133 100644 +index 338b7ad3a7..5a161133ba 100644 --- a/hotspot/src/share/vm/runtime/frame.cpp +++ b/hotspot/src/share/vm/runtime/frame.cpp @@ -22,6 +22,12 @@ @@ -116021,7 +115301,7 @@ index 338b7ad3..5a161133 100644 PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC diff --git a/hotspot/src/share/vm/runtime/frame.hpp b/hotspot/src/share/vm/runtime/frame.hpp -index 2d80ecc2..4a9e6edb 100644 +index 2d80ecc208..4a9e6edb54 100644 --- a/hotspot/src/share/vm/runtime/frame.hpp +++ b/hotspot/src/share/vm/runtime/frame.hpp @@ -22,6 +22,12 @@ @@ -116062,7 +115342,7 @@ index 2d80ecc2..4a9e6edb 100644 # include "frame_aarch64.hpp" #endif diff --git a/hotspot/src/share/vm/runtime/frame.inline.hpp b/hotspot/src/share/vm/runtime/frame.inline.hpp -index 710b8230..704cc8df 100644 +index 710b82306a..704cc8df8f 100644 --- a/hotspot/src/share/vm/runtime/frame.inline.hpp +++ b/hotspot/src/share/vm/runtime/frame.inline.hpp @@ -22,6 +22,12 @@ @@ -116105,7 +115385,7 @@ index 710b8230..704cc8df 100644 #endif // SHARE_VM_RUNTIME_FRAME_INLINE_HPP diff --git a/hotspot/src/share/vm/runtime/globals.hpp b/hotspot/src/share/vm/runtime/globals.hpp -index 23ce8af5..f36137aa 100644 +index 23ce8af569..f36137aabf 100644 --- a/hotspot/src/share/vm/runtime/globals.hpp +++ b/hotspot/src/share/vm/runtime/globals.hpp @@ -55,6 +55,12 @@ @@ -116170,7 +115450,7 @@ index 23ce8af5..f36137aa 100644 \ product(uintx, OldSize, ScaleForWordSize(4*M), \ diff --git a/hotspot/src/share/vm/runtime/icache.hpp b/hotspot/src/share/vm/runtime/icache.hpp -index ba81a06f..9c0cfdb7 100644 +index ba81a06ff5..9c0cfdb7d7 100644 --- a/hotspot/src/share/vm/runtime/icache.hpp +++ b/hotspot/src/share/vm/runtime/icache.hpp @@ -22,6 +22,12 @@ @@ -116201,7 +115481,7 @@ index ba81a06f..9c0cfdb7 100644 class ICacheStubGenerator : public StubCodeGenerator { diff --git a/hotspot/src/share/vm/runtime/java.cpp b/hotspot/src/share/vm/runtime/java.cpp -index 0a263b01..9ba0deca 100644 +index 0a263b017c..9ba0decaae 100644 --- a/hotspot/src/share/vm/runtime/java.cpp +++ b/hotspot/src/share/vm/runtime/java.cpp @@ -22,6 +22,12 @@ @@ -116231,7 +115511,7 @@ index 0a263b01..9ba0deca 100644 #include "gc_implementation/concurrentMarkSweep/concurrentMarkSweepThread.hpp" #include "gc_implementation/parallelScavenge/psScavenge.hpp" diff --git a/hotspot/src/share/vm/runtime/javaCalls.hpp b/hotspot/src/share/vm/runtime/javaCalls.hpp -index 6126bbe7..1747e2b2 100644 +index 6126bbe75e..1747e2b2ee 100644 --- a/hotspot/src/share/vm/runtime/javaCalls.hpp +++ b/hotspot/src/share/vm/runtime/javaCalls.hpp @@ -22,6 +22,12 @@ @@ -116261,7 +115541,7 @@ index 6126bbe7..1747e2b2 100644 // A JavaCallWrapper is constructed before each JavaCall and destructed after the call. // Its purpose is to allocate/deallocate a new handle block and to save/restore the last diff --git a/hotspot/src/share/vm/runtime/javaFrameAnchor.hpp b/hotspot/src/share/vm/runtime/javaFrameAnchor.hpp -index 129a01e2..c2b1b2e6 100644 +index 129a01e293..c2b1b2e6c3 100644 --- a/hotspot/src/share/vm/runtime/javaFrameAnchor.hpp +++ b/hotspot/src/share/vm/runtime/javaFrameAnchor.hpp @@ -22,6 +22,12 @@ @@ -116291,7 +115571,7 @@ index 129a01e2..c2b1b2e6 100644 # include "javaFrameAnchor_aarch64.hpp" #endif diff --git a/hotspot/src/share/vm/runtime/os.cpp b/hotspot/src/share/vm/runtime/os.cpp -index 96eed036..28c78409 100644 +index 96eed03670..28c78409e7 100644 --- a/hotspot/src/share/vm/runtime/os.cpp +++ b/hotspot/src/share/vm/runtime/os.cpp @@ -1122,7 +1122,8 @@ bool os::is_first_C_frame(frame* fr) { @@ -116305,7 +115585,7 @@ index 96eed036..28c78409 100644 // stack grows downwards; if old_fp is below current fp or if the stack // frame is too large, either the stack is corrupted or fp is not saved diff --git a/hotspot/src/share/vm/runtime/os.hpp b/hotspot/src/share/vm/runtime/os.hpp -index 836c231b..0ca6e645 100644 +index 836c231b03..0ca6e64598 100644 --- a/hotspot/src/share/vm/runtime/os.hpp +++ b/hotspot/src/share/vm/runtime/os.hpp @@ -22,6 +22,12 @@ @@ -116335,7 +115615,7 @@ index 836c231b..0ca6e645 100644 # include "os_linux_aarch64.hpp" #endif diff --git a/hotspot/src/share/vm/runtime/prefetch.inline.hpp b/hotspot/src/share/vm/runtime/prefetch.inline.hpp -index f4e30de3..fec16f84 100644 +index f4e30de34d..fec16f842c 100644 --- a/hotspot/src/share/vm/runtime/prefetch.inline.hpp +++ b/hotspot/src/share/vm/runtime/prefetch.inline.hpp @@ -46,6 +46,12 @@ @@ -116352,7 +115632,7 @@ index f4e30de3..fec16f84 100644 // Solaris #ifdef TARGET_OS_ARCH_solaris_x86 diff --git a/hotspot/src/share/vm/runtime/registerMap.hpp b/hotspot/src/share/vm/runtime/registerMap.hpp -index 67ef212d..1e26dfcb 100644 +index 67ef212d65..1e26dfcba4 100644 --- a/hotspot/src/share/vm/runtime/registerMap.hpp +++ b/hotspot/src/share/vm/runtime/registerMap.hpp @@ -22,6 +22,12 @@ @@ -116395,7 +115675,7 @@ index 67ef212d..1e26dfcb 100644 }; diff --git a/hotspot/src/share/vm/runtime/relocator.hpp b/hotspot/src/share/vm/runtime/relocator.hpp -index bb19c75f..53f3c9f6 100644 +index bb19c75fe6..53f3c9f6bd 100644 --- a/hotspot/src/share/vm/runtime/relocator.hpp +++ b/hotspot/src/share/vm/runtime/relocator.hpp @@ -22,6 +22,12 @@ @@ -116425,7 +115705,7 @@ index bb19c75f..53f3c9f6 100644 // This code has been converted from the 1.1E java virtual machine // Thanks to the JavaTopics group for using the code diff --git a/hotspot/src/share/vm/runtime/safepoint.cpp b/hotspot/src/share/vm/runtime/safepoint.cpp -index 440617c8..be0e4dd1 100644 +index 440617c802..be0e4dd13c 100644 --- a/hotspot/src/share/vm/runtime/safepoint.cpp +++ b/hotspot/src/share/vm/runtime/safepoint.cpp @@ -22,6 +22,12 @@ @@ -116457,7 +115737,7 @@ index 440617c8..be0e4dd1 100644 #include "gc_implementation/concurrentMarkSweep/concurrentMarkSweepThread.hpp" #include "gc_implementation/shared/suspendibleThreadSet.hpp" diff --git a/hotspot/src/share/vm/runtime/sharedRuntime.cpp b/hotspot/src/share/vm/runtime/sharedRuntime.cpp -index 5f540247..abcd6066 100644 +index 5f540247f9..abcd6066b9 100644 --- a/hotspot/src/share/vm/runtime/sharedRuntime.cpp +++ b/hotspot/src/share/vm/runtime/sharedRuntime.cpp @@ -22,6 +22,12 @@ @@ -116498,7 +115778,7 @@ index 5f540247..abcd6066 100644 // G1 write-barrier pre: executed before a pointer store. diff --git a/hotspot/src/share/vm/runtime/sharedRuntimeTrig.cpp b/hotspot/src/share/vm/runtime/sharedRuntimeTrig.cpp -index 37880d8a..3987880b 100644 +index 37880d8a5c..3987880b16 100644 --- a/hotspot/src/share/vm/runtime/sharedRuntimeTrig.cpp +++ b/hotspot/src/share/vm/runtime/sharedRuntimeTrig.cpp @@ -22,6 +22,12 @@ @@ -116531,7 +115811,7 @@ index 37880d8a..3987880b 100644 static const double S1 = -1.66666666666666324348e-01, /* 0xBFC55555, 0x55555549 */ diff --git a/hotspot/src/share/vm/runtime/stackValueCollection.cpp b/hotspot/src/share/vm/runtime/stackValueCollection.cpp -index 87747683..fe81c1bf 100644 +index 8774768311..fe81c1bfd8 100644 --- a/hotspot/src/share/vm/runtime/stackValueCollection.cpp +++ b/hotspot/src/share/vm/runtime/stackValueCollection.cpp @@ -22,6 +22,12 @@ @@ -116561,7 +115841,7 @@ index 87747683..fe81c1bf 100644 PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC diff --git a/hotspot/src/share/vm/runtime/statSampler.cpp b/hotspot/src/share/vm/runtime/statSampler.cpp -index 41f46962..3b430890 100644 +index 41f469622f..3b43089062 100644 --- a/hotspot/src/share/vm/runtime/statSampler.cpp +++ b/hotspot/src/share/vm/runtime/statSampler.cpp @@ -22,6 +22,12 @@ @@ -116591,7 +115871,7 @@ index 41f46962..3b430890 100644 // -------------------------------------------------------- // StatSamplerTask diff --git a/hotspot/src/share/vm/runtime/stubRoutines.hpp b/hotspot/src/share/vm/runtime/stubRoutines.hpp -index e18b9127..9bf93376 100644 +index e18b9127df..9bf933762a 100644 --- a/hotspot/src/share/vm/runtime/stubRoutines.hpp +++ b/hotspot/src/share/vm/runtime/stubRoutines.hpp @@ -22,6 +22,12 @@ @@ -116632,7 +115912,7 @@ index e18b9127..9bf93376 100644 static jint _verify_oop_count; diff --git a/hotspot/src/share/vm/runtime/thread.cpp b/hotspot/src/share/vm/runtime/thread.cpp -index e6586c40..3db678ff 100644 +index e6586c40cb..3db678ff48 100644 --- a/hotspot/src/share/vm/runtime/thread.cpp +++ b/hotspot/src/share/vm/runtime/thread.cpp @@ -22,6 +22,12 @@ @@ -116649,7 +115929,7 @@ index e6586c40..3db678ff 100644 #include "classfile/classLoader.hpp" #include "classfile/javaClasses.hpp" diff --git a/hotspot/src/share/vm/runtime/thread.hpp b/hotspot/src/share/vm/runtime/thread.hpp -index 1c19ab72..aa69217e 100644 +index 1c19ab7290..aa69217eef 100644 --- a/hotspot/src/share/vm/runtime/thread.hpp +++ b/hotspot/src/share/vm/runtime/thread.hpp @@ -22,6 +22,12 @@ @@ -116679,7 +115959,7 @@ index 1c19ab72..aa69217e 100644 # include "thread_linux_aarch64.hpp" #endif diff --git a/hotspot/src/share/vm/runtime/threadLocalStorage.hpp b/hotspot/src/share/vm/runtime/threadLocalStorage.hpp -index 58c1afc8..0938b2ed 100644 +index 58c1afc810..0938b2edda 100644 --- a/hotspot/src/share/vm/runtime/threadLocalStorage.hpp +++ b/hotspot/src/share/vm/runtime/threadLocalStorage.hpp @@ -22,6 +22,12 @@ @@ -116709,7 +115989,7 @@ index 58c1afc8..0938b2ed 100644 # include "threadLS_linux_aarch64.hpp" #endif diff --git a/hotspot/src/share/vm/runtime/virtualspace.cpp b/hotspot/src/share/vm/runtime/virtualspace.cpp -index 66392b75..5ced38d8 100644 +index 66392b75f1..5ced38d838 100644 --- a/hotspot/src/share/vm/runtime/virtualspace.cpp +++ b/hotspot/src/share/vm/runtime/virtualspace.cpp @@ -1,5 +1,6 @@ @@ -116749,7 +116029,7 @@ index 66392b75..5ced38d8 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 32e3921b..c6cc4c43 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 @@ @@ -116803,7 +116083,7 @@ index 32e3921b..c6cc4c43 100644 #endif // COMPILER2 diff --git a/hotspot/src/share/vm/runtime/vm_version.cpp b/hotspot/src/share/vm/runtime/vm_version.cpp -index 91f9c70f..d8dcfcfc 100644 +index 91f9c70f5a..d8dcfcfcca 100644 --- a/hotspot/src/share/vm/runtime/vm_version.cpp +++ b/hotspot/src/share/vm/runtime/vm_version.cpp @@ -22,6 +22,12 @@ @@ -116848,7 +116128,7 @@ index 91f9c70f..d8dcfcfc 100644 #define CPU IA32_ONLY("x86") \ IA64_ONLY("ia64") \ diff --git a/hotspot/src/share/vm/utilities/copy.hpp b/hotspot/src/share/vm/utilities/copy.hpp -index c1d82c70..73b858b8 100644 +index c1d82c7083..73b858b86e 100644 --- a/hotspot/src/share/vm/utilities/copy.hpp +++ b/hotspot/src/share/vm/utilities/copy.hpp @@ -22,6 +22,12 @@ @@ -116879,7 +116159,7 @@ index c1d82c70..73b858b8 100644 }; diff --git a/hotspot/src/share/vm/utilities/debug.cpp b/hotspot/src/share/vm/utilities/debug.cpp -index 58a32a2b..1026585f 100644 +index 58a32a2b83..1026585f84 100644 --- a/hotspot/src/share/vm/utilities/debug.cpp +++ b/hotspot/src/share/vm/utilities/debug.cpp @@ -690,6 +690,7 @@ void help() { @@ -116891,7 +116171,7 @@ index 58a32a2b..1026585f 100644 tty->print_cr(" - in gdb do 'set overload-resolution off' before calling pns()"); tty->print_cr(" - in dbx do 'frame 1' before calling pns()"); diff --git a/hotspot/src/share/vm/utilities/globalDefinitions.hpp b/hotspot/src/share/vm/utilities/globalDefinitions.hpp -index 81866b84..61fc0c48 100644 +index 81866b8409..61fc0c48a2 100644 --- a/hotspot/src/share/vm/utilities/globalDefinitions.hpp +++ b/hotspot/src/share/vm/utilities/globalDefinitions.hpp @@ -22,6 +22,12 @@ @@ -116921,7 +116201,7 @@ index 81866b84..61fc0c48 100644 /* * If a platform does not support native stack walking diff --git a/hotspot/src/share/vm/utilities/macros.hpp b/hotspot/src/share/vm/utilities/macros.hpp -index 599e1074..41ef06e2 100644 +index 599e1074de..41ef06e27f 100644 --- a/hotspot/src/share/vm/utilities/macros.hpp +++ b/hotspot/src/share/vm/utilities/macros.hpp @@ -22,6 +22,12 @@ @@ -116969,7 +116249,7 @@ index 599e1074..41ef06e2 100644 #ifndef PPC #define PPC diff --git a/hotspot/src/share/vm/utilities/taskqueue.hpp b/hotspot/src/share/vm/utilities/taskqueue.hpp -index bc06cacc..46be35a3 100644 +index bc06caccb4..46be35a325 100644 --- a/hotspot/src/share/vm/utilities/taskqueue.hpp +++ b/hotspot/src/share/vm/utilities/taskqueue.hpp @@ -121,11 +121,22 @@ protected: @@ -117153,7 +116433,7 @@ index bc06cacc..46be35a3 100644 // before the store just above. OrderAccess::fence(); diff --git a/hotspot/src/share/vm/utilities/vmError.cpp b/hotspot/src/share/vm/utilities/vmError.cpp -index fa7a3250..7098a98a 100644 +index fa7a32508e..7098a98a9f 100644 --- a/hotspot/src/share/vm/utilities/vmError.cpp +++ b/hotspot/src/share/vm/utilities/vmError.cpp @@ -22,6 +22,13 @@ @@ -117185,7 +116465,7 @@ index fa7a3250..7098a98a 100644 Abstract_VM_Version::vm_name(), Abstract_VM_Version::vm_release(), diff --git a/hotspot/test/compiler/criticalnatives/argumentcorruption/Test8167409.sh b/hotspot/test/compiler/criticalnatives/argumentcorruption/Test8167409.sh -index fcf1d04b..5b8e7dcc 100644 +index fcf1d04b6a..5b8e7dcce5 100644 --- a/hotspot/test/compiler/criticalnatives/argumentcorruption/Test8167409.sh +++ b/hotspot/test/compiler/criticalnatives/argumentcorruption/Test8167409.sh @@ -24,6 +24,12 @@ @@ -117221,7 +116501,7 @@ index fcf1d04b..5b8e7dcc 100644 cp ${TESTSRC}${FS}*.java ${THIS_DIR} diff --git a/hotspot/test/compiler/intrinsics/sha/cli/testcases/GenericTestCaseForOtherCPU.java b/hotspot/test/compiler/intrinsics/sha/cli/testcases/GenericTestCaseForOtherCPU.java -index fa9a6f20..885957cf 100644 +index fa9a6f208b..885957cf1c 100644 --- a/hotspot/test/compiler/intrinsics/sha/cli/testcases/GenericTestCaseForOtherCPU.java +++ b/hotspot/test/compiler/intrinsics/sha/cli/testcases/GenericTestCaseForOtherCPU.java @@ -34,11 +34,12 @@ import com.oracle.java.testlibrary.cli.predicate.OrPredicate; @@ -117240,7 +116520,7 @@ index fa9a6f20..885957cf 100644 @Override diff --git a/hotspot/test/compiler/testlibrary/sha/predicate/IntrinsicPredicates.java b/hotspot/test/compiler/testlibrary/sha/predicate/IntrinsicPredicates.java -index dc8c3984..2427b2bf 100644 +index dc8c398408..2427b2bf7b 100644 --- a/hotspot/test/compiler/testlibrary/sha/predicate/IntrinsicPredicates.java +++ b/hotspot/test/compiler/testlibrary/sha/predicate/IntrinsicPredicates.java @@ -62,18 +62,24 @@ public class IntrinsicPredicates { @@ -117271,7 +116551,7 @@ index dc8c3984..2427b2bf 100644 public static final BooleanSupplier SHA512_INSTRUCTION_AVAILABLE = new OrPredicate( diff --git a/hotspot/test/runtime/6929067/Test6929067.sh b/hotspot/test/runtime/6929067/Test6929067.sh -index 2bbb3401..1a5482e6 100644 +index 2bbb3401ce..1a5482e645 100644 --- a/hotspot/test/runtime/6929067/Test6929067.sh +++ b/hotspot/test/runtime/6929067/Test6929067.sh @@ -97,6 +97,10 @@ case "$ARCH" in @@ -117286,19 +116566,10 @@ index 2bbb3401..1a5482e6 100644 esac diff --git a/hotspot/test/runtime/Unsafe/RangeCheck.java b/hotspot/test/runtime/Unsafe/RangeCheck.java -index 9ded944c..0c8bcfb9 100644 +index 9ded944cb2..4d4ea2e048 100644 --- a/hotspot/test/runtime/Unsafe/RangeCheck.java +++ b/hotspot/test/runtime/Unsafe/RangeCheck.java -@@ -28,6 +28,8 @@ - * @library /testlibrary - */ - -+import org.jcp.xml.dsig.internal.dom.Utils; -+ - import com.oracle.java.testlibrary.*; - import sun.misc.Unsafe; - -@@ -43,6 +45,7 @@ public class RangeCheck { +@@ -43,6 +43,7 @@ public class RangeCheck { true, "-Xmx32m", "-XX:-TransmitErrorReport", @@ -117307,7 +116578,7 @@ index 9ded944c..0c8bcfb9 100644 OutputAnalyzer output = new OutputAnalyzer(pb.start()); diff --git a/hotspot/test/test_env.sh b/hotspot/test/test_env.sh -index 5ba4f28c..d9d8bb6b 100644 +index 5ba4f28c45..d9d8bb6b6b 100644 --- a/hotspot/test/test_env.sh +++ b/hotspot/test/test_env.sh @@ -211,6 +211,29 @@ if [ $? = 0 ] @@ -117341,7 +116612,7 @@ index 5ba4f28c..d9d8bb6b 100644 echo "VM_TYPE=${VM_TYPE}" echo "VM_BITS=${VM_BITS}" diff --git a/hotspot/test/testlibrary/com/oracle/java/testlibrary/Platform.java b/hotspot/test/testlibrary/com/oracle/java/testlibrary/Platform.java -index 6a140793..56a6375b 100644 +index 6a14079347..56a6375b5f 100644 --- a/hotspot/test/testlibrary/com/oracle/java/testlibrary/Platform.java +++ b/hotspot/test/testlibrary/com/oracle/java/testlibrary/Platform.java @@ -126,6 +126,10 @@ public class Platform { @@ -117367,7 +116638,7 @@ index 6a140793..56a6375b 100644 * Return a boolean for whether we expect to be able to attach * the SA to our own processes on this system. diff --git a/hotspot/test/testlibrary_tests/TestMutuallyExclusivePlatformPredicates.java b/hotspot/test/testlibrary_tests/TestMutuallyExclusivePlatformPredicates.java -index 7d56a4a3..41825e18 100644 +index 7d56a4a3bc..41825e18b3 100644 --- a/hotspot/test/testlibrary_tests/TestMutuallyExclusivePlatformPredicates.java +++ b/hotspot/test/testlibrary_tests/TestMutuallyExclusivePlatformPredicates.java @@ -43,7 +43,7 @@ import java.util.Set; @@ -117380,7 +116651,7 @@ index 7d56a4a3..41825e18 100644 OS("isAix", "isLinux", "isSolaris", "isWindows", "isOSX"), VM_TYPE("isClient", "isServer", "isGraal", "isMinimal"), diff --git a/jdk/make/Images.gmk b/jdk/make/Images.gmk -index 991c0af7..91716856 100644 +index 991c0af7b4..9171685655 100644 --- a/jdk/make/Images.gmk +++ b/jdk/make/Images.gmk @@ -23,6 +23,12 @@ @@ -117432,7 +116703,7 @@ index 991c0af7..91716856 100644 jre-overlay-image: $(JRE_OVERLAY_BIN_TARGETS) $(JRE_OVERLAY_LIB_TARGETS) \ diff --git a/jdk/make/gensrc/GensrcMisc.gmk b/jdk/make/gensrc/GensrcMisc.gmk -index 0e3dee5c..d428ac8c 100644 +index 0e3dee5ca3..66f19f4d25 100644 --- a/jdk/make/gensrc/GensrcMisc.gmk +++ b/jdk/make/gensrc/GensrcMisc.gmk @@ -23,6 +23,12 @@ @@ -117448,29 +116719,16 @@ index 0e3dee5c..d428ac8c 100644 include ProfileNames.gmk ################################################################################ -@@ -30,6 +36,11 @@ include ProfileNames.gmk - # string and the runtime name into the Version.java file. - # To be printed by java -version - -+company_name = -+ifneq ($(COMPANY_NAME),N/A) -+ company_name=($(COMPANY_NAME)) -+endif -+ - $(JDK_OUTPUTDIR)/gensrc/sun/misc/Version.java \ - $(PROFILE_VERSION_JAVA_TARGETS): \ - $(JDK_TOPDIR)/src/share/classes/sun/misc/Version.java.template -@@ -41,6 +52,8 @@ $(PROFILE_VERSION_JAVA_TARGETS): \ +@@ -39,6 +45,7 @@ $(PROFILE_VERSION_JAVA_TARGETS): \ + $(SED) -e 's/@@launcher_name@@/$(LAUNCHER_NAME)/g' \ + -e 's/@@java_version@@/$(RELEASE)/g' \ -e 's/@@java_runtime_version@@/$(FULL_VERSION)/g' \ ++ -e 's/@@loongson_runtime_name@@/$(LOONGSON_RUNTIME_NAME)/g' \ -e 's/@@java_runtime_name@@/$(RUNTIME_NAME)/g' \ -e 's/@@java_profile_name@@/$(call profile_version_name, $@)/g' \ -+ -e 's/@@company_name@@/$(company_name)/g' \ -+ -e 's/@@loongson_runtime_name@@/$(LOONGSON_RUNTIME_NAME)/g' \ $< > $@.tmp - $(MV) $@.tmp $@ - diff --git a/jdk/make/lib/SoundLibraries.gmk b/jdk/make/lib/SoundLibraries.gmk -index b59a9462..8ce97dc8 100644 +index b59a9462ec..8ce97dc854 100644 --- a/jdk/make/lib/SoundLibraries.gmk +++ b/jdk/make/lib/SoundLibraries.gmk @@ -23,6 +23,12 @@ @@ -117502,7 +116760,7 @@ index b59a9462..8ce97dc8 100644 LIBJSOUND_CFLAGS += -DX_ARCH=X_PPC64 endif diff --git a/jdk/src/share/classes/sun/misc/Version.java.template b/jdk/src/share/classes/sun/misc/Version.java.template -index 32e2586e..16b43a39 100644 +index 32e2586e79..e38541a9f7 100644 --- a/jdk/src/share/classes/sun/misc/Version.java.template +++ b/jdk/src/share/classes/sun/misc/Version.java.template @@ -23,6 +23,13 @@ @@ -117519,26 +116777,22 @@ index 32e2586e..16b43a39 100644 package sun.misc; import java.io.PrintStream; -@@ -43,6 +50,12 @@ public class Version { - +@@ -44,6 +51,9 @@ public class Version { private static final String java_runtime_version = "@@java_runtime_version@@"; -+ -+ private static final String company_name = -+ "@@company_name@@"; -+ + + private static final String loongson_runtime_name = + "@@loongson_runtime_name@@"; - ++ static { init(); -@@ -103,7 +116,12 @@ public class Version { + } +@@ -103,7 +113,11 @@ public class Version { /* Second line: runtime version (ie, libraries). */ - ps.print(java_runtime_name + " (build " + java_runtime_version); -+ ps.print(java_runtime_name + " "); -+ ++ ps.print(java_runtime_name); + if (loongson_runtime_name.length() > 0) { + ps.print(" ("+ loongson_runtime_name +")"); + } @@ -117546,18 +116800,9 @@ index 32e2586e..16b43a39 100644 if (java_profile_name.length() > 0) { // profile name -@@ -120,7 +138,7 @@ public class Version { - String java_vm_name = System.getProperty("java.vm.name"); - String java_vm_version = System.getProperty("java.vm.version"); - String java_vm_info = System.getProperty("java.vm.info"); -- ps.println(java_vm_name + " (build " + java_vm_version + ", " + -+ ps.println(java_vm_name + " " + company_name + " " + "(build " + java_vm_version + ", " + - java_vm_info + ")"); - } - diff --git a/jdk/src/solaris/bin/loongarch64/jvm.cfg b/jdk/src/solaris/bin/loongarch64/jvm.cfg new file mode 100644 -index 00000000..42a06755 +index 0000000000..42a06755da --- /dev/null +++ b/jdk/src/solaris/bin/loongarch64/jvm.cfg @@ -0,0 +1,36 @@ @@ -117599,7 +116844,7 @@ index 00000000..42a06755 +-client IGNORE diff --git a/jdk/src/solaris/bin/mips64/jvm.cfg b/jdk/src/solaris/bin/mips64/jvm.cfg new file mode 100644 -index 00000000..42a06755 +index 0000000000..42a06755da --- /dev/null +++ b/jdk/src/solaris/bin/mips64/jvm.cfg @@ -0,0 +1,36 @@ @@ -117640,7 +116885,7 @@ index 00000000..42a06755 +-server KNOWN +-client IGNORE diff --git a/jdk/test/jdk/jfr/event/os/TestCPUInformation.java b/jdk/test/jdk/jfr/event/os/TestCPUInformation.java -index 17c8419c..a8b76cb7 100644 +index 17c8419cbc..a8b76cb71a 100644 --- a/jdk/test/jdk/jfr/event/os/TestCPUInformation.java +++ b/jdk/test/jdk/jfr/event/os/TestCPUInformation.java @@ -54,8 +54,8 @@ public class TestCPUInformation { @@ -117655,13 +116900,15 @@ index 17c8419c..a8b76cb7 100644 } } diff --git a/jdk/test/sun/management/jmxremote/bootstrap/linux-loongarch64/launcher b/jdk/test/sun/management/jmxremote/bootstrap/linux-loongarch64/launcher -new file mode 100644 -index 00000000..e69de29b +new file mode 100755 +index 0000000000..66291c7522 +Binary files /dev/null and b/jdk/test/sun/management/jmxremote/bootstrap/linux-loongarch64/launcher differ diff --git a/jdk/test/sun/management/jmxremote/bootstrap/linux-mips64el/launcher b/jdk/test/sun/management/jmxremote/bootstrap/linux-mips64el/launcher new file mode 100644 -index 00000000..e69de29b +index 0000000000..5c8385ca12 +Binary files /dev/null and b/jdk/test/sun/management/jmxremote/bootstrap/linux-mips64el/launcher differ diff --git a/jdk/test/sun/security/pkcs11/PKCS11Test.java b/jdk/test/sun/security/pkcs11/PKCS11Test.java -index 5fc9c605..9db6a17d 100644 +index 5fc9c605de..9db6a17d66 100644 --- a/jdk/test/sun/security/pkcs11/PKCS11Test.java +++ b/jdk/test/sun/security/pkcs11/PKCS11Test.java @@ -21,6 +21,11 @@ @@ -117686,6 +116933,3 @@ index 5fc9c605..9db6a17d 100644 osMap.put("Windows-x86-32", new String[]{ PKCS11_BASE + "/nss/lib/windows-i586/".replace('/', SEP)}); osMap.put("Windows-amd64-64", new String[]{ --- -2.33.0 - diff --git a/The-fast-serialization-function-of-sun.rmi.transport.patch b/The-fast-serialization-function-of-sun.rmi.transport.patch new file mode 100644 index 0000000000000000000000000000000000000000..b0417a0f49fb414af63a10c010defd38d97f446e --- /dev/null +++ b/The-fast-serialization-function-of-sun.rmi.transport.patch @@ -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 + diff --git a/add-Fix-aarch64-runtime-thread-signal-transfer-bug.patch b/add-Fix-aarch64-runtime-thread-signal-transfer-bug.patch index 5adaf4b3e15f28e0b7aad3d6fd97d7e149493a0f..3afb0b9d076f1c9255afb0b12d377110e83e8ace 100644 --- a/add-Fix-aarch64-runtime-thread-signal-transfer-bug.patch +++ b/add-Fix-aarch64-runtime-thread-signal-transfer-bug.patch @@ -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 diff --git a/add-riscv64-support.patch b/add-riscv64-support.patch index 8dda639edb126fd67e2c9647ca17501be2921039..250feb7bcefa4572145a6dc7b39162299239bd85 100644 --- a/add-riscv64-support.patch +++ b/add-riscv64-support.patch @@ -90,14 +90,14 @@ index 54cfcdd1..88eb8acd 100644 #if (defined IA32) @@ -2010,9 +2014,11 @@ void * os::dll_load(const char *filename, char *ebuf, int ebuflen) static Elf32_Half running_arch_code=EM_AARCH64; - #elif (defined LOONGARCH) + #elif (defined LOONGARCH64) static Elf32_Half running_arch_code=EM_LOONGARCH; + #elif (defined RISCV) + static Elf32_Half running_arch_code=EM_RISCV; #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, PARISC, M68K, AARCH64, LOONGARCH, RISCV +- IA32, AMD64, IA64, __sparc, __powerpc__, ARM, S390, ALPHA, MIPS, MIPSEL, PARISC, M68K, AARCH64, LOONGARCH64 ++ IA32, AMD64, IA64, __sparc, __powerpc__, ARM, S390, ALPHA, MIPS, MIPSEL, PARISC, M68K, AARCH64, LOONGARCH64, RISCV #endif // Identify compatability class for VM's architecture and library's architecture diff --git a/add-safe-compilation-flags.patch b/add-safe-compilation-flags.patch index ccd57a663bffc015999a8ec329536871ffc64114..bf61aca88aea52986c7822813f650d9323c6f446 100644 --- a/add-safe-compilation-flags.patch +++ b/add-safe-compilation-flags.patch @@ -48,8 +48,8 @@ index f3581c163..a405eb336 100644 # improving the quality of crash log stack traces involving jvm.dll. # These are always used in all compiles --CXX_FLAGS=$(EXTRA_CFLAGS) /nologo /W3 /WX -+CXX_FLAGS=$(EXTRA_CFLAGS) /nologo /W3 /WX /GS +-CXX_FLAGS=$(EXTRA_CFLAGS) /nologo /W3 /WX /wd4800 ++CXX_FLAGS=$(EXTRA_CFLAGS) /nologo /W3 /WX /wd4800 /GS # Let's add debug information when Full Debug Symbols is enabled !if "$(ENABLE_FULL_DEBUG_SYMBOLS)" == "1" diff --git a/fix-log-bug-enhance-aes-hmac-performance.patch b/fix-log-bug-enhance-aes-hmac-performance.patch index c4110a17189c104a70107927ecc75b781e52fa47..a859556836293730380f8df8f4dea0a13aa9427d 100644 --- a/fix-log-bug-enhance-aes-hmac-performance.patch +++ b/fix-log-bug-enhance-aes-hmac-performance.patch @@ -149,7 +149,7 @@ index a405eb336..e5aed4418 100644 @@ -54,6 +54,9 @@ CXX=cl.exe # These are always used in all compiles - CXX_FLAGS=$(EXTRA_CFLAGS) /nologo /W3 /WX /GS + CXX_FLAGS=$(EXTRA_CFLAGS) /nologo /W3 /WX /wd4800 /GS +!if "$(MSC_VER)" > "1910" +CXX_FLAGS=$(EXTRA_CFLAGS) /nologo /W3 /GS /arch:IA32 +!endif diff --git a/fix_X509TrustManagerImpl_symantec_distrust.patch b/fix_X509TrustManagerImpl_symantec_distrust.patch index 65eeab574e11fab612e15f7535da3be6218528fa..777cba018c375417c2a84ce8dc20f495af652f24 100644 --- a/fix_X509TrustManagerImpl_symantec_distrust.patch +++ b/fix_X509TrustManagerImpl_symantec_distrust.patch @@ -40,13 +40,13 @@ index 54e1bfa0d..c1423dc5b 100644 // The numbers of certs now. - private static final int COUNT = 83; -+ private static final int COUNT = 102; ++ private static final int COUNT = 104; // SHA-256 of cacerts, can be generated with // shasum -a 256 cacerts | sed -e 's/../&:/g' | tr '[:lower:]' '[:upper:]' | cut -c1-95 private static final String CHECKSUM - = "2D:04:88:6C:52:53:54:EB:38:2D:BC:E0:AF:B7:82:F4:9E:32:A8:1A:1B:A3:AE:CF:25:CB:C2:F6:0F:4E:E1:20"; -+ = "2F:92:41:50:3B:2B:F2:AD:86:54:AB:2B:D4:AB:A2:92:8B:B6:1C:2B:58:A1:E3:1A:CE:43:43:FB:3E:94:2E:7E"; ++ = "1C:10:89:F9:32:8C:05:D1:10:90:27:7F:66:21:28:71:79:8F:55:44:6C:08:BA:00:48:C0:D4:7A:0D:3B:9C:45"; // map of cert alias to SHA-256 fingerprint @SuppressWarnings("serial") diff --git a/heap-dump-redact-support.patch b/heap-dump-redact-support.patch new file mode 100644 index 0000000000000000000000000000000000000000..c32d2125b39cde744cebab4dd24d50864f438d37 --- /dev/null +++ b/heap-dump-redact-support.patch @@ -0,0 +1,3904 @@ +--- + .../share/classes/sun/jvm/hotspot/HSDB.java | 18 +- + .../sun/jvm/hotspot/oops/Annotation.java | 69 ++ + .../classes/sun/jvm/hotspot/oops/Field.java | 10 + + .../sun/jvm/hotspot/oops/InstanceKlass.java | 7 + + .../classes/sun/jvm/hotspot/runtime/VM.java | 66 +- + .../sun/jvm/hotspot/tools/HeapDumper.java | 58 +- + .../hotspot/utilities/AnnotationArray2D.java | 63 ++ + .../hotspot/utilities/HeapHprofBinWriter.java | 304 ++++++++- + .../jvm/hotspot/utilities/HeapRedactor.java | 448 ++++++++++++ + .../make/linux/makefiles/mapfile-vers-debug | 2 + + .../make/linux/makefiles/mapfile-vers-product | 2 + + hotspot/make/linux/makefiles/vm.make | 27 +- + hotspot/src/os/linux/vm/os_linux.cpp | 48 ++ + hotspot/src/os/linux/vm/os_linux.hpp | 53 ++ + hotspot/src/share/vm/oops/annotations.hpp | 1 + + hotspot/src/share/vm/runtime/arguments.cpp | 24 + + hotspot/src/share/vm/runtime/arguments.hpp | 4 + + hotspot/src/share/vm/runtime/globals.hpp | 22 +- + hotspot/src/share/vm/runtime/vmStructs.cpp | 9 + + .../src/share/vm/services/attachListener.cpp | 20 +- + hotspot/src/share/vm/services/heapDumper.cpp | 635 +++++++++++++++++- + hotspot/src/share/vm/services/heapDumper.hpp | 2 +- + .../src/share/vm/services/heapRedactor.cpp | 621 +++++++++++++++++ + .../src/share/vm/services/heapRedactor.hpp | 201 ++++++ + .../share/classes/sun/tools/jmap/JMap.java | 244 ++++++- + 25 files changed, 2905 insertions(+), 53 deletions(-) + create mode 100644 hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/Annotation.java + create mode 100644 hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/AnnotationArray2D.java + create mode 100644 hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/HeapRedactor.java + create mode 100644 hotspot/src/share/vm/services/heapRedactor.cpp + create mode 100644 hotspot/src/share/vm/services/heapRedactor.hpp + +diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/HSDB.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/HSDB.java +index c961a6ce9..f5778dca1 100644 +--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/HSDB.java ++++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/HSDB.java +@@ -39,12 +39,12 @@ import sun.jvm.hotspot.gc_implementation.parallelScavenge.*; + import sun.jvm.hotspot.gc_interface.*; + import sun.jvm.hotspot.interpreter.*; + import sun.jvm.hotspot.memory.*; +-import sun.jvm.hotspot.oops.*; + import sun.jvm.hotspot.runtime.*; + import sun.jvm.hotspot.ui.*; + import sun.jvm.hotspot.ui.tree.*; + import sun.jvm.hotspot.ui.classbrowser.*; + import sun.jvm.hotspot.utilities.*; ++import sun.jvm.hotspot.oops.*; + + /** The top-level HotSpot Debugger. FIXME: make this an embeddable + component! (Among other things, figure out what to do with the +@@ -988,7 +988,7 @@ public class HSDB implements ObjectHistogramPanel.Listener, SAListener { + } + + if (curFrame.getFP() != null) { +- annoPanel.addAnnotation(new Annotation(curFrame.getSP(), ++ annoPanel.addAnnotation(new sun.jvm.hotspot.ui.Annotation(curFrame.getSP(), + curFrame.getFP(), + anno)); + } else { +@@ -1000,7 +1000,7 @@ public class HSDB implements ObjectHistogramPanel.Listener, SAListener { + if (Assert.ASSERTS_ENABLED) { + Assert.that(cb.getFrameSize() > 0, "CodeBlob must have non-zero frame size"); + } +- annoPanel.addAnnotation(new Annotation(sp, ++ annoPanel.addAnnotation(new sun.jvm.hotspot.ui.Annotation(sp, + sp.addOffsetTo(cb.getFrameSize()), + anno)); + } else { +@@ -1010,19 +1010,19 @@ public class HSDB implements ObjectHistogramPanel.Listener, SAListener { + + // Add interpreter frame annotations + if (curFrame.isInterpretedFrame()) { +- annoPanel.addAnnotation(new Annotation(curFrame.addressOfInterpreterFrameExpressionStack(), ++ annoPanel.addAnnotation(new sun.jvm.hotspot.ui.Annotation(curFrame.addressOfInterpreterFrameExpressionStack(), + curFrame.addressOfInterpreterFrameTOS(), + "Interpreter expression stack")); + Address monBegin = curFrame.interpreterFrameMonitorBegin().address(); + Address monEnd = curFrame.interpreterFrameMonitorEnd().address(); + if (!monBegin.equals(monEnd)) { +- annoPanel.addAnnotation(new Annotation(monBegin, monEnd, ++ annoPanel.addAnnotation(new sun.jvm.hotspot.ui.Annotation(monBegin, monEnd, + "BasicObjectLocks")); + } + if (interpreterFrameMethod != null) { + // The offset is just to get the right stack slots highlighted in the output + int offset = 1; +- annoPanel.addAnnotation(new Annotation(curFrame.addressOfInterpreterFrameLocal(offset), ++ annoPanel.addAnnotation(new sun.jvm.hotspot.ui.Annotation(curFrame.addressOfInterpreterFrameLocal(offset), + curFrame.addressOfInterpreterFrameLocal((int) interpreterFrameMethod.getMaxLocals() + offset), + "Interpreter locals area for frame with SP = " + curFrame.getSP())); + } +@@ -1031,9 +1031,9 @@ public class HSDB implements ObjectHistogramPanel.Listener, SAListener { + methodAnno += " (BAD OOP)"; + } + Address a = curFrame.addressOfInterpreterFrameMethod(); +- annoPanel.addAnnotation(new Annotation(a, a.addOffsetTo(addressSize), methodAnno)); ++ annoPanel.addAnnotation(new sun.jvm.hotspot.ui.Annotation(a, a.addOffsetTo(addressSize), methodAnno)); + a = curFrame.addressOfInterpreterFrameCPCache(); +- annoPanel.addAnnotation(new Annotation(a, a.addOffsetTo(addressSize), "Interpreter constant pool cache")); ++ annoPanel.addAnnotation(new sun.jvm.hotspot.ui.Annotation(a, a.addOffsetTo(addressSize), "Interpreter constant pool cache")); + } + + RegisterMap rm = (RegisterMap) vf.getRegisterMap().clone(); +@@ -1118,7 +1118,7 @@ public class HSDB implements ObjectHistogramPanel.Listener, SAListener { + } + } + +- annoPanel.addAnnotation(new Annotation(addr, addr.addOffsetTo(addressSize), anno)); ++ annoPanel.addAnnotation(new sun.jvm.hotspot.ui.Annotation(addr, addr.addOffsetTo(addressSize), anno)); + } + }, rm); + } catch (Exception e) { +diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/Annotation.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/Annotation.java +new file mode 100644 +index 000000000..9b95e7ab5 +--- /dev/null ++++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/Annotation.java +@@ -0,0 +1,69 @@ ++/* ++ * Copyright (c) 2000, 2012, 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. ++ * ++ */ ++ ++package sun.jvm.hotspot.oops; ++ ++import java.util.*; ++import sun.jvm.hotspot.debugger.Address; ++import sun.jvm.hotspot.runtime.VM; ++import sun.jvm.hotspot.runtime.VMObject; ++import sun.jvm.hotspot.types.AddressField; ++import sun.jvm.hotspot.types.Type; ++import sun.jvm.hotspot.types.TypeDataBase; ++import sun.jvm.hotspot.types.WrongTypeException; ++import sun.jvm.hotspot.utilities.AnnotationArray2D; ++ ++// An Annotation is an oop containing class annotations ++ ++public class Annotation extends VMObject { ++ private static AddressField class_annotations; ++ private static AddressField class_type_annotations; ++ private static AddressField fields_annotations; ++ private static AddressField fields_type_annotations; ++ ++ static { ++ VM.registerVMInitializedObserver(new Observer() { ++ public void update(Observable o, Object data) { ++ initialize(VM.getVM().getTypeDataBase()); ++ } ++ }); ++ } ++ ++ private static synchronized void initialize(TypeDataBase db) throws WrongTypeException { ++ Type type = db.lookupType("Annotations"); ++ class_annotations = type.getAddressField("_class_annotations"); ++ class_type_annotations = type.getAddressField("_class_type_annotations"); ++ fields_annotations = type.getAddressField("_fields_annotations"); ++ fields_type_annotations = type.getAddressField("_fields_type_annotations"); ++ } ++ ++ public Annotation(Address addr) { ++ super(addr); ++ } ++ ++ public AnnotationArray2D getFieldsAnnotations() { ++ Address addr = getAddress().getAddressAt(fields_annotations.getOffset()); ++ return new AnnotationArray2D(addr); ++ } ++} +\ No newline at end of file +diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/Field.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/Field.java +index 621c8cf4b..51b7d1232 100644 +--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/Field.java ++++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/Field.java +@@ -67,6 +67,8 @@ public class Field { + private Symbol genericSignature; + private AccessFlags accessFlags; + private int fieldIndex; ++ // java field redact annotation ++ private U1Array fieldAnnotations; + + /** Returns the byte offset of the field within the object or klass */ + public long getOffset() { return offset; } +@@ -112,6 +114,14 @@ public class Field { + + public boolean hasInitialValue() { return holder.getFieldInitialValueIndex(fieldIndex) != 0; } + ++ public void setFieldAnnotations(U1Array fieldAnnotations) { ++ this.fieldAnnotations = fieldAnnotations; ++ } ++ ++ public U1Array getFieldAnnotations() { ++ return fieldAnnotations; ++ } ++ + // + // Following acccessors are for named, non-VM fields only + // +diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/InstanceKlass.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/InstanceKlass.java +index 75aa05c39..0a88137c6 100644 +--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/InstanceKlass.java ++++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/InstanceKlass.java +@@ -73,6 +73,7 @@ public class InstanceKlass extends Klass { + transitiveInterfaces = type.getAddressField("_transitive_interfaces"); + fields = type.getAddressField("_fields"); + javaFieldsCount = new CIntField(type.getCIntegerField("_java_fields_count"), 0); ++ annotate = type.getAddressField("_annotations"); + constants = new MetadataField(type.getAddressField("_constants"), 0); + classLoaderData = type.getAddressField("_class_loader_data"); + sourceDebugExtension = type.getAddressField("_source_debug_extension"); +@@ -132,6 +133,7 @@ public class InstanceKlass extends Klass { + private static AddressField transitiveInterfaces; + private static AddressField fields; + private static CIntField javaFieldsCount; ++ private static AddressField annotate; + private static MetadataField constants; + private static AddressField classLoaderData; + private static AddressField sourceDebugExtension; +@@ -851,6 +853,11 @@ public class InstanceKlass extends Klass { + return (IntArray) VMObjectFactory.newObject(IntArray.class, addr); + } + ++ public Annotation getAnnotation() { ++ Address addr = getAddress().getAddressAt(annotate.getOffset()); ++ return (Annotation) VMObjectFactory.newObject(Annotation.class, addr); ++ } ++ + public U2Array getFields() { + Address addr = getAddress().getAddressAt(fields.getOffset()); + return (U2Array) VMObjectFactory.newObject(U2Array.class, addr); +diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/VM.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/VM.java +index 29bf9efea..fda624b20 100644 +--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/VM.java ++++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/VM.java +@@ -1,5 +1,5 @@ + /* +- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 2000, 2019, 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 +@@ -124,6 +124,7 @@ public class VM { + + private static Type intxType; + private static Type uintxType; ++ private static Type uint64tType; + private static CIntegerType boolType; + private Boolean sharingEnabled; + private Boolean compressedOopsEnabled; +@@ -192,6 +193,50 @@ public class VM { + return addr.getCIntegerAt(0, uintxType.getSize(), true); + } + ++ public boolean isCcstr() { ++ return type.equals("ccstr"); ++ } ++ ++ public String getCcstr() { ++ if (Assert.ASSERTS_ENABLED) { ++ Assert.that(isCcstr(), "not a ccstr flag!"); ++ } ++ return CStringUtilities.getString(addr.getAddressAt(0)); ++ } ++ ++ public boolean isCcstrlist() { ++ return type.equals("ccstrlist"); ++ } ++ ++ public String getCcstrlist() { ++ if (Assert.ASSERTS_ENABLED) { ++ Assert.that(isCcstrlist(), "not a ccstrlist flag!"); ++ } ++ return CStringUtilities.getString(addr.getAddressAt(0)); ++ } ++ ++ public boolean isDouble() { ++ return type.equals("double"); ++ } ++ ++ public double getDouble() { ++ if (Assert.ASSERTS_ENABLED) { ++ Assert.that(isDouble(), "not a double flag!"); ++ } ++ return addr.getJDoubleAt(0); ++ } ++ ++ public boolean isUint64t() { ++ return type.equals("uint64_t"); ++ } ++ ++ public long getUint64t() { ++ if (Assert.ASSERTS_ENABLED) { ++ Assert.that(isUint64t(), "not an uint64_t flag!"); ++ } ++ return addr.getCIntegerAt(0, uint64tType.getSize(), true); ++ } ++ + public String getValue() { + if (isBool()) { + return new Boolean(getBool()).toString(); +@@ -199,7 +244,23 @@ public class VM { + return new Long(getIntx()).toString(); + } else if (isUIntx()) { + return new Long(getUIntx()).toString(); +- } else { ++ } else if (isCcstr()) { ++ String str = getCcstr(); ++ if (str != null) { ++ str = "\"" + str + "\""; ++ } ++ return str; ++ } else if (isCcstrlist()) { ++ String str = getCcstrlist(); ++ if (str != null) { ++ str = "\"" + str + "\""; ++ } ++ return str; ++ } else if (isDouble()) { ++ return Double.toString(getDouble()); ++ } else if (isUint64t()) { ++ return Long.toUnsignedString(getUint64t()); ++ }else { + return null; + } + } +@@ -325,6 +386,7 @@ public class VM { + + intxType = db.lookupType("intx"); + uintxType = db.lookupType("uintx"); ++ uint64tType = db.lookupType("uint64_t"); + boolType = (CIntegerType) db.lookupType("bool"); + + minObjAlignmentInBytes = getObjectAlignmentInBytes(); +diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/HeapDumper.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/HeapDumper.java +index 1b9350431..be503fe06 100644 +--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/HeapDumper.java ++++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/HeapDumper.java +@@ -24,8 +24,11 @@ + + package sun.jvm.hotspot.tools; + ++import sun.jvm.hotspot.runtime.VM; + import sun.jvm.hotspot.utilities.HeapHprofBinWriter; + import sun.jvm.hotspot.debugger.JVMDebugger; ++import sun.jvm.hotspot.utilities.HeapRedactor; ++ + import java.io.IOException; + + /* +@@ -39,10 +42,17 @@ public class HeapDumper extends Tool { + + private String dumpFile; + ++ private HeapRedactor redactor; ++ + public HeapDumper(String dumpFile) { + this.dumpFile = dumpFile; + } + ++ public HeapDumper(String dumpFile, HeapRedactor redactor){ ++ this(dumpFile); ++ this.redactor = redactor; ++ } ++ + public HeapDumper(String dumpFile, JVMDebugger d) { + super(d); + this.dumpFile = dumpFile; +@@ -55,21 +65,59 @@ public class HeapDumper extends Tool { + super.printFlagsUsage(); + } + ++ private String getVMRedactParameter(String name){ ++ VM vm = VM.getVM(); ++ VM.Flag flag = vm.getCommandLineFlag(name); ++ if(flag == null){ ++ return null; ++ } ++ return flag.getCcstr(); ++ } ++ + // use HeapHprofBinWriter to write the heap dump + public void run() { + System.out.println("Dumping heap to " + dumpFile + " ..."); + try { +- new HeapHprofBinWriter().write(dumpFile); ++ HeapHprofBinWriter writer = new HeapHprofBinWriter(); ++ if(this.redactor != null){ ++ writer.setHeapRedactor(this.redactor); ++ if(writer.getHeapDumpRedactLevel() != HeapRedactor.HeapDumpRedactLevel.REDACT_UNKNOWN){ ++ System.out.println("HeapDump Redact Level = " + this.redactor.getRedactLevelString()); ++ } ++ }else{ ++ resetHeapHprofBinWriter(writer); ++ } ++ writer.write(dumpFile); + System.out.println("Heap dump file created"); + } catch (IOException ioe) { + System.err.println(ioe.getMessage()); + } + } + ++ private void resetHeapHprofBinWriter(HeapHprofBinWriter writer) { ++ String redactStr = getVMRedactParameter("HeapDumpRedact"); ++ if(redactStr != null && !redactStr.isEmpty()){ ++ HeapRedactor.RedactParams redactParams = new HeapRedactor.RedactParams(); ++ if(HeapRedactor.REDACT_ANNOTATION_OPTION.equals(redactStr)){ ++ String classPathStr = getVMRedactParameter("RedactClassPath"); ++ redactStr = (classPathStr != null && !classPathStr.isEmpty()) ? redactStr : HeapRedactor.REDACT_OFF_OPTION; ++ redactParams.setRedactClassPath(classPathStr); ++ } else { ++ String redactMapStr = getVMRedactParameter("RedactMap"); ++ redactParams.setRedactMap(redactMapStr); ++ String redactMapFileStr = getVMRedactParameter("RedactMapFile"); ++ redactParams.setRedactMapFile(redactMapFileStr); ++ } ++ redactParams.setAndCheckHeapDumpRedact(redactStr); ++ writer.setHeapRedactor(new HeapRedactor(redactParams)); ++ } ++ } ++ + // JDK jmap utility will always invoke this tool as: + // HeapDumper -f + public static void main(String args[]) { + String file = DEFAULT_DUMP_FILE; ++ HeapRedactor heapRedactor = null; + if (args.length > 2) { + if (args[0].equals("-f")) { + file = args[1]; +@@ -77,9 +125,15 @@ public class HeapDumper extends Tool { + System.arraycopy(args, 2, newargs, 0, args.length-2); + args = newargs; + } ++ if(args[0].equals("-r")){ ++ heapRedactor = new HeapRedactor(args[1]); ++ String[] newargs = new String[args.length-2]; ++ System.arraycopy(args, 2, newargs, 0, args.length-2); ++ args = newargs; ++ } + } + +- HeapDumper dumper = new HeapDumper(file); ++ HeapDumper dumper = heapRedactor == null? new HeapDumper(file):new HeapDumper(file, heapRedactor); + dumper.execute(args); + } + +diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/AnnotationArray2D.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/AnnotationArray2D.java +new file mode 100644 +index 000000000..0703549dd +--- /dev/null ++++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/AnnotationArray2D.java +@@ -0,0 +1,63 @@ ++/* ++ * Copyright (c) 2000, 2012, 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. ++ * ++ */ ++ ++package sun.jvm.hotspot.utilities; ++ ++import java.util.*; ++import sun.jvm.hotspot.debugger.Address; ++import sun.jvm.hotspot.runtime.VM; ++import sun.jvm.hotspot.types.Type; ++import sun.jvm.hotspot.types.TypeDataBase; ++import sun.jvm.hotspot.types.WrongTypeException; ++ ++public class AnnotationArray2D extends GenericArray { ++ static { ++ VM.registerVMInitializedObserver(new Observer() { ++ public void update(Observable o, Object data) { ++ initialize(VM.getVM().getTypeDataBase()); ++ } ++ }); ++ } ++ ++ private static synchronized void initialize(TypeDataBase db) throws WrongTypeException { ++ elemType = db.lookupType("Array*"); ++ ++ Type type = db.lookupType("Array*>"); ++ dataFieldOffset = type.getAddressField("_data").getOffset(); ++ } ++ ++ private static long dataFieldOffset; ++ protected static Type elemType; ++ ++ public AnnotationArray2D(Address addr) { ++ super(addr, dataFieldOffset); ++ } ++ ++ public U1Array getAt(int i) { ++ return new U1Array(getAddressAt(i)); ++ } ++ public Type getElemType() { ++ return elemType; ++ } ++} +\ No newline at end of file +diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/HeapHprofBinWriter.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/HeapHprofBinWriter.java +index 319aecdaa..1da6ed028 100644 +--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/HeapHprofBinWriter.java ++++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/HeapHprofBinWriter.java +@@ -379,6 +379,31 @@ public class HeapHprofBinWriter extends AbstractHeapGraphWriter { + private static final int JVM_SIGNATURE_ARRAY = '['; + private static final int JVM_SIGNATURE_CLASS = 'L'; + ++ // Heap Redact ++ private HeapRedactor heapRedactor; ++ ++ public HeapRedactor getHeapRedactor() { ++ return heapRedactor; ++ } ++ ++ public void setHeapRedactor(HeapRedactor heapRedactor) { ++ this.heapRedactor = heapRedactor; ++ } ++ ++ public HeapRedactor.HeapDumpRedactLevel getHeapDumpRedactLevel(){ ++ if(heapRedactor == null){ ++ return HeapRedactor.HeapDumpRedactLevel.REDACT_OFF; ++ } ++ return heapRedactor.getHeapDumpRedactLevel(); ++ } ++ ++ private String lookupRedactName(String name){ ++ if(heapRedactor == null){ ++ return null; ++ } ++ return heapRedactor.lookupRedactName(name); ++ } ++ + public synchronized void write(String fileName) throws IOException { + // open file stream and create buffered data output stream + fos = new FileOutputStream(fileName); +@@ -432,6 +457,9 @@ public class HeapHprofBinWriter extends AbstractHeapGraphWriter { + // this will write heap data into the buffer stream + super.write(); + ++ // write redacted String Field record ++ writeAnnotateFieldValue(); ++ + // flush buffer stream. + out.flush(); + +@@ -533,6 +561,59 @@ public class HeapHprofBinWriter extends AbstractHeapGraphWriter { + } + } + ++ private void writeAnnotateFieldValue() throws IOException { ++ HeapRedactor.HeapDumpRedactLevel level = getHeapDumpRedactLevel(); ++ if(level != HeapRedactor.HeapDumpRedactLevel.REDACT_ANNOTATION ++ && level != HeapRedactor.HeapDumpRedactLevel.REDACT_DIYRULES) { ++ return; ++ } ++ ++ HeapRedactor.RedactVectorNode redactVector = heapRedactor.getHeaderNode(); ++ if(redactVector == null) { ++ return; ++ } ++ ++ while(redactVector != null){ ++ List typeArrayList = redactVector.getTypeArrayList(); ++ for(int i = 0; i < redactVector.getCurrentIndex(); i++) { ++ TypeArray array = typeArrayList.get(i); ++ TypeArrayKlass tak = (TypeArrayKlass) array.getKlass(); ++ final int type = (int) tak.getElementType(); ++ ++ if(type != TypeArrayKlass.T_CHAR) { ++ continue; ++ } ++ ++ OopHandle handle = (array != null)? array.getHandle() : null; ++ long address = getAddressValue(handle); ++ Optional annotateValueOptional = heapRedactor.lookupRedactAnnotationValue(address); ++ String annotateValue = annotateValueOptional.isPresent() ? annotateValueOptional.get() : null; ++ long expectLength = array.getLength(); ++ if(annotateValue != null) { ++ expectLength = annotateValue.length(); ++ } ++ ++ final String typeName = tak.getElementTypeName(); ++ out.writeByte((byte) HPROF_GC_PRIM_ARRAY_DUMP); ++ writeObjectID(array); ++ out.writeInt(DUMMY_STACK_TRACE_ID); ++ out.writeInt((int)expectLength); ++ out.writeByte((byte) type); ++ ++ if (annotateValue != null) { ++ for(int index = 0; index < expectLength; index++) { ++ out.writeChar(annotateValue.charAt(index)); ++ } ++ } else { ++ writeCharArray(array); ++ } ++ } ++ ++ HeapRedactor.RedactVectorNode tempVector = redactVector.getNext(); ++ redactVector = tempVector; ++ } ++ } ++ + protected void writeClass(Instance instance) throws IOException { + Klass reflectedKlass = java_lang_Class.asKlass(instance); + // dump instance record only for primitive type Class objects. +@@ -690,19 +771,34 @@ public class HeapHprofBinWriter extends AbstractHeapGraphWriter { + } + + protected void writePrimitiveArray(TypeArray array) throws IOException { ++ HeapRedactor.HeapDumpRedactLevel level = getHeapDumpRedactLevel(); ++ ++ TypeArrayKlass tak = (TypeArrayKlass) array.getKlass(); ++ final int type = (int) tak.getElementType(); ++ if(type == TypeArrayKlass.T_CHAR && (level == HeapRedactor.HeapDumpRedactLevel.REDACT_ANNOTATION ++ || level == HeapRedactor.HeapDumpRedactLevel.REDACT_DIYRULES)) { ++ heapRedactor.recordTypeArray(array); ++ return; ++ } ++ + out.writeByte((byte) HPROF_GC_PRIM_ARRAY_DUMP); + writeObjectID(array); + out.writeInt(DUMMY_STACK_TRACE_ID); + out.writeInt((int) array.getLength()); +- TypeArrayKlass tak = (TypeArrayKlass) array.getKlass(); +- final int type = (int) tak.getElementType(); + out.writeByte((byte) type); ++ ++ boolean shouldRedact = ( level== HeapRedactor.HeapDumpRedactLevel.REDACT_BASIC ++ ||level == HeapRedactor.HeapDumpRedactLevel.REDACT_FULL); + switch (type) { + case TypeArrayKlass.T_BOOLEAN: + writeBooleanArray(array); + break; + case TypeArrayKlass.T_CHAR: +- writeCharArray(array); ++ if (shouldRedact) { ++ writeCharArrayObfuscated(array); ++ } else { ++ writeCharArray(array); ++ } + break; + case TypeArrayKlass.T_FLOAT: + writeFloatArray(array); +@@ -711,13 +807,21 @@ public class HeapHprofBinWriter extends AbstractHeapGraphWriter { + writeDoubleArray(array); + break; + case TypeArrayKlass.T_BYTE: +- writeByteArray(array); ++ if (shouldRedact) { ++ writeByteArrayObfuscated(array); ++ } else { ++ writeByteArray(array); ++ } + break; + case TypeArrayKlass.T_SHORT: + writeShortArray(array); + break; + case TypeArrayKlass.T_INT: +- writeIntArray(array); ++ if (shouldRedact) { ++ writeIntArrayObfuscated(array); ++ } else { ++ writeIntArray(array); ++ } + break; + case TypeArrayKlass.T_LONG: + writeLongArray(array); +@@ -743,6 +847,13 @@ public class HeapHprofBinWriter extends AbstractHeapGraphWriter { + } + } + ++ private void writeByteArrayObfuscated(TypeArray array) throws IOException { ++ final int length = (int) array.getLength(); ++ for (int index = 0; index < length; index++) { ++ out.writeByte(0); ++ } ++ } ++ + private void writeShortArray(TypeArray array) throws IOException { + final int length = (int) array.getLength(); + for (int index = 0; index < length; index++) { +@@ -759,6 +870,13 @@ public class HeapHprofBinWriter extends AbstractHeapGraphWriter { + } + } + ++ private void writeIntArrayObfuscated(TypeArray array) throws IOException { ++ final int length = (int) array.getLength(); ++ for (int index = 0; index < length; index++) { ++ out.writeInt(0); ++ } ++ } ++ + private void writeLongArray(TypeArray array) throws IOException { + final int length = (int) array.getLength(); + for (int index = 0; index < length; index++) { +@@ -775,6 +893,13 @@ public class HeapHprofBinWriter extends AbstractHeapGraphWriter { + } + } + ++ private void writeCharArrayObfuscated(TypeArray array) throws IOException { ++ final int length = (int) array.getLength(); ++ for (int index = 0; index < length; index++) { ++ out.writeChar(0); ++ } ++ } ++ + private void writeFloatArray(TypeArray array) throws IOException { + final int length = (int) array.getLength(); + for (int index = 0; index < length; index++) { +@@ -820,6 +945,20 @@ public class HeapHprofBinWriter extends AbstractHeapGraphWriter { + for (Iterator itr = fields.iterator(); itr.hasNext();) { + writeField((Field) itr.next(), instance); + } ++ ++ if(getHeapDumpRedactLevel() != HeapRedactor.HeapDumpRedactLevel.REDACT_ANNOTATION ++ && getHeapDumpRedactLevel() != HeapRedactor.HeapDumpRedactLevel.REDACT_DIYRULES) { ++ return; ++ } ++ // record the anonymous value for every field ++ if(klass instanceof InstanceKlass && heapRedactor != null) { ++ if(heapRedactor.getHeapDumpRedactLevel() == HeapRedactor.HeapDumpRedactLevel.REDACT_ANNOTATION ++ && heapRedactor.getRedactAnnotationClassPath() != null && !heapRedactor.getRedactAnnotationClassPath().isEmpty()) { ++ recordAnnotationValueMap(fields, instance); ++ } else if( heapRedactor.getHeapDumpRedactLevel() == HeapRedactor.HeapDumpRedactLevel.REDACT_DIYRULES) { ++ recordDiyRulesValueMap(fields, instance); ++ } ++ } + } + + //-- Internals only below this point +@@ -842,6 +981,130 @@ public class HeapHprofBinWriter extends AbstractHeapGraphWriter { + } + } + ++ private void recordAnnotationValueMap(List fields, Instance instance) { ++ Klass klass = instance.getKlass(); ++ boolean inJavaPackage = false; ++ Symbol classNameSymbol = klass.getName(); ++ if(classNameSymbol != null) { ++ String className = classNameSymbol.asString(); ++ inJavaPackage = (className != null && className.startsWith("java/")); ++ } ++ if(inJavaPackage){ ++ return; ++ } ++ for (Field field : fields) { ++ Symbol fieldSignature = field.getSignature(); ++ if(fieldSignature == null || fieldSignature.asString() == null || !"Ljava/lang/String;".equals(fieldSignature.asString())) { ++ continue; ++ } ++ try { ++ InstanceKlass fieldHolder = field.getFieldHolder(); ++ U1Array fieldAnnotations = field.getFieldAnnotations(); ++ Optional anonymousValueOption = getAnonymousValue(fieldAnnotations, fieldHolder.getConstants()); ++ if(!anonymousValueOption.isPresent()) { ++ continue; ++ } ++ long address = getStringFieldAddress(field, instance); ++ if(address > 0L) { ++ heapRedactor.recordRedactAnnotationValue(address, anonymousValueOption.get()); ++ } ++ } catch (Exception e) { ++ } ++ } ++ } ++ ++ private Optional getAnonymousValue(U1Array fieldAnnotations, ConstantPool cp) { ++ Optional anonymousValueOption = Optional.empty(); ++ if (fieldAnnotations.getAddress() == null) { ++ return anonymousValueOption; ++ } ++ ++ int fieldAnnotationsTagsLen = fieldAnnotations.length(); ++ boolean isAnonymousAnnotation = false; ++ int annotationStart = 0; ++ int annotationEnd = 0; ++ for (int j = 0; j < fieldAnnotationsTagsLen; j++) { ++ int cpIndex = fieldAnnotations.at(j); ++ if (cpIndex >= cp.getLength() || cpIndex < 0) { ++ continue; ++ } ++ byte cpConstType = cp.getTags().at(cpIndex); ++ if (cpConstType == ConstantPool.JVM_CONSTANT_Utf8) { ++ annotationStart += (isAnonymousAnnotation ? 0 : 1); ++ annotationEnd++; ++ Symbol symbol = cp.getSymbolAt(cpIndex); ++ if (symbol.asString() == null || symbol.asString().isEmpty()) { ++ continue; ++ } ++ if (symbol.asString().equals("L" + heapRedactor.getRedactAnnotationClassPath() + ";")) { ++ isAnonymousAnnotation = true; ++ } ++ if(annotationEnd - annotationStart == 1 && !"value".equals(symbol.asString())) { ++ break; ++ } ++ if(annotationEnd - annotationStart == 2) { ++ anonymousValueOption = Optional.ofNullable(cp.getSymbolAt(cpIndex).asString()); ++ break; ++ } ++ } ++ } ++ return anonymousValueOption; ++ } ++ ++ private void recordDiyRulesValueMap(List fields, Instance instance) { ++ Klass klass = instance.getKlass(); ++ boolean diyRulesFlag = false; ++ Symbol classNameSymbol = klass.getName(); ++ Map redactRulesMap = null; ++ if(classNameSymbol != null) { ++ String className = classNameSymbol.asString(); ++ Optional> redactRulesMapOptional = className == null ? Optional.>empty() : heapRedactor.getRedactRulesTable(className); ++ redactRulesMap = redactRulesMapOptional.isPresent() ? redactRulesMapOptional.get() : null; ++ diyRulesFlag = (redactRulesMap != null); ++ } ++ if(!diyRulesFlag){ ++ return; ++ } ++ for (Field field : fields) { ++ Symbol fieldSignature = field.getSignature(); ++ if(fieldSignature == null || fieldSignature.asString() == null || !"Ljava/lang/String;".equals(fieldSignature.asString())) { ++ continue; ++ } ++ ++ try { ++ FieldIdentifier fieldIdentifier = field.getID(); ++ if(fieldIdentifier == null || !(fieldIdentifier instanceof NamedFieldIdentifier)) { ++ continue; ++ } ++ ++ String filedName = fieldIdentifier.getName(); ++ String replaceValue = filedName == null ? null : redactRulesMap.get(filedName); ++ long address = getStringFieldAddress(field, instance); ++ if(address > 0L && replaceValue != null) { ++ heapRedactor.recordRedactAnnotationValue(address, replaceValue); ++ } ++ } catch (Exception e) { ++ } ++ } ++ } ++ ++ private long getStringFieldAddress(Field field, Instance instance) { ++ long address = 0L; ++ if(field instanceof OopField) { ++ Oop fieldOop = ((OopField) field).getValue(instance); ++ Field stringField = null; ++ if (fieldOop != null && fieldOop.getKlass() instanceof InstanceKlass) { ++ List oopFiledSubs = ((InstanceKlass) fieldOop.getKlass()).getAllFields(); ++ stringField = oopFiledSubs.iterator().next(); ++ } ++ if (stringField != null && stringField instanceof OopField) { ++ OopHandle handle = ((OopField) stringField).getValueAsOopHandle(fieldOop); ++ address = getAddressValue(handle); ++ } ++ } ++ return address; ++ } ++ + public static int signatureToHprofKind(char ch) { + switch (ch) { + case JVM_SIGNATURE_CLASS: +@@ -941,7 +1204,20 @@ public class HeapHprofBinWriter extends AbstractHeapGraphWriter { + } + + private void writeSymbol(Symbol sym) throws IOException { +- byte[] buf = sym.asString().getBytes("UTF-8"); ++ String symbolStr = sym.asString(); ++ HeapRedactor.HeapDumpRedactLevel level = getHeapDumpRedactLevel(); ++ boolean shouldRedact = (level == HeapRedactor.HeapDumpRedactLevel.REDACT_NAMES || ++ level == HeapRedactor.HeapDumpRedactLevel.REDACT_FULL); ++ byte[] buf = null; ++ if (shouldRedact) { ++ String redactFiled = lookupRedactName(symbolStr); ++ if (redactFiled != null) { ++ buf = redactFiled.getBytes("UTF-8"); ++ } ++ } ++ if (buf == null) { ++ buf = symbolStr.getBytes("UTF-8"); ++ } + writeHeader(HPROF_UTF8, buf.length + OBJ_ID_SIZE); + writeSymbolID(sym); + out.write(buf); +@@ -1019,11 +1295,23 @@ public class HeapHprofBinWriter extends AbstractHeapGraphWriter { + List res = new ArrayList(); + while (klass != null) { + List curFields = klass.getImmediateFields(); ++ Annotation annotation = klass.getAnnotation(); ++ AnnotationArray2D fieldsAnnotations = (annotation == null) ? null : annotation.getFieldsAnnotations(); ++ boolean hasAnnotations = false; ++ if(fieldsAnnotations != null && fieldsAnnotations.getAddress() != null) { ++ hasAnnotations = true; ++ } ++ int fieldIndex = 0; + for (Iterator itr = curFields.iterator(); itr.hasNext();) { + Field f = (Field) itr.next(); + if (! f.isStatic()) { +- res.add(f); +- } ++ // record annotation for class Field ++ res.add(f); ++ if(hasAnnotations) { ++ f.setFieldAnnotations(fieldsAnnotations.getAt(fieldIndex)); ++ } ++ } ++ fieldIndex++; + } + klass = (InstanceKlass) klass.getSuper(); + } +diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/HeapRedactor.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/HeapRedactor.java +new file mode 100644 +index 000000000..26782b879 +--- /dev/null ++++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/HeapRedactor.java +@@ -0,0 +1,448 @@ ++/* ++ * Copyright (c) 2023, Huawei Technologies Co., Ltd. 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. Huawei designates this ++ * particular file as subject to the "Classpath" exception as provided ++ * by Huawei in the LICENSE file that accompanied this code. ++ * ++ * 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 visit https://gitee.com/openeuler/bishengjdk-8 if you need additional ++ * information or have any questions. ++ */ ++ ++package sun.jvm.hotspot.utilities; ++ ++import sun.jvm.hotspot.oops.TypeArray; ++ ++import java.io.BufferedReader; ++import java.io.File; ++import java.io.FileReader; ++import java.io.IOException; ++import java.util.HashMap; ++import java.util.Locale; ++import java.util.Map; ++import java.util.ArrayList; ++import java.util.List; ++import java.util.Optional; ++ ++public class HeapRedactor { ++ public enum HeapDumpRedactLevel { ++ REDACT_UNKNOWN, ++ REDACT_OFF, ++ REDACT_NAMES, ++ REDACT_BASIC, ++ REDACT_DIYRULES, ++ REDACT_ANNOTATION, ++ REDACT_FULL ++ } ++ ++ private HeapDumpRedactLevel redactLevel; ++ private Map redactNameTable; ++ private Map> redactClassTable; ++ private String redactClassFullName = null; ++ private Map redactValueTable; ++ private RedactVectorNode headerNode; ++ private RedactVectorNode currentNode; ++ ++ private RedactParams redactParams; ++ ++ public static final String HEAP_DUMP_REDACT_PREFIX = "HeapDumpRedact="; ++ public static final String REDACT_MAP_PREFIX = "RedactMap="; ++ public static final String REDACT_MAP_FILE_PREFIX = "RedactMapFile="; ++ public static final String REDACT_CLASS_PATH_PREFIX = "RedactClassPath="; ++ ++ public static final String REDACT_UNKNOWN_STR = "UNKNOWN"; ++ public static final String REDACT_OFF_STR = "OFF"; ++ public static final String REDACT_NAME_STR = "NAMES"; ++ public static final String REDACT_BASIC_STR = "BASIC"; ++ public static final String REDACT_DIYRULES_STR = "DIYRULES"; ++ public static final String REDACT_ANNOTATION_STR = "ANNOTATION"; ++ public static final String REDACT_FULL_STR = "FULL"; ++ ++ public static final String REDACT_UNKNOWN_OPTION = REDACT_UNKNOWN_STR.toLowerCase(Locale.ROOT); ++ public static final String REDACT_OFF_OPTION = REDACT_OFF_STR.toLowerCase(Locale.ROOT); ++ public static final String REDACT_NAME_OPTION = REDACT_NAME_STR.toLowerCase(Locale.ROOT); ++ public static final String REDACT_BASIC_OPTION = REDACT_BASIC_STR.toLowerCase(Locale.ROOT); ++ public static final String REDACT_DIYRULES_OPTION = REDACT_DIYRULES_STR.toLowerCase(Locale.ROOT); ++ public static final String REDACT_ANNOTATION_OPTION = REDACT_ANNOTATION_STR.toLowerCase(Locale.ROOT); ++ public static final String REDACT_FULL_OPTION = REDACT_FULL_STR.toLowerCase(Locale.ROOT); ++ ++ public static final int PATH_MAX = 4096; ++ public static final int REDACT_VECTOR_SIZE = 1024; ++ ++ public HeapRedactor(String options) { ++ redactLevel = HeapDumpRedactLevel.REDACT_UNKNOWN; ++ redactNameTable = null; ++ redactClassTable = null; ++ redactValueTable = null; ++ init(options); ++ } ++ ++ public HeapRedactor(RedactParams redactParams) { ++ this.redactParams = redactParams; ++ redactLevel = HeapDumpRedactLevel.REDACT_UNKNOWN; ++ redactNameTable = null; ++ redactClassTable = null; ++ redactValueTable = null; ++ init(null); ++ } ++ ++ private void init(String options) { ++ if (redactLevel == HeapDumpRedactLevel.REDACT_UNKNOWN) { ++ initHeapdumpRedactLevel(options); ++ } ++ } ++ ++ public HeapDumpRedactLevel getHeapDumpRedactLevel() { ++ return redactLevel; ++ } ++ ++ public String getRedactLevelString() { ++ switch (redactLevel) { ++ case REDACT_BASIC: ++ return REDACT_BASIC_STR; ++ case REDACT_NAMES: ++ return REDACT_NAME_STR; ++ case REDACT_FULL: ++ return REDACT_FULL_STR; ++ case REDACT_DIYRULES: ++ return REDACT_DIYRULES_STR; ++ case REDACT_ANNOTATION: ++ return REDACT_ANNOTATION_STR; ++ case REDACT_OFF: ++ return REDACT_OFF_STR; ++ case REDACT_UNKNOWN: ++ default: ++ return REDACT_UNKNOWN_STR; ++ } ++ } ++ ++ public String lookupRedactName(String name) { ++ if (redactNameTable == null) { ++ return null; ++ } ++ return redactNameTable.get(name); ++ } ++ ++ public void recordTypeArray(TypeArray oop) { ++ int tmp_index = currentNode.getCurrentIndex(); ++ if(tmp_index == REDACT_VECTOR_SIZE){ ++ RedactVectorNode newNode = new RedactVectorNode(); ++ List list = new ArrayList<>(REDACT_VECTOR_SIZE); ++ newNode.setTypeArrayList(list); ++ newNode.setNext(null); ++ newNode.setCurrentIndex(0); ++ tmp_index = 0; ++ currentNode.setNext(newNode); ++ currentNode = newNode; ++ } ++ currentNode.getTypeArrayList().add(tmp_index, oop); ++ tmp_index++; ++ currentNode.setCurrentIndex(tmp_index); ++ ++ } ++ ++ public RedactVectorNode getHeaderNode(){ ++ return headerNode; ++ } ++ ++ public void recordRedactAnnotationValue(Long addr, String value) { ++ redactValueTable.put(addr, value); ++ } ++ ++ public Optional lookupRedactAnnotationValue(Long addr){ ++ return Optional.ofNullable(redactValueTable == null ? null : redactValueTable.get(addr)); ++ } ++ ++ public String getRedactAnnotationClassPath(){ ++ return redactParams.getRedactClassPath(); ++ } ++ ++ public Optional> getRedactRulesTable(String key) { ++ return Optional.>ofNullable(redactClassTable == null ? null: redactClassTable.get(key)); ++ } ++ ++ public HeapDumpRedactLevel initHeapdumpRedactLevel(String options) { ++ RedactParams customizedParams = parseRedactOptions(options); ++ ++ if (customizedParams.isEnableRedact() || this.redactParams == null) { ++ this.redactParams = customizedParams; ++ } ++ ++ if (redactParams.heapDumpRedact == null) { ++ redactLevel = HeapDumpRedactLevel.REDACT_OFF; ++ } else { ++ if (REDACT_BASIC_OPTION.equals(redactParams.heapDumpRedact)) { ++ redactLevel = HeapDumpRedactLevel.REDACT_BASIC; ++ } else if (REDACT_NAME_OPTION.equals(redactParams.heapDumpRedact)) { ++ redactLevel = HeapDumpRedactLevel.REDACT_NAMES; ++ initRedactMap(); ++ } else if (REDACT_FULL_OPTION.equals(redactParams.heapDumpRedact)) { ++ redactLevel = HeapDumpRedactLevel.REDACT_FULL; ++ initRedactMap(); ++ } else if (REDACT_DIYRULES_OPTION.equals(redactParams.heapDumpRedact)) { ++ redactLevel = HeapDumpRedactLevel.REDACT_DIYRULES; ++ initRedactMap(); ++ initRedactVector(); ++ } else if (REDACT_ANNOTATION_OPTION.equals(redactParams.heapDumpRedact)) { ++ redactLevel = HeapDumpRedactLevel.REDACT_ANNOTATION; ++ initRedactVector(); ++ } else { ++ redactLevel = HeapDumpRedactLevel.REDACT_OFF; ++ } ++ } ++ return redactLevel; ++ } ++ ++ private void initRedactVector(){ ++ if(redactValueTable == null) { ++ redactValueTable = new HashMap<>(); ++ } ++ if(headerNode == null) { ++ headerNode = new RedactVectorNode(); ++ List list = new ArrayList<>(REDACT_VECTOR_SIZE); ++ headerNode.setTypeArrayList(list); ++ headerNode.setNext(null); ++ headerNode.setCurrentIndex(0); ++ currentNode = headerNode; ++ } ++ } ++ ++ private RedactParams parseRedactOptions(String optionStr) { ++ RedactParams params = new RedactParams(REDACT_OFF_OPTION, null, null, null); ++ if (optionStr != null) { ++ String[] options = optionStr.split(","); ++ for (String option : options) { ++ if (option.startsWith(HEAP_DUMP_REDACT_PREFIX)) { ++ params.setAndCheckHeapDumpRedact(option.substring(HEAP_DUMP_REDACT_PREFIX.length())); ++ } else if (option.startsWith(REDACT_MAP_PREFIX)) { ++ params.setRedactMap(option.substring(REDACT_MAP_PREFIX.length())); ++ } else if (option.startsWith(REDACT_MAP_FILE_PREFIX)) { ++ params.setRedactMapFile(option.substring(REDACT_MAP_FILE_PREFIX.length())); ++ } else if (option.startsWith(REDACT_CLASS_PATH_PREFIX)) { ++ params.setRedactClassPath(option.substring(REDACT_CLASS_PATH_PREFIX.length())); ++ }else{ ++ // None matches ++ } ++ } ++ } ++ return params; ++ } ++ ++ private void initRedactMap() { ++ if (redactParams.redactMapFile != null) { ++ readRedactMapFromFile(redactParams.redactMapFile); ++ } ++ if (redactParams.redactMap != null) { ++ parseRedactMapStringDependOnMode(redactParams.redactMap, redactLevel); ++ } ++ } ++ ++ private void readRedactMapFromFile(String path) { ++ if (path == null || path.isEmpty()) { ++ // RedactMapFile= not specified ++ } else { ++ if (path.length() >= PATH_MAX) { ++ System.err.println("RedactMap File path is too long"); ++ return; ++ } ++ File file = new File(path); ++ if (!file.exists() || !file.isFile()) { ++ System.err.println("RedactMap File does not exist"); ++ } ++ try (BufferedReader reader = new BufferedReader(new FileReader(path))) { ++ String line; ++ while ((line = reader.readLine()) != null) { ++ parseRedactMapStringDependOnMode(line, redactLevel); ++ } ++ } catch (IOException e) { ++ System.err.println("Encounter an error when reading " + path + " , skip processing RedactMap File."); ++ e.printStackTrace(); ++ return; ++ } ++ } ++ } ++ ++ private void parseRedactMapStringDependOnMode(String nameMapList, HeapDumpRedactLevel redactLevel) { ++ if(redactLevel == HeapDumpRedactLevel.REDACT_DIYRULES) { ++ parseRedactDiyRulesString(nameMapList); ++ } else { ++ parseRedactMapString(nameMapList); ++ } ++ } ++ ++ private void parseRedactMapString(String nameMapList) { ++ if (redactNameTable == null) { ++ redactNameTable = new HashMap<>(); ++ } ++ String[] tokens = nameMapList.split("[,;\\s+]"); ++ for (String token : tokens) { ++ String[] pair = token.split(":"); ++ if (pair.length == 2) { ++ redactNameTable.put(pair[0], pair[1]); ++ } ++ } ++ } ++ ++ private void parseRedactDiyRulesString(String nameMapList) { ++ if (redactClassTable == null) { ++ redactClassTable = new HashMap<>(); ++ } ++ Map redactRulesTable = redactClassFullName == null ? null : redactClassTable.get(redactClassFullName); ++ String[] tokens = nameMapList.split("[,;\\s+]"); ++ for (String token : tokens) { ++ String[] pair = token.split(":"); ++ if (pair.length == 1) { ++ redactClassFullName = pair[0].replace(".", "/"); ++ redactRulesTable = redactClassTable.get(redactClassFullName); ++ if(redactRulesTable == null) { ++ redactRulesTable = new HashMap<>(); ++ redactClassTable.put(redactClassFullName, redactRulesTable); ++ } ++ } ++ if (pair.length == 2 && redactRulesTable != null) { ++ redactRulesTable.put(pair[0], pair[1]); ++ } ++ } ++ } ++ ++ public static class RedactParams { ++ private String heapDumpRedact; ++ private String redactMap; ++ private String redactMapFile; ++ private String redactClassPath; ++ private boolean enableRedact = false; ++ ++ public RedactParams() { ++ } ++ ++ public RedactParams(String heapDumpRedact, String redactMap, String redactMapFile, String redactClassPath) { ++ this.heapDumpRedact = heapDumpRedact; ++ this.redactMap = redactMap; ++ this.redactMapFile = redactMapFile; ++ this.redactClassPath = redactClassPath; ++ } ++ ++ @Override ++ public String toString() { ++ StringBuilder builder = new StringBuilder(); ++ if (heapDumpRedact != null) { ++ builder.append(HEAP_DUMP_REDACT_PREFIX); ++ builder.append(heapDumpRedact); ++ builder.append(","); ++ } ++ if (redactMap != null) { ++ builder.append(REDACT_MAP_PREFIX); ++ builder.append(redactMap); ++ builder.append(","); ++ } ++ if (redactMapFile != null) { ++ builder.append(REDACT_MAP_FILE_PREFIX); ++ builder.append(redactMapFile); ++ builder.append(","); ++ } ++ if (redactClassPath != null) { ++ builder.append(REDACT_CLASS_PATH_PREFIX); ++ builder.append(redactClassPath); ++ } ++ return builder.toString(); ++ } ++ ++ public String getHeapDumpRedact() { ++ return heapDumpRedact; ++ } ++ ++ public boolean setAndCheckHeapDumpRedact(String heapDumpRedact) { ++ if (!checkLauncherHeapdumpRedactSupport(heapDumpRedact)) { ++ return false; ++ } ++ this.heapDumpRedact = heapDumpRedact; ++ this.enableRedact = true; ++ return true; ++ } ++ ++ public String getRedactMap() { ++ return redactMap; ++ } ++ ++ public void setRedactMap(String redactMap) { ++ this.redactMap = redactMap; ++ } ++ ++ public String getRedactMapFile() { ++ return redactMapFile; ++ } ++ ++ public void setRedactMapFile(String redactMapFile) { ++ this.redactMapFile = redactMapFile; ++ } ++ ++ public String getRedactClassPath() { ++ return redactClassPath; ++ } ++ ++ public void setRedactClassPath(String redactClassPath) { ++ this.redactClassPath = redactClassPath; ++ } ++ ++ public static boolean checkLauncherHeapdumpRedactSupport(String value) { ++ String[] validValues = {REDACT_BASIC_OPTION, REDACT_NAME_OPTION, REDACT_FULL_OPTION, REDACT_DIYRULES_OPTION, REDACT_ANNOTATION_OPTION, REDACT_OFF_OPTION}; ++ for (String validValue : validValues) { ++ if (validValue.equals(value)) { ++ return true; ++ } ++ } ++ return false; ++ } ++ ++ public boolean isEnableRedact() { ++ return enableRedact; ++ } ++ ++ public void setEnableRedact(boolean enableRedact) { ++ this.enableRedact = enableRedact; ++ } ++ } ++ ++ public class RedactVectorNode{ ++ private List typeArrayList; ++ private RedactVectorNode next; ++ private int currentIndex; ++ ++ public List getTypeArrayList() { ++ return typeArrayList; ++ } ++ ++ public void setTypeArrayList(List list) { ++ this.typeArrayList = list; ++ } ++ ++ public RedactVectorNode getNext() { ++ return next; ++ } ++ ++ public void setNext(RedactVectorNode next) { ++ this.next = next; ++ } ++ ++ public int getCurrentIndex() { ++ return currentIndex; ++ } ++ ++ public void setCurrentIndex(int index) { ++ this.currentIndex = index; ++ } ++ } ++} +diff --git a/hotspot/make/linux/makefiles/mapfile-vers-debug b/hotspot/make/linux/makefiles/mapfile-vers-debug +index b006a84c2..b5e0d809a 100644 +--- a/hotspot/make/linux/makefiles/mapfile-vers-debug ++++ b/hotspot/make/linux/makefiles/mapfile-vers-debug +@@ -278,6 +278,8 @@ SUNWprivate_1.1 { + # This is for Forte Analyzer profiling support. + AsyncGetCallTrace; + ++ # INSERT EXTENDED SYMBOLS HERE ++ + # INSERT VTABLE SYMBOLS HERE + + local: +diff --git a/hotspot/make/linux/makefiles/mapfile-vers-product b/hotspot/make/linux/makefiles/mapfile-vers-product +index 64ccc47fb..554db7bdf 100644 +--- a/hotspot/make/linux/makefiles/mapfile-vers-product ++++ b/hotspot/make/linux/makefiles/mapfile-vers-product +@@ -273,6 +273,8 @@ SUNWprivate_1.1 { + # This is for Forte Analyzer profiling support. + AsyncGetCallTrace; + ++ # INSERT EXTENDED SYMBOLS HERE ++ + # INSERT VTABLE SYMBOLS HERE + + local: +diff --git a/hotspot/make/linux/makefiles/vm.make b/hotspot/make/linux/makefiles/vm.make +index 04b7c2028..0646301d0 100644 +--- a/hotspot/make/linux/makefiles/vm.make ++++ b/hotspot/make/linux/makefiles/vm.make +@@ -50,6 +50,15 @@ else + include $(if $(wildcard $(ALT_BUILDARCH_MAKE)),$(ALT_BUILDARCH_MAKE),$(BUILDARCH_MAKE)) + endif + ++# PLUGIN PATH ++JVM_KUNPENG_PLUGIN_DIR := $(shell find $(GAMMADIR)/../jdk/src/share/* -type d -name plugin) ++JVM_KUNPENG_PLUGIN_SRC := $(JVM_KUNPENG_PLUGIN_DIR)/feature ++ifeq ($(wildcard $(JVM_KUNPENG_PLUGIN_SRC)), $(JVM_KUNPENG_PLUGIN_SRC)) ++ JVM_KUNPENG_PLUGIN_SRCS := $(shell find $(JVM_KUNPENG_PLUGIN_SRC)/ -type d) ++ Src_Dirs_V += $(JVM_KUNPENG_PLUGIN_SRCS) ++ Src_Dirs_I += $(JVM_KUNPENG_PLUGIN_SRCS) ++endif ++ + # set VPATH so make knows where to look for source files + # Src_Dirs_V is everything in src/share/vm/*, plus the right os/*/vm and cpu/*/vm + # The adfiles directory contains ad_.[ch]pp. +@@ -186,6 +195,11 @@ Src_Dirs/ZERO := $(CORE_PATHS) + Src_Dirs/SHARK := $(CORE_PATHS) $(SHARK_PATHS) + Src_Dirs := $(Src_Dirs/$(TYPE)) + ++ifeq ($(wildcard $(JVM_KUNPENG_PLUGIN_SRC)), $(JVM_KUNPENG_PLUGIN_SRC)) ++ JVM_KUNPENG_PLUGIN_SRCS := $(shell find $(JVM_KUNPENG_PLUGIN_SRC)/ -type d) ++ Src_Dirs += $(JVM_KUNPENG_PLUGIN_SRCS) ++endif ++ + COMPILER2_SPECIFIC_FILES := opto libadt bcEscapeAnalyzer.cpp c2_\* runtime_\* + COMPILER1_SPECIFIC_FILES := c1_\* + SHARK_SPECIFIC_FILES := shark +@@ -233,7 +247,18 @@ JVM_OBJ_FILES = $(Obj_Files) + + vm_version.o: $(filter-out vm_version.o,$(JVM_OBJ_FILES)) + +-mapfile : $(MAPFILE) vm.def mapfile_ext ++JVM_KUNPENG_PLUGIN_SYMBOLS_SRC := $(JVM_KUNPENG_PLUGIN_DIR)/make/hotspot-symbols/symbols-plugin ++EXTENDED_SYMBOLS_START=$(shell awk '/EXTENDED SYMBOLS START/{print NR}' $(MAPFILE)) ++EXTENDED_SYMBOLS_END=$(shell awk '/EXTENDED SYMBOLS END/{print NR}' $(MAPFILE)) ++ ++mapfile_extend : $(MAPFILE) ++ if [ "$(EXTENDED_SYMBOLS_START)" != "" ] && [ "$(EXTENDED_SYMBOLS_END)" != "" ]; then\ ++ sed -i '$(EXTENDED_SYMBOLS_START), $(EXTENDED_SYMBOLS_END)d' $(MAPFILE);\ ++ fi ++ sed -i '/INSERT EXTENDED SYMBOLS HERE/r $(JVM_KUNPENG_PLUGIN_SYMBOLS_SRC)' $(MAPFILE) ++ ++ ++mapfile : mapfile_extend vm.def mapfile_ext + rm -f $@ + awk '{ if ($$0 ~ "INSERT VTABLE SYMBOLS HERE") \ + { system ("cat mapfile_ext"); system ("cat vm.def"); } \ +diff --git a/hotspot/src/os/linux/vm/os_linux.cpp b/hotspot/src/os/linux/vm/os_linux.cpp +index 773c746af..8d846b57b 100644 +--- a/hotspot/src/os/linux/vm/os_linux.cpp ++++ b/hotspot/src/os/linux/vm/os_linux.cpp +@@ -5513,6 +5513,52 @@ void os::pd_init_container_support() { + OSContainer::init(); + } + ++os::Linux::heap_dict_add_t os::Linux::_heap_dict_add; ++os::Linux::heap_dict_lookup_t os::Linux::_heap_dict_lookup; ++os::Linux::heap_dict_free_t os::Linux::_heap_dict_free; ++os::Linux::heap_vector_add_t os::Linux::_heap_vector_add; ++os::Linux::heap_vector_get_next_t os::Linux::_heap_vector_get_next; ++os::Linux::heap_vector_free_t os::Linux::_heap_vector_free; ++ ++void os::Linux::load_plugin_library() { ++ _heap_dict_add = CAST_TO_FN_PTR(heap_dict_add_t, dlsym(RTLD_DEFAULT, "HeapDict_Add")); ++ _heap_dict_lookup = CAST_TO_FN_PTR(heap_dict_lookup_t, dlsym(RTLD_DEFAULT, "HeapDict_Lookup")); ++ _heap_dict_free = CAST_TO_FN_PTR(heap_dict_free_t, dlsym(RTLD_DEFAULT, "HeapDict_Free")); ++ _heap_vector_add = CAST_TO_FN_PTR(heap_vector_add_t, dlsym(RTLD_DEFAULT, "HeapVector_Add")); ++ _heap_vector_get_next = CAST_TO_FN_PTR(heap_vector_get_next_t, dlsym(RTLD_DEFAULT, "HeapVector_GetNext")); ++ _heap_vector_free= CAST_TO_FN_PTR(heap_vector_free_t, dlsym(RTLD_DEFAULT, "HeapVector_Free")); ++ ++ char path[JVM_MAXPATHLEN]; ++ char ebuf[1024]; ++ void* handle = NULL; ++ if (os::dll_build_name(path, sizeof(path), Arguments::get_dll_dir(), "jvm8_kunpeng")) { ++ handle = dlopen(path, RTLD_LAZY); ++ } ++ if(handle == NULL && os::dll_build_name(path, sizeof(path), "/usr/lib64", "jvm8_kunpeng")) { ++ handle = dlopen(path, RTLD_LAZY); ++ } ++ if (handle != NULL) { ++ if(_heap_dict_add == NULL) { ++ _heap_dict_add = CAST_TO_FN_PTR(heap_dict_add_t, dlsym(handle, "HeapDict_Add")); ++ } ++ if(_heap_dict_lookup == NULL) { ++ _heap_dict_lookup = CAST_TO_FN_PTR(heap_dict_lookup_t, dlsym(handle, "HeapDict_Lookup")); ++ } ++ if(_heap_dict_free == NULL) { ++ _heap_dict_free = CAST_TO_FN_PTR(heap_dict_free_t, dlsym(handle, "HeapDict_Free")); ++ } ++ if(_heap_vector_add == NULL) { ++ _heap_vector_add = CAST_TO_FN_PTR(heap_vector_add_t, dlsym(handle, "HeapVector_Add")); ++ } ++ if(_heap_vector_get_next == NULL) { ++ _heap_vector_get_next = CAST_TO_FN_PTR(heap_vector_get_next_t, dlsym(handle, "HeapVector_GetNext")); ++ } ++ if(_heap_vector_free == NULL) { ++ _heap_vector_free= CAST_TO_FN_PTR(heap_vector_free_t, dlsym(handle, "HeapVector_Free")); ++ } ++ } ++} ++ + // this is called _after_ the global arguments have been parsed + jint os::init_2(void) + { +@@ -5585,6 +5631,8 @@ jint os::init_2(void) + Linux::is_floating_stack() ? "floating stack" : "fixed stack"); + } + ++ Linux::load_plugin_library(); ++ + if (UseNUMA) { + if (!Linux::libnuma_init()) { + UseNUMA = false; +diff --git a/hotspot/src/os/linux/vm/os_linux.hpp b/hotspot/src/os/linux/vm/os_linux.hpp +index 19dde2e58..d6866c67e 100644 +--- a/hotspot/src/os/linux/vm/os_linux.hpp ++++ b/hotspot/src/os/linux/vm/os_linux.hpp +@@ -197,6 +197,7 @@ class Linux { + // stack or fixed stack. + static bool is_floating_stack() { return _is_floating_stack; } + ++ static void load_plugin_library(); + static void libpthread_init(); + static void parse_numa_nodes(); + static bool libnuma_init(); +@@ -297,6 +298,18 @@ private: + typedef int (*numa_bitmask_isbitset_func_t)(struct bitmask *bmp, unsigned int n); + typedef int (*numa_distance_func_t)(int node1, int node2); + ++ typedef void* (*heap_dict_add_t)(void* key, void* val, void* heap_dict, uint8_t type); ++ typedef void* (*heap_dict_lookup_t)(void* key, void* heap_dict, bool deletable); ++ typedef void (*heap_dict_free_t)(void* heap_dict, bool is_nested); ++ typedef void* (*heap_vector_add_t)(void* val, void* heap_vector, bool &_inserted); ++ typedef void* (*heap_vector_get_next_t)(void* heap_vector, void* heap_vector_node, int &_cnt, void** &_items); ++ typedef void (*heap_vector_free_t)(void* heap_vector); ++ static heap_dict_add_t _heap_dict_add; ++ static heap_dict_lookup_t _heap_dict_lookup; ++ static heap_dict_free_t _heap_dict_free; ++ static heap_vector_add_t _heap_vector_add; ++ static heap_vector_get_next_t _heap_vector_get_next; ++ static heap_vector_free_t _heap_vector_free; + static sched_getcpu_func_t _sched_getcpu; + static numa_node_to_cpus_func_t _numa_node_to_cpus; + static numa_max_node_func_t _numa_max_node; +@@ -530,6 +543,46 @@ public: + _numa_bitmask_free(bitmask); + } + } ++ ++ static void* heap_dict_add(void* key, void* val, void* heap_dict, uint8_t type) { ++ if(_heap_dict_add == NULL) { ++ return NULL; ++ } ++ return _heap_dict_add(key, val, heap_dict, type); ++ } ++ ++ static void* heap_dict_lookup(void* key, void* heap_dict, bool deletable) { ++ if(_heap_dict_lookup == NULL) { ++ return NULL; ++ } ++ return _heap_dict_lookup(key, heap_dict, deletable); ++ } ++ ++ static void heap_dict_free(void* heap_dict, bool is_nested) { ++ if(_heap_dict_free != NULL) { ++ _heap_dict_free(heap_dict, is_nested); ++ } ++ } ++ ++ static void* heap_vector_add(void* val, void* heap_vector, bool &_inserted) { ++ if(_heap_vector_add == NULL) { ++ return NULL; ++ } ++ return _heap_vector_add(val, heap_vector, _inserted); ++ } ++ ++ static void* heap_vector_get_next(void* heap_vector, void* heap_vector_node, int &_cnt, void** &_items) { ++ if(_heap_vector_get_next == NULL) { ++ return NULL; ++ } ++ return _heap_vector_get_next(heap_vector, heap_vector_node, _cnt, _items); ++ } ++ ++ static void heap_vector_free(void* heap_vector) { ++ if(_heap_vector_free != NULL) { ++ _heap_vector_free(heap_vector); ++ } ++ } + }; + + +diff --git a/hotspot/src/share/vm/oops/annotations.hpp b/hotspot/src/share/vm/oops/annotations.hpp +index d1f7bc71b..1f9345503 100644 +--- a/hotspot/src/share/vm/oops/annotations.hpp ++++ b/hotspot/src/share/vm/oops/annotations.hpp +@@ -44,6 +44,7 @@ typedef Array AnnotationArray; + // a type_annotation instance. + + class Annotations: public MetaspaceObj { ++ friend class VMStructs; + + // Annotations for this class, or null if none. + AnnotationArray* _class_annotations; +diff --git a/hotspot/src/share/vm/runtime/arguments.cpp b/hotspot/src/share/vm/runtime/arguments.cpp +index 9db056b5e..360a87159 100644 +--- a/hotspot/src/share/vm/runtime/arguments.cpp ++++ b/hotspot/src/share/vm/runtime/arguments.cpp +@@ -42,6 +42,7 @@ + #include "runtime/java.hpp" + #include "services/management.hpp" + #include "services/memTracker.hpp" ++#include "services/heapRedactor.hpp" + #include "utilities/defaultStream.hpp" + #include "utilities/macros.hpp" + #include "utilities/stringUtils.hpp" +@@ -151,6 +152,8 @@ char* Arguments::_meta_index_dir = NULL; + + bool Arguments::_transletEnhance = false; + ++char* Arguments::_heap_dump_redact_auth = NULL; ++ + // Check if head of 'option' matches 'name', and sets 'tail' remaining part of option string + + static bool match_option(const JavaVMOption *option, const char* name, +@@ -4169,6 +4172,27 @@ jint Arguments::parse(const JavaVMInitArgs* args) { + #endif + } + ++ if (match_option(option, "-XX:HeapDumpRedact", &tail)) { ++ if (!HeapRedactor::check_launcher_heapdump_redact_support(tail)) { ++ warning("Heap dump redacting did not setup properly, using wrong argument?"); ++ vm_exit_during_initialization("Syntax error, expecting -XX:HeapDumpRedact=[off|names|basic|full|diyrules|annotation]",NULL); ++ } ++ } ++ ++ // heapDump redact password ++ if(match_option(option, "-XX:RedactPassword=", &tail)) { ++ if(tail == NULL || strlen(tail) == 0) { ++ VerifyRedactPassword = false; ++ jio_fprintf(defaultStream::output_stream(), "redact password is null, disable verify heap dump authority.\n"); ++ } else { ++ VerifyRedactPassword = true; ++ size_t redact_password_len = strlen(tail); ++ _heap_dump_redact_auth = NEW_C_HEAP_ARRAY(char, redact_password_len+1, mtInternal); ++ memcpy(_heap_dump_redact_auth, tail, redact_password_len); ++ _heap_dump_redact_auth[redact_password_len] = '\0'; ++ memset((void*)tail, '0', redact_password_len); ++ } ++ } + + #ifndef PRODUCT + if (match_option(option, "-XX:+PrintFlagsWithComments", &tail)) { +diff --git a/hotspot/src/share/vm/runtime/arguments.hpp b/hotspot/src/share/vm/runtime/arguments.hpp +index fdd1d14b0..945f487e1 100644 +--- a/hotspot/src/share/vm/runtime/arguments.hpp ++++ b/hotspot/src/share/vm/runtime/arguments.hpp +@@ -449,6 +449,8 @@ class Arguments : AllStatic { + + static char* SharedDynamicArchivePath; + ++ static char* _heap_dump_redact_auth; ++ + public: + // Parses the arguments, first phase + static jint parse(const JavaVMInitArgs* args); +@@ -562,6 +564,8 @@ class Arguments : AllStatic { + + static const char* GetSharedDynamicArchivePath() { return SharedDynamicArchivePath; } + ++ static const char* get_heap_dump_redact_auth() { return _heap_dump_redact_auth; } ++ + static bool init_shared_archive_paths(); + + static void extract_shared_archive_paths(const char* archive_path, +diff --git a/hotspot/src/share/vm/runtime/globals.hpp b/hotspot/src/share/vm/runtime/globals.hpp +index b47c10431..28bdd336f 100644 +--- a/hotspot/src/share/vm/runtime/globals.hpp ++++ b/hotspot/src/share/vm/runtime/globals.hpp +@@ -453,8 +453,8 @@ class CommandLineFlags { + // notproduct flags are settable / visible only during development and are not declared in the PRODUCT version + + // A flag must be declared with one of the following types: +-// bool, intx, uintx, ccstr. +-// The type "ccstr" is an alias for "const char*" and is used ++// bool, intx, uintx, ccstr, ccstrlist, double or uint64_t. ++// The type "ccstr" and "ccstrlist" are an alias for "const char*" and is used + // only in this file, because the macrology requires single-token type names. + + // Note: Diagnostic options not meant for VM tuning or for product modes. +@@ -992,6 +992,24 @@ class CommandLineFlags { + "directory) of the dump file (defaults to java_pid.hprof " \ + "in the working directory)") \ + \ ++ manageable(ccstr, HeapDumpRedact, NULL, \ ++ "Redact the heapdump information to remove sensitive data") \ ++ \ ++ manageable(ccstr, RedactMap, NULL, \ ++ "Redact the class and field names to other strings") \ ++ \ ++ manageable(ccstr, RedactMapFile, NULL, \ ++ "File path of the Redact Map") \ ++ \ ++ manageable(ccstr, RedactClassPath, NULL, \ ++ "full path of the Redact Annotation") \ ++ \ ++ product(bool, VerifyRedactPassword, false, \ ++ "verify authority for operating heapDump redact feature") \ ++ \ ++ product(ccstr, RedactPassword, "", \ ++ "authority for operating heapDump redact feature") \ ++ \ + develop(uintx, SegmentedHeapDumpThreshold, 2*G, \ + "Generate a segmented heap dump (JAVA PROFILE 1.0.2 format) " \ + "when the heap usage is larger than this") \ +diff --git a/hotspot/src/share/vm/runtime/vmStructs.cpp b/hotspot/src/share/vm/runtime/vmStructs.cpp +index 94726e498..f4061055f 100644 +--- a/hotspot/src/share/vm/runtime/vmStructs.cpp ++++ b/hotspot/src/share/vm/runtime/vmStructs.cpp +@@ -399,6 +399,10 @@ typedef OffsetCompactHashtable*) \ ++ nonstatic_field(Annotations, _class_type_annotations, Array*) \ ++ nonstatic_field(Annotations, _fields_annotations, Array*>*) \ ++ nonstatic_field(Annotations, _fields_type_annotations, Array*>*) \ + \ + /***********************/ \ + /* Constant Pool Cache */ \ +@@ -767,6 +771,8 @@ typedef OffsetCompactHashtable, _length, int) \ + nonstatic_field(Array, _data[0], Klass*) \ ++ nonstatic_field(Array*>, _length, int) \ ++ nonstatic_field(Array*>, _data[0], Array*) \ + \ + /*******************/ \ + /* GrowableArrays */ \ +@@ -1264,6 +1270,7 @@ typedef OffsetCompactHashtable, _data, sizeof(u2)) \ + unchecked_nonstatic_field(Array, _data, sizeof(Method*)) \ + unchecked_nonstatic_field(Array, _data, sizeof(Klass*)) \ ++ unchecked_nonstatic_field(Array*>, _data, sizeof(Array*)) \ + \ + /*********************************/ \ + /* java_lang_Class fields */ \ +@@ -1460,6 +1467,7 @@ typedef OffsetCompactHashtable, MetaspaceObj) \ + declare_type(Array, MetaspaceObj) \ + declare_type(Array, MetaspaceObj) \ ++ declare_type(Array*>, MetaspaceObj) \ + \ + declare_integer_type(AccessFlags) /* FIXME: wrong type (not integer) */\ + declare_toplevel_type(address) /* FIXME: should this be an integer type? */\ +diff --git a/hotspot/src/share/vm/services/attachListener.cpp b/hotspot/src/share/vm/services/attachListener.cpp +index 7c5763744..31411d061 100644 +--- a/hotspot/src/share/vm/services/attachListener.cpp ++++ b/hotspot/src/share/vm/services/attachListener.cpp +@@ -181,6 +181,7 @@ static jint jcmd(AttachOperation* op, outputStream* out) { + // Input arguments :- + // arg0: Name of the dump file + // arg1: "-live" or "-all" ++// arg2: "-HeapDumpRedact=,RedactMap=,RedactMapFile=" + jint dump_heap(AttachOperation* op, outputStream* out) { + const char* path = op->arg(0); + if (path == NULL || path[0] == '\0') { +@@ -196,11 +197,20 @@ jint dump_heap(AttachOperation* op, outputStream* out) { + live_objects_only = strcmp(arg1, "-live") == 0; + } + ++ const char* arg2 = op->arg(2); ++ if (arg2 != NULL && (strlen(arg2) > 0)) { ++ size_t len = strlen("-HeapDumpRedact="); ++ if (strncmp(arg2, "-HeapDumpRedact=", len) != 0){ ++ out->print_cr("Invalid argument to dumpheap operation: %s", arg2); ++ return JNI_ERR; ++ } ++ } ++ + // Request a full GC before heap dump if live_objects_only = true + // This helps reduces the amount of unreachable objects in the dump + // and makes it easier to browse. + HeapDumper dumper(live_objects_only /* request GC */); +- int res = dumper.dump(op->arg(0)); ++ int res = dumper.dump(op->arg(0), arg2, out); + if (res == 0) { + out->print_cr("Heap dump file created"); + } else { +@@ -371,6 +381,14 @@ static jint set_flag(AttachOperation* op, outputStream* out) { + + Flag* f = Flag::find_flag((char*)name, strlen(name)); + if (f && f->is_external() && f->is_writeable()) { ++ if(VerifyRedactPassword) { ++ if(strcmp(name, "HeapDumpRedact") == 0 || strcmp(name, "RedactMap") == 0 || strcmp(name, "RedactMapFile") == 0 ++ || strcmp(name, "RedactClassPath") == 0) { ++ out->print_cr("has no authority to reset redact params"); ++ return JNI_ERR; ++ } ++ } ++ + if (f->is_bool()) { + return set_bool_flag(name, op, out); + } else if (f->is_intx()) { +diff --git a/hotspot/src/share/vm/services/heapDumper.cpp b/hotspot/src/share/vm/services/heapDumper.cpp +index b5915c412..92bb81d01 100644 +--- a/hotspot/src/share/vm/services/heapDumper.cpp ++++ b/hotspot/src/share/vm/services/heapDumper.cpp +@@ -37,6 +37,7 @@ + #include "runtime/vframe.hpp" + #include "runtime/vmThread.hpp" + #include "runtime/vm_operations.hpp" ++#include "runtime/fieldDescriptor.hpp" + #include "services/heapDumper.hpp" + #include "services/threadService.hpp" + #include "utilities/ostream.hpp" +@@ -44,7 +45,7 @@ + #if INCLUDE_ALL_GCS + #include "gc_implementation/parallelScavenge/parallelScavengeHeap.hpp" + #endif // INCLUDE_ALL_GCS +- ++#include "heapRedactor.hpp" + /* + * HPROF binary format - description copied from: + * src/share/demo/jvmti/hprof/hprof_io.c +@@ -398,6 +399,8 @@ class DumpWriter : public StackObj { + // all I/O go through this function + void write_internal(void* s, size_t len); + ++ HeapRedactor* redactor; ++ + public: + DumpWriter(const char* path); + ~DumpWriter(); +@@ -435,6 +438,9 @@ class DumpWriter : public StackObj { + void write_symbolID(Symbol* o); + void write_classID(Klass* k); + void write_id(u4 x); ++ void setHeapRedactor(HeapRedactor *value); ++ HeapRedactor* heapRedactor(); ++ HeapDumpRedactLevel getHeapDumpRedactLevel(); + }; + + DumpWriter::DumpWriter(const char* path) { +@@ -460,6 +466,21 @@ DumpWriter::DumpWriter(const char* path) { + } + } + ++void DumpWriter::setHeapRedactor(HeapRedactor *value) { ++ redactor = value; ++} ++ ++HeapRedactor* DumpWriter::heapRedactor() { ++ return DumpWriter::redactor; ++} ++ ++HeapDumpRedactLevel DumpWriter::getHeapDumpRedactLevel() { ++ if(redactor == NULL) { ++ return REDACT_OFF; ++ } ++ return redactor->redact_level(); ++} ++ + DumpWriter::~DumpWriter() { + // flush and close dump file + if (is_open()) { +@@ -618,8 +639,9 @@ void DumpWriter::write_classID(Klass* k) { + write_objectID(k->java_mirror()); + } + +- +- ++typedef char* (*CALL_DO_LOOKUP_REPLACE_VALUE)(DumpWriter*, typeArrayOop); ++typedef void (*CALL_DUMP_INSTANCE_FIELDS_DESCRIPTORS)(DumpWriter*, Klass*); ++typedef void (*CALL_DUMP_PRIM_ARRAY)(DumpWriter*, typeArrayOop); + // Support class with a collection of functions used when dumping the heap + + class DumperSupport : AllStatic { +@@ -646,13 +668,25 @@ class DumperSupport : AllStatic { + static void dump_static_fields(DumpWriter* writer, Klass* k); + // dump the raw values of the instance fields of the given object + static void dump_instance_fields(DumpWriter* writer, oop o); ++ // dump the diyrules values of the instance fields of the given object ++ static void dump_instance_redact_fields(DumpWriter* writer, oop o, void* replace_value_table); + // dumps the definition of the instance fields for a given class + static void dump_instance_field_descriptors(DumpWriter* writer, Klass* k); ++ // dumps the definition of the instance fields with annotation info for a given class ++ static void dump_instance_annotation_field_descriptors(DumpWriter* writer, Klass* k); ++ // dumps the definition of the instance fields with diyrules info for a given class ++ static void dump_instance_diyrules_field_descriptors(DumpWriter* writer, Klass* k); + // creates HPROF_GC_INSTANCE_DUMP record for the given object + static void dump_instance(DumpWriter* writer, oop o); ++ // creates HPROF_GC_INSTANCE_REDACT_DUMP record for the given object ++ static void dump_redact_instance(DumpWriter* writer, oop o); ++ // lookup different value type depend on redact mode ++ static char* do_lookup_replace_value_with_symbol(DumpWriter* writer, typeArrayOop array); ++ static char* do_lookup_replace_value_with_char(DumpWriter* writer, typeArrayOop array); ++ static bool dump_replace_value(CALL_DO_LOOKUP_REPLACE_VALUE fn, DumpWriter* writer, typeArrayOop array); + // creates HPROF_GC_CLASS_DUMP record for the given class and each of its + // array classes +- static void dump_class_and_array_classes(DumpWriter* writer, Klass* k); ++ static void dump_class_and_array_classes(CALL_DUMP_INSTANCE_FIELDS_DESCRIPTORS fn, DumpWriter* writer, Klass* k); + // creates HPROF_GC_CLASS_DUMP record for a given primitive array + // class (and each multi-dimensional array class too) + static void dump_basic_type_array_class(DumpWriter* writer, Klass* k); +@@ -661,11 +695,15 @@ class DumperSupport : AllStatic { + static void dump_object_array(DumpWriter* writer, objArrayOop array); + // creates HPROF_GC_PRIM_ARRAY_DUMP record for the given type array + static void dump_prim_array(DumpWriter* writer, typeArrayOop array); ++ // creates HPROF_GC_PRIM_ARRAY_REDACT_DUMP record for the given type array ++ static void redact_basic_dump_prim_array(DumpWriter* writer, typeArrayOop array); ++ static bool redact_replace_dump_prim_array(CALL_DO_LOOKUP_REPLACE_VALUE fn, DumpWriter* writer, typeArrayOop array); ++ static void redact_dump_prim_array(CALL_DUMP_PRIM_ARRAY fn, DumpWriter* dumpWriter, typeArrayOop o); + // create HPROF_FRAME record for the given method and bci + static void dump_stack_frame(DumpWriter* writer, int frame_serial_num, int class_serial_num, Method* m, int bci); + + // check if we need to truncate an array +- static int calculate_array_max_length(DumpWriter* writer, arrayOop array, short header_size); ++ static int calculate_array_max_length(DumpWriter* writer, arrayOop array, short header_size, int char_length = 0); + + // writes a HPROF_HEAP_DUMP_SEGMENT record + static void write_dump_header(DumpWriter* writer); +@@ -929,6 +967,45 @@ void DumperSupport::dump_instance_fields(DumpWriter* writer, oop o) { + } + } + ++// dump the diyrules values of the instance fields of the given object ++void DumperSupport::dump_instance_redact_fields(DumpWriter* writer, oop o, void* replace_value_table) { ++ InstanceKlass* ik = InstanceKlass::cast(o->klass()); ++ ++ for (FieldStream fld(ik, false, false); !fld.eos(); fld.next()) { ++ if (fld.access_flags().is_static()) { ++ continue; ++ } ++ Symbol *sig = fld.signature(); ++ address addr = (address)o + fld.offset(); ++ // only redact string field ++ ResourceMark rm; ++ Symbol *field_name_symbol = fld.name(); ++ address field_adr = (address) ((uintptr_t) field_name_symbol); ++ void* replace_value = writer->heapRedactor()->lookup_value(field_adr, replace_value_table, false); ++ if (replace_value != NULL) { ++ oop field_oop = NULL; ++ if (UseCompressedOops) { ++ field_oop = oopDesc::load_decode_heap_oop((narrowOop*)addr); ++ } else { ++ field_oop = oopDesc::load_decode_heap_oop((oop*)addr); ++ } ++ if (!java_lang_String::is_instance(field_oop)) { ++ // data not completed, skip this field value; ++ writer->write_objectID(NULL); ++ continue; ++ } ++ ++ typeArrayOop field_value_oop = java_lang_String::value(field_oop); ++ address type_array_addr = cast_from_oop
(field_value_oop); ++ writer->heapRedactor()->insert_anonymous_value(type_array_addr, replace_value); ++ writer->write_objectID(field_oop); ++ continue; ++ } else { ++ dump_field_value(writer, sig->byte_at(0), addr); ++ } ++ } ++} ++ + // dumps the definition of the instance fields for a given class + void DumperSupport::dump_instance_field_descriptors(DumpWriter* writer, Klass* k) { + HandleMark hm; +@@ -953,6 +1030,128 @@ void DumperSupport::dump_instance_field_descriptors(DumpWriter* writer, Klass* k + } + } + ++// dumps the definition of the instance fields for a given class ++void DumperSupport::dump_instance_annotation_field_descriptors(DumpWriter* writer, Klass* k) { ++ HandleMark hm; ++ instanceKlassHandle ikh = instanceKlassHandle(Thread::current(), k); ++ ++ // pass 1 - count the instance fields ++ u2 field_count = 0; ++ for (FieldStream fldc(ikh, true, true); !fldc.eos(); fldc.next()) { ++ if (!fldc.access_flags().is_static()) field_count++; ++ } ++ ++ writer->write_u2(field_count); ++ ++ Symbol *class_name_symbol = ikh->name(); ++ bool in_exclude_package = false; ++ char *class_name = class_name_symbol->as_C_string(); ++ in_exclude_package = (strncmp("java/", class_name, 5) == 0) || (strncmp("org/springframework", class_name, 19) == 0); ++ if(in_exclude_package) { ++ // pass 2 - dump the field descriptors ++ for (FieldStream fld(ikh, true, true); !fld.eos(); fld.next()) { ++ if (!fld.access_flags().is_static()) { ++ Symbol* sig = fld.signature(); ++ ++ writer->write_symbolID(fld.name()); // name ++ writer->write_u1(sig2tag(sig)); // type ++ } ++ } ++ return; ++ } ++ ++ address obj_adr = (address)((uintptr_t)class_name_symbol); ++ // dump the field descriptors ++ for (FieldStream fld(ikh, true, true); !fld.eos(); fld.next()) { ++ if (!fld.access_flags().is_static()) { ++ Symbol* sig = fld.signature(); ++ Symbol* field_name = fld.name(); ++ ++ writer->write_symbolID(field_name); // name ++ writer->write_u1(sig2tag(sig)); // type ++ ++ if(strcmp(sig->as_C_string(), "Ljava/lang/String;") != 0) { ++ continue; ++ } ++ ++ AnnotationArray *field_annotations = fld.field_descriptor().annotations(); ++ if (field_annotations == NULL || field_annotations->length() == 0) { ++ continue; ++ } ++ ++ // byte index into field_annotations ++ ConstantPool *cp = fld.field_descriptor().field_holder()->constants(); ++ int byte_i = 0; ++ if (writer->heapRedactor()->lookup_annotation_index_in_constant_pool(field_annotations, cp, byte_i)) { ++ address element_value_addr = (address) field_annotations->adr_at(byte_i); ++ u2 cp_str_index = Bytes::get_Java_u2(element_value_addr); ++ Symbol *element_value_symbol = cp->symbol_at(cp_str_index); ++ ++ address field_adr = (address) ((uintptr_t) field_name); ++ writer->heapRedactor()->insert_class_field_value(obj_adr, field_adr, element_value_symbol); ++ } ++ } ++ } ++} ++ ++// dumps the definition of the instance fields for a given class ++void DumperSupport::dump_instance_diyrules_field_descriptors(DumpWriter *writer, Klass *k) { ++ HandleMark hm; ++ instanceKlassHandle ikh = instanceKlassHandle(Thread::current(), k); ++ ++ // pass 1 - count the instance fields ++ u2 field_count = 0; ++ for (FieldStream fldc(ikh, true, true); !fldc.eos(); fldc.next()) { ++ if (!fldc.access_flags().is_static()) field_count++; ++ } ++ ++ writer->write_u2(field_count); ++ ++ Symbol *class_name_symbol = ikh->name(); ++ void* redact_class_table = NULL; ++ bool has_diyrules = false; ++ char *class_name = class_name_symbol->as_C_string(); ++ redact_class_table = writer->heapRedactor()->lookup_class_rules(class_name); ++ has_diyrules = (redact_class_table != NULL); ++ if (!has_diyrules) { ++ // pass 2 - dump the field descriptors ++ for (FieldStream fld(ikh, true, true); !fld.eos(); fld.next()) { ++ if (!fld.access_flags().is_static()) { ++ Symbol* sig = fld.signature(); ++ ++ writer->write_symbolID(fld.name()); // name ++ writer->write_u1(sig2tag(sig)); // type ++ } ++ } ++ return; ++ } ++ ++ // pass 2 - dump the field descriptors ++ ++ address obj_adr = (address) ((uintptr_t) class_name_symbol); ++ // dump the field descriptors ++ for (FieldStream fld(ikh, true, true); !fld.eos(); fld.next()) { ++ if (!fld.access_flags().is_static()) { ++ Symbol* sig = fld.signature(); ++ Symbol* field_name = fld.name(); ++ ++ writer->write_symbolID(field_name); // name ++ writer->write_u1(sig2tag(sig)); // type ++ ++ if(strcmp(sig->as_C_string(), "Ljava/lang/String;") != 0) { ++ continue; ++ } ++ ++ char *field_name_str = field_name->as_C_string(); ++ char *replace_value = (char *) writer->heapRedactor()->lookup_value(field_name_str, redact_class_table, false); ++ if (replace_value != NULL) { ++ address field_adr = (address) ((uintptr_t) field_name); ++ writer->heapRedactor()->insert_class_field_value(obj_adr, field_adr, replace_value); ++ } ++ } ++ } ++} ++ + // creates HPROF_GC_INSTANCE_DUMP record for the given object + void DumperSupport::dump_instance(DumpWriter* writer, oop o) { + Klass* k = o->klass(); +@@ -971,9 +1170,101 @@ void DumperSupport::dump_instance(DumpWriter* writer, oop o) { + dump_instance_fields(writer, o); + } + ++// creates HPROF_GC_INSTANCE_REDACT_DUMP record for the given object ++void DumperSupport::dump_redact_instance(DumpWriter* writer, oop o) { ++ Klass* k = o->klass(); ++ ++ writer->write_u1(HPROF_GC_INSTANCE_DUMP); ++ writer->write_objectID(o); ++ writer->write_u4(STACK_TRACE_ID); ++ ++ // class ID ++ writer->write_classID(k); ++ ++ // number of bytes that follow ++ writer->write_u4(instance_size(k) ); ++ ++ // field values ++ void* replace_value_table = NULL; ++ InstanceKlass* java_super = InstanceKlass::cast(k); ++ do { ++ Symbol * class_name_symbol = java_super->name(); ++ address obj_adr = (address)((uintptr_t)class_name_symbol); ++ replace_value_table = writer->heapRedactor()->lookup_class_value(obj_adr); ++ java_super = java_super->java_super(); ++ } while (replace_value_table == NULL && java_super != NULL); ++ ++ bool has_rules = replace_value_table != NULL; ++ if(has_rules) { ++ dump_instance_redact_fields(writer, o, replace_value_table); ++ } else { ++ dump_instance_fields(writer, o); ++ } ++} ++ ++char* DumperSupport::do_lookup_replace_value_with_symbol(DumpWriter* writer, typeArrayOop array) { ++ address obj_addr = cast_from_oop
(array); ++ Symbol* anonymous_value_symbol = writer->heapRedactor()->lookup_replace_value(obj_addr); ++ if(anonymous_value_symbol == NULL) { ++ return NULL; ++ } ++ return anonymous_value_symbol->as_C_string(); ++} ++ ++char* DumperSupport::do_lookup_replace_value_with_char(DumpWriter* writer, typeArrayOop array) { ++ address obj_addr = cast_from_oop
(array); ++ char* anonymous_value = writer->heapRedactor()->lookup_replace_value(obj_addr); ++ return anonymous_value; ++} ++ ++bool DumperSupport::dump_replace_value(CALL_DO_LOOKUP_REPLACE_VALUE fn, DumpWriter* writer, typeArrayOop array) { ++ BasicType type = T_CHAR; ++ ++ // 2 * sizeof(u1) + 2 * sizeof(u4) + sizeof(objectID) ++ short header_size = 2 * 1 + 2 * 4 + sizeof(address); ++ ++ int length = 0; ++ ++ char *anonymous_value = NULL; ++ anonymous_value = fn(writer, array); ++ if(anonymous_value == NULL) { ++ if(!writer->heapRedactor()->record_typeArrayOop(array)) { ++ DumperSupport::dump_prim_array(writer, array); ++ return true; ++ } else { ++ return false; ++ } ++ } ++ ++ size_t char_length = strlen(anonymous_value); ++ length = DumperSupport::calculate_array_max_length(writer, array, header_size, char_length); ++ ++ int type_size = type2aelembytes(type); ++ u4 length_in_bytes = (u4)length * type_size; ++ u4 size = header_size + length_in_bytes; ++ ++ writer->write_u1(HPROF_GC_PRIM_ARRAY_DUMP); ++ writer->write_objectID(array); ++ writer->write_u4(STACK_TRACE_ID); ++ writer->write_u4(length); ++ writer->write_u1(HPROF_CHAR); ++ ++ // nothing to copy ++ if (length == 0) { ++ return true; ++ } ++ ++ if (Bytes::is_Java_byte_ordering_different()) { ++ for (int i = 0; i < length; i++) { writer->write_u2((u2) anonymous_value[i]); } ++ } else { ++ writer->write_raw(anonymous_value, length_in_bytes); ++ } ++ return true; ++} ++ + // creates HPROF_GC_CLASS_DUMP record for the given class and each of + // its array classes +-void DumperSupport::dump_class_and_array_classes(DumpWriter* writer, Klass* k) { ++void DumperSupport::dump_class_and_array_classes(CALL_DUMP_INSTANCE_FIELDS_DESCRIPTORS fn, DumpWriter* writer, Klass* k) { + Klass* klass = k; + InstanceKlass* ik = InstanceKlass::cast(k); + +@@ -1016,7 +1307,7 @@ void DumperSupport::dump_class_and_array_classes(DumpWriter* writer, Klass* k) { + dump_static_fields(writer, k); + + // description of instance fields +- dump_instance_field_descriptors(writer, k); ++ fn(writer, k); + + // array classes + k = klass->array_klass_or_null(); +@@ -1083,11 +1374,11 @@ void DumperSupport::dump_basic_type_array_class(DumpWriter* writer, Klass* k) { + + // Hprof uses an u4 as record length field, + // which means we need to truncate arrays that are too long. +-int DumperSupport::calculate_array_max_length(DumpWriter* writer, arrayOop array, short header_size) { ++int DumperSupport::calculate_array_max_length(DumpWriter* writer, arrayOop array, short header_size, int char_length) { + BasicType type = ArrayKlass::cast(array->klass())->element_type(); + assert(type >= T_BOOLEAN && type <= T_OBJECT, "invalid array element type"); + +- int length = array->length(); ++ int length = char_length == 0 ? array->length() : char_length; + + int type_size; + if (type == T_OBJECT) { +@@ -1150,6 +1441,9 @@ void DumperSupport::dump_object_array(DumpWriter* writer, objArrayOop array) { + #define WRITE_ARRAY(Array, Type, Size, Length) \ + for (int i = 0; i < Length; i++) { writer->write_##Size((Size)array->Type##_at(i)); } + ++#define WRITE_ARRAY_OBFUSCATED(Array, Type, Size, Length) \ ++ for (int i = 0; i < Length; i++) { writer->write_##Size(0); } ++ + // creates HPROF_GC_PRIM_ARRAY_DUMP record for the given type array + void DumperSupport::dump_prim_array(DumpWriter* writer, typeArrayOop array) { + BasicType type = TypeArrayKlass::cast(array->klass())->element_type(); +@@ -1172,14 +1466,12 @@ void DumperSupport::dump_prim_array(DumpWriter* writer, typeArrayOop array) { + return; + } + +- // If the byte ordering is big endian then we can copy most types directly +- + switch (type) { + case T_INT : { + if (Bytes::is_Java_byte_ordering_different()) { + WRITE_ARRAY(array, int, u4, length); + } else { +- writer->write_raw((void*)(array->int_at_addr(0)), length_in_bytes); ++ writer->write_raw((void *) (array->int_at_addr(0)), length_in_bytes); + } + break; + } +@@ -1240,6 +1532,96 @@ void DumperSupport::dump_prim_array(DumpWriter* writer, typeArrayOop array) { + } + } + ++// creates HPROF_GC_PRIM_ARRAY_DUMP redact record for the given type array ++void DumperSupport::redact_basic_dump_prim_array(DumpWriter* writer, typeArrayOop array) { ++ BasicType type = TypeArrayKlass::cast(array->klass())->element_type(); ++ ++ // 2 * sizeof(u1) + 2 * sizeof(u4) + sizeof(objectID) ++ short header_size = 2 * 1 + 2 * 4 + sizeof(address); ++ ++ int length = calculate_array_max_length(writer, array, header_size); ++ int type_size = type2aelembytes(type); ++ u4 length_in_bytes = (u4)length * type_size; ++ ++ writer->write_u1(HPROF_GC_PRIM_ARRAY_DUMP); ++ writer->write_objectID(array); ++ writer->write_u4(STACK_TRACE_ID); ++ writer->write_u4(length); ++ writer->write_u1(type2tag(type)); ++ ++ // nothing to copy ++ if (length == 0) { ++ return; ++ } ++ ++ switch (type) { ++ case T_INT : { ++ WRITE_ARRAY_OBFUSCATED(array, int, u4, length); ++ break; ++ } ++ case T_BYTE : { ++ WRITE_ARRAY_OBFUSCATED(array, int, u1, length); ++ break; ++ } ++ case T_CHAR : { ++ WRITE_ARRAY_OBFUSCATED(array, char, u2, length); ++ break; ++ } ++ case T_SHORT : { ++ if (Bytes::is_Java_byte_ordering_different()) { ++ WRITE_ARRAY(array, short, u2, length); ++ } else { ++ writer->write_raw((void*)(array->short_at_addr(0)), length_in_bytes); ++ } ++ break; ++ } ++ case T_BOOLEAN : { ++ if (Bytes::is_Java_byte_ordering_different()) { ++ WRITE_ARRAY(array, bool, u1, length); ++ } else { ++ writer->write_raw((void*)(array->bool_at_addr(0)), length_in_bytes); ++ } ++ break; ++ } ++ case T_LONG : { ++ if (Bytes::is_Java_byte_ordering_different()) { ++ WRITE_ARRAY(array, long, u8, length); ++ } else { ++ writer->write_raw((void*)(array->long_at_addr(0)), length_in_bytes); ++ } ++ break; ++ } ++ ++ // handle float/doubles in a special value to ensure than NaNs are ++ // written correctly. TO DO: Check if we can avoid this on processors that ++ // use IEEE 754. ++ ++ case T_FLOAT : { ++ for (int i = 0; i < length; i++) { ++ dump_float(writer, array->float_at(i)); ++ } ++ break; ++ } ++ case T_DOUBLE : { ++ for (int i = 0; i < length; i++) { ++ dump_double(writer, array->double_at(i)); ++ } ++ break; ++ } ++ default : ShouldNotReachHere(); ++ } ++} ++ ++// creates HPROF_GC_PRIM_ARRAY_DUMP redact record for the given type array ++bool DumperSupport::redact_replace_dump_prim_array(CALL_DO_LOOKUP_REPLACE_VALUE fn, DumpWriter *writer, typeArrayOop array) { ++ BasicType type = TypeArrayKlass::cast(array->klass())->element_type(); ++ if(type != T_CHAR) { ++ DumperSupport::dump_prim_array(writer, array); ++ return true; ++ } ++ return dump_replace_value(fn, writer, array); ++} ++ + // create a HPROF_FRAME record of the given Method* and bci + void DumperSupport::dump_stack_frame(DumpWriter* writer, + int frame_serial_num, +@@ -1289,6 +1671,38 @@ void SymbolTableDumper::do_symbol(Symbol** p) { + } + } + ++// Support class used to generate HPROF_UTF8 records from the entries in the ++// SymbolTable and Redact the sensitive String. ++ ++class SymbolTableRedactDumper : public SymbolClosure { ++private: ++ DumpWriter* _writer; ++ DumpWriter* writer() const { return _writer; } ++public: ++ SymbolTableRedactDumper(DumpWriter* writer) { _writer = writer; } ++ void do_symbol(Symbol** p); ++}; ++ ++void SymbolTableRedactDumper::do_symbol(Symbol** p) { ++ ResourceMark rm; ++ Symbol* sym = load_symbol(p); ++ int len = sym->utf8_length(); ++ if (len > 0) { ++ char* s = sym->as_utf8(); ++ ++ char* redact_field = NULL; ++ HeapDumpRedactLevel level = writer()->getHeapDumpRedactLevel(); ++ if((redact_field = writer()->heapRedactor()->lookup_redact_name(s)) != NULL){ ++ len = strlen(redact_field); ++ s = redact_field; ++ } ++ ++ DumperSupport::write_header(writer(), HPROF_UTF8, oopSize + len); ++ writer()->write_symbolID(sym); ++ writer()->write_raw(s, len); ++ } ++} ++ + // Support class used to generate HPROF_GC_ROOT_JNI_LOCAL records + + class JNILocalsDumper : public OopClosure { +@@ -1397,6 +1811,7 @@ class HeapObjectDumper : public ObjectClosure { + private: + VM_HeapDumper* _dumper; + DumpWriter* _writer; ++ CALL_DUMP_PRIM_ARRAY _redact_dump_prim_array; + + VM_HeapDumper* dumper() { return _dumper; } + DumpWriter* writer() { return _writer; } +@@ -1405,9 +1820,10 @@ class HeapObjectDumper : public ObjectClosure { + void mark_end_of_record(); + + public: +- HeapObjectDumper(VM_HeapDumper* dumper, DumpWriter* writer) { ++ HeapObjectDumper(VM_HeapDumper* dumper, DumpWriter* writer, CALL_DUMP_PRIM_ARRAY fn = DumperSupport::dump_prim_array) { + _dumper = dumper; + _writer = writer; ++ _redact_dump_prim_array = fn; + } + + // called for each object in the heap +@@ -1435,8 +1851,64 @@ void HeapObjectDumper::do_object(oop o) { + mark_end_of_record(); + } else if (o->is_typeArray()) { + // create a HPROF_GC_PRIM_ARRAY_DUMP record for each type array +- DumperSupport::dump_prim_array(writer(), typeArrayOop(o)); ++ DumperSupport::redact_dump_prim_array(_redact_dump_prim_array, writer(), typeArrayOop(o)); ++ mark_end_of_record(); ++ } ++} ++ ++void DumperSupport::redact_dump_prim_array(CALL_DUMP_PRIM_ARRAY fn, DumpWriter* dumpWriter, typeArrayOop o){ ++ fn(dumpWriter, o); ++} ++ ++class HeapObjectRedactDumper : public ObjectClosure { ++private: ++ VM_HeapDumper* _dumper; ++ DumpWriter* _writer; ++ char* _redact_level; ++ CALL_DO_LOOKUP_REPLACE_VALUE _do_lookup_replace_value; ++ ++ VM_HeapDumper* dumper() { return _dumper; } ++ DumpWriter* writer() { return _writer; } ++ ++ // used to indicate that a record has been writen ++ void mark_end_of_record(); ++ ++public: ++ HeapObjectRedactDumper(VM_HeapDumper* dumper, DumpWriter* writer, ++ CALL_DO_LOOKUP_REPLACE_VALUE do_lookup_replace_value) { ++ _dumper = dumper; ++ _writer = writer; ++ _do_lookup_replace_value = do_lookup_replace_value; ++ } ++ // called for each object in the heap ++ void do_object(oop o); ++}; ++ ++void HeapObjectRedactDumper::do_object(oop o) { ++ // hide the sentinel for deleted handles ++ if (o == JNIHandles::deleted_handle()) return; ++ ++ // skip classes as these emitted as HPROF_GC_CLASS_DUMP records ++ if (o->klass() == SystemDictionary::Class_klass()) { ++ if (!java_lang_Class::is_primitive(o)) { ++ return; ++ } ++ } ++ ++ if (o->is_instance()) { ++ // create a HPROF_GC_INSTANCE record for each object ++ DumperSupport::dump_redact_instance(writer(), o); + mark_end_of_record(); ++ } else if (o->is_objArray()) { ++ // create a HPROF_GC_OBJ_ARRAY_DUMP record for each object array ++ DumperSupport::dump_object_array(writer(), objArrayOop(o)); ++ mark_end_of_record(); ++ } else if (o->is_typeArray()) { ++ // create a HPROF_GC_PRIM_ARRAY_DUMP record for each type array ++ bool is_end_of_record = DumperSupport::redact_replace_dump_prim_array(_do_lookup_replace_value, writer(), typeArrayOop(o)); ++ if(is_end_of_record) { ++ mark_end_of_record(); ++ } + } + } + +@@ -1453,6 +1925,8 @@ class VM_HeapDumper : public VM_GC_Operation { + ThreadStackTrace** _stack_traces; + int _num_threads; + ++ static CALL_DUMP_INSTANCE_FIELDS_DESCRIPTORS _dump_instance_fields_descriptors; ++ + // accessors and setters + static VM_HeapDumper* dumper() { assert(_global_dumper != NULL, "Error"); return _global_dumper; } + static DumpWriter* writer() { assert(_global_writer != NULL, "Error"); return _global_writer; } +@@ -1491,6 +1965,9 @@ class VM_HeapDumper : public VM_GC_Operation { + // HPROF_TRACE and HPROF_FRAME records + void dump_stack_traces(); + ++ // HeapVector Records ++ void do_heapVector(); ++ + public: + VM_HeapDumper(DumpWriter* writer, bool gc_before_heap_dump, bool oome) : + VM_GC_Operation(0 /* total collections, dummy, ignored */, +@@ -1502,6 +1979,14 @@ class VM_HeapDumper : public VM_GC_Operation { + _klass_map = new (ResourceObj::C_HEAP, mtInternal) GrowableArray(INITIAL_CLASS_COUNT, true); + _stack_traces = NULL; + _num_threads = 0; ++ if(writer->getHeapDumpRedactLevel() == REDACT_ANNOTATION) { ++ _dump_instance_fields_descriptors = DumperSupport::dump_instance_annotation_field_descriptors; ++ } else if(writer->getHeapDumpRedactLevel() == REDACT_DIYRULES) { ++ _dump_instance_fields_descriptors = DumperSupport::dump_instance_diyrules_field_descriptors; ++ } else { ++ _dump_instance_fields_descriptors = DumperSupport::dump_instance_field_descriptors; ++ } ++ + if (oome) { + assert(!Thread::current()->is_VM_thread(), "Dump from OutOfMemoryError cannot be called by the VMThread"); + // get OutOfMemoryError zero-parameter constructor +@@ -1533,6 +2018,7 @@ class VM_HeapDumper : public VM_GC_Operation { + + VM_HeapDumper* VM_HeapDumper::_global_dumper = NULL; + DumpWriter* VM_HeapDumper::_global_writer = NULL; ++CALL_DUMP_INSTANCE_FIELDS_DESCRIPTORS VM_HeapDumper::_dump_instance_fields_descriptors = NULL; + + bool VM_HeapDumper::skip_operation() const { + return false; +@@ -1603,7 +2089,12 @@ void DumperSupport::end_of_dump(DumpWriter* writer) { + + // marks sub-record boundary + void HeapObjectDumper::mark_end_of_record() { +- dumper()->check_segment_length(); ++ dumper()->check_segment_length(); ++} ++ ++// marks sub-record boundary ++void HeapObjectRedactDumper::mark_end_of_record() { ++ dumper()->check_segment_length(); + } + + // writes a HPROF_LOAD_CLASS record for the class (and each of its +@@ -1642,7 +2133,7 @@ void VM_HeapDumper::do_load_class(Klass* k) { + // writes a HPROF_GC_CLASS_DUMP record for the given class + void VM_HeapDumper::do_class_dump(Klass* k) { + if (k->oop_is_instance()) { +- DumperSupport::dump_class_and_array_classes(writer(), k); ++ DumperSupport::dump_class_and_array_classes(_dump_instance_fields_descriptors, writer(), k); + } + } + +@@ -1811,8 +2302,14 @@ void VM_HeapDumper::doit() { + writer()->write_u8(os::javaTimeMillis()); + + // HPROF_UTF8 records +- SymbolTableDumper sym_dumper(writer()); +- SymbolTable::symbols_do(&sym_dumper); ++ if(writer()->heapRedactor() != NULL && (writer()->heapRedactor()->redact_level() == REDACT_NAMES || ++ writer()->heapRedactor()->redact_level() == REDACT_FULL)){ ++ SymbolTableRedactDumper sym_dumper(writer()); ++ SymbolTable::symbols_do(&sym_dumper); ++ } else{ ++ SymbolTableDumper sym_dumper(writer()); ++ SymbolTable::symbols_do(&sym_dumper); ++ } + + // write HPROF_LOAD_CLASS records + ClassLoaderDataGraph::classes_do(&do_load_class); +@@ -1836,8 +2333,25 @@ void VM_HeapDumper::doit() { + // segment is started. + // The HPROF_GC_CLASS_DUMP and HPROF_GC_INSTANCE_DUMP are the vast bulk + // of the heap dump. +- HeapObjectDumper obj_dumper(this, writer()); +- Universe::heap()->safe_object_iterate(&obj_dumper); ++ if(writer()->heapRedactor() != NULL && (writer()->heapRedactor()->redact_level() == REDACT_BASIC || ++ writer()->heapRedactor()->redact_level() == REDACT_FULL)) { ++ HeapObjectDumper obj_dumper(this, writer(), DumperSupport::redact_basic_dump_prim_array); ++ Universe::heap()->object_iterate(&obj_dumper); ++ } else if(writer()->heapRedactor() != NULL && writer()->heapRedactor()->redact_level() == REDACT_ANNOTATION) { ++ HeapObjectRedactDumper obj_dumper(this, writer(), DumperSupport::do_lookup_replace_value_with_symbol); ++ Universe::heap()->safe_object_iterate(&obj_dumper); ++ } else if(writer()->heapRedactor() != NULL && writer()->heapRedactor()->redact_level() == REDACT_DIYRULES) { ++ HeapObjectRedactDumper obj_dumper(this, writer(), DumperSupport::do_lookup_replace_value_with_char); ++ Universe::heap()->object_iterate(&obj_dumper); ++ } else { ++ HeapObjectDumper obj_dumper(this, writer()); ++ Universe::heap()->safe_object_iterate(&obj_dumper); ++ } ++ ++ // if value in INSTANCE is sensitive, ++ // and redact level is REDACT_ANNOTATION ++ // writes HeapVector records ++ do_heapVector(); + + // HPROF_GC_ROOT_THREAD_OBJ + frames + jni locals + do_threads(); +@@ -1921,9 +2435,80 @@ void VM_HeapDumper::dump_stack_traces() { + } + } + ++#define WRITE_ARRAY_IN_HEAPVECTOR(Array, Type, Size, Length) \ ++ for (int i = 0; i < Length; i++) { writer()->write_##Size((Size)array->Type##_at(i)); } ++ ++void VM_HeapDumper::do_heapVector(){ ++ CALL_DO_LOOKUP_REPLACE_VALUE fn = NULL; ++ if(writer()->getHeapDumpRedactLevel() == REDACT_ANNOTATION) { ++ fn = DumperSupport::do_lookup_replace_value_with_symbol; ++ } else if(writer()->getHeapDumpRedactLevel() == REDACT_DIYRULES) { ++ fn = DumperSupport::do_lookup_replace_value_with_char; ++ } else { ++ return; ++ } ++ ++ BasicType type = T_CHAR; ++ short header_size = 2 * 1 + 2 * 4 + sizeof(address); ++ int type_size = type2aelembytes(type); ++ uint max_bytes = max_juint - header_size; ++ ++ int node_len = 0, i =0; ++ void** items = NULL; ++ void *vector_node = writer()->heapRedactor()->get_vector_node_next(NULL, node_len, items); ++ while (vector_node != NULL && items != NULL) { ++ for (i = 0; i < node_len; i++) { ++ typeArrayOop array = (typeArrayOop)items[i]; ++ ++ char *anonymous_value = fn(writer(), array); ++ int length = anonymous_value == NULL ? array->length() : strlen(anonymous_value); ++ ++ u4 length_in_bytes = (u4) length * type_size; ++ if (length_in_bytes > max_bytes) { ++ length = max_bytes / type_size; ++ length_in_bytes = (size_t)length * type_size; ++ } ++ u4 size = header_size + length_in_bytes; ++ ++ writer()->write_u1(HPROF_GC_PRIM_ARRAY_DUMP); ++ writer()->write_objectID(array); ++ writer()->write_u4(STACK_TRACE_ID); ++ writer()->write_u4(length); ++ writer()->write_u1(HPROF_CHAR); ++ ++ // nothing to copy ++ if (length == 0) { ++ dumper()->check_segment_length(); ++ continue; ++ } ++ ++ if (anonymous_value != NULL) { ++ if (Bytes::is_Java_byte_ordering_different()) { ++ for (int i = 0; i < length; i++) { writer()->write_u2((u2) anonymous_value[i]); } ++ } else { ++ writer()->write_raw(anonymous_value, length_in_bytes); ++ } ++ } else { ++ if (Bytes::is_Java_byte_ordering_different()) { ++ WRITE_ARRAY_IN_HEAPVECTOR(array, char, u2, length); ++ } else { ++ writer()->write_raw((void*)(array->char_at_addr(0)), length_in_bytes); ++ } ++ } ++ dumper()->check_segment_length(); ++ } ++ ++ // clear current node info, maybe next node items is NULL, node_len = 0 will skip this NULL point error ++ node_len = 0; ++ items = NULL; ++ void *temp = writer()->heapRedactor()->get_vector_node_next(vector_node, node_len, items); ++ vector_node = temp; ++ } ++} ++ + // dump the heap to given path. + PRAGMA_FORMAT_NONLITERAL_IGNORED_EXTERNAL +-int HeapDumper::dump(const char* path) { ++int HeapDumper::dump(const char* path, const char* redact_params, outputStream* out) { + assert(path != NULL && strlen(path) > 0, "path missing"); + + // print message in interactive case +@@ -1932,8 +2517,16 @@ int HeapDumper::dump(const char* path) { + timer()->start(); + } + ++ HeapRedactor heapRedactor(redact_params, out); + // create the dump writer. If the file can be opened then bail + DumpWriter writer(path); ++ if(heapRedactor.redact_level() > REDACT_UNKNOWN) { ++ if(out != NULL) { ++ out->print_cr("HeapDump Redact Level = %s", heapRedactor.get_redact_level_string()); ++ } ++ } ++ writer.setHeapRedactor(&heapRedactor); ++ + if (!writer.is_open()) { + set_error(writer.error()); + if (print_to_tty()) { +diff --git a/hotspot/src/share/vm/services/heapDumper.hpp b/hotspot/src/share/vm/services/heapDumper.hpp +index 0bf6ba7be..5711d318e 100644 +--- a/hotspot/src/share/vm/services/heapDumper.hpp ++++ b/hotspot/src/share/vm/services/heapDumper.hpp +@@ -71,7 +71,7 @@ class HeapDumper : public StackObj { + ~HeapDumper(); + + // dumps the heap to the specified file, returns 0 if success. +- int dump(const char* path); ++ int dump(const char* path, const char* redact_params = NULL, outputStream* out = NULL); + + // returns error message (resource allocated), or NULL if no error + char* error_as_C_string() const; +diff --git a/hotspot/src/share/vm/services/heapRedactor.cpp b/hotspot/src/share/vm/services/heapRedactor.cpp +new file mode 100644 +index 000000000..6120e9458 +--- /dev/null ++++ b/hotspot/src/share/vm/services/heapRedactor.cpp +@@ -0,0 +1,621 @@ ++/* ++ * Copyright (c) 2023, Huawei Technologies Co., Ltd. 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. Huawei designates this ++ * particular file as subject to the "Classpath" exception as provided ++ * by Huawei in the LICENSE file that accompanied this code. ++ * ++ * 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 visit https://gitee.com/openeuler/bishengjdk-8 if you need additional ++ * information or have any questions. ++ */ ++ ++#include "../runtime/globals.hpp" ++#include "../runtime/os.hpp" ++#include "../runtime/arguments.hpp" ++#include "../utilities/ostream.hpp" ++#include "../memory/allocation.hpp" ++#include "../memory/allocation.inline.hpp" ++#include "../../../os/linux/vm/jvm_linux.h" ++#include "../utilities/debug.hpp" ++#include "heapRedactor.hpp" ++#include "../utilities/debug.hpp" ++#ifdef TARGET_ARCH_x86 ++# include "bytes_x86.hpp" ++#endif ++#ifdef TARGET_ARCH_aarch64 ++# include "bytes_aarch64.hpp" ++#endif ++#ifdef TARGET_ARCH_sparc ++# include "bytes_sparc.hpp" ++#endif ++#ifdef TARGET_ARCH_zero ++# include "bytes_zero.hpp" ++#endif ++#ifdef TARGET_ARCH_arm ++# include "bytes_arm.hpp" ++#endif ++#ifdef TARGET_ARCH_ppc ++# include "bytes_ppc.hpp" ++#endif ++ ++const char* HeapRedactor::REDACT_UNKNOWN_STR = "UNKNOWN"; ++const char* HeapRedactor::REDACT_OFF_STR = "OFF"; ++const char* HeapRedactor::REDACT_NAMES_STR = "NAMES"; ++const char* HeapRedactor::REDACT_BASIC_STR = "BASIC"; ++const char* HeapRedactor::REDACT_DIYRULES_STR = "DIYRULES"; ++const char* HeapRedactor::REDACT_ANNOTATION_STR = "ANNOTATION"; ++const char* HeapRedactor::REDACT_FULL_STR = "FULL"; ++ ++HeapRedactor::HeapRedactor(outputStream* out) { ++ init_fields(); ++ _use_sys_params = true; ++ init(out); ++} ++ ++HeapRedactor::HeapRedactor(const char *redact_params_string, outputStream* out) { ++ init_fields(); ++ if (redact_params_string != NULL && strlen(redact_params_string) > 0) { ++ _use_sys_params = false; ++ parse_redact_params(redact_params_string); ++ } else { ++ _use_sys_params = true; ++ } ++ init(out); ++} ++ ++HeapRedactor::~HeapRedactor() { ++#ifdef LINUX ++ if (_redact_name_table != NULL) { ++ os::Linux::heap_dict_free(_redact_name_table,false); ++ _redact_name_table = NULL; ++ } ++ if (_redact_rules_table != NULL) { ++ os::Linux::heap_dict_free(_redact_rules_table, true); ++ _redact_rules_table = NULL; ++ } ++ if (_replace_value_table != NULL) { ++ os::Linux::heap_dict_free(_replace_value_table, false); ++ _replace_value_table = NULL; ++ } ++ if(_redact_class_field_table != NULL) { ++ os::Linux::heap_dict_free(_redact_class_field_table, true); ++ _redact_class_field_table = NULL; ++ } ++ if(_redact_record != NULL) { ++ os::Linux::heap_vector_free(_redact_record); ++ _redact_record = NULL; ++ } ++#endif ++ if (_file_name_map_list != NULL) { ++ FREE_C_HEAP_ARRAY(char, _file_name_map_list, mtInternal); ++ } ++ if (_name_map_list != NULL) { ++ FREE_C_HEAP_ARRAY(char, _name_map_list, mtInternal); ++ } ++ if (_redact_params.params_string != NULL) { ++ FREE_C_HEAP_ARRAY(char, _redact_params.params_string, mtInternal); ++ } ++ if(_annotation_class_path != NULL) { ++ FREE_C_HEAP_ARRAY(char, _annotation_class_path, mtInternal); ++ } ++} ++ ++void HeapRedactor::init_fields() { ++ _redact_level = REDACT_UNKNOWN; ++ _redact_name_table = NULL; ++ _redact_rules_table= NULL; ++ _replace_value_table = NULL; ++ _redact_class_field_table = NULL; ++ _file_name_map_list = NULL; ++ _name_map_list = NULL; ++ _redact_class_full_name = NULL; ++ _annotation_class_path = NULL; ++ _redact_record = NULL; ++ _redact_params.params_string = NULL; ++ _redact_params.heap_dump_redact = NULL; ++ _redact_params.redact_map = NULL; ++ _redact_params.redact_map_file = NULL; ++ _redact_params.annotation_class_path = NULL; ++ _redact_params.redact_password = NULL; ++} ++ ++void HeapRedactor::parse_redact_params(const char *redact_params_string) { ++ size_t length = strlen(redact_params_string); ++ char* buf = NEW_C_HEAP_ARRAY(char, length + 1, mtInternal); ++ _redact_params.params_string = buf; ++ strncpy(_redact_params.params_string, redact_params_string, length + 1); ++ size_t start = strlen("-HeapDumpRedact="); ++ _redact_params.heap_dump_redact = _redact_params.params_string + start; ++ char* map_pos = strstr(_redact_params.heap_dump_redact, ",RedactMap="); ++ char* file_pos = strstr(_redact_params.heap_dump_redact, ",RedactMapFile="); ++ char* class_path_pos = strstr(_redact_params.heap_dump_redact, ",RedactClassPath="); ++ char* redact_password_pos = strstr(_redact_params.heap_dump_redact, ",RedactPassword="); ++ ++ _redact_params.redact_map = parse_redact_child_param(map_pos, ",RedactMap=", ++ file_pos); ++ _redact_params.redact_map_file = parse_redact_child_param(file_pos, ",RedactMapFile=", ++ class_path_pos); ++ _redact_params.annotation_class_path = parse_redact_child_param(class_path_pos, ",RedactClassPath=", ++ redact_password_pos); ++ _redact_params.redact_password = parse_redact_child_param(redact_password_pos, ",RedactPassword=", ++ _redact_params.params_string + length); ++} ++ ++char* HeapRedactor::parse_redact_child_param(char *redact_params_sub_string, const char* redact_param_prefix, ++ const char* next_redact_param_prefix) { ++ char* pos = NULL; ++ if (redact_params_sub_string == NULL) { ++ pos = NULL; ++ } else { ++ *redact_params_sub_string = '\0'; ++ pos = redact_params_sub_string + strlen(redact_param_prefix); ++ if (pos == next_redact_param_prefix) { ++ pos = NULL; ++ } ++ } ++ return pos; ++} ++ ++bool HeapRedactor::check_launcher_heapdump_redact_support(const char *value) { ++ if (!strcmp(value, "=basic") || !strcmp(value, "=names") || !strcmp(value, "=off") ++ || !strcmp(value, "=diyrules") ||!strcmp(value, "=annotation") || !strcmp(value, "=full")) { ++ return true; ++ } ++ return false; ++} ++ ++void HeapRedactor::init(outputStream* out) { ++ /** -XX:+VerifyRedactPassword, ++ * if HeapDumpRedact is NULL , jmap operation can not open redact feature without password ++ * if HeapDumpRedact is not NULL, jmap operation can not change redact level without password ++ **/ ++ if(Arguments::get_heap_dump_redact_auth() == NULL) { ++ VerifyRedactPassword = false; ++ } ++ if(VerifyRedactPassword && !_use_sys_params) { ++ if(_redact_params.redact_password == NULL || ++ strcmp(_redact_params.redact_password, Arguments::get_heap_dump_redact_auth()) ) { ++ // no password or wrong password; ++ _use_sys_params = true; ++ if(out != NULL) { ++ out->print_cr("not correct password, use the default redact mode when stared"); ++ } ++ } ++ } ++ ++ if(_redact_params.redact_password != NULL) { ++ size_t password_Len = strlen(_redact_params.redact_password); ++ memset(_redact_params.redact_password, '\0', password_Len); ++ } ++ ++ if (_redact_level == REDACT_UNKNOWN) { ++ init_heapdump_redact_level(); ++ } ++ return; ++} ++ ++void HeapRedactor::init_redact_map() { ++ const char* map_param = NULL; ++ const char* map_file_param = NULL; ++ if (_use_sys_params) { ++ map_param = RedactMap; ++ map_file_param = RedactMapFile; ++ } else { ++ map_param = _redact_params.redact_map; ++ map_file_param = _redact_params.redact_map_file; ++ } ++ if (map_file_param != NULL) { ++ read_redact_map_from_file(map_file_param); ++ } ++ if (map_param != NULL) { ++ size_t length = strlen(map_param); ++ _name_map_list = NEW_C_HEAP_ARRAY(char, length + 1, mtInternal); ++ strncpy(_name_map_list, map_param, length + 1); ++ read_redact_map_dependon_mode(_name_map_list, _redact_level); ++ } ++} ++ ++void HeapRedactor::read_redact_map_dependon_mode(char* name_map_list, HeapDumpRedactLevel redact_level) { ++ if(redact_level == REDACT_DIYRULES) { ++ parse_redact_diy_rules(name_map_list); ++ } else { ++ parse_redact_map_string(name_map_list); ++ } ++} ++ ++void HeapRedactor::parse_redact_map_string(char *name_map_list) { ++#ifdef LINUX ++ size_t token_start = 0; ++ size_t step = 0; ++ size_t length = strlen(name_map_list); ++ ++ while (step < length) { ++ bool is_seperator = false; ++ if ((is_seperator = (name_map_list[step] == ',' || name_map_list[step] == ';' || name_map_list[step] == '\n' || ++ name_map_list[step] == ' ')) || ++ step == length - 1) { ++ if (is_seperator) { ++ name_map_list[step] = '\0'; ++ } else { ++ step++; ++ } ++ if (token_start < step) { ++ char *token = name_map_list + token_start; ++ size_t i = 0; ++ size_t token_length = strlen(token); ++ while (i < token_length && token[i] != ':') { ++ i++; ++ } ++ if (i < token_length - 1) { ++ token[i] = '\0'; ++ if((strlen(token) < INT_MAX) && (strlen(token + i + 1) < INT_MAX)) { ++ _redact_name_table = os::Linux::heap_dict_add(token, token + i + 1, _redact_name_table, 0); ++ } ++ } ++ } ++ token_start = step + 1; ++ } ++ step++; ++ } ++#endif ++} ++ ++void HeapRedactor::read_redact_map_from_file(const char *path) { ++ char base_path[JVM_MAXPATHLEN] = {'\0'}; ++ char buffer[MAX_MAP_FILE_LENGTH + 1] = {'\0'}; ++ if (path == NULL || path[0] == '\0') { ++ // RedactMapFile= not specified ++ } else { ++ if (strlen(path) >= JVM_MAXPATHLEN) { ++ warning("RedactMap File path is too long "); ++ return; ++ } ++ strncpy(base_path, path, sizeof(base_path)); ++ // check if the path is a directory (must exist) ++ int fd = open(base_path, O_RDONLY); ++ if (fd == -1) { ++ return; ++ } ++ size_t num_read = os::read(fd, (char *)buffer, MAX_MAP_FILE_LENGTH); ++ ++ _file_name_map_list = NEW_C_HEAP_ARRAY(char, num_read + 1, mtInternal); ++ strncpy(_file_name_map_list, buffer, num_read + 1); ++ ++ read_redact_map_dependon_mode(_file_name_map_list, _redact_level); ++ } ++} ++ ++void HeapRedactor::parse_redact_diy_rules(char* name_map_list) { ++ size_t token_start = 0; ++ size_t step = 0; ++ size_t length = strlen(name_map_list); ++ ++ while (step < length) { ++ bool is_seperator = false; ++ if ((is_seperator = (name_map_list[step] == ',' || name_map_list[step] == ';' || name_map_list[step] == '\n' || ++ name_map_list[step] == ' ')) || ++ step == length - 1) { ++ if (is_seperator) { ++ name_map_list[step] = '\0'; ++ } else { ++ step++; ++ } ++ ++ if (token_start >= step) { ++ // to reduce the depth of the method ++ token_start = step + 1; ++ continue; ++ } ++ ++ char *token = name_map_list + token_start; ++ parse_token(token); ++ token_start = step + 1; ++ } ++ step++; ++ } ++ // clear _redact_class_full_name, encase RedactMap has an unformatted value(without class name), ++ // will rewrite the last class's value_map ++ _redact_class_full_name = NULL; ++} ++ ++void HeapRedactor::parse_token(char* token) { ++#ifdef LINUX ++ size_t i = 0; ++ size_t token_length = strlen(token); ++ while (i < token_length && token[i] != ':') { ++ if(token[i] == '.' ) { ++ token[i] = '/'; ++ } ++ i++; ++ } ++ ++ void* _redact_rules_sub_table = _redact_class_full_name == NULL ? NULL : ++ os::Linux::heap_dict_lookup(_redact_class_full_name, _redact_rules_table, false); ++ if (i < token_length - 1 && _redact_rules_sub_table != NULL) { ++ token[i] = '\0'; ++ os::Linux::heap_dict_add(token, token + i + 1, _redact_rules_sub_table, 0); ++ } else if( i == token_length) { ++ _redact_class_full_name = token; ++ _redact_rules_sub_table = os::Linux::heap_dict_lookup(token, _redact_rules_table, false); ++ if (_redact_rules_sub_table == NULL) { ++ _redact_rules_sub_table = os::Linux::heap_dict_add(token, NULL, _redact_rules_sub_table, 0); ++ _redact_rules_table = os::Linux::heap_dict_add(token, _redact_rules_sub_table, _redact_rules_table, 0); ++ } ++ } ++#endif ++} ++ ++HeapDumpRedactLevel HeapRedactor::init_heapdump_redact_level() { ++ const char* redact_string = NULL; ++ if (_use_sys_params) { ++ redact_string = HeapDumpRedact; ++ } else { ++ redact_string = _redact_params.heap_dump_redact; ++ } ++ if (redact_string == NULL) { ++ _redact_level = REDACT_OFF; ++ } else { ++#ifdef LINUX ++ if (strcmp(redact_string, "basic") == 0) { ++ _redact_level = REDACT_BASIC; ++ } else if (strcmp(redact_string, "names") == 0) { ++ _redact_level = REDACT_NAMES; ++ init_redact_map(); ++ } else if (strcmp(redact_string, "full") == 0) { ++ _redact_level = REDACT_FULL; ++ init_redact_map(); ++ } else if (strcmp(redact_string, "diyrules") == 0) { ++ _redact_level = REDACT_DIYRULES; ++ init_redact_map(); ++ } else if (strcmp(redact_string, "annotation") == 0) { ++ _redact_level = REDACT_ANNOTATION; ++ init_class_path(); ++ if(_annotation_class_path == NULL) { ++ _redact_level = REDACT_OFF; ++ } ++ } else { ++ _redact_level = REDACT_OFF; ++ } ++#else ++ if (strcmp(redact_string, "basic") == 0) { ++ _redact_level = REDACT_BASIC; ++ } else if (strcmp(redact_string, "full") == 0) { ++ _redact_level = REDACT_BASIC; ++ } else { ++ _redact_level = REDACT_OFF; ++ } ++#endif ++ } ++ return _redact_level; ++} ++ ++void HeapRedactor::init_class_path() { ++ const char* class_path = NULL; ++ if (_use_sys_params) { ++ class_path = RedactClassPath; ++ } else { ++ class_path = _redact_params.annotation_class_path; ++ } ++ ++ if(class_path != NULL) { ++ size_t class_path_len = strlen(class_path); ++ _annotation_class_path = NEW_C_HEAP_ARRAY(char, class_path_len + 3, mtInternal); ++ _annotation_class_path[0] = 'L'; ++ strncpy(_annotation_class_path + 1, class_path, class_path_len + 1); ++ _annotation_class_path[class_path_len + 1] = ';'; ++ _annotation_class_path[class_path_len + 2] = '\0'; ++ } ++} ++ ++void HeapRedactor::insert_anonymous_value(void* key, void* value){ ++#ifdef LINUX ++ _replace_value_table = os::Linux::heap_dict_add(key, value, _replace_value_table, 1); ++#endif ++} ++ ++bool HeapRedactor::lookup_annotation_index_in_constant_pool(AnnotationArray* field_annotations, ConstantPool *cp, int &byte_i_ref) { ++ u2 num_annotations = 0; ++ bool has_anonymous_annotation = false; ++ ++ if ((byte_i_ref + 2) > field_annotations->length()) { ++ // not enough room for num_annotations field ++ return false; ++ } else { ++ num_annotations = Bytes::get_Java_u2((address) field_annotations->adr_at(byte_i_ref)); ++ } ++ ++ byte_i_ref += 2; ++ ++ for (int calc_num_annotations = 0; calc_num_annotations < num_annotations; calc_num_annotations++) { ++ ++ if ((byte_i_ref + 2 + 2) > field_annotations->length()) { ++ // not enough room for smallest annotation_struct ++ return false; ++ } ++ ++ // get constants pool index ++ address cp_index_addr = (address) field_annotations->adr_at(byte_i_ref); ++ byte_i_ref += 2; ++ u2 cp_index = Bytes::get_Java_u2(cp_index_addr); ++ if (cp_index >= cp->tags()->length()) { ++ return false; ++ } ++ Symbol *annotate_class_symbol = cp->symbol_at(cp_index); ++ char *annotate_class_name = annotate_class_symbol->as_C_string(); ++ ++ u2 num_element_value_pairs = Bytes::get_Java_u2((address) field_annotations->adr_at(byte_i_ref)); ++ byte_i_ref += 2; ++ if ((byte_i_ref + 2 + 1) > field_annotations->length()) { ++ // not enough room for smallest annotation_struct ++ return false; ++ } ++ ++ const char *annotation_class_path = get_annotation_class_path(); ++ has_anonymous_annotation = (strcmp(annotation_class_path, annotate_class_name) == 0); ++ if (has_anonymous_annotation) { ++ address element_name_addr = (address) field_annotations->adr_at(byte_i_ref); ++ byte_i_ref += 2; ++ u2 cp_name_index = Bytes::get_Java_u2(element_name_addr); ++ Symbol *element_name_symbol = cp->symbol_at(cp_name_index); ++ char *element_name = element_name_symbol->as_C_string(); ++ if(element_name == NULL || strcmp(element_name, "value")) { ++ // expected annotation has only one field "value" ++ return false; ++ } ++ // skip element tag ++ byte_i_ref++; ++ return true; ++ } ++ ++ int calc_num_element_value_pairs = 0; ++ // skip element_name_index ++ byte_i_ref += 2; ++ for (; calc_num_element_value_pairs < num_element_value_pairs; calc_num_element_value_pairs++) { ++ if (!recursion_cp_refs_in_element_value(field_annotations, byte_i_ref)) { ++ return false; ++ } ++ } ++ } ++ return false; ++} ++ ++bool HeapRedactor::recursion_cp_refs_in_annotation_struct( ++ AnnotationArray* annotations_typeArray, int &byte_i_ref) { ++ if ((byte_i_ref + 2 + 2) > annotations_typeArray->length()) { ++ // not enough room for smallest annotation_struct ++ return false; ++ } ++ ++ u2 type_index = Bytes::get_Java_u2((address)annotations_typeArray->adr_at(byte_i_ref)); ++ byte_i_ref += 2; ++ ++ u2 num_element_value_pairs = Bytes::get_Java_u2((address) annotations_typeArray->adr_at(byte_i_ref)); ++ byte_i_ref += 2; ++ ++ int calc_num_element_value_pairs = 0; ++ for (; calc_num_element_value_pairs < num_element_value_pairs; ++ calc_num_element_value_pairs++) { ++ if ((byte_i_ref + 2) > annotations_typeArray->length()) { ++ // not enough room for another element_name_index, let alone ++ // the rest of another component ++ // length() is too small for element_name_index ++ return false; ++ } ++ ++ u2 element_name_index = Bytes::get_Java_u2((address) annotations_typeArray->adr_at(byte_i_ref)); ++ byte_i_ref += 2; ++ ++ if (!recursion_cp_refs_in_element_value(annotations_typeArray, byte_i_ref)) { ++ // bad element_value ++ // propagate failure back to caller ++ return false; ++ } ++ } // end for each component ++ assert(num_element_value_pairs == calc_num_element_value_pairs, "sanity check"); ++ ++ return true; ++} // end recursion_cp_refs_in_annotation_struct() ++ ++bool HeapRedactor::recursion_cp_refs_in_element_value(AnnotationArray* field_annotations, int &byte_i_ref) { ++ if ((byte_i_ref + 1) > field_annotations->length()) { ++ // not enough room for a tag let alone the rest of an element_value ++ return false; ++ } ++ ++ u1 tag = field_annotations->at(byte_i_ref); ++ byte_i_ref++; ++ switch (tag) { ++ case JVM_SIGNATURE_BYTE: ++ case JVM_SIGNATURE_CHAR: ++ case JVM_SIGNATURE_DOUBLE: ++ case JVM_SIGNATURE_FLOAT: ++ case JVM_SIGNATURE_INT: ++ case JVM_SIGNATURE_LONG: ++ case JVM_SIGNATURE_SHORT: ++ case JVM_SIGNATURE_BOOLEAN: ++ case 's': ++ case 'c': ++ { ++ if ((byte_i_ref + 2) > field_annotations->length()) { ++ // length() is too small for a const_value_index ++ break; ++ } ++ byte_i_ref += 2; ++ } break; ++ case 'e': ++ { ++ if ((byte_i_ref + 4) > field_annotations->length()) { ++ // length() is too small for a enum_const_value ++ break; ++ } ++ byte_i_ref += 4; ++ } break; ++ ++ case '@': ++ // For the above tag value, value.attr_value is the right union ++ // field. This is a nested annotation. ++ if (!recursion_cp_refs_in_annotation_struct(field_annotations, byte_i_ref)) { ++ // propagate failure back to caller ++ return false; ++ } ++ break; ++ ++ case JVM_SIGNATURE_ARRAY: ++ { ++ if ((byte_i_ref + 2) > field_annotations->length()) { ++ // not enough room for a num_values field ++ return false; ++ } ++ ++ // For the above tag value, value.array_value is the right union ++ // field. This is an array of nested element_value. ++ u2 num_values = Bytes::get_Java_u2((address) field_annotations->adr_at(byte_i_ref)); ++ byte_i_ref += 2; ++ ++ int calc_num_values = 0; ++ for (; calc_num_values < num_values; calc_num_values++) { ++ if (!recursion_cp_refs_in_element_value(field_annotations, byte_i_ref)) { ++ // bad nested element_value ++ // propagate failure back to caller ++ return false; ++ } ++ } ++ } break; ++ ++ default: ++ // bad tag ++ return false; ++ } ++ ++ return true; ++} ++ ++bool HeapRedactor::record_typeArrayOop(typeArrayOop array) { ++ bool _inserted = false; ++#ifdef LINUX ++ _redact_record = os::Linux::heap_vector_add(array, _redact_record, _inserted); ++#endif ++ return _inserted; ++} ++ ++ ++void HeapRedactor::insert_class_field_value(void* class_key, void* field_key, void* value) { ++#ifdef LINUX ++ void* _redact_sub_table = os::Linux::heap_dict_lookup(class_key, _redact_class_field_table, false); ++ _redact_sub_table = os::Linux::heap_dict_add(field_key, value, _redact_sub_table, 1); ++ _redact_class_field_table = os::Linux::heap_dict_add(class_key, _redact_sub_table, _redact_class_field_table, 1); ++#endif ++} +diff --git a/hotspot/src/share/vm/services/heapRedactor.hpp b/hotspot/src/share/vm/services/heapRedactor.hpp +new file mode 100644 +index 000000000..06ffcc830 +--- /dev/null ++++ b/hotspot/src/share/vm/services/heapRedactor.hpp +@@ -0,0 +1,201 @@ ++/* ++ * Copyright (c) 2023, Huawei Technologies Co., Ltd. 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. Huawei designates this ++ * particular file as subject to the "Classpath" exception as provided ++ * by Huawei in the LICENSE file that accompanied this code. ++ * ++ * 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 visit https://gitee.com/openeuler/bishengjdk-8 if you need additional ++ * information or have any questions. ++ */ ++ ++#ifndef LINUX_X86_64_NORMAL_SERVER_SLOWDEBUG_HEAPREDACTOR_HPP ++#define LINUX_X86_64_NORMAL_SERVER_SLOWDEBUG_HEAPREDACTOR_HPP ++#include "../memory/allocation.hpp" ++#include "oops/annotations.hpp" ++#include "oops/constantPool.hpp" ++#ifdef LINUX ++#include "os_linux.hpp" ++#endif ++ ++#define MAX_MAP_FILE_LENGTH 1024 ++ ++enum HeapDumpRedactLevel { ++ REDACT_UNKNOWN, ++ REDACT_OFF, ++ REDACT_NAMES, ++ REDACT_BASIC, ++ REDACT_DIYRULES, ++ REDACT_ANNOTATION, ++ REDACT_FULL ++}; ++ ++struct RedactParams { ++ char* params_string; ++ char* heap_dump_redact; ++ char* redact_map; ++ char* redact_map_file; ++ char* annotation_class_path; ++ char* redact_password; ++}; ++ ++class HeapRedactor : public StackObj { ++private: ++ HeapDumpRedactLevel _redact_level; ++ RedactParams _redact_params; ++ bool _use_sys_params; ++ void* _redact_name_table; ++ void* _redact_rules_table; ++ void* _replace_value_table; ++ void* _redact_class_field_table; ++ char* _file_name_map_list; ++ char* _name_map_list; ++ char* _annotation_class_path; ++ char* _redact_class_full_name; ++ void* _redact_record; ++ HeapDumpRedactLevel init_heapdump_redact_level(); ++ void read_redact_map_from_file(const char* path); ++ void read_redact_map_dependon_mode(char* name_map_list, HeapDumpRedactLevel redact_level); ++ void parse_redact_map_string(char* name_map_list); ++ void parse_redact_diy_rules(char* name_map_list); ++ void parse_token(char* token); ++ void parse_redact_params(const char *redact_params_string); ++ char* parse_redact_child_param(char *redact_params_sub_string, const char* redact_param_prefix, const char* next_redact_param_prefix); ++ void init(outputStream* out); ++ void init_fields(); ++ void init_redact_map(); ++ void init_class_path(); ++ ++public: ++ static const char* REDACT_UNKNOWN_STR; ++ static const char* REDACT_OFF_STR; ++ static const char* REDACT_NAMES_STR; ++ static const char* REDACT_BASIC_STR; ++ static const char* REDACT_DIYRULES_STR; ++ static const char* REDACT_ANNOTATION_STR; ++ static const char* REDACT_FULL_STR; ++ HeapRedactor(outputStream* out); ++ HeapRedactor(const char* redact_params, outputStream* out); ++ ~HeapRedactor(); ++ static bool check_launcher_heapdump_redact_support(const char* value); ++ HeapDumpRedactLevel redact_level() { ++ if(_redact_level == REDACT_UNKNOWN) { ++ _redact_level = init_heapdump_redact_level(); ++ } ++ return _redact_level; ++ } ++ ++ const char* get_redact_level_string() { ++#ifdef LINUX ++ switch (_redact_level) { ++ case REDACT_OFF: ++ return REDACT_OFF_STR; ++ case REDACT_NAMES: ++ return REDACT_NAMES_STR; ++ case REDACT_BASIC: ++ return REDACT_BASIC_STR; ++ case REDACT_DIYRULES: ++ return REDACT_DIYRULES_STR; ++ case REDACT_ANNOTATION: ++ return REDACT_ANNOTATION_STR; ++ case REDACT_FULL: ++ return REDACT_FULL_STR; ++ case REDACT_UNKNOWN: ++ default: ++ return REDACT_UNKNOWN_STR; ++ } ++#else ++ switch (_redact_level) { ++ case REDACT_OFF: ++ return REDACT_OFF_STR; ++ case REDACT_BASIC: ++ return REDACT_BASIC_STR; ++ case REDACT_UNKNOWN: ++ default: ++ return REDACT_UNKNOWN_STR; ++ } ++#endif ++ } ++ ++ char* lookup_redact_name(const void* name) const { ++ void* val = NULL; ++#ifdef LINUX ++ val = os::Linux::heap_dict_lookup(const_cast(name), _redact_name_table, false); ++#endif ++ if(val != NULL) { ++ return (char*)val; ++ } ++ return NULL; ++ } ++ ++ void* lookup_class_rules(const void* name) { ++ void* val = NULL; ++#ifdef LINUX ++ val = os::Linux::heap_dict_lookup(const_cast(name), _redact_rules_table, false); ++#endif ++ return val; ++ } ++ ++ void insert_class_field_value(void* class_key, void* field_key, void* value); ++ ++ void* lookup_class_value(void* key) { ++ void* val = NULL; ++#ifdef LINUX ++ val = os::Linux::heap_dict_lookup(key, _redact_class_field_table, false); ++#endif ++ return val; ++ } ++ ++ const char* get_annotation_class_path(){ ++ return _annotation_class_path; ++ } ++ ++ void insert_anonymous_value(void* key, void* value); ++ ++ template ++ T lookup_replace_value(void* key) { ++ void* val = NULL; ++#ifdef LINUX ++ val = os::Linux::heap_dict_lookup(key, _replace_value_table, true); ++#endif ++ if(val != NULL) { ++ return (T)val; ++ } ++ return NULL; ++ } ++ ++ void* lookup_value(void* key, void* heap_dict, bool deletable) { ++ void* val = NULL; ++#ifdef LINUX ++ val = os::Linux::heap_dict_lookup(key, heap_dict, deletable); ++#endif ++ return val; ++ } ++ ++ bool lookup_annotation_index_in_constant_pool(AnnotationArray* field_annotations, ConstantPool *cp, int &byte_i_ref); ++ bool recursion_cp_refs_in_element_value(AnnotationArray* field_annotations, int &byte_i_ref); ++ bool recursion_cp_refs_in_annotation_struct(AnnotationArray* field_annotations, int &byte_i_ref); ++ ++ bool record_typeArrayOop(typeArrayOop array); ++ void* get_vector_node_next(void* node, int &_cnt, void** &_items) { ++ void* val = NULL; ++#ifdef LINUX ++ val = os::Linux::heap_vector_get_next(_redact_record, node, _cnt, _items); ++#endif ++ return val; ++ } ++}; ++#endif // LINUX_X86_64_NORMAL_SERVER_SLOWDEBUG_HEAPREDACTOR_HPP +diff --git a/jdk/src/share/classes/sun/tools/jmap/JMap.java b/jdk/src/share/classes/sun/tools/jmap/JMap.java +index 2cb5a5c10..b184beb74 100644 +--- a/jdk/src/share/classes/sun/tools/jmap/JMap.java ++++ b/jdk/src/share/classes/sun/tools/jmap/JMap.java +@@ -25,10 +25,15 @@ + + package sun.tools.jmap; + ++import java.io.Console; ++import java.lang.reflect.Field; + import java.lang.reflect.Method; + import java.io.File; + import java.io.IOException; + import java.io.InputStream; ++import java.nio.charset.StandardCharsets; ++import java.security.MessageDigest; ++import java.util.Arrays; + + import com.sun.tools.attach.VirtualMachine; + import com.sun.tools.attach.AttachNotSupportedException; +@@ -163,7 +168,8 @@ public class JMap { + // -dump option needs to be handled in a special way + if (option.startsWith(DUMP_OPTION_PREFIX)) { + // first check that the option can be parsed +- String fn = parseDumpOptions(option); ++ RedactParams redactParams = new RedactParams(); ++ String fn = parseDumpOptions(option, redactParams); + if (fn == null) { + usage(1); + } +@@ -171,6 +177,11 @@ public class JMap { + // tool for heap dumping + tool = "sun.jvm.hotspot.tools.HeapDumper"; + ++ // HeapDump redact arguments ++ if (redactParams.isEnableRedact()) { ++ args = prepend(redactParams.toString(), args); ++ args = prepend("-r", args); ++ } + // HeapDumper -f + args = prepend(fn, args); + args = prepend("-f", args); +@@ -245,12 +256,18 @@ public class JMap { + } + + private static void dump(String pid, String options) throws IOException { ++ RedactParams redactParams = new RedactParams(); + // parse the options to get the dump filename +- String filename = parseDumpOptions(options); ++ String filename = parseDumpOptions(options,redactParams); + if (filename == null) { + usage(1); // invalid options or no filename + } + ++ String redactPassword = ",RedactPassword="; ++ if (options.contains("RedactPassword,") || options.contains(",RedactPassword")) { ++ // heap dump may need a password ++ redactPassword = getRedactPassword(); ++ } + // get the canonical path - important to avoid just passing + // a "heap.bin" and having the dump created in the target VM + // working directory rather than the directory where jmap +@@ -264,14 +281,77 @@ public class JMap { + System.out.println("Dumping heap to " + filename + " ..."); + InputStream in = ((HotSpotVirtualMachine)vm). + dumpHeap((Object)filename, +- (live ? LIVE_OBJECTS_OPTION : ALL_OBJECTS_OPTION)); ++ (live ? LIVE_OBJECTS_OPTION : ALL_OBJECTS_OPTION), ++ redactParams.isEnableRedact() ? redactParams.toDumpArgString() + redactPassword : ""); + drain(vm, in); + } + ++ private static String getRedactPassword() { ++ String redactPassword = ",RedactPassword="; ++ Console console = System.console(); ++ char[] passwords = null; ++ if (console == null) { ++ return redactPassword; ++ } ++ ++ try { ++ passwords = console.readPassword("redact authority password:"); ++ } catch (Exception e) { ++ } ++ if(passwords == null) { ++ return redactPassword; ++ } ++ ++ String password = new String(passwords); ++ Arrays.fill(passwords, '0'); ++ String passwordPattern = "^[0-9a-zA-Z!@#$]{1,9}$"; ++ if(!password.matches(passwordPattern)) { ++ return redactPassword; ++ } ++ ++ String digestStr = null; ++ byte[] passwordBytes = null; ++ char[] passwordValue = null; ++ try { ++ Field valueField = password.getClass().getDeclaredField("value"); ++ valueField.setAccessible(true); ++ passwordValue = (char[])valueField.get(password); ++ ++ passwordBytes= password.getBytes(StandardCharsets.UTF_8); ++ StringBuilder digestStrBuilder = new StringBuilder(); ++ MessageDigest messageDigest = MessageDigest.getInstance("SHA-256"); ++ byte[] digestBytes = messageDigest.digest(passwordBytes); ++ for(byte b : digestBytes) { ++ String hex = Integer.toHexString(0xff & b); ++ if(hex.length() == 1) { ++ digestStrBuilder.append('0'); ++ } ++ digestStrBuilder.append(hex); ++ } ++ digestStr = digestStrBuilder.toString(); ++ } catch (Exception e) { ++ }finally { ++ // clear all password ++ if(passwordBytes != null) { ++ Arrays.fill(passwordBytes, (byte) 0); ++ } ++ if(passwordValue != null) { ++ Arrays.fill(passwordValue, '0'); ++ } ++ } ++ ++ redactPassword += (digestStr == null ? "" : digestStr); ++ return redactPassword; ++ } ++ + // Parse the options to the -dump option. Valid options are format=b and + // file=. Returns if provided. Returns null if not + // provided, or invalid option. +- private static String parseDumpOptions(String arg) { ++ private static String parseDumpOptions(String arg){ ++ return parseDumpOptions(arg, null); ++ } ++ ++ private static String parseDumpOptions(String arg, RedactParams redactParams) { + assert arg.startsWith(DUMP_OPTION_PREFIX); + + String filename = null; +@@ -279,15 +359,16 @@ public class JMap { + // options are separated by comma (,) + String options[] = arg.substring(DUMP_OPTION_PREFIX.length()).split(","); + +- for (int i=0; i - check that is specified + if (option.startsWith("file=")) { + filename = option.substring(5); +@@ -295,13 +376,48 @@ public class JMap { + return null; + } + } else { ++ if (redactParams != null && initRedactParams(redactParams, option)) { ++ continue; ++ } + return null; // option not recognized + } + } + } ++ if (redactParams != null) { ++ if (redactParams.getHeapDumpRedact() == null) { ++ if (redactParams.getRedactMap() == null && redactParams.getRedactMapFile() == null ++ && redactParams.getRedactClassPath() == null) { ++ redactParams.setEnableRedact(false); ++ } else { ++ System.err.println("Error: HeapDumpRedact must be specified to enable heap-dump-redacting"); ++ usage(1); ++ } ++ } ++ } + return filename; + } + ++ private static boolean initRedactParams(RedactParams redactParams, String option) { ++ if (option.startsWith("HeapDumpRedact=")) { ++ if (!redactParams.setAndCheckHeapDumpRedact(option.substring("HeapDumpRedact=".length()))) { ++ usage(1); ++ } ++ return true; ++ } else if (option.startsWith("RedactMap=")) { ++ redactParams.setRedactMap(option.substring("RedactMap=".length())); ++ return true; ++ } else if (option.startsWith("RedactMapFile=")) { ++ redactParams.setRedactMapFile(option.substring("RedactMapFile=".length())); ++ return true; ++ } else if (option.startsWith("RedactClassPath")) { ++ redactParams.setRedactClassPath(option.substring("RedactClassPath=".length())); ++ return true; ++ } else { ++ // None matches ++ return false; ++ } ++ } ++ + private static boolean isDumpLiveObjects(String arg) { + // options are separated by comma (,) + String options[] = arg.substring(DUMP_OPTION_PREFIX.length()).split(","); +@@ -391,6 +507,14 @@ public class JMap { + System.err.println(" all objects in the heap are dumped."); + System.err.println(" format=b binary format"); + System.err.println(" file= dump heap to "); ++ System.err.println(" HeapDumpRedact= redact the heapdump"); ++ System.err.println(" information to remove sensitive data"); ++ System.err.println(" RedactMap= Redact the class and"); ++ System.err.println(" field names to other strings"); ++ System.err.println(" RedactMapFile= file path of the redact map"); ++ System.err.println(" RedactClassPath= full path of the redact annotation"); ++ System.err.println(" RedactPassword maybe redact feature has an authority, RedactPassword will wait for a password, "); ++ System.err.println(" without a correct password, heap dump with default redact level"); + System.err.println(" Example: jmap -dump:live,format=b,file=heap.bin "); + System.err.println(" -F force. Use with -dump: or -histo"); + System.err.println(" to force a heap dump or histogram when does not"); +@@ -413,4 +537,112 @@ public class JMap { + + System.exit(exit); + } ++ ++ public static class RedactParams { ++ private boolean enableRedact = false; ++ private String heapDumpRedact; ++ private String redactMap; ++ private String redactMapFile; ++ private String redactClassPath; ++ ++ public RedactParams() { ++ } ++ ++ public RedactParams(String heapDumpRedact, String redactMap, String redactMapFile, String redactClassPath) { ++ if (heapDumpRedact != null && checkLauncherHeapdumpRedactSupport(heapDumpRedact)) { ++ enableRedact = true; ++ } ++ this.heapDumpRedact = heapDumpRedact; ++ this.redactMap = redactMap; ++ this.redactMapFile = redactMapFile; ++ this.redactClassPath = redactClassPath; ++ } ++ ++ @Override ++ public String toString() { ++ StringBuilder builder = new StringBuilder(); ++ if (heapDumpRedact != null) { ++ builder.append("HeapDumpRedact="); ++ builder.append(heapDumpRedact); ++ builder.append(","); ++ } ++ if (redactMap != null) { ++ builder.append("RedactMap="); ++ builder.append(redactMap); ++ builder.append(","); ++ } ++ if (redactMapFile != null) { ++ builder.append("RedactMapFile="); ++ builder.append(redactMapFile); ++ builder.append(","); ++ } ++ if (redactClassPath != null) { ++ builder.append("RedactClassPath="); ++ builder.append(redactClassPath); ++ } ++ return builder.toString(); ++ } ++ ++ public String toDumpArgString() { ++ return "-HeapDumpRedact=" + (heapDumpRedact == null ? "off" : heapDumpRedact) + ++ ",RedactMap=" + (redactMap == null ? "" : redactMap) + ++ ",RedactMapFile=" + (redactMapFile == null ? "" : redactMapFile) + ++ ",RedactClassPath=" + (redactClassPath == null ? "" : redactClassPath); ++ } ++ ++ public static boolean checkLauncherHeapdumpRedactSupport(String value) { ++ String[] validValues = {"basic", "names", "full", "diyrules", "annotation", "off"}; ++ for (String validValue : validValues) { ++ if (validValue.equals(value)) { ++ return true; ++ } ++ } ++ return false; ++ } ++ ++ public boolean isEnableRedact() { ++ return enableRedact; ++ } ++ ++ public void setEnableRedact(boolean enableRedact) { ++ this.enableRedact = enableRedact; ++ } ++ ++ public String getHeapDumpRedact() { ++ return heapDumpRedact; ++ } ++ ++ public boolean setAndCheckHeapDumpRedact(String heapDumpRedact) { ++ if (!checkLauncherHeapdumpRedactSupport(heapDumpRedact)) { ++ return false; ++ } ++ this.heapDumpRedact = heapDumpRedact; ++ this.enableRedact = true; ++ return true; ++ } ++ ++ public String getRedactMap() { ++ return redactMap; ++ } ++ ++ public void setRedactMap(String redactMap) { ++ this.redactMap = redactMap; ++ } ++ ++ public String getRedactMapFile() { ++ return redactMapFile; ++ } ++ ++ public void setRedactMapFile(String redactMapFile) { ++ this.redactMapFile = redactMapFile; ++ } ++ ++ public String getRedactClassPath() { ++ return redactClassPath; ++ } ++ ++ public void setRedactClassPath(String redactClassPath) { ++ this.redactClassPath = redactClassPath; ++ } ++ } + } +-- +2.19.1 + diff --git a/jdk8u-jdk8u412-b08.tar.xz b/jdk8u-jdk8u422-b05.tar.xz similarity index 82% rename from jdk8u-jdk8u412-b08.tar.xz rename to jdk8u-jdk8u422-b05.tar.xz index 41cfa2c9f1415ac1eb687d9ce7f4919ee9e95725..3fba88a6361cbf5235899dfc1b8713f5b489101a 100644 Binary files a/jdk8u-jdk8u412-b08.tar.xz and b/jdk8u-jdk8u422-b05.tar.xz differ diff --git a/openjdk-1.8.0.spec b/openjdk-1.8.0.spec index 46ff677f7176d0d2ec4b83a2ef9cfd58b6a8e9f7..e4135b2c1adf89475894a2c875c239677a1a76f6 100644 --- a/openjdk-1.8.0.spec +++ b/openjdk-1.8.0.spec @@ -132,6 +132,12 @@ %global stapinstall powerpc64le %endif +# Need to support noarch for srpm build +%ifarch noarch +%global archinstall %{nil} +%global stapinstall %{nil} +%endif + %ifarch %{jit_arches} %global with_systemtap 1 %else @@ -166,13 +172,13 @@ %global origin_nice OpenJDK %global top_level_dir_name %{origin} %global repo jdk8u -%global revision jdk8u412-b08 +%global revision jdk8u422-b05 %global full_revision %{repo}-%{revision} # Define IcedTea version used for SystemTap tapsets and desktop files %global icedteaver 3.15.0 -%global updatever 412 -%global buildver b08 +%global updatever 422 +%global buildver b05 # priority must be 7 digits in total. The expression is workarounding tip %global priority 1800%{updatever} @@ -613,6 +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 @@ -936,7 +945,7 @@ Provides: java-%{javaver}-%{origin}-accessibility%{?1} = %{epoch}:%{version}-%{r Name: java-%{javaver}-%{origin} Version: %{javaver}.%{updatever}.%{buildver} -Release: 6 +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 @@ -1198,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 @@ -1322,6 +1331,25 @@ Patch428: 8223486-split-if-update_uses-accesses-stale-idom-dat.patch Patch429: 8256488-Use-ldpq-stpq-instead-of-ld4-st4-for-small-c.patch Patch430: DependencyContext-mark_dependent_nmethods-crash-in-Dynamic-cds-mode.patch Patch431: 8138922-StubCodeDesc-constructor-publishes-partially-constructed.patch +Patch432: support-KAE-zip.patch +Patch433: Backport-6956385-URLConnection.getLastModified-leaks-file-han.patch +Patch434: Backport-8068864-C2-failed-modified-node-is-not-on-IGVN._work.patch +Patch435: Huawei-improve-GCTR-performance.patch +Patch436: Backport-8209362-sun-security-ssl-SSLSocketImpl-ReuseAddr.jav.patch +Patch437: Backport-7036144-GZIPInputStream-readTrailer-uses-faulty-avai.patch +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 @@ -1966,10 +1994,35 @@ pushd %{top_level_dir_name} %patch429 -p1 %patch430 -p1 %patch431 -p1 +%patch432 -p1 +%patch433 -p1 +%patch434 -p1 +%patch435 -p1 +%patch436 -p1 +%patch437 -p1 +%ifnarch riscv64 +%patch438 -p1 +%endif +%patch439 -p1 +%patch440 -p1 +%patch441 -p1 +%patch442 -p1 +%patch443 -p1 +%patch445 -p1 +%patch446 -p1 +%patch447 -p1 +%patch448 -p1 +%patch449 -p1 %endif %ifarch loongarch64 %patch4000 -p1 + +%patch308 -p1 +%patch310 -p1 +%patch311 -p1 +%patch312 -p1 + %endif %ifarch riscv64 @@ -2094,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/" \ @@ -2221,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" < -1:1.8.0.422-b05.11 +- add Enhance-SIGBUS-and-rlimit-information-in-errlog.patch + +* Wed Sep 4 2024 neu-mobi -1:1.8.0.422-b05.10 +- Support KAE Zip +- rename Bisheng to BiSheng + +* Mon Sep 2 2024 Dingli Zhang -1:1.8.0.422-b05.9 +- Fix build error on riscv64 because of patch438 + +* Thu Aug 29 2024 Dingli Zhang -1:1.8.0.422-b05.8 +- Fix build on riscv64 in prep stage for 8u422 + +* Tue Aug 20 2024 wuyafang -1:1.8.0.422-b05.7 +- modified add-Fix-aarch64-runtime-thread-signal-transfer-bug.patch + +* Wed Aug 7 2024 songliyang -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 -1:1.8.0.422-b05.5 +- modified add-Fix-aarch64-runtime-thread-signal-transfer-bug.patch + +* Sat Aug 3 2024 kuenking111 -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 -1:1.8.0.422-b05.3 +- Fix-the-ActiveProcessorCount-function-of-the-spark-s.patch + +* Tue Jul 30 2024 Xiang Gao - 1:1.8.0.422-b05.2 +- Backport 8178498,8193710,8196743,8284330, serviceability tools support containers on loongarch + +* Fri Jul 26 2024 benshuai5D -1:1.8.0.422-b05.1 +- Add The-fast-serialization-function-of-sun.rmi.transport.patch + +* Tue Jul 16 2024 Autistic_boyya -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 +- modified Dynamic-CDS-Archive.patch +- modified add-safe-compilation-flags.patch +- modified fix-log-bug-enhance-aes-hmac-performance.patch +- modified fix_X509TrustManagerImpl_symantec_distrust.patch +- modified openjdk-1.8.0.spec +- modified update-cacerts-and-VerifyCACerts.java-test.patch +- Add Backport-6956385-URLConnection.getLastModified-leaks-file-han.patch +- Add Backport-7036144-GZIPInputStream-readTrailer-uses-faulty-avai.patch +- Add Backport-8068864-C2-failed-modified-node-is-not-on-IGVN._work.patch +- Add Backport-8151845-Comment-in-globals.hpp-for-MetaspaceSize-is-.patch +- Add Backport-8209362-sun-security-ssl-SSLSocketImpl-ReuseAddr.jav.patch +- Add Backport-8210706-G1-may-deadlock-when-starting-a-concurrent-c.patch +- Add Backport-8318889-Backport-Important-Fixed-Issues-in-Later-Ver.patch +- Add Huawei-Add-Aggressive-CDS.patch +- Add Huawei-Keep-objects-when-remove-unshareable-info.patch +- Add Huawei-improve-GCTR-performance.patch + +* Thu Jul 4 2024 Autistic_boyya -1:1.8.0.412-b08.9 +- Add support-KAE-zip.patch + +* Fri Jun 21 2024 songliyang -1:1.8.0.412-b08.8 +- Add noarch support for srpm build +- null the arg to solve openjdk-headless install error + +* Thu Jun 20 2024 aoqi -1:1.8.0.412-b08.7 +- update LoongArch64 port to 8u412 + * Wed Jun 19 2024 neu-mobi -1:1.8.0.412-b08.6 - Fix aarch64 runtime thread signal transfer bug @@ -2864,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 - 1:1.8.0.372-b07.1 -- modified Fix-the-crash-that-occurs-when-the-process-exits-due.patch +* Thu May 11 2023 crash888 - 1:1.8.0.372-b07.1 +- modified Fix-the-crash-that-occurs-when-the-process-exits-due.patch -* Fri May 6 2023 crash888 - 1:1.8.0.372-b07.0 +* Sat May 6 2023 crash888 - 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 @@ -2883,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 @@ -3090,7 +3211,7 @@ cjc.mainProgram(arg) - modified implementation_of_Blas_hotspot_function_in_Intrinsics.patch * Tue Feb 15 2022 eapen - 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 - 1:1.8.0.322-b06.0 - upgrade to 8u322-b06(ga) @@ -3366,7 +3487,7 @@ cjc.mainProgram(arg) * Tue Nov 10 2020 ow_wo - 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 - 1:1.8.0.272-b10.5 - add 8223940-Private-key-not-supported-by-chosen-signature.patch @@ -3444,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 - 1:1.8.0.265-b10.0 - Update to aarch64-shenandoah-jdk8u-8u265-b01 diff --git a/support-KAE-zip.patch b/support-KAE-zip.patch new file mode 100644 index 0000000000000000000000000000000000000000..3f584e597e26891f23e09c364f7b882605c185f9 --- /dev/null +++ b/support-KAE-zip.patch @@ -0,0 +1,717 @@ +Subject: [PATCH] [Huawei]support KAE-zip + +--- + jdk/make/CompileLaunchers.gmk | 34 ++++--- + jdk/make/lib/CoreLibraries.gmk | 71 ++++++++++++++ + jdk/make/mapfiles/libzip/mapfile-vers | 3 + + .../share/classes/java/util/zip/Deflater.java | 10 +- + .../java/util/zip/GZIPInputStream.java | 14 +++ + .../java/util/zip/GZIPOutputStream.java | 20 ++++ + .../share/classes/java/util/zip/Inflater.java | 14 ++- + .../java/util/zip/InflaterOutputStream.java | 24 ++--- + jdk/src/share/lib/security/java.policy | 2 + + jdk/src/share/native/java/util/zip/Deflater.c | 37 +++++++ + jdk/src/share/native/java/util/zip/Inflater.c | 98 +++++++++++++++++++ + .../java/util/zip/DeflateIn_InflateOut.java | 74 +++++++++++++- + 12 files changed, 367 insertions(+), 34 deletions(-) + +diff --git a/jdk/make/CompileLaunchers.gmk b/jdk/make/CompileLaunchers.gmk +index de1ea9f4b..513e2ee1b 100644 +--- a/jdk/make/CompileLaunchers.gmk ++++ b/jdk/make/CompileLaunchers.gmk +@@ -474,17 +474,29 @@ ifeq ($(USE_EXTERNAL_LIBZ), true) + UNPACKEXE_ZIPOBJS := -lz + else + UNPACKEXE_CFLAGS := -I$(JDK_TOPDIR)/src/share/native/java/util/zip/zlib +- UNPACKEXE_ZIPOBJS := $(JDK_OUTPUTDIR)/objs/libzip/zcrc32$(OBJ_SUFFIX) \ +- $(JDK_OUTPUTDIR)/objs/libzip/deflate$(OBJ_SUFFIX) \ +- $(JDK_OUTPUTDIR)/objs/libzip/trees$(OBJ_SUFFIX) \ +- $(JDK_OUTPUTDIR)/objs/libzip/zadler32$(OBJ_SUFFIX) \ +- $(JDK_OUTPUTDIR)/objs/libzip/compress$(OBJ_SUFFIX) \ +- $(JDK_OUTPUTDIR)/objs/libzip/zutil$(OBJ_SUFFIX) \ +- $(JDK_OUTPUTDIR)/objs/libzip/inflate$(OBJ_SUFFIX) \ +- $(JDK_OUTPUTDIR)/objs/libzip/infback$(OBJ_SUFFIX) \ +- $(JDK_OUTPUTDIR)/objs/libzip/inftrees$(OBJ_SUFFIX) \ +- $(JDK_OUTPUTDIR)/objs/libzip/inffast$(OBJ_SUFFIX) +- ++ ifeq ($(OPENJDK_TARGET_OS), windows) ++ UNPACKEXE_ZIPOBJS := $(JDK_OUTPUTDIR)/objs/libzip/zcrc32$(OBJ_SUFFIX) \ ++ $(JDK_OUTPUTDIR)/objs/libzip/deflate$(OBJ_SUFFIX) \ ++ $(JDK_OUTPUTDIR)/objs/libzip/trees$(OBJ_SUFFIX) \ ++ $(JDK_OUTPUTDIR)/objs/libzip/zadler32$(OBJ_SUFFIX) \ ++ $(JDK_OUTPUTDIR)/objs/libzip/compress$(OBJ_SUFFIX) \ ++ $(JDK_OUTPUTDIR)/objs/libzip/zutil$(OBJ_SUFFIX) \ ++ $(JDK_OUTPUTDIR)/objs/libzip/inflate$(OBJ_SUFFIX) \ ++ $(JDK_OUTPUTDIR)/objs/libzip/infback$(OBJ_SUFFIX) \ ++ $(JDK_OUTPUTDIR)/objs/libzip/inftrees$(OBJ_SUFFIX) \ ++ $(JDK_OUTPUTDIR)/objs/libzip/inffast$(OBJ_SUFFIX) ++ else ++ UNPACKEXE_ZIPOBJS := $(JDK_OUTPUTDIR)/objs/libz/zcrc32$(OBJ_SUFFIX) \ ++ $(JDK_OUTPUTDIR)/objs/libz/deflate$(OBJ_SUFFIX) \ ++ $(JDK_OUTPUTDIR)/objs/libz/trees$(OBJ_SUFFIX) \ ++ $(JDK_OUTPUTDIR)/objs/libz/zadler32$(OBJ_SUFFIX) \ ++ $(JDK_OUTPUTDIR)/objs/libz/compress$(OBJ_SUFFIX) \ ++ $(JDK_OUTPUTDIR)/objs/libz/zutil$(OBJ_SUFFIX) \ ++ $(JDK_OUTPUTDIR)/objs/libz/inflate$(OBJ_SUFFIX) \ ++ $(JDK_OUTPUTDIR)/objs/libz/infback$(OBJ_SUFFIX) \ ++ $(JDK_OUTPUTDIR)/objs/libz/inftrees$(OBJ_SUFFIX) \ ++ $(JDK_OUTPUTDIR)/objs/libz/inffast$(OBJ_SUFFIX) ++ endif + endif + + UNPACKEXE_LANG := C +diff --git a/jdk/make/lib/CoreLibraries.gmk b/jdk/make/lib/CoreLibraries.gmk +index d1cd1d3de..1af991693 100644 +--- a/jdk/make/lib/CoreLibraries.gmk ++++ b/jdk/make/lib/CoreLibraries.gmk +@@ -261,11 +261,76 @@ $(BUILD_LIBJAVA): $(BUILD_LIBFDLIBM) + + ########################################################################################## + ++ifneq ($(USE_EXTERNAL_LIBZ), true) ++ ifneq ($(OPENJDK_TARGET_OS), windows) ++ BUILD_LIBZ_EXCLUDES := ++ ++ ZLIB_CPPFLAGS := -I$(JDK_TOPDIR)/src/share/native/java/util/zip/zlib ++ ifeq ($(OPENJDK_TARGET_OS), macosx) ++ ZLIB_CPPFLAGS += -DHAVE_UNISTD_H ++ endif ++ ++ BUILD_LIBZ_REORDER := ++ ifeq ($(OPENJDK_TARGET_OS), solaris) ++ ifneq ($(OPENJDK_TARGET_CPU), x86_64) ++ BUILD_LIBZ_REORDER := $(JDK_TOPDIR)/make/mapfiles/libzip/reorder-$(OPENJDK_TARGET_CPU) ++ endif ++ endif ++ ++ ifeq ($(LIBZ_CAN_USE_MMAP), true) ++ BUILD_LIBZ_MMAP := -DUSE_MMAP ++ endif ++ ++ $(eval $(call SetupNativeCompilation,BUILD_LIBZ, \ ++ LIBRARY := z, \ ++ OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \ ++ LANG := C, \ ++ OPTIMIZATION := LOW, \ ++ SRC := $(JDK_TOPDIR)/src/share/native/java/util/zip/zlib, \ ++ EXCLUDES := $(LIBZ_EXCLUDES), \ ++ CFLAGS := $(CFLAGS_JDKLIB) \ ++ $(ZLIB_CPPFLAGS) \ ++ -I$(JDK_TOPDIR)/src/share/native/java/io \ ++ -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/java/io, \ ++ CFLAGS_posix := $(BUILD_LIBZ_MMAP) -UDEBUG, \ ++ MAPFILE := , \ ++ REORDER := $(BUILD_LIBZ_REORDER), \ ++ LDFLAGS := $(LDFLAGS_JDKLIB) \ ++ $(call SET_SHARED_LIBRARY_ORIGIN) \ ++ $(EXPORT_Z_FUNCS), \ ++ LDFLAGS_windows := jvm.lib \ ++ $(WIN_JAVA_LIB), \ ++ LDFLAGS_SUFFIX_linux := , \ ++ LDFLAGS_SUFFIX_solaris := , \ ++ LDFLAGS_SUFFIX_aix := ,\ ++ LDFLAGS_SUFFIX_macosx := , \ ++ VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \ ++ RC_FLAGS := $(RC_FLAGS) \ ++ -D "JDK_FNAME=z.dll" \ ++ -D "JDK_INTERNAL_NAME=z" \ ++ -D "JDK_FTYPE=0x2L", \ ++ OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libz, \ ++ DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES))) ++ ++ ++ $(BUILD_LIBZ): $(BUILD_LIBJAVA) ++ ++ BUILD_LIBRARIES += $(BUILD_LIBZ) ++ endif ++endif ++ ++########################################################################################## ++ + BUILD_LIBZIP_EXCLUDES := + ifeq ($(USE_EXTERNAL_LIBZ), true) ++ BUILD_LIBZIP_SRC := + LIBZ := -lz + LIBZIP_EXCLUDES += zlib + else ++ ifneq ($(OPENJDK_TARGET_OS), windows) ++ BUILD_LIBZIP_SRC := Adler32.c CRC32.c Deflater.c Inflater.c zip_util.c ZipFile.c ++ LIBZ := -lz ++ endif + ZLIB_CPPFLAGS := -I$(JDK_TOPDIR)/src/share/native/java/util/zip/zlib + ifeq ($(OPENJDK_TARGET_OS), macosx) + ZLIB_CPPFLAGS += -DHAVE_UNISTD_H +@@ -289,6 +354,7 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBZIP, \ + LANG := C, \ + OPTIMIZATION := LOW, \ + SRC := $(JDK_TOPDIR)/src/share/native/java/util/zip, \ ++ INCLUDE_FILES := $(BUILD_LIBZIP_SRC), \ + EXCLUDES := $(LIBZIP_EXCLUDES), \ + CFLAGS := $(CFLAGS_JDKLIB) \ + $(ZLIB_CPPFLAGS) \ +@@ -315,9 +381,14 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBZIP, \ + OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libzip, \ + DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES))) + ++ifneq ($(USE_EXTERNAL_LIBZ), true) ++ LIBZ := ++endif + + $(BUILD_LIBZIP): $(BUILD_LIBJAVA) + ++$(BUILD_LIBZIP): $(BUILD_LIBZ) ++ + BUILD_LIBRARIES += $(BUILD_LIBZIP) + + ########################################################################################## +diff --git a/jdk/make/mapfiles/libzip/mapfile-vers b/jdk/make/mapfiles/libzip/mapfile-vers +index 5d33990c3..5c6d27d0d 100644 +--- a/jdk/make/mapfiles/libzip/mapfile-vers ++++ b/jdk/make/mapfiles/libzip/mapfile-vers +@@ -38,13 +38,16 @@ 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_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_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 bffa397d9..a4ea40cf8 100644 +--- a/jdk/src/share/classes/java/util/zip/Deflater.java ++++ b/jdk/src/share/classes/java/util/zip/Deflater.java +@@ -81,6 +81,7 @@ 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 +@@ -168,7 +169,13 @@ class Deflater { + public Deflater(int level, boolean nowrap) { + this.level = level; + this.strategy = DEFAULT_STRATEGY; +- this.zsRef = new ZStreamRef(init(level, DEFAULT_STRATEGY, nowrap)); ++ 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)); + } + + /** +@@ -571,6 +578,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 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 0d57e8ab3..7fb753729 100644 +--- a/jdk/src/share/classes/java/util/zip/GZIPInputStream.java ++++ b/jdk/src/share/classes/java/util/zip/GZIPInputStream.java +@@ -54,6 +54,11 @@ class GZIPInputStream extends InflaterInputStream { + + private boolean closed = false; + ++ /* ++ * GZIP use KAE. ++ */ ++ private boolean gzipUseKae = false; ++ + /** + * Check to make sure that this stream has not been closed + */ +@@ -76,6 +81,12 @@ class GZIPInputStream extends InflaterInputStream { + public GZIPInputStream(InputStream in, int size) throws IOException { + super(in, 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; + readHeader(in); + } + +@@ -209,6 +220,9 @@ 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; ++ + InputStream in = this.in; + int n = inf.getRemaining(); + if (n > 0) { +diff --git a/jdk/src/share/classes/java/util/zip/GZIPOutputStream.java b/jdk/src/share/classes/java/util/zip/GZIPOutputStream.java +index 1c3f8592e..0f0be98bb 100644 +--- a/jdk/src/share/classes/java/util/zip/GZIPOutputStream.java ++++ b/jdk/src/share/classes/java/util/zip/GZIPOutputStream.java +@@ -52,6 +52,11 @@ class GZIPOutputStream extends DeflaterOutputStream { + */ + private final static int TRAILER_SIZE = 8; + ++ /* ++ * GZIP use KAE. ++ */ ++ private boolean gzipUseKae = false; ++ + /** + * Creates a new output stream with the specified buffer size. + * +@@ -91,6 +96,12 @@ class GZIPOutputStream extends DeflaterOutputStream { + 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; + writeHeader(); + crc.reset(); + } +@@ -160,6 +171,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) { ++ out.write(buf, 0, len); ++ return; ++ } + writeTrailer(buf, len); + len = len + TRAILER_SIZE; + out.write(buf, 0, len); +@@ -168,6 +184,10 @@ 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 + byte[] trailer = new byte[TRAILER_SIZE]; +diff --git a/jdk/src/share/classes/java/util/zip/Inflater.java b/jdk/src/share/classes/java/util/zip/Inflater.java +index c1eefe122..42e90f525 100644 +--- a/jdk/src/share/classes/java/util/zip/Inflater.java ++++ b/jdk/src/share/classes/java/util/zip/Inflater.java +@@ -80,6 +80,7 @@ class Inflater { + private boolean needDict; + private long bytesRead; + private long bytesWritten; ++ private boolean inflaterUseKae; + + private static final byte[] defaultBuf = new byte[0]; + +@@ -100,7 +101,11 @@ class Inflater { + * @param nowrap if true then support GZIP compatible compression + */ + public Inflater(boolean nowrap) { +- zsRef = new ZStreamRef(init(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)); + } + + /** +@@ -256,7 +261,9 @@ class Inflater { + synchronized (zsRef) { + ensureOpen(); + int thisLen = this.len; +- int n = inflateBytes(zsRef.address(), b, off, len); ++ int n = this.inflaterUseKae ? ++ inflateBytesKAE(zsRef.address(), b, off, len) : ++ inflateBytes(zsRef.address(), b, off, len); + bytesWritten += n; + bytesRead += (thisLen - this.len); + return n; +@@ -397,10 +404,13 @@ class Inflater { + + private native static void initIDs(); + private native static long init(boolean nowrap); ++ private native static long initKae(); + 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/InflaterOutputStream.java b/jdk/src/share/classes/java/util/zip/InflaterOutputStream.java +index 02900c741..62c6bb153 100644 +--- a/jdk/src/share/classes/java/util/zip/InflaterOutputStream.java ++++ b/jdk/src/share/classes/java/util/zip/InflaterOutputStream.java +@@ -1,5 +1,5 @@ + /* +- * Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 2006, 2020, 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 +@@ -236,16 +236,9 @@ public class InflaterOutputStream extends FilterOutputStream { + + // Fill the decompressor buffer with output data + if (inf.needsInput()) { +- int part; +- +- if (len < 1) { +- break; +- } +- +- part = (len < 512 ? len : 512); +- inf.setInput(b, off, part); +- off += part; +- len -= part; ++ inf.setInput(b, off, len); ++ // Only use input buffer once. ++ len = 0; + } + + // Decompress and write blocks of output data +@@ -256,13 +249,14 @@ public class InflaterOutputStream extends FilterOutputStream { + } + } while (n > 0); + +- // Check the decompressor +- if (inf.finished()) { +- break; +- } ++ // Check for missing dictionary first + if (inf.needsDictionary()) { + throw new ZipException("ZLIB dictionary missing"); + } ++ // Check the decompressor ++ if (inf.finished() || (len == 0) /* no more input */ ) { ++ break; ++ } + } + } catch (DataFormatException ex) { + // Improperly formatted compressed (ZIP) data +diff --git a/jdk/src/share/lib/security/java.policy b/jdk/src/share/lib/security/java.policy +index 8b6289720..baec2ea15 100644 +--- a/jdk/src/share/lib/security/java.policy ++++ b/jdk/src/share/lib/security/java.policy +@@ -48,5 +48,7 @@ grant { + permission java.util.PropertyPermission "java.vm.name", "read"; + + permission java.util.PropertyPermission "sun.security.pkcs11.disableKeyExtraction", "read"; ++ ++ permission java.util.PropertyPermission "GZIP_USE_KAE", "read"; + }; + +diff --git a/jdk/src/share/native/java/util/zip/Deflater.c b/jdk/src/share/native/java/util/zip/Deflater.c +index c1bd34667..1b048e4f5 100644 +--- a/jdk/src/share/native/java/util/zip/Deflater.c ++++ b/jdk/src/share/native/java/util/zip/Deflater.c +@@ -37,6 +37,7 @@ + #include "java_util_zip_Deflater.h" + + #define DEF_MEM_LEVEL 8 ++#define KAE_DEFLATER_WindowBit 31 + + static jfieldID levelID; + static jfieldID strategyID; +@@ -104,6 +105,42 @@ 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) ++{ ++ z_stream *strm = calloc(1, sizeof(z_stream)); ++ ++ if (strm == 0) { ++ JNU_ThrowOutOfMemoryError(env, 0); ++ return jlong_zero; ++ } else { ++ const char *msg; ++ int ret = deflateInit2(strm, level, Z_DEFLATED, KAE_DEFLATER_WindowBit, DEF_MEM_LEVEL, strategy); ++ switch (ret) { ++ case Z_OK: ++ return ptr_to_jlong(strm); ++ case Z_MEM_ERROR: ++ free(strm); ++ JNU_ThrowOutOfMemoryError(env, 0); ++ return jlong_zero; ++ case Z_STREAM_ERROR: ++ free(strm); ++ JNU_ThrowIllegalArgumentException(env, 0); ++ return jlong_zero; ++ default: ++ msg = ((strm->msg != NULL) ? strm->msg : ++ (ret == Z_VERSION_ERROR) ? ++ "zlib returned Z_VERSION_ERROR: " ++ "compile time and runtime zlib implementations differ" : ++ "unknown error initializing zlib library"); ++ free(strm); ++ JNU_ThrowInternalError(env, msg); ++ return jlong_zero; ++ } ++ } ++} ++ + JNIEXPORT void JNICALL + Java_java_util_zip_Deflater_setDictionary(JNIEnv *env, jclass cls, jlong addr, + jarray b, jint off, jint len) +diff --git a/jdk/src/share/native/java/util/zip/Inflater.c b/jdk/src/share/native/java/util/zip/Inflater.c +index 79bcdd5b6..fca207215 100644 +--- a/jdk/src/share/native/java/util/zip/Inflater.c ++++ b/jdk/src/share/native/java/util/zip/Inflater.c +@@ -41,6 +41,7 @@ + + #define ThrowDataFormatException(env, msg) \ + JNU_ThrowByName(env, "java/util/zip/DataFormatException", msg) ++#define KAE_INFLATER_WindowBit 31 + + static jfieldID needDictID; + static jfieldID finishedID; +@@ -94,6 +95,39 @@ 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) ++{ ++ z_stream *strm = calloc(1, sizeof(z_stream)); ++ ++ if (strm == NULL) { ++ JNU_ThrowOutOfMemoryError(env, 0); ++ return jlong_zero; ++ } else { ++ const char *msg; ++ int ret = inflateInit2(strm, KAE_INFLATER_WindowBit); ++ switch (ret) { ++ case Z_OK: ++ return ptr_to_jlong(strm); ++ case Z_MEM_ERROR: ++ free(strm); ++ JNU_ThrowOutOfMemoryError(env, 0); ++ return jlong_zero; ++ default: ++ msg = ((strm->msg != NULL) ? strm->msg : ++ (ret == Z_VERSION_ERROR) ? ++ "zlib returned Z_VERSION_ERROR: " ++ "compile time and runtime zlib implementations differ" : ++ (ret == Z_STREAM_ERROR) ? ++ "inflateInit2 returned Z_STREAM_ERROR" : ++ "unknown error initializing zlib library"); ++ free(strm); ++ JNU_ThrowInternalError(env, msg); ++ return jlong_zero; ++ } ++ } ++} ++ + JNIEXPORT void JNICALL + Java_java_util_zip_Inflater_setDictionary(JNIEnv *env, jclass cls, jlong addr, + jarray b, jint off, jint len) +@@ -181,6 +215,70 @@ Java_java_util_zip_Inflater_inflateBytes(JNIEnv *env, jobject this, jlong addr, + } + } + ++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); ++ (*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_getAdler(JNIEnv *env, jclass cls, jlong addr) + { +diff --git a/jdk/test/java/util/zip/DeflateIn_InflateOut.java b/jdk/test/java/util/zip/DeflateIn_InflateOut.java +index dd69a7773..048d8e34c 100644 +--- a/jdk/test/java/util/zip/DeflateIn_InflateOut.java ++++ b/jdk/test/java/util/zip/DeflateIn_InflateOut.java +@@ -41,14 +41,31 @@ public class DeflateIn_InflateOut { + private static ByteArrayOutputStream baos; + private static InflaterOutputStream ios; + +- private static void reset() { ++ private static Inflater reset(byte[] dict) { + new Random(new Date().getTime()).nextBytes(data); + + bais = new ByteArrayInputStream(data); +- dis = new DeflaterInputStream(bais); ++ if (dict == null) { ++ dis = new DeflaterInputStream(bais); ++ } else { ++ Deflater def = new Deflater(); ++ def.setDictionary(dict); ++ dis = new DeflaterInputStream(bais, def); ++ } + + baos = new ByteArrayOutputStream(); +- ios = new InflaterOutputStream(baos); ++ if (dict == null) { ++ ios = new InflaterOutputStream(baos); ++ return null; ++ } else { ++ Inflater inf = new Inflater(); ++ ios = new InflaterOutputStream(baos, inf); ++ return inf; ++ } ++ } ++ ++ private static void reset() { ++ reset(null); + } + + /** Check byte arrays read/write. */ +@@ -216,6 +233,44 @@ public class DeflateIn_InflateOut { + check(numNotSkipped + numSkipBytes == numReadable); + } + ++ /** Check "needsDictionary()". */ ++ private static void NeedsDictionary() throws Throwable { ++ byte[] dict = {1, 2, 3, 4}; ++ Adler32 adler32 = new Adler32(); ++ adler32.update(dict); ++ long checksum = adler32.getValue(); ++ byte[] buf = new byte[512]; ++ ++ Inflater inf = reset(dict); ++ check(dis.available() == 1); ++ boolean dictSet = false; ++ for (;;) { ++ int len = dis.read(buf, 0, buf.length); ++ if (len < 0) { ++ break; ++ } else { ++ try { ++ ios.write(buf, 0, len); ++ if (dictSet == false) { ++ check(false, "Must throw ZipException without dictionary"); ++ return; ++ } ++ } catch (ZipException ze) { ++ check(dictSet == false, "Dictonary must be set only once"); ++ check(checksum == inf.getAdler(), "Incorrect dictionary"); ++ inf.setDictionary(dict); ++ // After setting the dictionary, we have to flush the ++ // InflaterOutputStream now in order to consume all the ++ // pending input data from the last, failed call to "write()". ++ ios.flush(); ++ dictSet = true; ++ } ++ } ++ } ++ check(dis.available() == 0); ++ ios.close(); ++ check(Arrays.equals(data, baos.toByteArray())); ++ } + + public static void realMain(String[] args) throws Throwable { + ArrayReadWrite(); +@@ -227,15 +282,24 @@ public class DeflateIn_InflateOut { + ByteReadByteWrite(); + + SkipBytes(); ++ ++ NeedsDictionary(); + } + + //--------------------- Infrastructure --------------------------- + static volatile int passed = 0, failed = 0; + static void pass() {passed++;} +- static void fail() {failed++; Thread.dumpStack();} +- static void fail(String msg) {System.out.println(msg); fail();} ++ static void fail() { fail(null); } ++ static void fail(String msg) { ++ failed++; ++ if (msg != null) { ++ System.err.println(msg); ++ } ++ Thread.dumpStack(); ++ } + static void unexpected(Throwable t) {failed++; t.printStackTrace();} + static void check(boolean cond) {if (cond) pass(); else fail();} ++ static void check(boolean cond, String msg) {if (cond) pass(); else fail(msg);} + static void equal(Object x, Object y) { + if (x == null ? y == null : x.equals(y)) pass(); + else fail(x + " not equal to " + y);} +-- +2.23.0 + diff --git a/update-cacerts-and-VerifyCACerts.java-test.patch b/update-cacerts-and-VerifyCACerts.java-test.patch index 4128a07b63afd355bbe18e3a7cfd327cd31e7e86..3bcc6f44392f5b2669c39d87c37b3b43ebcd0dfc 100644 --- a/update-cacerts-and-VerifyCACerts.java-test.patch +++ b/update-cacerts-and-VerifyCACerts.java-test.patch @@ -257,13 +257,13 @@ index dd107fc..791ddb6 100644 + File.separator + "security" + File.separator + "cacerts"; // The numbers of certs now. -- private static final int COUNT = 108; +- private static final int COUNT = 110; + private static final int COUNT = 83; // SHA-256 of cacerts, can be generated with // shasum -a 256 cacerts | sed -e 's/../&:/g' | tr '[:lower:]' '[:upper:]' | cut -c1-95 private static final String CHECKSUM -- = "81:D4:84:F6:92:78:A4:82:25:06:DC:42:25:C9:5D:6C:63:E4:99:CE:BC:ED:66:B3:8C:BA:E6:BA:6B:34:0F:01"; +- = "C1:68:B4:AC:51:BF:B5:C6:FD:20:69:17:E1:AF:E4:5B:01:9B:AA:3F:C3:9A:80:A8:51:53:74:2C:A2:04:B0:FF"; + = "2D:04:88:6C:52:53:54:EB:38:2D:BC:E0:AF:B7:82:F4:9E:32:A8:1A:1B:A3:AE:CF:25:CB:C2:F6:0F:4E:E1:20"; // map of cert alias to SHA-256 fingerprint