<pre style='margin:0'>
Christopher Nielsen (mascguy) pushed a commit to branch master
in repository macports-ports.
</pre>
<p><a href="https://github.com/macports/macports-ports/commit/d6769f0110c4f57019b197269d7c373cae2e305e">https://github.com/macports/macports-ports/commit/d6769f0110c4f57019b197269d7c373cae2e305e</a></p>
<pre style="white-space: pre; background: #F8F8F8"><span style='display:block; white-space:pre;color:#808000;'>commit d6769f0110c4f57019b197269d7c373cae2e305e
</span>Author: usersxx <97012123+usersxx@users.noreply.github.com>
AuthorDate: Thu Apr 21 16:24:41 2022 +0530
<span style='display:block; white-space:pre;color:#404040;'> openjdk11: remove patches
</span>---
.../openjdk11/files/patch-openjdk11-arm64-fix.diff | 249 --
.../files/patch-openjdk11-arm64-fix2.diff | 20 -
.../files/patch-openjdk11-arm64-fix3.diff | 31 -
java/openjdk11/files/patch-openjdk11-arm64.diff | 4647 --------------------
java/openjdk11/files/patch-openjdk11-build1.diff | 11 -
5 files changed, 4958 deletions(-)
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/java/openjdk11/files/patch-openjdk11-arm64-fix.diff b/java/openjdk11/files/patch-openjdk11-arm64-fix.diff
</span>deleted file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index 95686bf60ee..00000000000
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/java/openjdk11/files/patch-openjdk11-arm64-fix.diff
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ /dev/null
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -1,249 +0,0 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- src/hotspot/os/bsd/os_bsd.cpp.orig
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ src/hotspot/os/bsd/os_bsd.cpp
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -22,6 +22,16 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- *
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+/*
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * On macOS MAP_JIT cannot be used in conjunction with MAP_FIXED when mapping
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * a page for codecache. Therefore our traditional technique of doing commit
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * and uncommit - replacing a mapping with another one at the same address
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * range but swapped MAP_NORESERVE - does not work.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * The "exec" flag basically means "its code cache" and it should be used
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * consistently for the same mapping (reserve-commit-uncommit etc)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * This affects pd_reserve_memory, pd_commit_memory, pd_uncommit_memory functions
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- // no precompiled headers
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #include "jvm.h"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #include "classfile/classLoader.hpp"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -2007,12 +2017,25 @@ static void warn_fail_commit_memory(char* addr, size_t size, bool exec,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- // problem.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- bool os::pd_commit_memory(char* addr, size_t size, bool exec) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- int prot = exec ? PROT_READ|PROT_WRITE|PROT_EXEC : PROT_READ|PROT_WRITE;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--#ifdef __OpenBSD__
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#if defined(__OpenBSD__)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- // XXX: Work-around mmap/MAP_FIXED bug temporarily on OpenBSD
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- Events::log(NULL, "Protecting memory [" INTPTR_FORMAT "," INTPTR_FORMAT "] with protection modes %x", p2i(addr), p2i(addr+size), prot);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if (::mprotect(addr, size, prot) == 0) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- return true;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#elif defined(__APPLE__)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (exec) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // Do not replace MAP_JIT mappings, see JDK-8234930
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (::mprotect(addr, size, prot) == 0) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ return true;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ } else {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ uintptr_t res = (uintptr_t) ::mmap(addr, size, prot,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (res != (uintptr_t) MAP_FAILED) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ return true;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #else
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- uintptr_t res = (uintptr_t) ::mmap(addr, size, prot,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -2091,11 +2114,23 @@ char *os::scan_pages(char *start, char* end, page_info* page_expected, page_info
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--bool os::pd_uncommit_memory(char* addr, size_t size) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--#ifdef __OpenBSD__
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+MACOS_ONLY(bool os::pd_uncommit_memory(char* addr, size_t size, bool executable))
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+NOT_MACOS(bool os::pd_uncommit_memory(char* addr, size_t size)) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#if defined(__OpenBSD__)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- // XXX: Work-around mmap/MAP_FIXED bug temporarily on OpenBSD
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- Events::log(NULL, "Protecting memory [" INTPTR_FORMAT "," INTPTR_FORMAT "] with PROT_NONE", p2i(addr), p2i(addr+size));
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- return ::mprotect(addr, size, PROT_NONE) == 0;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#elif defined(__APPLE__)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (executable) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (::madvise(addr, size, MADV_FREE) != 0) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ return false;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ return ::mprotect(addr, size, PROT_NONE) == 0;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ } else {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ uintptr_t res = (uintptr_t) ::mmap(addr, size, PROT_NONE,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ MAP_PRIVATE|MAP_FIXED|MAP_NORESERVE|MAP_ANONYMOUS, -1, 0);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ return res != (uintptr_t) MAP_FAILED;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #else
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- uintptr_t res = (uintptr_t) ::mmap(addr, size, PROT_NONE,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- MAP_PRIVATE|MAP_FIXED|MAP_NORESERVE|MAP_ANONYMOUS, -1, 0);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -2119,11 +2154,17 @@ bool os::remove_stack_guard_pages(char* addr, size_t size) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- // 'requested_addr' is only treated as a hint, the return value may or
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- // may not start from the requested address. Unlike Bsd mmap(), this
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- // function returns NULL to indicate failure.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--static char* anon_mmap(char* requested_addr, size_t bytes, bool fixed) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+static char* anon_mmap(char* requested_addr, size_t bytes, bool fixed, bool executable = false) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- char * addr;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- int flags;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- flags = MAP_PRIVATE | MAP_NORESERVE | MAP_ANONYMOUS;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#ifdef __APPLE__
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (executable) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ guarantee(!fixed, "MAP_JIT (for execute) is incompatible with MAP_FIXED");
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ flags |= MAP_JIT;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#endif
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if (fixed) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- assert((uintptr_t)requested_addr % os::Bsd::page_size() == 0, "unaligned address");
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- flags |= MAP_FIXED;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -2142,10 +2183,18 @@ static int anon_munmap(char * addr, size_t size) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- return ::munmap(addr, size) == 0;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#if defined(__APPLE__)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+char* os::pd_reserve_memory(size_t bytes, char* requested_addr,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ size_t alignment_hint,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ bool executable) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ return anon_mmap(requested_addr, bytes, (requested_addr != NULL), executable);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#else
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- char* os::pd_reserve_memory(size_t bytes, char* requested_addr,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- size_t alignment_hint) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- return anon_mmap(requested_addr, bytes, (requested_addr != NULL));
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#endif
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- bool os::pd_release_memory(char* addr, size_t size) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- return anon_munmap(addr, size);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- src/hotspot/share/memory/virtualspace.cpp.orig
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ src/hotspot/share/memory/virtualspace.cpp
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -196,7 +196,8 @@ void ReservedSpace::initialize(size_t size, size_t alignment, bool large,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- base = NULL;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- } else {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- base = os::reserve_memory(size, NULL, alignment, _fd_for_heap);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ base = MACOS_ONLY(os::reserve_memory(size, NULL, alignment, _fd_for_heap, _executable))
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ NOT_MACOS(os::reserve_memory(size, NULL, alignment, _fd_for_heap));
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if (base == NULL) return;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -990,7 +991,8 @@ void VirtualSpace::shrink_by(size_t size) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- assert(middle_high_boundary() <= aligned_upper_new_high &&
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- aligned_upper_new_high + upper_needs <= upper_high_boundary(),
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- "must not shrink beyond region");
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- if (!os::uncommit_memory(aligned_upper_new_high, upper_needs)) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (MACOS_ONLY(!os::uncommit_memory(aligned_upper_new_high, upper_needs, _executable))
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ NOT_MACOS(!os::uncommit_memory(aligned_upper_new_high, upper_needs))) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- debug_only(warning("os::uncommit_memory failed"));
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- return;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- } else {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -1001,7 +1003,8 @@ void VirtualSpace::shrink_by(size_t size) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- assert(lower_high_boundary() <= aligned_middle_new_high &&
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- aligned_middle_new_high + middle_needs <= middle_high_boundary(),
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- "must not shrink beyond region");
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- if (!os::uncommit_memory(aligned_middle_new_high, middle_needs)) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (MACOS_ONLY(!os::uncommit_memory(aligned_middle_new_high, middle_needs, _executable))
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ NOT_MACOS(!os::uncommit_memory(aligned_middle_new_high, middle_needs))) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- debug_only(warning("os::uncommit_memory failed"));
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- return;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- } else {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -1012,7 +1015,8 @@ void VirtualSpace::shrink_by(size_t size) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- assert(low_boundary() <= aligned_lower_new_high &&
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- aligned_lower_new_high + lower_needs <= lower_high_boundary(),
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- "must not shrink beyond region");
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- if (!os::uncommit_memory(aligned_lower_new_high, lower_needs)) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (MACOS_ONLY(!os::uncommit_memory(aligned_lower_new_high, lower_needs, _executable))
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ NOT_MACOS(!os::uncommit_memory(aligned_lower_new_high, lower_needs))) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- debug_only(warning("os::uncommit_memory failed"));
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- return;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- } else {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- src/hotspot/share/runtime/os.cpp.orig
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ src/hotspot/share/runtime/os.cpp
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -1737,7 +1737,8 @@ bool os::create_stack_guard_pages(char* addr, size_t bytes) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- return os::pd_create_stack_guard_pages(addr, bytes);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--char* os::reserve_memory(size_t bytes, char* addr, size_t alignment_hint, int file_desc) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+MACOS_ONLY(char* os::reserve_memory(size_t bytes, char* addr, size_t alignment_hint, int file_desc, bool executable))
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+NOT_MACOS(char* os::reserve_memory(size_t bytes, char* addr, size_t alignment_hint, int file_desc)) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- char* result = NULL;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if (file_desc != -1) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -1748,7 +1749,8 @@ char* os::reserve_memory(size_t bytes, char* addr, size_t alignment_hint, int fi
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- MemTracker::record_virtual_memory_reserve_and_commit((address)result, bytes, CALLER_PC);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- } else {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- result = pd_reserve_memory(bytes, addr, alignment_hint);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ result = MACOS_ONLY(pd_reserve_memory(bytes, addr, alignment_hint, executable))
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ NOT_MACOS(pd_reserve_memory(bytes, addr, alignment_hint));
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if (result != NULL) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- MemTracker::record_virtual_memory_reserve((address)result, bytes, CALLER_PC);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -1818,16 +1820,19 @@ void os::commit_memory_or_exit(char* addr, size_t size, size_t alignment_hint,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- MemTracker::record_virtual_memory_commit((address)addr, size, CALLER_PC);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--bool os::uncommit_memory(char* addr, size_t bytes) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+MACOS_ONLY(bool os::uncommit_memory(char* addr, size_t bytes, bool executable))
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+NOT_MACOS(bool os::uncommit_memory(char* addr, size_t bytes)) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- bool res;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if (MemTracker::tracking_level() > NMT_minimal) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- Tracker tkr(Tracker::uncommit);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- res = pd_uncommit_memory(addr, bytes);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ res = MACOS_ONLY(pd_uncommit_memory(addr, bytes, executable))
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ NOT_MACOS(pd_uncommit_memory(addr, bytes));
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if (res) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- tkr.record((address)addr, bytes);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- } else {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- res = pd_uncommit_memory(addr, bytes);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ res = MACOS_ONLY(pd_uncommit_memory(addr, bytes, executable))
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ NOT_MACOS(pd_uncommit_memory(addr, bytes));
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- return res;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- src/hotspot/share/runtime/os.hpp.orig
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ src/hotspot/share/runtime/os.hpp
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -116,8 +116,12 @@ class os: AllStatic {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- _page_sizes[1] = 0; // sentinel
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- static char* pd_reserve_memory(size_t bytes, char* addr = 0,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- size_t alignment_hint = 0);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ MACOS_ONLY(static char* pd_reserve_memory(size_t bytes, char* addr = 0,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ size_t alignment_hint = 0,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ bool executable = false);)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ NOT_MACOS(static char* pd_reserve_memory(size_t bytes, char* addr = 0,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ size_t alignment_hint = 0);)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- static char* pd_attempt_reserve_memory_at(size_t bytes, char* addr);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- static char* pd_attempt_reserve_memory_at(size_t bytes, char* addr, int file_desc);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- static void pd_split_reserved_memory(char *base, size_t size,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -132,7 +136,9 @@ class os: AllStatic {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- static void pd_commit_memory_or_exit(char* addr, size_t size,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- size_t alignment_hint,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- bool executable, const char* mesg);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- static bool pd_uncommit_memory(char* addr, size_t bytes);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ MACOS_ONLY(static bool pd_uncommit_memory(char* addr, size_t bytes,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ bool executable = false);)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ NOT_MACOS(static bool pd_uncommit_memory(char* addr, size_t bytes);)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- static bool pd_release_memory(char* addr, size_t bytes);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- static char* pd_map_memory(int fd, const char* file_name, size_t file_offset,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -330,8 +336,11 @@ class os: AllStatic {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- const size_t size);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- static int vm_allocation_granularity();
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- static char* reserve_memory(size_t bytes, char* addr = 0,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- size_t alignment_hint = 0, int file_desc = -1);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ MACOS_ONLY(static char* reserve_memory(size_t bytes, char* addr = 0,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ size_t alignment_hint = 0, int file_desc = -1,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ bool executable = false);)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ NOT_MACOS(static char* reserve_memory(size_t bytes, char* addr = 0,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ size_t alignment_hint = 0, int file_desc = -1);)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- static char* reserve_memory(size_t bytes, char* addr,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- size_t alignment_hint, MEMFLAGS flags);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- static char* reserve_memory_aligned(size_t size, size_t alignment, int file_desc = -1);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -348,7 +357,8 @@ class os: AllStatic {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- static void commit_memory_or_exit(char* addr, size_t size,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- size_t alignment_hint,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- bool executable, const char* mesg);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- static bool uncommit_memory(char* addr, size_t bytes);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ MACOS_ONLY(static bool uncommit_memory(char* addr, size_t bytes, bool executable = false);)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ NOT_MACOS(static bool uncommit_memory(char* addr, size_t bytes);)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- static bool release_memory(char* addr, size_t bytes);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- // Touch memory pages that cover the memory range from start to end (exclusive)
</span><span style='display:block; white-space:pre;color:#808080;'>diff --git a/java/openjdk11/files/patch-openjdk11-arm64-fix2.diff b/java/openjdk11/files/patch-openjdk11-arm64-fix2.diff
</span>deleted file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index 067c33a231b..00000000000
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/java/openjdk11/files/patch-openjdk11-arm64-fix2.diff
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ /dev/null
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -1,20 +0,0 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- src/hotspot/share/prims/jvmtiEnv.cpp.orig
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ src/hotspot/share/prims/jvmtiEnv.cpp
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -3287,6 +3287,8 @@ JvmtiEnv::RawMonitorEnter(JvmtiRawMonitor * rmonitor) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- } else {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- int r = 0;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- Thread* thread = Thread::current();
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // 8266889: raw_enter changes Java thread state, needs WXWrite
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ MACOS_AARCH64_ONLY(ThreadWXEnable __wx(WXWrite, thread));
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if (thread->is_Java_thread()) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- JavaThread* current_thread = (JavaThread*)thread;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -3384,6 +3386,8 @@ jvmtiError
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- JvmtiEnv::RawMonitorWait(JvmtiRawMonitor * rmonitor, jlong millis) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- int r = 0;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- Thread* thread = Thread::current();
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // 8266889: raw_wait changes Java thread state, needs WXWrite
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ MACOS_AARCH64_ONLY(ThreadWXEnable __wx(WXWrite, thread));
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if (thread->is_Java_thread()) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- JavaThread* current_thread = (JavaThread*)thread;
</span><span style='display:block; white-space:pre;color:#808080;'>diff --git a/java/openjdk11/files/patch-openjdk11-arm64-fix3.diff b/java/openjdk11/files/patch-openjdk11-arm64-fix3.diff
</span>deleted file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index ae9561d87cb..00000000000
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/java/openjdk11/files/patch-openjdk11-arm64-fix3.diff
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ /dev/null
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -1,31 +0,0 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- src/hotspot/share/prims/jni.cpp.orig
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ src/hotspot/share/prims/jni.cpp
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -4151,6 +4151,10 @@ static jint JNICALL jni_DestroyJavaVM_inner(JavaVM *vm) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- // Since this is not a JVM_ENTRY we have to set the thread state manually before entering.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- JavaThread* thread = JavaThread::current();
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // We are going to VM, change W^X state to the expected one.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ MACOS_AARCH64_ONLY(WXMode oldmode = thread->enable_wx(WXWrite));
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- ThreadStateTransition::transition_from_native(thread, _thread_in_vm);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if (Threads::destroy_vm()) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- // Should not change thread state, VM is gone
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -4159,6 +4163,7 @@ static jint JNICALL jni_DestroyJavaVM_inner(JavaVM *vm) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- return res;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- } else {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- ThreadStateTransition::transition_and_fence(thread, _thread_in_vm, _thread_in_native);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ MACOS_AARCH64_ONLY(thread->enable_wx(oldmode));
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- res = JNI_ERR;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- return res;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -4342,6 +4347,9 @@ jint JNICALL jni_DetachCurrentThread(JavaVM *vm) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- return JNI_ERR;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // We are going to VM, change W^X state to the expected one.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ MACOS_AARCH64_ONLY(thread->enable_wx(WXWrite));
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- // Safepoint support. Have to do call-back to safepoint code, if in the
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- // middle of a safepoint operation
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- ThreadStateTransition::transition_from_native(thread, _thread_in_vm);
</span><span style='display:block; white-space:pre;color:#808080;'>diff --git a/java/openjdk11/files/patch-openjdk11-arm64.diff b/java/openjdk11/files/patch-openjdk11-arm64.diff
</span>deleted file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index 8f0b342cb69..00000000000
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/java/openjdk11/files/patch-openjdk11-arm64.diff
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ /dev/null
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -1,4647 +0,0 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-This patch adds arm64 support using OpenJDK's AArch64 port
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- make/autoconf/build-aux/config.guess.orig
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ make/autoconf/build-aux/config.guess
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -1,6 +1,7 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #!/bin/sh
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+# Copyright (c) 2012, 2021, Oracle and/or its affiliates. All rights reserved.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+# Copyright (c) 2021, Azul Systems, Inc. All rights reserved.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- # This code is free software; you can redistribute it and/or modify it
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -106,6 +107,14 @@ if [ "x$OUT" = x ]; then
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- fi
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- fi
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+# Test and fix cpu on macos-aarch64, uname -p reports arm, buildsys expects aarch64
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+echo $OUT | grep arm-apple-darwin > /dev/null 2> /dev/null
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+if test $? = 0; then
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if [ `uname -m` = arm64 ]; then
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ OUT=aarch64`echo $OUT | sed -e 's/[^-]*//'`
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ fi
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+fi
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- # Test and fix cpu on Macosx when C preprocessor is not on the path
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- echo $OUT | grep i386-apple-darwin > /dev/null 2> /dev/null
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if test $? = 0; then
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- make/autoconf/flags.m4.orig
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ make/autoconf/flags.m4
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -111,19 +111,25 @@ AC_DEFUN([FLAGS_SETUP_MACOSX_VERSION],
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- [
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- # Additional macosx handling
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if test "x$OPENJDK_TARGET_OS" = xmacosx; then
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ # The expected format for <version> is either nn.n.n or nn.nn.nn. See
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ # /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AvailabilityVersions.h
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- # MACOSX_VERSION_MIN specifies the lowest version of Macosx that the built
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- # binaries should be compatible with, even if compiled on a newer version
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- # of the OS. It currently has a hard coded value. Setting this also limits
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- # exposure to API changes in header files. Bumping this is likely to
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- # require code changes to build.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- MACOSX_VERSION_MIN=10.9.0
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if test "x$OPENJDK_TARGET_CPU_ARCH" = xaarch64; then
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ MACOSX_VERSION_MIN=11.00.00
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ else
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ MACOSX_VERSION_MIN=10.9.0
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ fi
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- MACOSX_VERSION_MIN_NODOTS=${MACOSX_VERSION_MIN//\./}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- AC_SUBST(MACOSX_VERSION_MIN)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- # Setting --with-macosx-version-max=<version> makes it an error to build or
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- # link to macosx APIs that are newer than the given OS version. The expected
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- # format for <version> is either nn.n.n or nn.nn.nn. See /usr/include/AvailabilityMacros.h.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ # link to macosx APIs that are newer than the given OS version.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- AC_ARG_WITH([macosx-version-max], [AS_HELP_STRING([--with-macosx-version-max],
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- [error on use of newer functionality. @<:@macosx@:>@])],
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- [
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- make/autoconf/hotspot.m4.orig
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ make/autoconf/hotspot.m4
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -1,5 +1,5 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--# Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+# Copyright (c) 2011, 2021, Oracle and/or its affiliates. All rights reserved.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- # This code is free software; you can redistribute it and/or modify it
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -274,6 +274,14 @@ AC_DEFUN_ONCE([HOTSPOT_ENABLE_DISABLE_CDS],
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- fi
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- fi
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ # Disable CDS on macos-aarch64
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if test "x$OPENJDK_TARGET_OS" = "xmacosx" && test "x$OPENJDK_TARGET_CPU" = "xaarch64"; then
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ ENABLE_CDS="false"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if test "x$enable_cds" = "xyes"; then
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ AC_MSG_ERROR([CDS is currently not supported on macOS/aarch64. Remove --enable-cds.])
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ fi
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ fi
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- AC_SUBST(ENABLE_CDS)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- ])
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- make/common/NativeCompilation.gmk.orig
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ make/common/NativeCompilation.gmk
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -1213,7 +1213,7 @@ define SetupNativeCompilationBody
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- # This only works if the openjdk_codesign identity is present on the system. Let
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- # silently fail otherwise.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- ifneq ($(CODESIGN), )
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- $(CODESIGN) -s "$(MACOSX_CODESIGN_IDENTITY)" --timestamp --options runtime \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ $(CODESIGN) -f -s "$(MACOSX_CODESIGN_IDENTITY)" --timestamp --options runtime \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- --entitlements $$(call GetEntitlementsFile, $$@) $$@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- endif
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- endif
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- make/hotspot/gensrc/GensrcAdlc.gmk.orig
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ make/hotspot/gensrc/GensrcAdlc.gmk
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -1,5 +1,5 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--# Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+# Copyright (c) 2013, 2021, Oracle and/or its affiliates. All rights reserved.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- # This code is free software; you can redistribute it and/or modify it
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -99,6 +99,9 @@ ifeq ($(call check-jvm-feature, compiler2), true)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- ADLCFLAGS += -DAIX=1
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- else ifeq ($(OPENJDK_TARGET_OS), macosx)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- ADLCFLAGS += -D_ALLBSD_SOURCE=1 -D_GNU_SOURCE=1
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ ifeq ($(HOTSPOT_TARGET_CPU_ARCH), aarch64)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ ADLCFLAGS += -DR18_RESERVED
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ endif
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- else ifeq ($(OPENJDK_TARGET_OS), windows)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- ifeq ($(call isTargetCpuBits, 64), true)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- ADLCFLAGS += -D_WIN64=1
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- make/lib/Awt2dLibraries.gmk.orig
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ make/lib/Awt2dLibraries.gmk
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -562,7 +562,7 @@ else
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- maybe-uninitialized class-memaccess
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- HARFBUZZ_DISABLED_WARNINGS_clang := unused-value incompatible-pointer-types \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- tautological-constant-out-of-range-compare int-to-pointer-cast \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- undef missing-field-initializers
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ undef missing-field-initializers deprecated-declarations c++11-narrowing
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- HARFBUZZ_DISABLED_WARNINGS_microsoft := 4267 4244 4090 4146 4334 4819 4101 4068 4805 4138
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- HARFBUZZ_DISABLED_WARNINGS_C_solstudio := \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- E_INTEGER_OVERFLOW_DETECTED \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- make/lib/Lib-jdk.hotspot.agent.gmk.orig
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ make/lib/Lib-jdk.hotspot.agent.gmk
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -36,7 +36,7 @@ else ifeq ($(OPENJDK_TARGET_OS), solaris)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- SA_LDFLAGS := -mt
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- else ifeq ($(OPENJDK_TARGET_OS), macosx)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- SA_CFLAGS := -Damd64 -D_GNU_SOURCE -mno-omit-leaf-frame-pointer \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ SA_CFLAGS := -D_GNU_SOURCE -mno-omit-leaf-frame-pointer \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- -mstack-alignment=16 -fPIC
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- LIBSA_EXTRA_SRC := $(SUPPORT_OUTPUTDIR)/gensrc/jdk.hotspot.agent
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- else ifeq ($(OPENJDK_TARGET_OS), windows)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- src/hotspot/cpu/aarch64/globalDefinitions_aarch64.hpp.orig
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ src/hotspot/cpu/aarch64/globalDefinitions_aarch64.hpp
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -1,5 +1,5 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- /*
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * Copyright (c) 1999, 2021, Oracle and/or its affiliates. All rights reserved.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- * Copyright (c) 2014, 2015, Red Hat Inc. All rights reserved.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- *
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -53,7 +53,7 @@ const bool CCallingConventionRequiresIntsAsLongs = false;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #define THREAD_LOCAL_POLL
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--#if defined(_WIN64)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#if defined(__APPLE__) || defined(_WIN64)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #define R18_RESERVED
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #define R18_RESERVED_ONLY(code) code
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #define NOT_R18_RESERVED(code)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- src/hotspot/cpu/aarch64/interpreterRT_aarch64.cpp.orig
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ src/hotspot/cpu/aarch64/interpreterRT_aarch64.cpp
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -1,6 +1,7 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- /*
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- * Copyright (c) 2003, 2020, Oracle and/or its affiliates. All rights reserved.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * Copyright (c) 2003, 2021, Oracle and/or its affiliates. All rights reserved.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- * Copyright (c) 2014, 2020, Red Hat Inc. All rights reserved.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * Copyright (c) 2021, Azul Systems, Inc. All rights reserved.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- *
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- * This code is free software; you can redistribute it and/or modify it
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -58,9 +59,14 @@ FloatRegister InterpreterRuntime::SignatureHandlerGenerator::next_fpr() {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- return fnoreg;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--int InterpreterRuntime::SignatureHandlerGenerator::next_stack_offset() {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+// On macos/aarch64 native stack is packed, int/float are using only 4 bytes
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+// on stack. Natural alignment for types are still in place,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+// for example double/long should be 8 bytes aligned.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+int InterpreterRuntime::SignatureHandlerGenerator::next_stack_offset(unsigned elem_size) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ MACOS_ONLY(_stack_offset = align_up(_stack_offset, elem_size));
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- int ret = _stack_offset;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- _stack_offset += wordSize;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ _stack_offset += NOT_MACOS(wordSize) MACOS_ONLY(elem_size);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- return ret;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -72,6 +78,30 @@ InterpreterRuntime::SignatureHandlerGenerator::SignatureHandlerGenerator(
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- _stack_offset = 0;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+void InterpreterRuntime::SignatureHandlerGenerator::pass_byte() {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ const Address src(from(), Interpreter::local_offset_in_bytes(offset()));
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ Register reg = next_gpr();
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (reg != noreg) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ __ ldr(reg, src);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ } else {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ __ ldrb(r0, src);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ __ strb(r0, Address(to(), next_stack_offset(sizeof(jbyte))));
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+void InterpreterRuntime::SignatureHandlerGenerator::pass_short() {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ const Address src(from(), Interpreter::local_offset_in_bytes(offset()));
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ Register reg = next_gpr();
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (reg != noreg) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ __ ldr(reg, src);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ } else {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ __ ldrh(r0, src);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ __ strh(r0, Address(to(), next_stack_offset(sizeof(jshort))));
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- void InterpreterRuntime::SignatureHandlerGenerator::pass_int() {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- const Address src(from(), Interpreter::local_offset_in_bytes(offset()));
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -80,7 +110,7 @@ void InterpreterRuntime::SignatureHandlerGenerator::pass_int() {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- __ ldr(reg, src);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- } else {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- __ ldrw(r0, src);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- __ strw(r0, Address(to(), next_stack_offset()));
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ __ strw(r0, Address(to(), next_stack_offset(sizeof(jint))));
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -92,7 +122,7 @@ void InterpreterRuntime::SignatureHandlerGenerator::pass_long() {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- __ ldr(reg, src);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- } else {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- __ ldr(r0, src);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- __ str(r0, Address(to(), next_stack_offset()));
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ __ str(r0, Address(to(), next_stack_offset(sizeof(jlong))));
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -104,7 +134,7 @@ void InterpreterRuntime::SignatureHandlerGenerator::pass_float() {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- __ ldrs(reg, src);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- } else {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- __ ldrw(r0, src);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- __ strw(r0, Address(to(), next_stack_offset()));
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ __ strw(r0, Address(to(), next_stack_offset(sizeof(jfloat))));
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -116,7 +146,7 @@ void InterpreterRuntime::SignatureHandlerGenerator::pass_double() {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- __ ldrd(reg, src);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- } else {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- __ ldr(r0, src);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- __ str(r0, Address(to(), next_stack_offset()));
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ __ str(r0, Address(to(), next_stack_offset(sizeof(jdouble))));
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -140,7 +170,8 @@ void InterpreterRuntime::SignatureHandlerGenerator::pass_object() {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- __ cbnz(temp(), L);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- __ mov(r0, zr);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- __ bind(L);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- __ str(r0, Address(to(), next_stack_offset()));
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ STATIC_ASSERT(sizeof(jobject) == wordSize);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ __ str(r0, Address(to(), next_stack_offset(sizeof(jobject))));
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -165,7 +196,7 @@ class SlowSignatureHandler
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- : public NativeSignatureIterator {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- private:
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- address _from;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- intptr_t* _to;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ char* _to;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- intptr_t* _int_args;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- intptr_t* _fp_args;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- intptr_t* _fp_identifiers;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -200,21 +231,38 @@ class SlowSignatureHandler
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- return -1;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- void pass_stack(intptr_t value) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- *_to++ = value;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ template<typename T>
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ void pass_stack(T value) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ MACOS_ONLY(_to = align_up(_to, sizeof(value)));
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ *(T *)_to = value;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ _to += NOT_MACOS(wordSize) MACOS_ONLY(sizeof(value));
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ virtual void pass_byte() {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ jbyte value = *(jbyte*)single_slot_addr();
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (pass_gpr(value) < 0) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ pass_stack<>(value);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ virtual void pass_short() {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ jshort value = *(jshort*)single_slot_addr();
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (pass_gpr(value) < 0) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ pass_stack<>(value);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- virtual void pass_int() {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- jint value = *(jint*)single_slot_addr();
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if (pass_gpr(value) < 0) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- pass_stack(value);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ pass_stack<>(value);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- virtual void pass_long() {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- intptr_t value = *double_slot_addr();
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if (pass_gpr(value) < 0) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- pass_stack(value);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ pass_stack<>(value);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -222,14 +270,14 @@ class SlowSignatureHandler
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- intptr_t* addr = single_slot_addr();
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- intptr_t value = *addr == 0 ? NULL : (intptr_t)addr;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if (pass_gpr(value) < 0) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- pass_stack(value);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ pass_stack<>(value);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- virtual void pass_float() {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- jint value = *(jint*)single_slot_addr();
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if (pass_fpr(value) < 0) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- pass_stack(value);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ pass_stack<>(value);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -239,7 +287,7 @@ class SlowSignatureHandler
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if (0 <= arg) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- *_fp_identifiers |= (1ull << arg); // mark as double
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- } else {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- pass_stack(value);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ pass_stack<>(value);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -248,7 +296,7 @@ class SlowSignatureHandler
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- : NativeSignatureIterator(method)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- _from = from;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- _to = to;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ _to = (char *)to;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- _int_args = to - (method->is_static() ? 16 : 17);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- _fp_args = to - 8;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- src/hotspot/cpu/aarch64/interpreterRT_aarch64.hpp.orig
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ src/hotspot/cpu/aarch64/interpreterRT_aarch64.hpp
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -1,6 +1,7 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- /*
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- * Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * Copyright (c) 1998, 2021, Oracle and/or its affiliates. All rights reserved.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- * Copyright (c) 2014, Red Hat Inc. All rights reserved.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * Copyright (c) 2021, Azul Systems, Inc. All rights reserved.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- *
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- * This code is free software; you can redistribute it and/or modify it
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -38,6 +39,8 @@ class SignatureHandlerGenerator: public NativeSignatureIterator {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- unsigned int _num_reg_int_args;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- int _stack_offset;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ void pass_byte();
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ void pass_short();
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- void pass_int();
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- void pass_long();
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- void pass_float();
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -46,7 +49,7 @@ class SignatureHandlerGenerator: public NativeSignatureIterator {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- Register next_gpr();
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- FloatRegister next_fpr();
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- int next_stack_offset();
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ int next_stack_offset(unsigned elem_size);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- public:
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- // Creation
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- src/hotspot/cpu/aarch64/jniFastGetField_aarch64.cpp.orig
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ src/hotspot/cpu/aarch64/jniFastGetField_aarch64.cpp
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -31,6 +31,7 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #include "prims/jniFastGetField.hpp"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #include "prims/jvm_misc.hpp"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #include "runtime/safepoint.hpp"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#include "runtime/threadWXSetters.inline.hpp"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #define __ masm->
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -51,6 +52,48 @@ static const Register roffset = r5;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- static const Register rcounter_addr = r6;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- static const Register result = r7;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+// On macos/aarch64 we need to ensure WXExec mode when running generated
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+// FastGetXXXField, as these functions can be called from WXWrite context
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+// (8262896). So each FastGetXXXField is wrapped into a C++ statically
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+// compiled template function that optionally switches to WXExec if necessary.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#ifdef __APPLE__
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+static address generated_fast_get_field[T_LONG + 1 - T_BOOLEAN];
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+template<int BType> struct BasicTypeToJni {};
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+template<> struct BasicTypeToJni<T_BOOLEAN> { static const jboolean jni_type; };
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+template<> struct BasicTypeToJni<T_BYTE> { static const jbyte jni_type; };
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+template<> struct BasicTypeToJni<T_CHAR> { static const jchar jni_type; };
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+template<> struct BasicTypeToJni<T_SHORT> { static const jshort jni_type; };
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+template<> struct BasicTypeToJni<T_INT> { static const jint jni_type; };
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+template<> struct BasicTypeToJni<T_LONG> { static const jlong jni_type; };
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+template<> struct BasicTypeToJni<T_FLOAT> { static const jfloat jni_type; };
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+template<> struct BasicTypeToJni<T_DOUBLE> { static const jdouble jni_type; };
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+template<int BType>
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+decltype(BasicTypeToJni<BType>::jni_type) static_fast_get_field_wrapper(JNIEnv *env, jobject obj, jfieldID fieldID) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ JavaThread* thread = JavaThread::thread_from_jni_environment(env);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ ThreadWXEnable wx(WXExec, thread);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ address get_field_addr = generated_fast_get_field[BType - T_BOOLEAN];
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ return ((decltype(BasicTypeToJni<BType>::jni_type)(*)(JNIEnv *env, jobject obj, jfieldID fieldID))get_field_addr)(env, obj, fieldID);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+template<int BType>
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+address JNI_FastGetField::generate_fast_get_int_field1() {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ generated_fast_get_field[BType - T_BOOLEAN] = generate_fast_get_int_field0((BasicType)BType);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ return (address)static_fast_get_field_wrapper<BType>;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#else // __APPLE__
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+template<int BType>
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+address JNI_FastGetField::generate_fast_get_int_field1() {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ return generate_fast_get_int_field0((BasicType)BType);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#endif // __APPLE__
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- address JNI_FastGetField::generate_fast_get_int_field0(BasicType type) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- const char *name;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- switch (type) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -147,33 +190,33 @@ address JNI_FastGetField::generate_fast_get_int_field0(BasicType type) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- address JNI_FastGetField::generate_fast_get_boolean_field() {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- return generate_fast_get_int_field0(T_BOOLEAN);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ return generate_fast_get_int_field1<T_BOOLEAN>();
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- address JNI_FastGetField::generate_fast_get_byte_field() {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- return generate_fast_get_int_field0(T_BYTE);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ return generate_fast_get_int_field1<T_BYTE>();
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- address JNI_FastGetField::generate_fast_get_char_field() {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- return generate_fast_get_int_field0(T_CHAR);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ return generate_fast_get_int_field1<T_CHAR>();
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- address JNI_FastGetField::generate_fast_get_short_field() {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- return generate_fast_get_int_field0(T_SHORT);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ return generate_fast_get_int_field1<T_SHORT>();
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- address JNI_FastGetField::generate_fast_get_int_field() {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- return generate_fast_get_int_field0(T_INT);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ return generate_fast_get_int_field1<T_INT>();
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- address JNI_FastGetField::generate_fast_get_long_field() {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- return generate_fast_get_int_field0(T_LONG);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ return generate_fast_get_int_field1<T_LONG>();
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- address JNI_FastGetField::generate_fast_get_float_field() {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- return generate_fast_get_int_field0(T_FLOAT);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ return generate_fast_get_int_field1<T_FLOAT>();
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- address JNI_FastGetField::generate_fast_get_double_field() {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- return generate_fast_get_int_field0(T_DOUBLE);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ return generate_fast_get_int_field1<T_DOUBLE>();
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp.orig
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -1492,7 +1492,7 @@ void MacroAssembler::movptr(Register r, uintptr_t imm64) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #ifndef PRODUCT
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- char buffer[64];
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- snprintf(buffer, sizeof(buffer), PTR64_FORMAT, imm64);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ snprintf(buffer, sizeof(buffer), "0x%"PRIX64, (uint64_t)imm64);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- block_comment(buffer);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #endif
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -1555,7 +1555,7 @@ void MacroAssembler::mov_immediate64(Register dst, uint64_t imm64)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #ifndef PRODUCT
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- char buffer[64];
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- snprintf(buffer, sizeof(buffer), PTR64_FORMAT, imm64);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ snprintf(buffer, sizeof(buffer), "0x%"PRIX64, imm64);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- block_comment(buffer);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #endif
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -1668,7 +1668,7 @@ void MacroAssembler::mov_immediate32(Register dst, uint32_t imm32)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #ifndef PRODUCT
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- char buffer[64];
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- snprintf(buffer, sizeof(buffer), PTR32_FORMAT, imm32);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ snprintf(buffer, sizeof(buffer), "0x%"PRIX32, imm32);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- block_comment(buffer);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #endif
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- src/hotspot/cpu/aarch64/macroAssembler_aarch64.hpp.orig
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ src/hotspot/cpu/aarch64/macroAssembler_aarch64.hpp
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -27,6 +27,7 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #define CPU_AARCH64_VM_MACROASSEMBLER_AARCH64_HPP
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #include "asm/assembler.inline.hpp"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#include "runtime/vm_version.hpp"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- // MacroAssembler extends Assembler by frequently used macros.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- //
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -88,7 +89,7 @@ class MacroAssembler: public Assembler {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- = (operand_valid_for_logical_immediate(false /*is32*/,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- (uint64_t)Universe::narrow_klass_base())
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- && ((uint64_t)Universe::narrow_klass_base()
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- > (1UL << log2_intptr(Universe::narrow_klass_range()))));
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ > (1UL << log2_intptr((uintptr_t)Universe::narrow_klass_range()))));
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- // These routines should emit JVMTI PopFrame and ForceEarlyReturn handling code.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- src/hotspot/cpu/aarch64/sharedRuntime_aarch64.cpp.orig
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ src/hotspot/cpu/aarch64/sharedRuntime_aarch64.cpp
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -1,6 +1,7 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- /*
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- * Copyright (c) 2014, 2019, Red Hat Inc. All rights reserved.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * Copyright (c) 2021, Azul Systems, Inc. All rights reserved.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- *
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- * This code is free software; you can redistribute it and/or modify it
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -715,7 +716,7 @@ AdapterHandlerEntry* SharedRuntime::generate_i2c2i_adapters(MacroAssembler *masm
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- return AdapterHandlerLibrary::new_entry(fingerprint, i2c_entry, c2i_entry, c2i_unverified_entry);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--int SharedRuntime::c_calling_convention(const BasicType *sig_bt,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+static int c_calling_convention_priv(const BasicType *sig_bt,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- VMRegPair *regs,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- VMRegPair *regs2,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- int total_args_passed) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -746,6 +747,11 @@ int SharedRuntime::c_calling_convention(const BasicType *sig_bt,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if (int_args < Argument::n_int_register_parameters_c) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- regs[i].set1(INT_ArgReg[int_args++]->as_VMReg());
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- } else {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#ifdef __APPLE__
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // Less-than word types are stored one after another.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // The code is unable to handle this so bailout.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ return -1;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#endif
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- regs[i].set1(VMRegImpl::stack2reg(stk_args));
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- stk_args += 2;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -768,6 +774,11 @@ int SharedRuntime::c_calling_convention(const BasicType *sig_bt,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if (fp_args < Argument::n_float_register_parameters_c) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- regs[i].set1(FP_ArgReg[fp_args++]->as_VMReg());
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- } else {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#ifdef __APPLE__
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // Less-than word types are stored one after another.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // The code is unable to handle this so bailout.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ return -1;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#endif
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- regs[i].set1(VMRegImpl::stack2reg(stk_args));
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- stk_args += 2;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -794,6 +805,16 @@ int SharedRuntime::c_calling_convention(const BasicType *sig_bt,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- return stk_args;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+int SharedRuntime::c_calling_convention(const BasicType *sig_bt,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ VMRegPair *regs,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ VMRegPair *regs2,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ int total_args_passed)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+{
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ int result = c_calling_convention_priv(sig_bt, regs, regs2, total_args_passed);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ guarantee(result >= 0, "Unsupported arguments configuration");
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ return result;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- // On 64 bit we will store integer like items to the stack as
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- // 64 bits items (sparc abi) even though java would only store
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- // 32bits for a parameter. On 32bit it will simply be 32 bits
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -1340,7 +1361,11 @@ nmethod* SharedRuntime::generate_native_wrapper(MacroAssembler* masm,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- // Now figure out where the args must be stored and how much stack space
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- // they require.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- int out_arg_slots;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- out_arg_slots = c_calling_convention(out_sig_bt, out_regs, NULL, total_c_args);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ out_arg_slots = c_calling_convention_priv(out_sig_bt, out_regs, NULL, total_c_args);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (out_arg_slots < 0) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ return NULL;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- // Compute framesize for the wrapper. We need to handlize all oops in
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- // incoming registers
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- src/hotspot/cpu/aarch64/templateTable_aarch64.cpp.orig
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ src/hotspot/cpu/aarch64/templateTable_aarch64.cpp
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -94,10 +94,6 @@ static inline Address aaddress(Register r) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- return iaddress(r);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--static inline Address at_rsp() {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- return Address(esp, 0);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- // At top of Java expression stack which may be different than esp(). It
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- // isn't for category 1 objects.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- static inline Address at_tos () {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- src/hotspot/cpu/aarch64/vm_version_aarch64.hpp.orig
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ src/hotspot/cpu/aarch64/vm_version_aarch64.hpp
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -67,6 +67,9 @@ class VM_Version : public Abstract_VM_Version {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- return false;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // Arm can assign codes that are not published in the manual.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // Apple's code is defined in
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // https://github.com/apple/darwin-xnu/blob/33eb983/osfmk/arm/cpuid.h#L62
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- enum Family {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- CPU_ARM = 'A',
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- CPU_BROADCOM = 'B',
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -79,6 +82,7 @@ class VM_Version : public Abstract_VM_Version {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- CPU_QUALCOM = 'Q',
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- CPU_MARVELL = 'V',
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- CPU_INTEL = 'i',
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ CPU_APPLE = 'a',
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- };
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- enum Feature_Flag {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -111,6 +115,11 @@ class VM_Version : public Abstract_VM_Version {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- static int icache_line_size() { return _icache_line_size; }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- static int dcache_line_size() { return _dcache_line_size; }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#ifdef __APPLE__
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // Is the CPU running emulated (for example macOS Rosetta running x86_64 code on M1 ARM (aarch64)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ static bool is_cpu_emulated();
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#endif
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- };
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #endif // CPU_AARCH64_VM_VM_VERSION_AARCH64_HPP
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- src/hotspot/os/bsd/os_bsd.cpp.orig
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ src/hotspot/os/bsd/os_bsd.cpp
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -239,6 +239,8 @@ static char cpu_arch[] = "i386";
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- static char cpu_arch[] = "amd64";
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #elif defined(ARM)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- static char cpu_arch[] = "arm";
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#elif defined(AARCH64)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+static char cpu_arch[] = "aarch64";
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #elif defined(PPC32)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- static char cpu_arch[] = "ppc";
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #elif defined(SPARC)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -3069,20 +3071,17 @@ void os::Bsd::install_signal_handlers() {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- set_signal_handler(SIGXFSZ, true);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #if defined(__APPLE__)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- // In Mac OS X 10.4, CrashReporter will write a crash log for all 'fatal' signals, including
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- // signals caught and handled by the JVM. To work around this, we reset the mach task
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- // signal handler that's placed on our process by CrashReporter. This disables
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- // CrashReporter-based reporting.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- //
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- // This work-around is not necessary for 10.5+, as CrashReporter no longer intercedes
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- // on caught fatal signals.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- //
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- // Additionally, gdb installs both standard BSD signal handlers, and mach exception
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- // handlers. By replacing the existing task exception handler, we disable gdb's mach
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // lldb (gdb) installs both standard BSD signal handlers, and mach exception
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // handlers. By replacing the existing task exception handler, we disable lldb's mach
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- // exception handling, while leaving the standard BSD signal handlers functional.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ //
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // EXC_MASK_BAD_ACCESS needed by all architectures for NULL ptr checking
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // EXC_MASK_ARITHMETIC needed by all architectures for div by 0 checking
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // EXC_MASK_BAD_INSTRUCTION needed by aarch64 to initiate deoptimization
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- kern_return_t kr;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- kr = task_set_exception_ports(mach_task_self(),
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- EXC_MASK_BAD_ACCESS | EXC_MASK_ARITHMETIC,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ EXC_MASK_BAD_ACCESS | EXC_MASK_ARITHMETIC
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ AARCH64_ONLY(| EXC_MASK_BAD_INSTRUCTION),
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- MACH_PORT_NULL,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- EXCEPTION_STATE_IDENTITY,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- MACHINE_THREAD_STATE);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- /dev/null
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ src/hotspot/os_cpu/bsd_aarch64/atomic_bsd_aarch64.hpp
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -0,0 +1,82 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+/*
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * Copyright (c) 2014, 2019, Red Hat Inc. All rights reserved.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ *
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * This code is free software; you can redistribute it and/or modify it
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * under the terms of the GNU General Public License version 2 only, as
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * published by the Free Software Foundation.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ *
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * This code is distributed in the hope that it will be useful, but WITHOUT
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * version 2 for more details (a copy is included in the LICENSE file that
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * accompanied this code).
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ *
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * You should have received a copy of the GNU General Public License version
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * 2 along with this work; if not, write to the Free Software Foundation,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ *
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * or visit www.oracle.com if you need additional information or have any
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * questions.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ *
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#ifndef OS_CPU_BSD_AARCH64_VM_ATOMIC_BSD_AARCH64_HPP
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#define OS_CPU_BSD_AARCH64_VM_ATOMIC_BSD_AARCH64_HPP
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+// Implementation of class atomic
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+// Note that memory_order_conservative requires a full barrier after atomic stores.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+// See https://patchwork.kernel.org/patch/3575821/
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#define FULL_MEM_BARRIER __sync_synchronize()
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#define READ_MEM_BARRIER __atomic_thread_fence(__ATOMIC_ACQUIRE);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#define WRITE_MEM_BARRIER __atomic_thread_fence(__ATOMIC_RELEASE);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+template<size_t byte_size>
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+struct Atomic::PlatformAdd
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ : Atomic::AddAndFetch<Atomic::PlatformAdd<byte_size> >
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+{
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ template<typename I, typename D>
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ D add_and_fetch(I add_value, D volatile* dest, atomic_memory_order order) const {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ D res = __atomic_add_fetch(dest, add_value, __ATOMIC_RELEASE);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ FULL_MEM_BARRIER;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ return res;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+};
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+template<size_t byte_size>
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+template<typename T>
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+inline T Atomic::PlatformXchg<byte_size>::operator()(T exchange_value,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ T volatile* dest,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ atomic_memory_order order) const {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ STATIC_ASSERT(byte_size == sizeof(T));
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ T res = __atomic_exchange_n(dest, exchange_value, __ATOMIC_RELEASE);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ FULL_MEM_BARRIER;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ return res;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+template<size_t byte_size>
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+template<typename T>
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+inline T Atomic::PlatformCmpxchg<byte_size>::operator()(T exchange_value,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ T volatile* dest,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ T compare_value,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ atomic_memory_order order) const {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ STATIC_ASSERT(byte_size == sizeof(T));
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (order == memory_order_relaxed) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ T value = compare_value;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ __atomic_compare_exchange(dest, &value, &exchange_value, /*weak*/false,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ __ATOMIC_RELAXED, __ATOMIC_RELAXED);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ return value;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ } else {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ T value = compare_value;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ FULL_MEM_BARRIER;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ __atomic_compare_exchange(dest, &value, &exchange_value, /*weak*/false,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ __ATOMIC_RELAXED, __ATOMIC_RELAXED);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ FULL_MEM_BARRIER;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ return value;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#endif // OS_CPU_BSD_AARCH64_VM_ATOMIC_BSD_AARCH64_HPP
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- /dev/null
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ src/hotspot/os_cpu/bsd_aarch64/bytes_bsd_aarch64.inline.hpp
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -0,0 +1,55 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+/*
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * Copyright (c) 1999, 2021, Oracle and/or its affiliates. All rights reserved.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * Copyright (c) 2014, Red Hat Inc. All rights reserved.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ *
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * This code is free software; you can redistribute it and/or modify it
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * under the terms of the GNU General Public License version 2 only, as
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * published by the Free Software Foundation.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ *
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * This code is distributed in the hope that it will be useful, but WITHOUT
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * version 2 for more details (a copy is included in the LICENSE file that
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * accompanied this code).
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ *
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * You should have received a copy of the GNU General Public License version
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * 2 along with this work; if not, write to the Free Software Foundation,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ *
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * or visit www.oracle.com if you need additional information or have any
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * questions.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ *
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#ifndef OS_CPU_BSD_AARCH64_VM_BYTES_BSD_AARCH64_INLINE_HPP
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#define OS_CPU_BSD_AARCH64_VM_BYTES_BSD_AARCH64_INLINE_HPP
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#ifdef __APPLE__
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#include <libkern/OSByteOrder.h>
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#endif
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#if defined(__APPLE__)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+# define bswap_16(x) OSSwapInt16(x)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+# define bswap_32(x) OSSwapInt32(x)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+# define bswap_64(x) OSSwapInt64(x)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#else
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+# error "Unimplemented"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#endif
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+// Efficient swapping of data bytes from Java byte
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+// ordering to native byte ordering and vice versa.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+inline u2 Bytes::swap_u2(u2 x) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ return bswap_16(x);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+inline u4 Bytes::swap_u4(u4 x) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ return bswap_32(x);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+inline u8 Bytes::swap_u8(u8 x) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ return bswap_64(x);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#endif // OS_CPU_BSD_AARCH64_VM_BYTES_BSD_AARCH64_INLINE_HPP
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- /dev/null
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ src/hotspot/os_cpu/bsd_aarch64/copy_bsd_aarch64.inline.hpp
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -0,0 +1,188 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+/*
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * Copyright (c) 2014, Red Hat Inc. All rights reserved.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ *
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * This code is free software; you can redistribute it and/or modify it
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * under the terms of the GNU General Public License version 2 only, as
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * published by the Free Software Foundation.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ *
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * This code is distributed in the hope that it will be useful, but WITHOUT
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * version 2 for more details (a copy is included in the LICENSE file that
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * accompanied this code).
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ *
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * You should have received a copy of the GNU General Public License version
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * 2 along with this work; if not, write to the Free Software Foundation,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ *
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * or visit www.oracle.com if you need additional information or have any
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * questions.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ *
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#ifndef OS_CPU_BSD_AARCH64_VM_COPY_BSD_AARCH64_INLINE_HPP
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#define OS_CPU_BSD_AARCH64_VM_COPY_BSD_AARCH64_INLINE_HPP
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#define COPY_SMALL(from, to, count) \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+{ \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ long tmp0, tmp1, tmp2, tmp3; \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ long tmp4, tmp5, tmp6, tmp7; \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ __asm volatile( \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+" adr %[t0], 0f;\n" \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+" add %[t0], %[t0], %[cnt], lsl #5;\n" \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+" br %[t0];\n" \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+" .align 5;\n" \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+"0:" \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+" b 1f;\n" \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+" .align 5;\n" \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+" ldr %[t0], [%[s], #0];\n" \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+" str %[t0], [%[d], #0];\n" \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+" b 1f;\n" \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+" .align 5;\n" \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+" ldp %[t0], %[t1], [%[s], #0];\n" \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+" stp %[t0], %[t1], [%[d], #0];\n" \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+" b 1f;\n" \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+" .align 5;\n" \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+" ldp %[t0], %[t1], [%[s], #0];\n" \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+" ldr %[t2], [%[s], #16];\n" \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+" stp %[t0], %[t1], [%[d], #0];\n" \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+" str %[t2], [%[d], #16];\n" \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+" b 1f;\n" \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+" .align 5;\n" \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+" ldp %[t0], %[t1], [%[s], #0];\n" \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+" ldp %[t2], %[t3], [%[s], #16];\n" \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+" stp %[t0], %[t1], [%[d], #0];\n" \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+" stp %[t2], %[t3], [%[d], #16];\n" \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+" b 1f;\n" \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+" .align 5;\n" \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+" ldp %[t0], %[t1], [%[s], #0];\n" \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+" ldp %[t2], %[t3], [%[s], #16];\n" \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+" ldr %[t4], [%[s], #32];\n" \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+" stp %[t0], %[t1], [%[d], #0];\n" \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+" stp %[t2], %[t3], [%[d], #16];\n" \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+" str %[t4], [%[d], #32];\n" \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+" b 1f;\n" \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+" .align 5;\n" \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+" ldp %[t0], %[t1], [%[s], #0];\n" \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+" ldp %[t2], %[t3], [%[s], #16];\n" \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+" ldp %[t4], %[t5], [%[s], #32];\n" \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+"2:" \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+" stp %[t0], %[t1], [%[d], #0];\n" \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+" stp %[t2], %[t3], [%[d], #16];\n" \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+" stp %[t4], %[t5], [%[d], #32];\n" \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+" b 1f;\n" \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+" .align 5;\n" \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+" ldr %[t6], [%[s], #0];\n" \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+" ldp %[t0], %[t1], [%[s], #8];\n" \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+" ldp %[t2], %[t3], [%[s], #24];\n" \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+" ldp %[t4], %[t5], [%[s], #40];\n" \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+" str %[t6], [%[d]], #8;\n" \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+" b 2b;\n" \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+" .align 5;\n" \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+" ldp %[t0], %[t1], [%[s], #0];\n" \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+" ldp %[t2], %[t3], [%[s], #16];\n" \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+" ldp %[t4], %[t5], [%[s], #32];\n" \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+" ldp %[t6], %[t7], [%[s], #48];\n" \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+" stp %[t0], %[t1], [%[d], #0];\n" \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+" stp %[t2], %[t3], [%[d], #16];\n" \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+" stp %[t4], %[t5], [%[d], #32];\n" \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+" stp %[t6], %[t7], [%[d], #48];\n" \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+"1:" \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ : [s]"+r"(from), [d]"+r"(to), [cnt]"+r"(count), \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ [t0]"=&r"(tmp0), [t1]"=&r"(tmp1), [t2]"=&r"(tmp2), [t3]"=&r"(tmp3), \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ [t4]"=&r"(tmp4), [t5]"=&r"(tmp5), [t6]"=&r"(tmp6), [t7]"=&r"(tmp7) \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ : \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ : "memory", "cc"); \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+static void pd_conjoint_words(const HeapWord* from, HeapWord* to, size_t count) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ __asm volatile( "prfm pldl1strm, [%[s], #0];" :: [s]"r"(from) : "memory");
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (__builtin_expect(count <= 8, 1)) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ COPY_SMALL(from, to, count);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ return;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ _Copy_conjoint_words(from, to, count);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+static void pd_disjoint_words(const HeapWord* from, HeapWord* to, size_t count) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (__builtin_constant_p(count)) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ memcpy(to, from, count * sizeof(HeapWord));
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ return;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ __asm volatile( "prfm pldl1strm, [%[s], #0];" :: [s]"r"(from) : "memory");
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (__builtin_expect(count <= 8, 1)) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ COPY_SMALL(from, to, count);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ return;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ _Copy_disjoint_words(from, to, count);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+static void pd_disjoint_words_atomic(const HeapWord* from, HeapWord* to, size_t count) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ __asm volatile( "prfm pldl1strm, [%[s], #0];" :: [s]"r"(from) : "memory");
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (__builtin_expect(count <= 8, 1)) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ COPY_SMALL(from, to, count);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ return;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ _Copy_disjoint_words(from, to, count);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+static void pd_aligned_conjoint_words(const HeapWord* from, HeapWord* to, size_t count) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ pd_conjoint_words(from, to, count);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+static void pd_aligned_disjoint_words(const HeapWord* from, HeapWord* to, size_t count) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ pd_disjoint_words(from, to, count);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+static void pd_conjoint_bytes(const void* from, void* to, size_t count) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ (void)memmove(to, from, count);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+static void pd_conjoint_bytes_atomic(const void* from, void* to, size_t count) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ pd_conjoint_bytes(from, to, count);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+static void pd_conjoint_jshorts_atomic(const jshort* from, jshort* to, size_t count) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ _Copy_conjoint_jshorts_atomic(from, to, count);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+static void pd_conjoint_jints_atomic(const jint* from, jint* to, size_t count) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ _Copy_conjoint_jints_atomic(from, to, count);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+static void pd_conjoint_jlongs_atomic(const jlong* from, jlong* to, size_t count) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ _Copy_conjoint_jlongs_atomic(from, to, count);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+static void pd_conjoint_oops_atomic(const oop* from, oop* to, size_t count) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ assert(BytesPerLong == BytesPerOop, "jlongs and oops must be the same size");
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ _Copy_conjoint_jlongs_atomic((const jlong*)from, (jlong*)to, count);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+static void pd_arrayof_conjoint_bytes(const HeapWord* from, HeapWord* to, size_t count) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ _Copy_arrayof_conjoint_bytes(from, to, count);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+static void pd_arrayof_conjoint_jshorts(const HeapWord* from, HeapWord* to, size_t count) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ _Copy_arrayof_conjoint_jshorts(from, to, count);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+static void pd_arrayof_conjoint_jints(const HeapWord* from, HeapWord* to, size_t count) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ _Copy_arrayof_conjoint_jints(from, to, count);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+static void pd_arrayof_conjoint_jlongs(const HeapWord* from, HeapWord* to, size_t count) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ _Copy_arrayof_conjoint_jlongs(from, to, count);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+static void pd_arrayof_conjoint_oops(const HeapWord* from, HeapWord* to, size_t count) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ assert(!UseCompressedOops, "foo!");
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ assert(BytesPerLong == BytesPerOop, "jlongs and oops must be the same size");
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ _Copy_arrayof_conjoint_jlongs(from, to, count);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#endif // OS_CPU_BSD_AARCH64_VM_COPY_BSD_AARCH64_INLINE_HPP
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- /dev/null
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ src/hotspot/os_cpu/bsd_aarch64/copy_bsd_aarch64.s
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -0,0 +1,239 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+/*
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * Copyright (c) 2016, Linaro Ltd. All rights reserved.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ *
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * This code is free software; you can redistribute it and/or modify it
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * under the terms of the GNU General Public License version 2 only, as
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * published by the Free Software Foundation.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ *
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * This code is distributed in the hope that it will be useful, but WITHOUT
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * version 2 for more details (a copy is included in the LICENSE file that
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * accompanied this code).
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ *
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * You should have received a copy of the GNU General Public License version
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * 2 along with this work; if not, write to the Free Software Foundation,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ *
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * or visit www.oracle.com if you need additional information or have any
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * questions.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ *
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#define CFUNC(x) _##x
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ .global CFUNC(_Copy_conjoint_words)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ .global CFUNC(_Copy_disjoint_words)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+s .req x0
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+d .req x1
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+count .req x2
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+t0 .req x3
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+t1 .req x4
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+t2 .req x5
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+t3 .req x6
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+t4 .req x7
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+t5 .req x8
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+t6 .req x9
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+t7 .req x10
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ .align 6
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+CFUNC(_Copy_disjoint_words):
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // Ensure 2 word aligned
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ tbz s, #3, fwd_copy_aligned
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ ldr t0, [s], #8
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ str t0, [d], #8
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ sub count, count, #1
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+fwd_copy_aligned:
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // Bias s & d so we only pre index on the last copy
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ sub s, s, #16
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ sub d, d, #16
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ ldp t0, t1, [s, #16]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ ldp t2, t3, [s, #32]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ ldp t4, t5, [s, #48]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ ldp t6, t7, [s, #64]!
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ subs count, count, #16
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ blo fwd_copy_drain
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+fwd_copy_again:
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ prfm pldl1keep, [s, #256]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ stp t0, t1, [d, #16]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ ldp t0, t1, [s, #16]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ stp t2, t3, [d, #32]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ ldp t2, t3, [s, #32]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ stp t4, t5, [d, #48]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ ldp t4, t5, [s, #48]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ stp t6, t7, [d, #64]!
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ ldp t6, t7, [s, #64]!
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ subs count, count, #8
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ bhs fwd_copy_again
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+fwd_copy_drain:
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ stp t0, t1, [d, #16]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ stp t2, t3, [d, #32]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ stp t4, t5, [d, #48]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ stp t6, t7, [d, #64]!
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // count is now -8..-1 for 0..7 words to copy
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ adr t0, 0f
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ add t0, t0, count, lsl #5
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ br t0
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ .align 5
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ ret // -8 == 0 words
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ .align 5
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ ldr t0, [s, #16] // -7 == 1 word
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ str t0, [d, #16]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ ret
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ .align 5
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ ldp t0, t1, [s, #16] // -6 = 2 words
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ stp t0, t1, [d, #16]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ ret
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ .align 5
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ ldp t0, t1, [s, #16] // -5 = 3 words
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ ldr t2, [s, #32]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ stp t0, t1, [d, #16]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ str t2, [d, #32]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ ret
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ .align 5
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ ldp t0, t1, [s, #16] // -4 = 4 words
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ ldp t2, t3, [s, #32]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ stp t0, t1, [d, #16]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ stp t2, t3, [d, #32]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ ret
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ .align 5
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ ldp t0, t1, [s, #16] // -3 = 5 words
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ ldp t2, t3, [s, #32]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ ldr t4, [s, #48]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ stp t0, t1, [d, #16]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ stp t2, t3, [d, #32]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ str t4, [d, #48]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ ret
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ .align 5
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ ldp t0, t1, [s, #16] // -2 = 6 words
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ ldp t2, t3, [s, #32]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ ldp t4, t5, [s, #48]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ stp t0, t1, [d, #16]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ stp t2, t3, [d, #32]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ stp t4, t5, [d, #48]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ ret
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ .align 5
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ ldp t0, t1, [s, #16] // -1 = 7 words
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ ldp t2, t3, [s, #32]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ ldp t4, t5, [s, #48]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ ldr t6, [s, #64]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ stp t0, t1, [d, #16]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ stp t2, t3, [d, #32]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ stp t4, t5, [d, #48]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ str t6, [d, #64]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // Is always aligned here, code for 7 words is one instruction
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // too large so it just falls through.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ .align 5
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+0:
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ ret
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ .align 6
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+CFUNC(_Copy_conjoint_words):
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ sub t0, d, s
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ cmp t0, count, lsl #3
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ bhs CFUNC(_Copy_disjoint_words)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ add s, s, count, lsl #3
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ add d, d, count, lsl #3
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // Ensure 2 word aligned
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ tbz s, #3, bwd_copy_aligned
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ ldr t0, [s, #-8]!
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ str t0, [d, #-8]!
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ sub count, count, #1
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+bwd_copy_aligned:
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ ldp t0, t1, [s, #-16]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ ldp t2, t3, [s, #-32]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ ldp t4, t5, [s, #-48]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ ldp t6, t7, [s, #-64]!
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ subs count, count, #16
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ blo bwd_copy_drain
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+bwd_copy_again:
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ prfum pldl1keep, [s, #-256]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ stp t0, t1, [d, #-16]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ ldp t0, t1, [s, #-16]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ stp t2, t3, [d, #-32]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ ldp t2, t3, [s, #-32]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ stp t4, t5, [d, #-48]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ ldp t4, t5, [s, #-48]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ stp t6, t7, [d, #-64]!
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ ldp t6, t7, [s, #-64]!
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ subs count, count, #8
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ bhs bwd_copy_again
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+bwd_copy_drain:
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ stp t0, t1, [d, #-16]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ stp t2, t3, [d, #-32]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ stp t4, t5, [d, #-48]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ stp t6, t7, [d, #-64]!
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // count is now -8..-1 for 0..7 words to copy
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ adr t0, 0f
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ add t0, t0, count, lsl #5
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ br t0
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ .align 5
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ ret // -8 == 0 words
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ .align 5
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ ldr t0, [s, #-8] // -7 == 1 word
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ str t0, [d, #-8]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ ret
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ .align 5
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ ldp t0, t1, [s, #-16] // -6 = 2 words
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ stp t0, t1, [d, #-16]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ ret
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ .align 5
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ ldp t0, t1, [s, #-16] // -5 = 3 words
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ ldr t2, [s, #-24]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ stp t0, t1, [d, #-16]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ str t2, [d, #-24]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ ret
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ .align 5
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ ldp t0, t1, [s, #-16] // -4 = 4 words
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ ldp t2, t3, [s, #-32]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ stp t0, t1, [d, #-16]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ stp t2, t3, [d, #-32]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ ret
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ .align 5
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ ldp t0, t1, [s, #-16] // -3 = 5 words
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ ldp t2, t3, [s, #-32]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ ldr t4, [s, #-40]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ stp t0, t1, [d, #-16]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ stp t2, t3, [d, #-32]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ str t4, [d, #-40]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ ret
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ .align 5
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ ldp t0, t1, [s, #-16] // -2 = 6 words
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ ldp t2, t3, [s, #-32]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ ldp t4, t5, [s, #-48]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ stp t0, t1, [d, #-16]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ stp t2, t3, [d, #-32]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ stp t4, t5, [d, #-48]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ ret
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ .align 5
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ ldp t0, t1, [s, #-16] // -1 = 7 words
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ ldp t2, t3, [s, #-32]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ ldp t4, t5, [s, #-48]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ ldr t6, [s, #-56]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ stp t0, t1, [d, #-16]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ stp t2, t3, [d, #-32]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ stp t4, t5, [d, #-48]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ str t6, [d, #-56]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // Is always aligned here, code for 7 words is one instruction
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // too large so it just falls through.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ .align 5
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+0:
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ ret
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- /dev/null
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ src/hotspot/os_cpu/bsd_aarch64/globals_bsd_aarch64.hpp
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -0,0 +1,43 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+/*
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * Copyright (c) 2014, Red Hat Inc. All rights reserved.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ *
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * This code is free software; you can redistribute it and/or modify it
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * under the terms of the GNU General Public License version 2 only, as
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * published by the Free Software Foundation.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ *
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * This code is distributed in the hope that it will be useful, but WITHOUT
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * version 2 for more details (a copy is included in the LICENSE file that
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * accompanied this code).
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ *
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * You should have received a copy of the GNU General Public License version
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * 2 along with this work; if not, write to the Free Software Foundation,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ *
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * or visit www.oracle.com if you need additional information or have any
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * questions.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ *
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#ifndef OS_CPU_BSD_AARCH64_VM_GLOBALS_BSD_AARCH64_HPP
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#define OS_CPU_BSD_AARCH64_VM_GLOBALS_BSD_AARCH64_HPP
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+// Sets the default values for platform dependent flags used by the runtime system.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+// (see globals.hpp)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+define_pd_global(bool, DontYieldALot, false);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+define_pd_global(intx, ThreadStackSize, 2048); // 0 => use system default
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+define_pd_global(intx, VMThreadStackSize, 2048);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+define_pd_global(intx, CompilerThreadStackSize, 2048);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+define_pd_global(uintx,JVMInvokeMethodSlack, 8192);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+// Used on 64 bit platforms for UseCompressedOops base address
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+define_pd_global(uintx,HeapBaseMinAddress, 2*G);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#endif // OS_CPU_BSD_AARCH64_VM_GLOBALS_BSD_AARCH64_HPP
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- /dev/null
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ src/hotspot/os_cpu/bsd_aarch64/icache_bsd_aarch64.hpp
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -0,0 +1,45 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+/*
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * Copyright (c) 1999, 2021, Oracle and/or its affiliates. All rights reserved.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * Copyright (c) 2014, Red Hat Inc. All rights reserved.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * Copyright (c) 2021, Azul Systems, Inc. All rights reserved.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ *
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * This code is free software; you can redistribute it and/or modify it
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * under the terms of the GNU General Public License version 2 only, as
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * published by the Free Software Foundation.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ *
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * This code is distributed in the hope that it will be useful, but WITHOUT
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * version 2 for more details (a copy is included in the LICENSE file that
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * accompanied this code).
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ *
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * You should have received a copy of the GNU General Public License version
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * 2 along with this work; if not, write to the Free Software Foundation,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ *
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * or visit www.oracle.com if you need additional information or have any
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * questions.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ *
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#ifndef OS_CPU_BSD_AARCH64_ICACHE_AARCH64_HPP
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#define OS_CPU_BSD_AARCH64_ICACHE_AARCH64_HPP
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+// Interface for updating the instruction cache. Whenever the VM
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+// modifies code, part of the processor instruction cache potentially
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+// has to be flushed.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+class ICache : public AbstractICache {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ public:
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ static void initialize();
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ static void invalidate_word(address addr) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ __clear_cache((char *)addr, (char *)(addr + 4));
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ static void invalidate_range(address start, int nbytes) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ __clear_cache((char *)start, (char *)(start + nbytes));
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+};
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#endif // OS_CPU_BSD_AARCH64_ICACHE_AARCH64_HPP
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-\ No newline at end of file
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- /dev/null
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ src/hotspot/os_cpu/bsd_aarch64/orderAccess_bsd_aarch64.hpp
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -0,0 +1,54 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+/*
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * Copyright (c) 2014, 2019, Red Hat Inc. All rights reserved.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ *
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * This code is free software; you can redistribute it and/or modify it
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * under the terms of the GNU General Public License version 2 only, as
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * published by the Free Software Foundation.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ *
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * This code is distributed in the hope that it will be useful, but WITHOUT
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * version 2 for more details (a copy is included in the LICENSE file that
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * accompanied this code).
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ *
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * You should have received a copy of the GNU General Public License version
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * 2 along with this work; if not, write to the Free Software Foundation,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ *
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * or visit www.oracle.com if you need additional information or have any
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * questions.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ *
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#ifndef OS_CPU_BSD_AARCH64_VM_ORDERACCESS_BSD_AARCH64_HPP
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#define OS_CPU_BSD_AARCH64_VM_ORDERACCESS_BSD_AARCH64_HPP
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+// Included in orderAccess.hpp header file.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+// Implementation of class OrderAccess.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+inline void OrderAccess::loadload() { acquire(); }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+inline void OrderAccess::storestore() { release(); }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+inline void OrderAccess::loadstore() { acquire(); }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+inline void OrderAccess::storeload() { fence(); }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#define FULL_MEM_BARRIER __sync_synchronize()
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#define READ_MEM_BARRIER __atomic_thread_fence(__ATOMIC_ACQUIRE);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#define WRITE_MEM_BARRIER __atomic_thread_fence(__ATOMIC_RELEASE);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+inline void OrderAccess::acquire() {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ READ_MEM_BARRIER;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+inline void OrderAccess::release() {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ WRITE_MEM_BARRIER;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+inline void OrderAccess::fence() {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ FULL_MEM_BARRIER;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#endif // OS_CPU_BSD_AARCH64_VM_ORDERACCESS_BSD_AARCH64_HPP
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- /dev/null
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ src/hotspot/os_cpu/bsd_aarch64/os_bsd_aarch64.cpp
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -0,0 +1,753 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+/*
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * Copyright (c) 2014, Red Hat Inc. All rights reserved.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * Copyright (c) 2021, Azul Systems, Inc. All rights reserved.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ *
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * This code is free software; you can redistribute it and/or modify it
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * under the terms of the GNU General Public License version 2 only, as
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * published by the Free Software Foundation.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ *
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * This code is distributed in the hope that it will be useful, but WITHOUT
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * version 2 for more details (a copy is included in the LICENSE file that
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * accompanied this code).
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ *
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * You should have received a copy of the GNU General Public License version
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * 2 along with this work; if not, write to the Free Software Foundation,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ *
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * or visit www.oracle.com if you need additional information or have any
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * questions.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ *
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+// no precompiled headers
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#include "jvm.h"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#include "asm/macroAssembler.hpp"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#include "classfile/classLoader.hpp"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#include "classfile/systemDictionary.hpp"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#include "classfile/vmSymbols.hpp"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#include "code/codeCache.hpp"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#include "code/icBuffer.hpp"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#include "code/vtableStubs.hpp"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#include "interpreter/interpreter.hpp"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#include "logging/log.hpp"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#include "memory/allocation.inline.hpp"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#include "os_share_bsd.hpp"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#include "prims/jniFastGetField.hpp"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#include "prims/jvm_misc.hpp"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#include "runtime/arguments.hpp"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#include "runtime/extendedPC.hpp"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#include "runtime/frame.inline.hpp"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#include "runtime/interfaceSupport.inline.hpp"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#include "runtime/java.hpp"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#include "runtime/javaCalls.hpp"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#include "runtime/mutexLocker.hpp"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#include "runtime/osThread.hpp"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#include "runtime/sharedRuntime.hpp"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#include "runtime/stubRoutines.hpp"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#include "runtime/thread.inline.hpp"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#include "runtime/timer.hpp"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#include "utilities/align.hpp"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#include "utilities/events.hpp"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#include "utilities/vmError.hpp"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+// put OS-includes here
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+# include <sys/types.h>
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+# include <sys/mman.h>
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+# include <pthread.h>
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+# include <signal.h>
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+# include <errno.h>
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+# include <dlfcn.h>
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+# include <stdlib.h>
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+# include <stdio.h>
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+# include <unistd.h>
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+# include <sys/resource.h>
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+# include <sys/stat.h>
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+# include <sys/time.h>
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+# include <sys/utsname.h>
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+# include <sys/socket.h>
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+# include <sys/wait.h>
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+# include <pwd.h>
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+# include <poll.h>
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#ifndef __OpenBSD__
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ # include <ucontext.h>
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#endif
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#if !defined(__APPLE__) && !defined(__NetBSD__)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+# include <pthread_np.h>
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#endif
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#define SPELL_REG_SP "sp"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#define SPELL_REG_FP "fp"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#ifdef __APPLE__
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+// see darwin-xnu/osfmk/mach/arm/_structs.h
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+// 10.5 UNIX03 member name prefixes
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#define DU3_PREFIX(s, m) __ ## s.__ ## m
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#endif
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#define context_x uc_mcontext->DU3_PREFIX(ss,x)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#define context_fp uc_mcontext->DU3_PREFIX(ss,fp)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#define context_lr uc_mcontext->DU3_PREFIX(ss,lr)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#define context_sp uc_mcontext->DU3_PREFIX(ss,sp)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#define context_pc uc_mcontext->DU3_PREFIX(ss,pc)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#define context_cpsr uc_mcontext->DU3_PREFIX(ss,cpsr)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#define context_esr uc_mcontext->DU3_PREFIX(es,esr)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+address os::current_stack_pointer() {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#if defined(__clang__) || defined(__llvm__)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ void *sp;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ __asm__("mov %0, " SPELL_REG_SP : "=r"(sp));
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ return (address) sp;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#else
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ register void *sp __asm__ (SPELL_REG_SP);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ return (address) sp;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#endif
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+char* os::non_memory_address_word() {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // Must never look like an address returned by reserve_memory,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // even in its subfields (as defined by the CPU immediate fields,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // if the CPU splits constants across multiple instructions).
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // the return value used in computation of Universe::non_oop_word(), which
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // is loaded by cpu/aarch64 by MacroAssembler::movptr(Register, uintptr_t)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ return (char*) 0xffffffffffff;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+address os::Bsd::ucontext_get_pc(const ucontext_t * uc) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ return (address)uc->context_pc;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+void os::Bsd::ucontext_set_pc(ucontext_t * uc, address pc) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ uc->context_pc = (intptr_t)pc;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+intptr_t* os::Bsd::ucontext_get_sp(const ucontext_t * uc) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ return (intptr_t*)uc->context_sp;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+intptr_t* os::Bsd::ucontext_get_fp(const ucontext_t * uc) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ return (intptr_t*)uc->context_fp;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+// For Forte Analyzer AsyncGetCallTrace profiling support - thread
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+// is currently interrupted by SIGPROF.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+// os::Solaris::fetch_frame_from_ucontext() tries to skip nested signal
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+// frames. Currently we don't do that on Linux, so it's the same as
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+// os::fetch_frame_from_context().
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ExtendedPC os::Bsd::fetch_frame_from_ucontext(Thread* thread,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ const ucontext_t* uc, intptr_t** ret_sp, intptr_t** ret_fp) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ assert(thread != NULL, "just checking");
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ assert(ret_sp != NULL, "just checking");
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ assert(ret_fp != NULL, "just checking");
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ return os::fetch_frame_from_context(uc, ret_sp, ret_fp);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ExtendedPC os::fetch_frame_from_context(const void* ucVoid,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ intptr_t** ret_sp, intptr_t** ret_fp) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ ExtendedPC epc;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ const ucontext_t* uc = (const ucontext_t*)ucVoid;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (uc != NULL) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ epc = ExtendedPC(os::Bsd::ucontext_get_pc(uc));
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (ret_sp) *ret_sp = os::Bsd::ucontext_get_sp(uc);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (ret_fp) *ret_fp = os::Bsd::ucontext_get_fp(uc);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ } else {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // construct empty ExtendedPC for return value checking
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ epc = ExtendedPC(NULL);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (ret_sp) *ret_sp = (intptr_t *)NULL;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (ret_fp) *ret_fp = (intptr_t *)NULL;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ return epc;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+frame os::fetch_frame_from_context(const void* ucVoid) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ intptr_t* sp;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ intptr_t* fp;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ ExtendedPC epc = fetch_frame_from_context(ucVoid, &sp, &fp);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ return frame(sp, fp, epc.pc());
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+bool os::Bsd::get_frame_at_stack_banging_point(JavaThread* thread, ucontext_t* uc, frame* fr) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ address pc = (address) os::Bsd::ucontext_get_pc(uc);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (Interpreter::contains(pc)) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // interpreter performs stack banging after the fixed frame header has
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // been generated while the compilers perform it before. To maintain
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // semantic consistency between interpreted and compiled frames, the
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // method returns the Java sender of the current frame.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ *fr = os::fetch_frame_from_context(uc);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (!fr->is_first_java_frame()) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ assert(fr->safe_for_sender(thread), "Safety check");
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ *fr = fr->java_sender();
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ } else {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // more complex code with compiled code
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ assert(!Interpreter::contains(pc), "Interpreted methods should have been handled above");
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ CodeBlob* cb = CodeCache::find_blob(pc);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (cb == NULL || !cb->is_nmethod() || cb->is_frame_complete_at(pc)) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // Not sure where the pc points to, fallback to default
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // stack overflow handling
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ return false;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ } else {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // In compiled code, the stack banging is performed before LR
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // has been saved in the frame. LR is live, and SP and FP
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // belong to the caller.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ intptr_t* fp = os::Bsd::ucontext_get_fp(uc);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ intptr_t* sp = os::Bsd::ucontext_get_sp(uc);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ address pc = (address)(uc->context_lr
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ - NativeInstruction::instruction_size);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ *fr = frame(sp, fp, pc);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (!fr->is_java_frame()) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ assert(fr->safe_for_sender(thread), "Safety check");
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ assert(!fr->is_first_frame(), "Safety check");
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ *fr = fr->java_sender();
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ assert(fr->is_java_frame(), "Safety check");
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ return true;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+// JVM compiled with -fno-omit-frame-pointer, so RFP is saved on the stack.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+frame os::get_sender_for_C_frame(frame* fr) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ return frame(fr->link(), fr->link(), fr->sender_pc());
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+NOINLINE frame os::current_frame() {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ intptr_t *fp = *(intptr_t **)__builtin_frame_address(0);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ frame myframe((intptr_t*)os::current_stack_pointer(),
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ (intptr_t*)fp,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ CAST_FROM_FN_PTR(address, os::current_frame));
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (os::is_first_C_frame(&myframe)) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // stack is not walkable
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ return frame();
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ } else {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ return os::get_sender_for_C_frame(&myframe);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+// Utility functions
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+extern "C" JNIEXPORT int
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+JVM_handle_bsd_signal(int sig,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ siginfo_t* info,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ void* ucVoid,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ int abort_if_unrecognized) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ ucontext_t* uc = (ucontext_t*) ucVoid;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ Thread* t = Thread::current_or_null_safe();
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // Must do this before SignalHandlerMark, if crash protection installed we will longjmp away
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // (no destructors can be run)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ os::ThreadCrashProtection::check_crash_protection(sig, t);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ SignalHandlerMark shm(t);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // Note: it's not uncommon that JNI code uses signal/sigset to install
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // then restore certain signal handler (e.g. to temporarily block SIGPIPE,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // or have a SIGILL handler when detecting CPU type). When that happens,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // JVM_handle_bsd_signal() might be invoked with junk info/ucVoid. To
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // avoid unnecessary crash when libjsig is not preloaded, try handle signals
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // that do not require siginfo/ucontext first.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (sig == SIGPIPE || sig == SIGXFSZ) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // allow chained handler to go first
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (os::Bsd::chained_handler(sig, info, ucVoid)) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ return true;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ } else {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // Ignoring SIGPIPE/SIGXFSZ - see bugs 4229104 or 6499219
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ return true;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#ifdef CAN_SHOW_REGISTERS_ON_ASSERT
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if ((sig == SIGSEGV || sig == SIGBUS) && info != NULL && info->si_addr == g_assert_poison) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (handle_assert_poison_fault(ucVoid, info->si_addr)) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ return 1;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#endif
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ JavaThread* thread = NULL;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ VMThread* vmthread = NULL;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (os::Bsd::signal_handlers_are_installed) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (t != NULL ){
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if(t->is_Java_thread()) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ thread = (JavaThread*)t;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ else if(t->is_VM_thread()){
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ vmthread = (VMThread *)t;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // Handle SafeFetch faults:
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (uc != NULL) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ address const pc = (address) os::Bsd::ucontext_get_pc(uc);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (pc && StubRoutines::is_safefetch_fault(pc)) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ os::Bsd::ucontext_set_pc(uc, StubRoutines::continuation_for_safefetch_fault(pc));
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ return 1;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // decide if this trap can be handled by a stub
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ address stub = NULL;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ address pc = NULL;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ //%note os_trap_1
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (info != NULL && uc != NULL && thread != NULL) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ pc = (address) os::Bsd::ucontext_get_pc(uc);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // Handle ALL stack overflow variations here
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (sig == SIGSEGV || sig == SIGBUS) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ address addr = (address) info->si_addr;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // check if fault address is within thread stack
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (thread->on_local_stack(addr)) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ ThreadWXEnable wx(WXWrite, thread);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // stack overflow
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (thread->in_stack_yellow_reserved_zone(addr)) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (thread->thread_state() == _thread_in_Java) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (thread->in_stack_reserved_zone(addr)) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ frame fr;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (os::Bsd::get_frame_at_stack_banging_point(thread, uc, &fr)) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ assert(fr.is_java_frame(), "Must be a Java frame");
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ frame activation =
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ SharedRuntime::look_for_reserved_stack_annotated_method(thread, fr);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (activation.sp() != NULL) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ thread->disable_stack_reserved_zone();
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (activation.is_interpreted_frame()) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ thread->set_reserved_stack_activation((address)(
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ activation.fp() + frame::interpreter_frame_initial_sp_offset));
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ } else {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ thread->set_reserved_stack_activation((address)activation.unextended_sp());
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ return 1;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // Throw a stack overflow exception. Guard pages will be reenabled
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // while unwinding the stack.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ thread->disable_stack_yellow_reserved_zone();
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ stub = SharedRuntime::continuation_for_implicit_exception(thread, pc, SharedRuntime::STACK_OVERFLOW);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ } else {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // Thread was in the vm or native code. Return and try to finish.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ thread->disable_stack_yellow_reserved_zone();
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ return 1;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ } else if (thread->in_stack_red_zone(addr)) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // Fatal red zone violation. Disable the guard pages and fall through
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // to handle_unexpected_exception way down below.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ thread->disable_stack_red_zone();
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ tty->print_raw_cr("An irrecoverable stack overflow has occurred.");
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // We test if stub is already set (by the stack overflow code
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // above) so it is not overwritten by the code that follows. This
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // check is not required on other platforms, because on other
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // platforms we check for SIGSEGV only or SIGBUS only, where here
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // we have to check for both SIGSEGV and SIGBUS.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (thread->thread_state() == _thread_in_Java && stub == NULL) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // Java thread running in Java code => find exception handler if any
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // a fault inside compiled code, the interpreter, or a stub
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ ThreadWXEnable wx(WXWrite, thread);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // Handle signal from NativeJump::patch_verified_entry().
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if ((sig == SIGILL)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ && nativeInstruction_at(pc)->is_sigill_zombie_not_entrant()) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (TraceTraps) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ tty->print_cr("trap: zombie_not_entrant");
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ stub = SharedRuntime::get_handle_wrong_method_stub();
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ } else if ((sig == SIGSEGV || sig == SIGBUS) && os::is_poll_address((address)info->si_addr)) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ stub = SharedRuntime::get_poll_stub(pc);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#if defined(__APPLE__)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // 32-bit Darwin reports a SIGBUS for nearly all memory access exceptions.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // 64-bit Darwin may also use a SIGBUS (seen with compressed oops).
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // Catching SIGBUS here prevents the implicit SIGBUS NULL check below from
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // being called, so only do so if the implicit NULL check is not necessary.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ } else if (sig == SIGBUS && MacroAssembler::needs_explicit_null_check((intptr_t)info->si_addr)) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#else
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ } else if (sig == SIGBUS /* && info->si_code == BUS_OBJERR */) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#endif
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // BugId 4454115: A read from a MappedByteBuffer can fault
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // here if the underlying file has been truncated.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // Do not crash the VM in such a case.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ CodeBlob* cb = CodeCache::find_blob_unsafe(pc);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ CompiledMethod* nm = (cb != NULL) ? cb->as_compiled_method_or_null() : NULL;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if ((nm != NULL && nm->has_unsafe_access())) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ address next_pc = pc + NativeCall::instruction_size;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ stub = SharedRuntime::handle_unsafe_access(thread, next_pc);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ else
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (sig == SIGFPE &&
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ (info->si_code == FPE_INTDIV || info->si_code == FPE_FLTDIV)) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ stub =
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ SharedRuntime::
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ continuation_for_implicit_exception(thread,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ pc,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ SharedRuntime::
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ IMPLICIT_DIVIDE_BY_ZERO);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#ifdef __APPLE__
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ } else if (sig == SIGFPE && info->si_code == FPE_NOOP) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ Unimplemented();
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#endif /* __APPLE__ */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ } else if ((sig == SIGSEGV || sig == SIGBUS) &&
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ !MacroAssembler::needs_explicit_null_check((intptr_t)info->si_addr)) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // Determination of interpreter/vtable stub/compiled code null exception
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ stub = SharedRuntime::continuation_for_implicit_exception(thread, pc, SharedRuntime::IMPLICIT_NULL);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ } else if ((thread->thread_state() == _thread_in_vm ||
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ thread->thread_state() == _thread_in_native) &&
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ sig == SIGBUS && /* info->si_code == BUS_OBJERR && */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ thread->doing_unsafe_access()) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ address next_pc = pc + NativeCall::instruction_size;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ stub = SharedRuntime::handle_unsafe_access(thread, next_pc);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // jni_fast_Get<Primitive>Field can trap at certain pc's if a GC kicks in
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // and the heap gets shrunk before the field access.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if ((sig == SIGSEGV) || (sig == SIGBUS)) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ address addr = JNI_FastGetField::find_slowcase_pc(pc);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (addr != (address)-1) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ stub = addr;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // Check to see if we caught the safepoint code in the
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // process of write protecting the memory serialization page.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // It write enables the page immediately after protecting it
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // so we can just return to retry the write.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if ((sig == SIGSEGV) &&
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ os::is_memory_serialize_page(thread, (address) info->si_addr)) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // Block current thread until the memory serialize page permission restored.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ os::block_on_serialize_page_trap();
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ return true;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (stub != NULL) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // save all thread context in case we need to restore it
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (thread != NULL) thread->set_saved_exception_pc(pc);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ os::Bsd::ucontext_set_pc(uc, stub);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ return true;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // signal-chaining
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (os::Bsd::chained_handler(sig, info, ucVoid)) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ return true;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (!abort_if_unrecognized) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // caller wants another chance, so give it to him
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ return false;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (pc == NULL && uc != NULL) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ pc = os::Bsd::ucontext_get_pc(uc);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // unmask current signal
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ sigset_t newset;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ sigemptyset(&newset);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ sigaddset(&newset, sig);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ sigprocmask(SIG_UNBLOCK, &newset, NULL);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ VMError::report_and_die(t, sig, pc, info, ucVoid);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ ShouldNotReachHere();
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ return true; // Mute compiler
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+void os::Bsd::init_thread_fpu_state(void) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+bool os::is_allocatable(size_t bytes) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ return true;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+////////////////////////////////////////////////////////////////////////////////
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+// thread stack
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+// Minimum usable stack sizes required to get to user code. Space for
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+// HotSpot guard pages is added later.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+size_t os::Posix::_compiler_thread_min_stack_allowed = 72 * K;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+size_t os::Posix::_java_thread_min_stack_allowed = 72 * K;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+size_t os::Posix::_vm_internal_thread_min_stack_allowed = 72 * K;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+// return default stack size for thr_type
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+size_t os::Posix::default_stack_size(os::ThreadType thr_type) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // default stack size (compiler thread needs larger stack)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ size_t s = (thr_type == os::compiler_thread ? 4 * M : 1 * M);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ return s;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+static void current_stack_region(address * bottom, size_t * size) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#ifdef __APPLE__
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ pthread_t self = pthread_self();
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ void *stacktop = pthread_get_stackaddr_np(self);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ *size = pthread_get_stacksize_np(self);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ *bottom = (address) stacktop - *size;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#elif defined(__OpenBSD__)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ stack_t ss;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ int rslt = pthread_stackseg_np(pthread_self(), &ss);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (rslt != 0)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ fatal("pthread_stackseg_np failed with error = %d", rslt);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ *bottom = (address)((char *)ss.ss_sp - ss.ss_size);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ *size = ss.ss_size;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#else
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ pthread_attr_t attr;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ int rslt = pthread_attr_init(&attr);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // JVM needs to know exact stack location, abort if it fails
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (rslt != 0)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ fatal("pthread_attr_init failed with error = %d", rslt);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ rslt = pthread_attr_get_np(pthread_self(), &attr);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (rslt != 0)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ fatal("pthread_attr_get_np failed with error = %d", rslt);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (pthread_attr_getstackaddr(&attr, (void **)bottom) != 0 ||
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ pthread_attr_getstacksize(&attr, size) != 0) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ fatal("Can not locate current stack attributes!");
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ pthread_attr_destroy(&attr);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#endif
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ assert(os::current_stack_pointer() >= *bottom &&
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ os::current_stack_pointer() < *bottom + *size, "just checking");
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+address os::current_stack_base() {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ address bottom;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ size_t size;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ current_stack_region(&bottom, &size);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ return (bottom + size);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+size_t os::current_stack_size() {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // stack size includes normal stack and HotSpot guard pages
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ address bottom;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ size_t size;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ current_stack_region(&bottom, &size);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ return size;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+/////////////////////////////////////////////////////////////////////////////
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+// helper functions for fatal error handler
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+void os::print_context(outputStream *st, const void *context) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (context == NULL) return;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ const ucontext_t *uc = (const ucontext_t*)context;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ st->print_cr("Registers:");
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ st->print( " x0=" INTPTR_FORMAT, (intptr_t)uc->context_x[ 0]);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ st->print(" x1=" INTPTR_FORMAT, (intptr_t)uc->context_x[ 1]);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ st->print(" x2=" INTPTR_FORMAT, (intptr_t)uc->context_x[ 2]);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ st->print(" x3=" INTPTR_FORMAT, (intptr_t)uc->context_x[ 3]);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ st->cr();
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ st->print( " x4=" INTPTR_FORMAT, (intptr_t)uc->context_x[ 4]);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ st->print(" x5=" INTPTR_FORMAT, (intptr_t)uc->context_x[ 5]);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ st->print(" x6=" INTPTR_FORMAT, (intptr_t)uc->context_x[ 6]);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ st->print(" x7=" INTPTR_FORMAT, (intptr_t)uc->context_x[ 7]);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ st->cr();
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ st->print( " x8=" INTPTR_FORMAT, (intptr_t)uc->context_x[ 8]);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ st->print(" x9=" INTPTR_FORMAT, (intptr_t)uc->context_x[ 9]);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ st->print(" x10=" INTPTR_FORMAT, (intptr_t)uc->context_x[10]);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ st->print(" x11=" INTPTR_FORMAT, (intptr_t)uc->context_x[11]);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ st->cr();
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ st->print( "x12=" INTPTR_FORMAT, (intptr_t)uc->context_x[12]);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ st->print(" x13=" INTPTR_FORMAT, (intptr_t)uc->context_x[13]);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ st->print(" x14=" INTPTR_FORMAT, (intptr_t)uc->context_x[14]);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ st->print(" x15=" INTPTR_FORMAT, (intptr_t)uc->context_x[15]);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ st->cr();
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ st->print( "x16=" INTPTR_FORMAT, (intptr_t)uc->context_x[16]);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ st->print(" x17=" INTPTR_FORMAT, (intptr_t)uc->context_x[17]);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ st->print(" x18=" INTPTR_FORMAT, (intptr_t)uc->context_x[18]);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ st->print(" x19=" INTPTR_FORMAT, (intptr_t)uc->context_x[19]);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ st->cr();
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ st->print( "x20=" INTPTR_FORMAT, (intptr_t)uc->context_x[20]);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ st->print(" x21=" INTPTR_FORMAT, (intptr_t)uc->context_x[21]);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ st->print(" x22=" INTPTR_FORMAT, (intptr_t)uc->context_x[22]);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ st->print(" x23=" INTPTR_FORMAT, (intptr_t)uc->context_x[23]);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ st->cr();
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ st->print( "x24=" INTPTR_FORMAT, (intptr_t)uc->context_x[24]);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ st->print(" x25=" INTPTR_FORMAT, (intptr_t)uc->context_x[25]);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ st->print(" x26=" INTPTR_FORMAT, (intptr_t)uc->context_x[26]);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ st->print(" x27=" INTPTR_FORMAT, (intptr_t)uc->context_x[27]);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ st->cr();
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ st->print( "x28=" INTPTR_FORMAT, (intptr_t)uc->context_x[28]);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ st->print(" fp=" INTPTR_FORMAT, (intptr_t)uc->context_fp);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ st->print(" lr=" INTPTR_FORMAT, (intptr_t)uc->context_lr);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ st->print(" sp=" INTPTR_FORMAT, (intptr_t)uc->context_sp);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ st->cr();
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ st->print( "pc=" INTPTR_FORMAT, (intptr_t)uc->context_pc);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ st->print(" cpsr=" INTPTR_FORMAT, (intptr_t)uc->context_cpsr);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ st->cr();
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ intptr_t *sp = (intptr_t *)os::Bsd::ucontext_get_sp(uc);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ st->print_cr("Top of Stack: (sp=" INTPTR_FORMAT ")", (intptr_t)sp);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ print_hex_dump(st, (address)sp, (address)(sp + 8*sizeof(intptr_t)), sizeof(intptr_t));
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ st->cr();
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // Note: it may be unsafe to inspect memory near pc. For example, pc may
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // point to garbage if entry point in an nmethod is corrupted. Leave
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // this at the end, and hope for the best.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ address pc = os::Bsd::ucontext_get_pc(uc);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ print_instructions(st, pc, sizeof(char));
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ st->cr();
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+void os::print_register_info(outputStream *st, const void *context) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (context == NULL) return;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ const ucontext_t *uc = (const ucontext_t*)context;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ st->print_cr("Register to memory mapping:");
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ st->cr();
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // this is horrendously verbose but the layout of the registers in the
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // context does not match how we defined our abstract Register set, so
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // we can't just iterate through the gregs area
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // this is only for the "general purpose" registers
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ st->print(" x0="); print_location(st, uc->context_x[ 0]);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ st->print(" x1="); print_location(st, uc->context_x[ 1]);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ st->print(" x2="); print_location(st, uc->context_x[ 2]);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ st->print(" x3="); print_location(st, uc->context_x[ 3]);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ st->print(" x4="); print_location(st, uc->context_x[ 4]);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ st->print(" x5="); print_location(st, uc->context_x[ 5]);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ st->print(" x6="); print_location(st, uc->context_x[ 6]);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ st->print(" x7="); print_location(st, uc->context_x[ 7]);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ st->print(" x8="); print_location(st, uc->context_x[ 8]);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ st->print(" x9="); print_location(st, uc->context_x[ 9]);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ st->print("x10="); print_location(st, uc->context_x[10]);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ st->print("x11="); print_location(st, uc->context_x[11]);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ st->print("x12="); print_location(st, uc->context_x[12]);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ st->print("x13="); print_location(st, uc->context_x[13]);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ st->print("x14="); print_location(st, uc->context_x[14]);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ st->print("x15="); print_location(st, uc->context_x[15]);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ st->print("x16="); print_location(st, uc->context_x[16]);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ st->print("x17="); print_location(st, uc->context_x[17]);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ st->print("x18="); print_location(st, uc->context_x[18]);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ st->print("x19="); print_location(st, uc->context_x[19]);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ st->print("x20="); print_location(st, uc->context_x[20]);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ st->print("x21="); print_location(st, uc->context_x[21]);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ st->print("x22="); print_location(st, uc->context_x[22]);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ st->print("x23="); print_location(st, uc->context_x[23]);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ st->print("x24="); print_location(st, uc->context_x[24]);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ st->print("x25="); print_location(st, uc->context_x[25]);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ st->print("x26="); print_location(st, uc->context_x[26]);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ st->print("x27="); print_location(st, uc->context_x[27]);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ st->print("x28="); print_location(st, uc->context_x[28]);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ st->cr();
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+void os::setup_fpu() {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#ifndef PRODUCT
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+void os::verify_stack_alignment() {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ assert(((intptr_t)os::current_stack_pointer() & (StackAlignmentInBytes-1)) == 0, "incorrect stack alignment");
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#endif
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+int os::extra_bang_size_in_bytes() {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // AArch64 does not require the additional stack bang.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ return 0;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+void os::current_thread_enable_wx(WXMode mode) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ pthread_jit_write_protect_np(mode == WXExec);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+extern "C" {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ int SpinPause() {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ return 0;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ void _Copy_conjoint_jshorts_atomic(const jshort* from, jshort* to, size_t count) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (from > to) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ const jshort *end = from + count;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ while (from < end)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ *(to++) = *(from++);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ else if (from < to) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ const jshort *end = from;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ from += count - 1;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ to += count - 1;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ while (from >= end)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ *(to--) = *(from--);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ void _Copy_conjoint_jints_atomic(const jint* from, jint* to, size_t count) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (from > to) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ const jint *end = from + count;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ while (from < end)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ *(to++) = *(from++);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ else if (from < to) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ const jint *end = from;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ from += count - 1;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ to += count - 1;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ while (from >= end)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ *(to--) = *(from--);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ void _Copy_conjoint_jlongs_atomic(const jlong* from, jlong* to, size_t count) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (from > to) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ const jlong *end = from + count;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ while (from < end)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ os::atomic_copy64(from++, to++);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ else if (from < to) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ const jlong *end = from;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ from += count - 1;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ to += count - 1;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ while (from >= end)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ os::atomic_copy64(from--, to--);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ void _Copy_arrayof_conjoint_bytes(const HeapWord* from,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ HeapWord* to,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ size_t count) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ memmove(to, from, count);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ void _Copy_arrayof_conjoint_jshorts(const HeapWord* from,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ HeapWord* to,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ size_t count) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ memmove(to, from, count * 2);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ void _Copy_arrayof_conjoint_jints(const HeapWord* from,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ HeapWord* to,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ size_t count) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ memmove(to, from, count * 4);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ void _Copy_arrayof_conjoint_jlongs(const HeapWord* from,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ HeapWord* to,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ size_t count) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ memmove(to, from, count * 8);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+};
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- /dev/null
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ src/hotspot/os_cpu/bsd_aarch64/os_bsd_aarch64.hpp
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -0,0 +1,42 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+/*
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * Copyright (c) 1999, 2020, Oracle and/or its affiliates. All rights reserved.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * Copyright (c) 2014, Red Hat Inc. All rights reserved.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ *
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * This code is free software; you can redistribute it and/or modify it
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * under the terms of the GNU General Public License version 2 only, as
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * published by the Free Software Foundation.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ *
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * This code is distributed in the hope that it will be useful, but WITHOUT
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * version 2 for more details (a copy is included in the LICENSE file that
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * accompanied this code).
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ *
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * You should have received a copy of the GNU General Public License version
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * 2 along with this work; if not, write to the Free Software Foundation,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ *
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * or visit www.oracle.com if you need additional information or have any
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * questions.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ *
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#ifndef OS_CPU_BSD_AARCH64_VM_OS_BSD_AARCH64_HPP
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#define OS_CPU_BSD_AARCH64_VM_OS_BSD_AARCH64_HPP
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ static void setup_fpu();
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ static bool is_allocatable(size_t bytes);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // Used to register dynamic code cache area with the OS
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // Note: Currently only used in 64 bit Windows implementations
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ static bool register_code_area(char *low, char *high) { return true; }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // Atomically copy 64 bits of data
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ static void atomic_copy64(const volatile void *src, volatile void *dst) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ *(jlong *) dst = *(const jlong *) src;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#endif // OS_CPU_BSD_AARCH64_VM_OS_BSD_AARCH64_HPP
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- /dev/null
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ src/hotspot/os_cpu/bsd_aarch64/pauth_bsd_aarch64.inline.hpp
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -0,0 +1,53 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+/*
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * Copyright (c) 2021, Arm Limited. All rights reserved.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ *
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * This code is free software; you can redistribute it and/or modify it
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * under the terms of the GNU General Public License version 2 only, as
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * published by the Free Software Foundation.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ *
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * This code is distributed in the hope that it will be useful, but WITHOUT
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * version 2 for more details (a copy is included in the LICENSE file that
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * accompanied this code).
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ *
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * You should have received a copy of the GNU General Public License version
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * 2 along with this work; if not, write to the Free Software Foundation,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ *
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * or visit www.oracle.com if you need additional information or have any
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * questions.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ *
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#ifndef OS_CPU_BSD_AARCH64_VM_PAUTH_BSD_AARCH64_INLINE_HPP
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#define OS_CPU_BSD_AARCH64_VM_PAUTH_BSD_AARCH64_INLINE_HPP
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#ifdef __APPLE__
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#include <ptrauth.h>
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#endif
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+// Only the PAC instructions in the NOP space can be used. This ensures the
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+// binaries work on systems without PAC. Write these instructions using their
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+// alternate "hint" instructions to ensure older compilers can still be used.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+// For Apple, use the provided interface as this may provide additional
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+// optimization.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#define XPACLRI "hint #0x7;"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+inline address pauth_strip_pointer(address ptr) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#ifdef __APPLE__
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ return ptrauth_strip(ptr, ptrauth_key_asib);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#else
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ register address result __asm__("x30") = ptr;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ asm (XPACLRI : "+r"(result));
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ return result;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#endif
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#undef XPACLRI
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#endif // OS_CPU_BSD_AARCH64_VM_PAUTH_BSD_AARCH64_INLINE_HPP
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- /dev/null
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ src/hotspot/os_cpu/bsd_aarch64/prefetch_bsd_aarch64.inline.hpp
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -0,0 +1,42 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+/*
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * Copyright (c) 2014, Red Hat Inc. All rights reserved.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ *
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * This code is free software; you can redistribute it and/or modify it
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * under the terms of the GNU General Public License version 2 only, as
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * published by the Free Software Foundation.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ *
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * This code is distributed in the hope that it will be useful, but WITHOUT
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * version 2 for more details (a copy is included in the LICENSE file that
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * accompanied this code).
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ *
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * You should have received a copy of the GNU General Public License version
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * 2 along with this work; if not, write to the Free Software Foundation,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ *
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * or visit www.oracle.com if you need additional information or have any
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * questions.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ *
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#ifndef OS_CPU_BSD_AARCH64_VM_PREFETCH_BSD_AARCH64_INLINE_HPP
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#define OS_CPU_BSD_AARCH64_VM_PREFETCH_BSD_AARCH64_INLINE_HPP
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#include "runtime/prefetch.hpp"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+inline void Prefetch::read (void *loc, intx interval) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (interval >= 0)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ asm("prfm PLDL1KEEP, [%0, %1]" : : "r"(loc), "r"(interval));
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+inline void Prefetch::write(void *loc, intx interval) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (interval >= 0)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ asm("prfm PSTL1KEEP, [%0, %1]" : : "r"(loc), "r"(interval));
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#endif // OS_CPU_BSD_AARCH64_VM_PREFETCH_BSD_AARCH64_INLINE_HPP
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- /dev/null
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ src/hotspot/os_cpu/bsd_aarch64/thread_bsd_aarch64.cpp
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -0,0 +1,104 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+/*
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * Copyright (c) 2003, 2021, Oracle and/or its affiliates. All rights reserved.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * Copyright (c) 2014, Red Hat Inc. All rights reserved.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ *
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * This code is free software; you can redistribute it and/or modify it
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * under the terms of the GNU General Public License version 2 only, as
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * published by the Free Software Foundation.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ *
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * This code is distributed in the hope that it will be useful, but WITHOUT
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * version 2 for more details (a copy is included in the LICENSE file that
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * accompanied this code).
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ *
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * You should have received a copy of the GNU General Public License version
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * 2 along with this work; if not, write to the Free Software Foundation,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ *
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * or visit www.oracle.com if you need additional information or have any
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * questions.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ *
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#include "precompiled.hpp"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#include "memory/metaspaceShared.hpp"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#include "runtime/frame.inline.hpp"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#include "runtime/thread.inline.hpp"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+frame JavaThread::pd_last_frame() {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ assert(has_last_Java_frame(), "must have last_Java_sp() when suspended");
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ vmassert(_anchor.last_Java_pc() != NULL, "not walkable");
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ return frame(_anchor.last_Java_sp(), _anchor.last_Java_fp(), _anchor.last_Java_pc());
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+// For Forte Analyzer AsyncGetCallTrace profiling support - thread is
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+// currently interrupted by SIGPROF
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+bool JavaThread::pd_get_top_frame_for_signal_handler(frame* fr_addr,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ void* ucontext, bool isInJava) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ assert(Thread::current() == this, "caller must be current thread");
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ return pd_get_top_frame(fr_addr, ucontext, isInJava);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+bool JavaThread::pd_get_top_frame_for_profiling(frame* fr_addr, void* ucontext, bool isInJava) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ return pd_get_top_frame(fr_addr, ucontext, isInJava);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+bool JavaThread::pd_get_top_frame(frame* fr_addr, void* ucontext, bool isInJava) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ assert(this->is_Java_thread(), "must be JavaThread");
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ JavaThread* jt = (JavaThread *)this;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // If we have a last_Java_frame, then we should use it even if
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // isInJava == true. It should be more reliable than ucontext info.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (jt->has_last_Java_frame() && jt->frame_anchor()->walkable()) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ *fr_addr = jt->pd_last_frame();
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ return true;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // At this point, we don't have a last_Java_frame, so
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // we try to glean some information out of the ucontext
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // if we were running Java code when SIGPROF came in.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (isInJava) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ ucontext_t* uc = (ucontext_t*) ucontext;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ intptr_t* ret_fp;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ intptr_t* ret_sp;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ ExtendedPC addr = os::fetch_frame_from_context(uc, &ret_sp, &ret_fp);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (addr.pc() == NULL || ret_sp == NULL ) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // ucontext wasn't useful
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ return false;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (MetaspaceShared::is_in_trampoline_frame(addr.pc())) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // In the middle of a trampoline call. Bail out for safety.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // This happens rarely so shouldn't affect profiling.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ return false;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ frame ret_frame(ret_sp, ret_fp, addr.pc());
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (!ret_frame.safe_for_sender(jt)) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#ifdef COMPILER2
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ frame ret_frame2(ret_sp, NULL, addr.pc());
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (!ret_frame2.safe_for_sender(jt)) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // nothing else to try if the frame isn't good
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ return false;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ ret_frame = ret_frame2;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#else
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // nothing else to try if the frame isn't good
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ return false;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#endif /* COMPILER2 */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ *fr_addr = ret_frame;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ return true;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // nothing else to try
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ return false;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+void JavaThread::cache_global_variables() { }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- /dev/null
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ src/hotspot/os_cpu/bsd_aarch64/thread_bsd_aarch64.hpp
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -0,0 +1,74 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+/*
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * Copyright (c) 2000, 2021, Oracle and/or its affiliates. All rights reserved.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * Copyright (c) 2014, Red Hat Inc. All rights reserved.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * Copyright (c) 2021, Azul Systems, Inc. All rights reserved.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ *
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * This code is free software; you can redistribute it and/or modify it
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * under the terms of the GNU General Public License version 2 only, as
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * published by the Free Software Foundation.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ *
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * This code is distributed in the hope that it will be useful, but WITHOUT
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * version 2 for more details (a copy is included in the LICENSE file that
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * accompanied this code).
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ *
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * You should have received a copy of the GNU General Public License version
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * 2 along with this work; if not, write to the Free Software Foundation,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ *
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * or visit www.oracle.com if you need additional information or have any
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * questions.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ *
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#ifndef OS_CPU_BSD_AARCH64_VM_THREAD_BSD_AARCH64_HPP
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#define OS_CPU_BSD_AARCH64_VM_THREAD_BSD_AARCH64_HPP
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ private:
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ void pd_initialize() {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ _anchor.clear();
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ frame pd_last_frame();
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ public:
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // Mutators are highly dangerous....
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ intptr_t* last_Java_fp() { return _anchor.last_Java_fp(); }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ void set_last_Java_fp(intptr_t* fp) { _anchor.set_last_Java_fp(fp); }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ void set_base_of_stack_pointer(intptr_t* base_sp) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ static ByteSize last_Java_fp_offset() {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ return byte_offset_of(JavaThread, _anchor) + JavaFrameAnchor::last_Java_fp_offset();
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ intptr_t* base_of_stack_pointer() {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ return NULL;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ void record_base_of_stack_pointer() {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ bool pd_get_top_frame_for_signal_handler(frame* fr_addr, void* ucontext,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ bool isInJava);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ bool pd_get_top_frame_for_profiling(frame* fr_addr, void* ucontext, bool isInJava);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+private:
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ bool pd_get_top_frame(frame* fr_addr, void* ucontext, bool isInJava);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+public:
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ static Thread *aarch64_get_thread_helper() {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ return Thread::current();
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // These routines are only used on cpu architectures that
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // have separate register stacks (Itanium).
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ static bool register_stack_overflow() { return false; }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ static void enable_register_stack_guard() {}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ static void disable_register_stack_guard() {}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#endif // OS_CPU_BSD_AARCH64_VM_THREAD_BSD_AARCH64_HPP
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- /dev/null
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ src/hotspot/os_cpu/bsd_aarch64/vmStructs_bsd_aarch64.hpp
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -0,0 +1,54 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+/*
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * Copyright (c) 2000, 2021, Oracle and/or its affiliates. All rights reserved.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * Copyright (c) 2014, Red Hat Inc. All rights reserved.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ *
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * This code is free software; you can redistribute it and/or modify it
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * under the terms of the GNU General Public License version 2 only, as
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * published by the Free Software Foundation.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ *
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * This code is distributed in the hope that it will be useful, but WITHOUT
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * version 2 for more details (a copy is included in the LICENSE file that
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * accompanied this code).
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ *
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * You should have received a copy of the GNU General Public License version
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * 2 along with this work; if not, write to the Free Software Foundation,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ *
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * or visit www.oracle.com if you need additional information or have any
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * questions.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ *
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#ifndef OS_CPU_BSD_AARCH64_VM_VMSTRUCTS_BSD_AARCH64_HPP
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#define OS_CPU_BSD_AARCH64_VM_VMSTRUCTS_BSD_AARCH64_HPP
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+// These are the OS and CPU-specific fields, types and integer
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+// constants required by the Serviceability Agent. This file is
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+// referenced by vmStructs.cpp.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#define VM_STRUCTS_OS_CPU(nonstatic_field, static_field, unchecked_nonstatic_field, volatile_nonstatic_field, nonproduct_nonstatic_field, c2_nonstatic_field, unchecked_c1_static_field, unchecked_c2_static_field) \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ /******************************/ \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ /* Threads (NOTE: incomplete) */ \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ /******************************/ \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ nonstatic_field(OSThread, _thread_id, OSThread::thread_id_t) \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ nonstatic_field(OSThread, _unique_thread_id, uint64_t)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#define VM_TYPES_OS_CPU(declare_type, declare_toplevel_type, declare_oop_type, declare_integer_type, declare_unsigned_integer_type, declare_c1_toplevel_type, declare_c2_type, declare_c2_toplevel_type) \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ /**********************/ \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ /* Thread IDs */ \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ /**********************/ \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ declare_unsigned_integer_type(OSThread::thread_id_t)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#define VM_INT_CONSTANTS_OS_CPU(declare_constant, declare_preprocessor_constant, declare_c1_constant, declare_c2_constant, declare_c2_preprocessor_constant)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#define VM_LONG_CONSTANTS_OS_CPU(declare_constant, declare_preprocessor_constant, declare_c1_constant, declare_c2_constant, declare_c2_preprocessor_constant)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#endif // OS_CPU_BSD_AARCH64_VM_VMSTRUCTS_BSD_AARCH64_HPP
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- /dev/null
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ src/hotspot/os_cpu/bsd_aarch64/vm_version_bsd_aarch64.cpp
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -0,0 +1,89 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+/*
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * Copyright (c) 2006, 2019, Oracle and/or its affiliates. All rights reserved.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * Copyright (c) 2014, 2019, Red Hat Inc. All rights reserved.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * Copyright (c) 2021, Azul Systems, Inc. All rights reserved.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ *
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * This code is free software; you can redistribute it and/or modify it
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * under the terms of the GNU General Public License version 2 only, as
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * published by the Free Software Foundation.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ *
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * This code is distributed in the hope that it will be useful, but WITHOUT
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * version 2 for more details (a copy is included in the LICENSE file that
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * accompanied this code).
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ *
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * You should have received a copy of the GNU General Public License version
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * 2 along with this work; if not, write to the Free Software Foundation,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ *
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * or visit www.oracle.com if you need additional information or have any
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * questions.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ *
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#include "precompiled.hpp"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#include "runtime/java.hpp"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#include "runtime/os.hpp"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#include "runtime/vm_version.hpp"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#include <sys/sysctl.h>
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+static bool cpu_has(const char* optional) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ uint32_t val;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ size_t len = sizeof(val);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (sysctlbyname(optional, &val, &len, NULL, 0)) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ return false;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ return val;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+void VM_Version::get_os_cpu_info() {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ size_t sysctllen;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // hw.optional.floatingpoint always returns 1, see
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // https://github.com/apple/darwin-xnu/blob/master/bsd/kern/kern_mib.c#L416.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // ID_AA64PFR0_EL1 describes AdvSIMD always equals to FP field.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ assert(cpu_has("hw.optional.floatingpoint"), "should be");
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ assert(cpu_has("hw.optional.neon"), "should be");
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ _features = CPU_FP | CPU_ASIMD;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // Only few features are available via sysctl, see line 614
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // https://opensource.apple.com/source/xnu/xnu-6153.141.1/bsd/kern/kern_mib.c.auto.html
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (cpu_has("hw.optional.armv8_crc32")) _features |= CPU_CRC32;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (cpu_has("hw.optional.armv8_1_atomics")) _features |= CPU_LSE;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ int cache_line_size;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ int hw_conf_cache_line[] = { CTL_HW, HW_CACHELINE };
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ sysctllen = sizeof(cache_line_size);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (sysctl(hw_conf_cache_line, 2, &cache_line_size, &sysctllen, NULL, 0)) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ cache_line_size = 16;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ _icache_line_size = 16; // minimal line lenght CCSIDR_EL1 can hold
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ _dcache_line_size = cache_line_size;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ uint64_t dczid_el0;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ __asm__ (
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ "mrs %0, DCZID_EL0\n"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ : "=r"(dczid_el0)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ );
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (!(dczid_el0 & 0x10)) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ _zva_length = 4 << (dczid_el0 & 0xf);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ int family;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ sysctllen = sizeof(family);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (sysctlbyname("hw.cpufamily", &family, &sysctllen, NULL, 0)) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ family = 0;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ _model = family;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ _cpu = CPU_APPLE;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#ifdef __APPLE__
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+bool VM_Version::is_cpu_emulated() {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ return false;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#endif
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-\ No newline at end of file
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- src/hotspot/share/c1/c1_Runtime1.cpp.orig
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ src/hotspot/share/c1/c1_Runtime1.cpp
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -834,6 +834,10 @@ static Klass* resolve_field_return_klass(const methodHandle& caller, int bci, TR
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- JRT_ENTRY(void, Runtime1::patch_code(JavaThread* thread, Runtime1::StubID stub_id ))
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- NOT_PRODUCT(_patch_code_slowcase_cnt++;)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // Enable WXWrite: the function is called by c1 stub as a runtime function
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // (see another implementation above).
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ MACOS_AARCH64_ONLY(ThreadWXEnable wx(WXWrite, thread));
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- ResourceMark rm(thread);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- RegisterMap reg_map(thread, false);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- frame runtime_frame = thread->last_frame();
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- src/hotspot/share/interpreter/interpreterRuntime.cpp.orig
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ src/hotspot/share/interpreter/interpreterRuntime.cpp
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -1015,6 +1015,9 @@ IRT_END
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- nmethod* InterpreterRuntime::frequency_counter_overflow(JavaThread* thread, address branch_bcp) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // Enable WXWrite: the function is called directly by interpreter.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ MACOS_AARCH64_ONLY(ThreadWXEnable wx(WXWrite, thread));
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- nmethod* nm = frequency_counter_overflow_inner(thread, branch_bcp);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- assert(branch_bcp != NULL || nm == NULL, "always returns null for non OSR requests");
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if (branch_bcp != NULL && nm != NULL) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- src/hotspot/share/interpreter/oopMapCache.cpp.orig
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ src/hotspot/share/interpreter/oopMapCache.cpp
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -241,6 +241,8 @@ class MaskFillerForNative: public NativeSignatureIterator {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- public:
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ void pass_byte() { /* ignore */ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ void pass_short() { /* ignore */ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- void pass_int() { /* ignore */ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- void pass_long() { /* ignore */ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- void pass_float() { /* ignore */ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- src/hotspot/share/jvmci/jvmciEnv.hpp.orig
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ src/hotspot/share/jvmci/jvmciEnv.hpp
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -37,6 +37,7 @@ class CompileTask;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- // Bring the JVMCI compiler thread into the VM state.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #define JVMCI_VM_ENTRY_MARK \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- JavaThread* thread = JavaThread::current(); \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ MACOS_AARCH64_ONLY(ThreadWXEnable __wx(WXWrite, thread)); \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- ThreadInVMfromNative __tiv(thread); \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- ResetNoHandleMark rnhm; \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- HandleMarkCleaner __hm(thread); \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- src/hotspot/share/opto/runtime.cpp.orig
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ src/hotspot/share/opto/runtime.cpp
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -68,6 +68,7 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #include "runtime/sharedRuntime.hpp"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #include "runtime/signature.hpp"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #include "runtime/threadCritical.hpp"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#include "runtime/threadWXSetters.inline.hpp"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #include "runtime/vframe.hpp"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #include "runtime/vframeArray.hpp"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #include "runtime/vframe_hp.hpp"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -1444,6 +1445,10 @@ address OptoRuntime::handle_exception_C(JavaThread* thread) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- // *THIS IS NOT RECOMMENDED PROGRAMMING STYLE*
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- //
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- address OptoRuntime::rethrow_C(oopDesc* exception, JavaThread* thread, address ret_pc) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // Enable WXWrite: the function called directly by compiled code.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ MACOS_AARCH64_ONLY(ThreadWXEnable wx(WXWrite, thread));
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #ifndef PRODUCT
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- SharedRuntime::_rethrow_ctr++; // count rethrows
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #endif
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- src/hotspot/share/prims/jni.cpp.orig
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ src/hotspot/share/prims/jni.cpp
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -1,6 +1,7 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- /*
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- * Copyright (c) 1997, 2021, Oracle and/or its affiliates. All rights reserved.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- * Copyright (c) 2012 Red Hat, Inc.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * Copyright (c) 2021, Azul Systems, Inc. All rights reserved.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- *
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- * This code is free software; you can redistribute it and/or modify it
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -4055,6 +4056,7 @@ static jint JNI_CreateJavaVM_inner(JavaVM **vm, void **penv, void *args) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- // Since this is not a JVM_ENTRY we have to set the thread state manually before leaving.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- ThreadStateTransition::transition_and_fence(thread, _thread_in_vm, _thread_in_native);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ MACOS_AARCH64_ONLY(thread->enable_wx(WXExec));
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- } else {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- // If create_vm exits because of a pending exception, exit with that
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- // exception. In the future when we figure out how to reclaim memory,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -4210,6 +4212,7 @@ static jint attach_current_thread(JavaVM *vm, void **penv, void *_args, bool dae
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- thread->record_stack_base_and_size();
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- thread->register_thread_stack_with_NMT();
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- thread->initialize_thread_current();
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ MACOS_AARCH64_ONLY(thread->init_wx());
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if (!os::create_attached_thread(thread)) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- thread->smr_delete();
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -4284,6 +4287,7 @@ static jint attach_current_thread(JavaVM *vm, void **penv, void *_args, bool dae
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- // needed.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- ThreadStateTransition::transition_and_fence(thread, _thread_in_vm, _thread_in_native);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ MACOS_AARCH64_ONLY(thread->enable_wx(WXExec));
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- // Perform any platform dependent FPU setup
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- os::setup_fpu();
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -4354,6 +4358,10 @@ jint JNICALL jni_DetachCurrentThread(JavaVM *vm) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- thread->exit(false, JavaThread::jni_detach);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- thread->smr_delete();
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // Go to the execute mode, the initial state of the thread on creation.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // Use os interface as the thread is not a JavaThread anymore.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ MACOS_AARCH64_ONLY(os::current_thread_enable_wx(WXExec));
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- HOTSPOT_JNI_DETACHCURRENTTHREAD_RETURN(JNI_OK);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- return JNI_OK;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- src/hotspot/share/prims/jniCheck.cpp.orig
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ src/hotspot/share/prims/jniCheck.cpp
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -100,6 +100,7 @@ extern "C" { \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if (env != xenv) { \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- NativeReportJNIFatalError(thr, warn_wrong_jnienv); \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- } \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ MACOS_AARCH64_ONLY(ThreadWXEnable __wx(WXWrite, thr)); \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- VM_ENTRY_BASE(result_type, header, thr)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- src/hotspot/share/prims/jniFastGetField.hpp.orig
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ src/hotspot/share/prims/jniFastGetField.hpp
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -65,6 +65,11 @@ class JNI_FastGetField : AllStatic {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- static address generate_fast_get_int_field0(BasicType type);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- static address generate_fast_get_float_field0(BasicType type);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#ifdef AARCH64
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ template<int BType>
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ static address generate_fast_get_int_field1();
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#endif // AARCH64
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- public:
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #if defined(_WINDOWS) && !defined(_WIN64)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- static GetBooleanField_t jni_fast_GetBooleanField_fp;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- src/hotspot/share/prims/jvmtiEnter.xsl.orig
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ src/hotspot/share/prims/jvmtiEnter.xsl
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -432,6 +432,8 @@ struct jvmtiInterface_1_ jvmti</xsl:text>
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- <xsl:if test="count(@impl)=0 or not(contains(@impl,'innative'))">
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- <xsl:text>JavaThread* current_thread = (JavaThread*)this_thread;</xsl:text>
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- <xsl:value-of select="$space"/>
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ <xsl:text>MACOS_AARCH64_ONLY(ThreadWXEnable __wx(WXWrite, current_thread));</xsl:text>
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ <xsl:value-of select="$space"/>
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- <xsl:text>ThreadInVMfromNative __tiv(current_thread);</xsl:text>
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- <xsl:value-of select="$space"/>
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- <xsl:text>VM_ENTRY_BASE(jvmtiError, </xsl:text>
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- src/hotspot/share/prims/jvmtiEnv.cpp.orig
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ src/hotspot/share/prims/jvmtiEnv.cpp
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -172,6 +172,7 @@ JvmtiEnv::GetThreadLocalStorage(jthread thread, void** data_ptr) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- // other than the current thread is required we need to transition
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- // from native so as to resolve the jthread.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ MACOS_AARCH64_ONLY(ThreadWXEnable __wx(WXWrite, current_thread));
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- ThreadInVMfromNative __tiv(current_thread);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- VM_ENTRY_BASE(jvmtiError, JvmtiEnv::GetThreadLocalStorage , current_thread)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- debug_only(VMNativeEntryWrapper __vew;)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- src/hotspot/share/prims/whitebox.inline.hpp.orig
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ src/hotspot/share/prims/whitebox.inline.hpp
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -1,5 +1,5 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- /*
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * Copyright (c) 2018, 2021, Oracle and/or its affiliates. All rights reserved.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- *
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- * This code is free software; you can redistribute it and/or modify it
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -31,7 +31,8 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- // Entry macro to transition from JNI to VM state.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #define WB_ENTRY(result_type, header) JNI_ENTRY(result_type, header) \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- ClearPendingJniExcCheck _clearCheck(env);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ ClearPendingJniExcCheck _clearCheck(env); \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ MACOS_AARCH64_ONLY(ThreadWXEnable _wx(WXWrite, thread));
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #define WB_END JNI_END
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- src/hotspot/share/runtime/deoptimization.cpp.orig
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ src/hotspot/share/runtime/deoptimization.cpp
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -54,6 +54,7 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #include "runtime/stubRoutines.hpp"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #include "runtime/thread.hpp"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #include "runtime/threadSMR.hpp"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#include "runtime/threadWXSetters.inline.hpp"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #include "runtime/vframe.hpp"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #include "runtime/vframeArray.hpp"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #include "runtime/vframe_hp.hpp"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -2079,6 +2080,9 @@ Deoptimization::update_method_data_from_interpreter(MethodData* trap_mdo, int tr
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- Deoptimization::UnrollBlock* Deoptimization::uncommon_trap(JavaThread* thread, jint trap_request, jint exec_mode) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // Enable WXWrite: current function is called from methods compiled by C2 directly
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ MACOS_AARCH64_ONLY(ThreadWXEnable wx(WXWrite, thread));
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if (TraceDeoptimization) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- tty->print("Uncommon trap ");
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- src/hotspot/share/runtime/interfaceSupport.inline.hpp.orig
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ src/hotspot/share/runtime/interfaceSupport.inline.hpp
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -1,5 +1,6 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- /*
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * Copyright (c) 2021, Azul Systems, Inc. All rights reserved.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- *
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- * This code is free software; you can redistribute it and/or modify it
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -32,6 +33,7 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #include "runtime/safepointMechanism.inline.hpp"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #include "runtime/safepointVerifiers.hpp"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #include "runtime/thread.hpp"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#include "runtime/threadWXSetters.inline.hpp"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #include "runtime/vmOperations.hpp"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #include "utilities/globalDefinitions.hpp"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #include "utilities/macros.hpp"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -403,6 +405,8 @@ class RuntimeHistogramElement : public HistogramElement {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #define VM_LEAF_BASE(result_type, header) \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- TRACE_CALL(result_type, header) \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- debug_only(NoHandleMark __hm;) \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ MACOS_AARCH64_ONLY(ThreadWXEnable __wx(WXWrite, \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ Thread::current())); \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- os::verify_stack_alignment(); \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- /* begin of body */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -440,6 +444,7 @@ class RuntimeHistogramElement : public HistogramElement {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #define IRT_ENTRY(result_type, header) \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- result_type header { \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ MACOS_AARCH64_ONLY(ThreadWXEnable __wx(WXWrite, thread)); \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- ThreadInVMfromJava __tiv(thread); \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- VM_ENTRY_BASE(result_type, header, thread) \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- debug_only(VMEntryWrapper __vew;)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -453,6 +458,7 @@ class RuntimeHistogramElement : public HistogramElement {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #define IRT_ENTRY_NO_ASYNC(result_type, header) \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- result_type header { \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ MACOS_AARCH64_ONLY(ThreadWXEnable __wx(WXWrite, thread)); \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- ThreadInVMfromJavaNoAsyncException __tiv(thread); \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- VM_ENTRY_BASE(result_type, header, thread) \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- debug_only(VMEntryWrapper __vew;)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -461,6 +467,7 @@ class RuntimeHistogramElement : public HistogramElement {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #define JRT_ENTRY(result_type, header) \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- result_type header { \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ MACOS_AARCH64_ONLY(ThreadWXEnable __wx(WXWrite, thread)); \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- ThreadInVMfromJava __tiv(thread); \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- VM_ENTRY_BASE(result_type, header, thread) \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- debug_only(VMEntryWrapper __vew;)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -474,7 +481,8 @@ class RuntimeHistogramElement : public HistogramElement {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #define JRT_ENTRY_NO_ASYNC(result_type, header) \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- result_type header { \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- ThreadInVMfromJavaNoAsyncException __tiv(thread); \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ MACOS_AARCH64_ONLY(ThreadWXEnable __wx(WXWrite, thread)); \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ ThreadInVMfromJava __tiv(thread); \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- VM_ENTRY_BASE(result_type, header, thread) \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- debug_only(VMEntryWrapper __vew;)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -482,6 +490,7 @@ class RuntimeHistogramElement : public HistogramElement {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- // to get back into Java from the VM
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #define JRT_BLOCK_ENTRY(result_type, header) \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- result_type header { \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ MACOS_AARCH64_ONLY(ThreadWXEnable __wx(WXWrite, thread)); \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- TRACE_CALL(result_type, header) \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- HandleMarkCleaner __hm(thread);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -512,6 +521,7 @@ extern "C" { \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- result_type JNICALL header { \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- JavaThread* thread=JavaThread::thread_from_jni_environment(env); \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- assert( !VerifyJNIEnvThread || (thread == Thread::current()), "JNIEnv is only valid in same thread"); \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ MACOS_AARCH64_ONLY(ThreadWXEnable __wx(WXWrite, thread)); \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- ThreadInVMfromNative __tiv(thread); \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- debug_only(VMNativeEntryWrapper __vew;) \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- VM_ENTRY_BASE(result_type, header, thread)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -524,6 +534,7 @@ extern "C" { \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- result_type JNICALL header { \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- JavaThread* thread=JavaThread::thread_from_jni_environment(env); \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- assert( !VerifyJNIEnvThread || (thread == Thread::current()), "JNIEnv is only valid in same thread"); \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ MACOS_AARCH64_ONLY(ThreadWXEnable __wx(WXWrite, thread)); \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- ThreadInVMfromNative __tiv(thread); \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- debug_only(VMNativeEntryWrapper __vew;) \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- VM_QUICK_ENTRY_BASE(result_type, header, thread)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -548,6 +559,7 @@ extern "C" { \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- extern "C" { \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- result_type JNICALL header { \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- JavaThread* thread=JavaThread::thread_from_jni_environment(env); \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ MACOS_AARCH64_ONLY(ThreadWXEnable __wx(WXWrite, thread)); \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- ThreadInVMfromNative __tiv(thread); \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- debug_only(VMNativeEntryWrapper __vew;) \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- VM_ENTRY_BASE(result_type, header, thread)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -557,6 +569,7 @@ extern "C" { \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- extern "C" { \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- result_type JNICALL header { \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- JavaThread* thread = JavaThread::current(); \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ MACOS_AARCH64_ONLY(ThreadWXEnable __wx(WXWrite, thread)); \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- ThreadInVMfromNative __tiv(thread); \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- debug_only(VMNativeEntryWrapper __vew;) \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- VM_ENTRY_BASE(result_type, header, thread)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -566,6 +579,7 @@ extern "C" { \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- extern "C" { \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- result_type JNICALL header { \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- JavaThread* thread=JavaThread::thread_from_jni_environment(env); \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ MACOS_AARCH64_ONLY(ThreadWXEnable __wx(WXWrite, thread)); \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- ThreadInVMfromNative __tiv(thread); \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- debug_only(VMNativeEntryWrapper __vew;) \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- VM_QUICK_ENTRY_BASE(result_type, header, thread)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- src/hotspot/share/runtime/javaCalls.cpp.orig
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ src/hotspot/share/runtime/javaCalls.cpp
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -1,5 +1,6 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- /*
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * Copyright (c) 2021, Azul Systems, Inc. All rights reserved.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- *
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- * This code is free software; you can redistribute it and/or modify it
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -79,7 +80,6 @@ JavaCallWrapper::JavaCallWrapper(const methodHandle& callee_method, Handle recei
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- // Make sure to set the oop's after the thread transition - since we can block there. No one is GC'ing
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- // the JavaCallWrapper before the entry frame is on the stack.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- _callee_method = callee_method();
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -113,12 +113,16 @@ JavaCallWrapper::JavaCallWrapper(const methodHandle& callee_method, Handle recei
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if (_anchor.last_Java_sp() == NULL) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- _thread->record_base_of_stack_pointer();
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ MACOS_AARCH64_ONLY(_thread->enable_wx(WXExec));
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- JavaCallWrapper::~JavaCallWrapper() {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- assert(_thread == JavaThread::current(), "must still be the same thread");
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ MACOS_AARCH64_ONLY(_thread->enable_wx(WXWrite));
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- // restore previous handle block & Java frame linkage
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- JNIHandleBlock *_old_handles = _thread->active_handles();
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- _thread->set_active_handles(_handles);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- src/hotspot/share/runtime/os.hpp.orig
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ src/hotspot/share/runtime/os.hpp
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -81,6 +81,11 @@ enum ThreadPriority { // JLS 20.20.1-3
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- CriticalPriority = 11 // Critical thread priority
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- };
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+enum WXMode {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ WXWrite,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ WXExec
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+};
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- // Executable parameter flag for os::commit_memory() and
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- // os::commit_memory_or_exit().
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- const bool ExecMem = true;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -964,6 +969,11 @@ class os: AllStatic {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- bool _done;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- };
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#if defined(__APPLE__) && defined(AARCH64)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // Enables write or execute access to writeable and executable pages.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ static void current_thread_enable_wx(WXMode mode);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#endif // __APPLE__ && AARCH64
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #ifndef _WINDOWS
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- // Suspend/resume support
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- // Protocol:
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- src/hotspot/share/runtime/safefetch.inline.hpp.orig
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ src/hotspot/share/runtime/safefetch.inline.hpp
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -26,16 +26,27 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #define SHARE_RUNTIME_SAFEFETCH_INLINE_HPP
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #include "runtime/stubRoutines.hpp"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#include "runtime/threadWXSetters.inline.hpp"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- // Safefetch allows to load a value from a location that's not known
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- // to be valid. If the load causes a fault, the error value is returned.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- inline int SafeFetch32(int* adr, int errValue) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- assert(StubRoutines::SafeFetch32_stub(), "stub not yet generated");
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#if defined(__APPLE__) && defined(AARCH64)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ Thread* thread = Thread::current_or_null_safe();
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ assert(thread != NULL, "required for W^X management");
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ ThreadWXEnable wx(WXExec, thread);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#endif // __APPLE__ && AARCH64
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- return StubRoutines::SafeFetch32_stub()(adr, errValue);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- inline intptr_t SafeFetchN(intptr_t* adr, intptr_t errValue) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- assert(StubRoutines::SafeFetchN_stub(), "stub not yet generated");
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#if defined(__APPLE__) && defined(AARCH64)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ Thread* thread = Thread::current_or_null_safe();
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ assert(thread != NULL, "required for W^X management");
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ ThreadWXEnable wx(WXExec, thread);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#endif // __APPLE__ && AARCH64
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- return StubRoutines::SafeFetchN_stub()(adr, errValue);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- src/hotspot/share/runtime/safepoint.cpp.orig
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ src/hotspot/share/runtime/safepoint.cpp
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -61,6 +61,7 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #include "runtime/synchronizer.hpp"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #include "runtime/thread.inline.hpp"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #include "runtime/threadSMR.hpp"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#include "runtime/threadWXSetters.inline.hpp"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #include "runtime/timerTrace.hpp"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #include "services/runtimeService.hpp"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #include "utilities/events.hpp"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -954,6 +955,9 @@ void SafepointSynchronize::handle_polling_page_exception(JavaThread *thread) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- assert(SafepointSynchronize::is_synchronizing(), "polling encountered outside safepoint synchronization");
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // Enable WXWrite: the function is called implicitly from java code.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ MACOS_AARCH64_ONLY(ThreadWXEnable wx(WXWrite, thread));
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if (PrintSafepointStatistics) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- inc_page_trap_count();
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- src/hotspot/share/runtime/signature.hpp.orig
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ src/hotspot/share/runtime/signature.hpp
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -1,5 +1,6 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- /*
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * Copyright (c) 1997, 2021, Oracle and/or its affiliates. All rights reserved.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * Copyright (c) 2021, Azul Systems, Inc. All rights reserved.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- *
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- * This code is free software; you can redistribute it and/or modify it
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -282,16 +283,16 @@ class NativeSignatureIterator: public SignatureIterator {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- int _prepended; // number of prepended JNI parameters (1 JNIEnv, plus 1 mirror if static)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- int _jni_offset; // the current parameter offset, starting with 0
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- void do_bool () { pass_int(); _jni_offset++; _offset++; }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- void do_char () { pass_int(); _jni_offset++; _offset++; }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ void do_bool () { pass_byte(); _jni_offset++; _offset++; }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ void do_char () { pass_short(); _jni_offset++; _offset++; }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- void do_float () { pass_float(); _jni_offset++; _offset++; }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #ifdef _LP64
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- void do_double() { pass_double(); _jni_offset++; _offset += 2; }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #else
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- void do_double() { pass_double(); _jni_offset += 2; _offset += 2; }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #endif
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- void do_byte () { pass_int(); _jni_offset++; _offset++; }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- void do_short () { pass_int(); _jni_offset++; _offset++; }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ void do_byte () { pass_byte(); _jni_offset++; _offset++; }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ void do_short () { pass_short(); _jni_offset++; _offset++; }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- void do_int () { pass_int(); _jni_offset++; _offset++; }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #ifdef _LP64
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- void do_long () { pass_long(); _jni_offset++; _offset += 2; }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -312,6 +313,8 @@ class NativeSignatureIterator: public SignatureIterator {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- virtual void pass_long() = 0;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- virtual void pass_object() = 0;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- virtual void pass_float() = 0;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ virtual void pass_byte() { pass_int(); };
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ virtual void pass_short() { pass_int(); };
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #ifdef _LP64
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- virtual void pass_double() = 0;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #else
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- src/hotspot/share/runtime/stubRoutines.cpp.orig
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ src/hotspot/share/runtime/stubRoutines.cpp
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -289,6 +289,8 @@ void StubRoutines::initialize2() {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #ifdef ASSERT
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ MACOS_AARCH64_ONLY(os::current_thread_enable_wx(WXExec));
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #define TEST_ARRAYCOPY(type) \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- test_arraycopy_func( type##_arraycopy(), sizeof(type)); \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- test_arraycopy_func( type##_disjoint_arraycopy(), sizeof(type)); \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -369,6 +371,8 @@ void StubRoutines::initialize2() {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- test_safefetchN();
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #endif
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ MACOS_AARCH64_ONLY(os::current_thread_enable_wx(WXWrite));
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #endif
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- src/hotspot/share/runtime/thread.cpp.orig
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ src/hotspot/share/runtime/thread.cpp
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -1,5 +1,6 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- /*
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * Copyright (c) 2021, Azul Systems, Inc. All rights reserved.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- *
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- * This code is free software; you can redistribute it and/or modify it
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -97,6 +98,7 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #include "runtime/threadCritical.hpp"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #include "runtime/threadSMR.inline.hpp"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #include "runtime/threadStatisticalInfo.hpp"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#include "runtime/threadWXSetters.inline.hpp"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #include "runtime/timer.hpp"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #include "runtime/timerTrace.hpp"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #include "runtime/vframe.inline.hpp"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -317,6 +319,8 @@ Thread::Thread() {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if (barrier_set != NULL) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- barrier_set->on_thread_create(this);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ MACOS_AARCH64_ONLY(DEBUG_ONLY(_wx_init = false));
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- void Thread::initialize_thread_current() {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -370,6 +374,8 @@ void Thread::call_run() {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- register_thread_stack_with_NMT();
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ MACOS_AARCH64_ONLY(this->init_wx());
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- JFR_ONLY(Jfr::on_thread_start(this);)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- log_debug(os, thread)("Thread " UINTX_FORMAT " stack dimensions: "
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -2538,6 +2544,9 @@ void JavaThread::check_safepoint_and_suspend_for_native_trans(JavaThread *thread
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- // Note only the native==>VM/Java barriers can call this function and when
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- // thread state is _thread_in_native_trans.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- void JavaThread::check_special_condition_for_native_trans(JavaThread *thread) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // Enable WXWrite: called directly from interpreter native wrapper.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ MACOS_AARCH64_ONLY(ThreadWXEnable wx(WXWrite, thread));
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- check_safepoint_and_suspend_for_native_trans(thread);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if (thread->has_async_exception()) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -3682,6 +3691,8 @@ jint Threads::create_vm(JavaVMInitArgs* args, bool* canTryAgain) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- // Initialize the os module
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- os::init();
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ MACOS_AARCH64_ONLY(os::current_thread_enable_wx(WXWrite));
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- // Record VM creation timing statistics
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- TraceVmCreationTime create_vm_timer;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- create_vm_timer.start();
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -3785,6 +3796,7 @@ jint Threads::create_vm(JavaVMInitArgs* args, bool* canTryAgain) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- main_thread->record_stack_base_and_size();
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- main_thread->register_thread_stack_with_NMT();
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- main_thread->set_active_handles(JNIHandleBlock::allocate_block());
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ MACOS_AARCH64_ONLY(main_thread->init_wx());
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if (!main_thread->set_as_starting_thread()) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- vm_shutdown_during_initialization(
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- src/hotspot/share/runtime/thread.hpp.orig
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ src/hotspot/share/runtime/thread.hpp
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -1,5 +1,6 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- /*
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * Copyright (c) 2021, Azul Systems, Inc. All rights reserved.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- *
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- * This code is free software; you can redistribute it and/or modify it
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -752,6 +753,15 @@ class Thread: public ThreadShadow {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- static void muxAcquire(volatile intptr_t * Lock, const char * Name);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- static void muxAcquireW(volatile intptr_t * Lock, ParkEvent * ev);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- static void muxRelease(volatile intptr_t * Lock);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#if defined(__APPLE__) && defined(AARCH64)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ private:
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ DEBUG_ONLY(bool _wx_init);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ WXMode _wx_state;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ public:
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ void init_wx();
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ WXMode enable_wx(WXMode new_state);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#endif // __APPLE__ && AARCH64
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- };
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- // Inline implementation of Thread::current()
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- src/hotspot/share/runtime/thread.inline.hpp.orig
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ src/hotspot/share/runtime/thread.inline.hpp
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -1,5 +1,6 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- /*
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * Copyright (c) 2021, Azul Systems, Inc. All rights reserved.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- *
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- * This code is free software; you can redistribute it and/or modify it
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -93,6 +94,27 @@ inline void Thread::set_threads_hazard_ptr(ThreadsList* new_list) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- OrderAccess::release_store_fence(&_threads_hazard_ptr, new_list);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#if defined(__APPLE__) && defined(AARCH64)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+inline void Thread::init_wx() {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ assert(this == Thread::current(), "should only be called for current thread");
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ assert(!_wx_init, "second init");
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ _wx_state = WXWrite;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ os::current_thread_enable_wx(_wx_state);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ DEBUG_ONLY(_wx_init = true);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+inline WXMode Thread::enable_wx(WXMode new_state) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ assert(this == Thread::current(), "should only be called for current thread");
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ assert(_wx_init, "should be inited");
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ WXMode old = _wx_state;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (_wx_state != new_state) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ _wx_state = new_state;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ os::current_thread_enable_wx(new_state);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ return old;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#endif // __APPLE__ && AARCH64
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- inline void JavaThread::set_ext_suspended() {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- set_suspend_flag (_ext_suspended);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- /dev/null
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ src/hotspot/share/runtime/threadWXSetters.inline.hpp
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -0,0 +1,49 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+/*
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * Copyright (c) 1997, 2021, Oracle and/or its affiliates. All rights reserved.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * Copyright (c) 2021, Azul Systems, Inc. All rights reserved.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ *
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * This code is free software; you can redistribute it and/or modify it
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * under the terms of the GNU General Public License version 2 only, as
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * published by the Free Software Foundation.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ *
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * This code is distributed in the hope that it will be useful, but WITHOUT
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * version 2 for more details (a copy is included in the LICENSE file that
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * accompanied this code).
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ *
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * You should have received a copy of the GNU General Public License version
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * 2 along with this work; if not, write to the Free Software Foundation,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ *
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * or visit www.oracle.com if you need additional information or have any
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * questions.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ *
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#ifndef SHARE_RUNTIME_THREADWXSETTERS_INLINE_HPP
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#define SHARE_RUNTIME_THREADWXSETTERS_INLINE_HPP
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#include "runtime/thread.inline.hpp"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#if defined(__APPLE__) && defined(AARCH64)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+class ThreadWXEnable {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ Thread* _thread;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ WXMode _old_mode;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+public:
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ ThreadWXEnable(WXMode new_mode, Thread* thread) :
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ _thread(thread),
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ _old_mode(_thread ? _thread->enable_wx(new_mode) : WXWrite)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ { }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ ~ThreadWXEnable() {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (_thread) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ _thread->enable_wx(_old_mode);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+};
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#endif // __APPLE__ && AARCH64
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#endif // SHARE_RUNTIME_THREADWXSETTERS_INLINE_HPP
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- src/hotspot/share/utilities/macros.hpp.orig
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ src/hotspot/share/utilities/macros.hpp
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -595,6 +595,8 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #define NOT_AARCH64(code) code
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #endif
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#define MACOS_AARCH64_ONLY(x) MACOS_ONLY(AARCH64_ONLY(x))
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #ifdef VM_LITTLE_ENDIAN
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #define LITTLE_ENDIAN_ONLY(code) code
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #define BIG_ENDIAN_ONLY(code)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- src/hotspot/share/utilities/nativeCallStack.cpp.orig
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ src/hotspot/share/utilities/nativeCallStack.cpp
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -38,7 +38,7 @@ NativeCallStack::NativeCallStack(int toSkip, bool fillStack) :
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- // to call os::get_native_stack. A tail call is used if _NMT_NOINLINE_ is not defined
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- // (which means this is not a slowdebug build), and we are on 64-bit (except Windows).
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- // This is not necessarily a rule, but what has been obvserved to date.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--#if (defined(_NMT_NOINLINE_) || defined(_WINDOWS) || !defined(_LP64))
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#if (defined(_NMT_NOINLINE_) || defined(_WINDOWS) || !defined(_LP64) || (defined(BSD) && defined (__aarch64__)))
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- // Not a tail call.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- toSkip++;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #if (defined(_NMT_NOINLINE_) && defined(BSD) && defined(_LP64))
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- src/java.base/macosx/native/libjli/java_md_macosx.c.orig
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ src/java.base/macosx/native/libjli/java_md_macosx.c
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -1,5 +1,5 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- /*
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- * Copyright (c) 2012, 2020, Oracle and/or its affiliates. All rights reserved.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * Copyright (c) 2012, 2021, Oracle and/or its affiliates. All rights reserved.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- *
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- * This code is free software; you can redistribute it and/or modify it
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -210,6 +210,8 @@ static InvocationFunctions *GetExportedJNIFunctions() {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- preferredJVM = "client";
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #elif defined(__x86_64__)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- preferredJVM = "server";
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#elif defined(__aarch64__)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ preferredJVM = "server";
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #else
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #error "Unknown architecture - needs definition"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #endif
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- src/java.security.jgss/share/native/libj2gss/gssapi.h.orig
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ src/java.security.jgss/share/native/libj2gss/gssapi.h
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -1,5 +1,5 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- /*
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- * Copyright (c) 2005, 2019, Oracle and/or its affiliates. All rights reserved.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * Copyright (c) 2005, 2021, Oracle and/or its affiliates. All rights reserved.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- *
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- * This code is free software; you can redistribute it and/or modify it
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -43,7 +43,9 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- extern "C" {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #endif /* __cplusplus */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--#if TARGET_OS_MAC
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+// Condition was copied from
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+// Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/gssapi/gssapi.h
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#if TARGET_OS_MAC && (defined(__ppc__) || defined(__ppc64__) || defined(__i386__) || defined(__x86_64__))
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- # pragma pack(push,2)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #endif
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -695,7 +697,7 @@ GSS_DLLIMP OM_uint32 gss_canonicalize_name(
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- gss_name_t * /* output_name */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- );
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--#if TARGET_OS_MAC
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#if TARGET_OS_MAC && (defined(__ppc__) || defined(__ppc64__) || defined(__i386__) || defined(__x86_64__))
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- # pragma pack(pop)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #endif
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- src/jdk.hotspot.agent/macosx/native/libsaproc/MacosxDebuggerLocal.m.orig
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ src/jdk.hotspot.agent/macosx/native/libsaproc/MacosxDebuggerLocal.m
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -1,5 +1,6 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- /*
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- * Copyright (c) 2002, 2020, Oracle and/or its affiliates. All rights reserved.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * Copyright (c) 2021, Azul Systems, Inc. All rights reserved.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- *
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- * This code is free software; you can redistribute it and/or modify it
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -42,14 +43,10 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #import <sys/ptrace.h>
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #include "libproc_impl.h"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--#define UNSUPPORTED_ARCH "Unsupported architecture!"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--#if defined(x86_64) && !defined(amd64)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--#define amd64 1
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--#endif
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--#if amd64
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#if defined(amd64)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #include "sun_jvm_hotspot_debugger_amd64_AMD64ThreadContext.h"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#elif defined(aarch64)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#include "sun_jvm_hotspot_debugger_aarch64_AARCH64ThreadContext.h"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #else
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #error UNSUPPORTED_ARCH
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #endif
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -162,20 +159,20 @@ static void throw_new_debugger_exception(JNIEnv* env, const char* errMsg) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- return (struct ps_prochandle*)(intptr_t)ptr;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--#if defined(__i386__)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- #define hsdb_thread_state_t x86_thread_state32_t
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- #define hsdb_float_state_t x86_float_state32_t
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- #define HSDB_THREAD_STATE x86_THREAD_STATE32
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- #define HSDB_FLOAT_STATE x86_FLOAT_STATE32
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- #define HSDB_THREAD_STATE_COUNT x86_THREAD_STATE32_COUNT
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- #define HSDB_FLOAT_STATE_COUNT x86_FLOAT_STATE32_COUNT
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--#elif defined(__x86_64__)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#if defined(amd64)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #define hsdb_thread_state_t x86_thread_state64_t
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #define hsdb_float_state_t x86_float_state64_t
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #define HSDB_THREAD_STATE x86_THREAD_STATE64
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #define HSDB_FLOAT_STATE x86_FLOAT_STATE64
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #define HSDB_THREAD_STATE_COUNT x86_THREAD_STATE64_COUNT
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #define HSDB_FLOAT_STATE_COUNT x86_FLOAT_STATE64_COUNT
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#elif defined(aarch64)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ #define hsdb_thread_state_t arm_thread_state64_t
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ #define hsdb_float_state_t arm_neon_state64_t
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ #define HSDB_THREAD_STATE ARM_THREAD_STATE64
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ #define HSDB_FLOAT_STATE ARM_NEON_STATE64
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ #define HSDB_THREAD_STATE_COUNT ARM_THREAD_STATE64_COUNT
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ #define HSDB_FLOAT_STATE_COUNT ARM_NEON_STATE64_COUNT
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #else
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #error UNSUPPORTED_ARCH
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #endif
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -493,11 +490,21 @@ bool fill_java_threads(JNIEnv* env, jobject this_obj, struct ps_prochandle* ph)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- lwpid_t uid = cinfos[j];
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- uint64_t beg = cinfos[j + 1];
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- uint64_t end = cinfos[j + 2];
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#if defined(amd64)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if ((regs.r_rsp < end && regs.r_rsp >= beg) ||
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- (regs.r_rbp < end && regs.r_rbp >= beg)) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- set_lwp_id(ph, i, uid);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- break;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#elif defined(aarch64)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if ((regs.r_sp < end && regs.r_sp >= beg) ||
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ (regs.r_fp < end && regs.r_fp >= beg)) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ set_lwp_id(ph, i, uid);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ break;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#else
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#error UNSUPPORTED_ARCH
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#endif
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- (*env)->ReleaseLongArrayElements(env, thrinfos, (jlong*)cinfos, 0);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -529,14 +536,22 @@ jlongArray getThreadIntegerRegisterSetFromCore(JNIEnv *env, jobject this_obj, lo
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #undef NPRGREG
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #undef REG_INDEX
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--#if amd64
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#if defined(amd64)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #define NPRGREG sun_jvm_hotspot_debugger_amd64_AMD64ThreadContext_NPRGREG
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #define REG_INDEX(reg) sun_jvm_hotspot_debugger_amd64_AMD64ThreadContext_##reg
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#elif defined(aarch64)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#define NPRGREG sun_jvm_hotspot_debugger_aarch64_AARCH64ThreadContext_NPRGREG
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#define REG_INDEX(reg) sun_jvm_hotspot_debugger_aarch64_AARCH64ThreadContext_##reg
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#else
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#error UNSUPPORTED_ARCH
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#endif
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- array = (*env)->NewLongArray(env, NPRGREG);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- CHECK_EXCEPTION_(0);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- regs = (*env)->GetLongArrayElements(env, array, &isCopy);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#if defined(amd64)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- regs[REG_INDEX(R15)] = gregs.r_r15;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- regs[REG_INDEX(R14)] = gregs.r_r14;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- regs[REG_INDEX(R13)] = gregs.r_r13;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -565,7 +580,46 @@ jlongArray getThreadIntegerRegisterSetFromCore(JNIEnv *env, jobject this_obj, lo
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- regs[REG_INDEX(TRAPNO)] = gregs.r_trapno;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- regs[REG_INDEX(RFL)] = gregs.r_rflags;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--#endif /* amd64 */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#elif defined(aarch64)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ regs[REG_INDEX(R0)] = gregs.r_r0;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ regs[REG_INDEX(R1)] = gregs.r_r1;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ regs[REG_INDEX(R2)] = gregs.r_r2;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ regs[REG_INDEX(R3)] = gregs.r_r3;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ regs[REG_INDEX(R4)] = gregs.r_r4;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ regs[REG_INDEX(R5)] = gregs.r_r5;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ regs[REG_INDEX(R6)] = gregs.r_r6;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ regs[REG_INDEX(R7)] = gregs.r_r7;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ regs[REG_INDEX(R8)] = gregs.r_r8;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ regs[REG_INDEX(R9)] = gregs.r_r9;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ regs[REG_INDEX(R10)] = gregs.r_r10;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ regs[REG_INDEX(R11)] = gregs.r_r11;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ regs[REG_INDEX(R12)] = gregs.r_r12;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ regs[REG_INDEX(R13)] = gregs.r_r13;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ regs[REG_INDEX(R14)] = gregs.r_r14;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ regs[REG_INDEX(R15)] = gregs.r_r15;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ regs[REG_INDEX(R16)] = gregs.r_r16;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ regs[REG_INDEX(R17)] = gregs.r_r17;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ regs[REG_INDEX(R18)] = gregs.r_r18;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ regs[REG_INDEX(R19)] = gregs.r_r19;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ regs[REG_INDEX(R20)] = gregs.r_r20;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ regs[REG_INDEX(R21)] = gregs.r_r21;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ regs[REG_INDEX(R22)] = gregs.r_r22;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ regs[REG_INDEX(R23)] = gregs.r_r23;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ regs[REG_INDEX(R24)] = gregs.r_r24;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ regs[REG_INDEX(R25)] = gregs.r_r25;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ regs[REG_INDEX(R26)] = gregs.r_r26;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ regs[REG_INDEX(R27)] = gregs.r_r27;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ regs[REG_INDEX(R28)] = gregs.r_r28;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ regs[REG_INDEX(FP)] = gregs.r_fp;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ regs[REG_INDEX(LR)] = gregs.r_lr;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ regs[REG_INDEX(SP)] = gregs.r_sp;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ regs[REG_INDEX(PC)] = gregs.r_pc;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#else
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#error UNSUPPORTED_ARCH
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#endif
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- (*env)->ReleaseLongArrayElements(env, array, regs, JNI_COMMIT);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- return array;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -655,10 +709,14 @@ jlongArray getThreadIntegerRegisterSetFromCore(JNIEnv *env, jobject this_obj, lo
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- return NULL;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--#if amd64
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#undef NPRGREG
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#if defined(amd64)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #define NPRGREG sun_jvm_hotspot_debugger_amd64_AMD64ThreadContext_NPRGREG
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--#undef REG_INDEX
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--#define REG_INDEX(reg) sun_jvm_hotspot_debugger_amd64_AMD64ThreadContext_##reg
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#elif defined(aarch64)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#define NPRGREG sun_jvm_hotspot_debugger_aarch64_AARCH64ThreadContext_NPRGREG
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#else
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#error UNSUPPORTED_ARCH
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#endif
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- // 64 bit
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- print_debug("Getting threads for a 64-bit process\n");
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -666,6 +724,8 @@ jlongArray getThreadIntegerRegisterSetFromCore(JNIEnv *env, jobject this_obj, lo
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- CHECK_EXCEPTION_(0);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- primitiveArray = (*env)->GetLongArrayElements(env, registerArray, NULL);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#if defined(amd64)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- primitiveArray[REG_INDEX(R15)] = state.__r15;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- primitiveArray[REG_INDEX(R14)] = state.__r14;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- primitiveArray[REG_INDEX(R13)] = state.__r13;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -694,14 +754,50 @@ jlongArray getThreadIntegerRegisterSetFromCore(JNIEnv *env, jobject this_obj, lo
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- primitiveArray[REG_INDEX(DS)] = 0;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- primitiveArray[REG_INDEX(FSBASE)] = 0;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- primitiveArray[REG_INDEX(GSBASE)] = 0;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- print_debug("set registers\n");
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- (*env)->ReleaseLongArrayElements(env, registerArray, primitiveArray, 0);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#elif defined(aarch64)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ primitiveArray[REG_INDEX(R0)] = state.__x[0];
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ primitiveArray[REG_INDEX(R1)] = state.__x[1];
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ primitiveArray[REG_INDEX(R2)] = state.__x[2];
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ primitiveArray[REG_INDEX(R3)] = state.__x[3];
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ primitiveArray[REG_INDEX(R4)] = state.__x[4];
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ primitiveArray[REG_INDEX(R5)] = state.__x[5];
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ primitiveArray[REG_INDEX(R6)] = state.__x[6];
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ primitiveArray[REG_INDEX(R7)] = state.__x[7];
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ primitiveArray[REG_INDEX(R8)] = state.__x[8];
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ primitiveArray[REG_INDEX(R9)] = state.__x[9];
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ primitiveArray[REG_INDEX(R10)] = state.__x[10];
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ primitiveArray[REG_INDEX(R11)] = state.__x[11];
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ primitiveArray[REG_INDEX(R12)] = state.__x[12];
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ primitiveArray[REG_INDEX(R13)] = state.__x[13];
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ primitiveArray[REG_INDEX(R14)] = state.__x[14];
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ primitiveArray[REG_INDEX(R15)] = state.__x[15];
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ primitiveArray[REG_INDEX(R16)] = state.__x[16];
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ primitiveArray[REG_INDEX(R17)] = state.__x[17];
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ primitiveArray[REG_INDEX(R18)] = state.__x[18];
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ primitiveArray[REG_INDEX(R19)] = state.__x[19];
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ primitiveArray[REG_INDEX(R20)] = state.__x[20];
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ primitiveArray[REG_INDEX(R21)] = state.__x[21];
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ primitiveArray[REG_INDEX(R22)] = state.__x[22];
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ primitiveArray[REG_INDEX(R23)] = state.__x[23];
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ primitiveArray[REG_INDEX(R24)] = state.__x[24];
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ primitiveArray[REG_INDEX(R25)] = state.__x[25];
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ primitiveArray[REG_INDEX(R26)] = state.__x[26];
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ primitiveArray[REG_INDEX(R27)] = state.__x[27];
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ primitiveArray[REG_INDEX(R28)] = state.__x[28];
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ primitiveArray[REG_INDEX(FP)] = state.__fp;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ primitiveArray[REG_INDEX(LR)] = state.__lr;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ primitiveArray[REG_INDEX(SP)] = state.__sp;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ primitiveArray[REG_INDEX(PC)] = state.__pc;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #else
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #error UNSUPPORTED_ARCH
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--#endif /* amd64 */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#endif
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ print_debug("set registers\n");
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ (*env)->ReleaseLongArrayElements(env, registerArray, primitiveArray, 0);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- return registerArray;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- src/jdk.hotspot.agent/macosx/native/libsaproc/libproc_impl.h.orig
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ src/jdk.hotspot.agent/macosx/native/libsaproc/libproc_impl.h
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -1,5 +1,6 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- /*
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * Copyright (c) 2003, 2021, Oracle and/or its affiliates. All rights reserved.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * Copyright (c) 2021, Azul Systems, Inc. All rights reserved.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- *
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- * This code is free software; you can redistribute it and/or modify it
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -30,6 +31,16 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #include "libproc.h"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #include "symtab.h"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#define UNSUPPORTED_ARCH "Unsupported architecture!"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#if defined(__x86_64__) && !defined(amd64)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#define amd64 1
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#endif
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#if defined(__arm64__) && !defined(aarch64)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#define aarch64 1
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#endif
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #ifdef __APPLE__
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #include <inttypes.h> // for PRIx64, 32, ...
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #include <pthread.h>
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -41,6 +52,7 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #define register_t uint64_t
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #endif
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#if defined(amd64)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- /*** registers copied from bsd/amd64 */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- typedef struct reg {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- register_t r_r15;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -71,6 +83,48 @@ typedef struct reg {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- register_t r_ss; // not used
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- } reg;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#elif defined(aarch64)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+/*** registers copied from bsd/arm64 */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+typedef struct reg {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ register_t r_r0;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ register_t r_r1;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ register_t r_r2;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ register_t r_r3;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ register_t r_r4;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ register_t r_r5;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ register_t r_r6;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ register_t r_r7;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ register_t r_r8;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ register_t r_r9;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ register_t r_r10;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ register_t r_r11;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ register_t r_r12;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ register_t r_r13;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ register_t r_r14;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ register_t r_r15;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ register_t r_r16;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ register_t r_r17;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ register_t r_r18;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ register_t r_r19;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ register_t r_r20;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ register_t r_r21;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ register_t r_r22;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ register_t r_r23;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ register_t r_r24;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ register_t r_r25;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ register_t r_r26;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ register_t r_r27;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ register_t r_r28;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ register_t r_fp;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ register_t r_lr;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ register_t r_sp;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ register_t r_pc;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+} reg;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#else
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#error UNSUPPORTED_ARCH
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#endif
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- // convenient defs
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- typedef struct mach_header_64 mach_header_64;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- typedef struct load_command load_command;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- src/jdk.hotspot.agent/macosx/native/libsaproc/ps_core.c.orig
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ src/jdk.hotspot.agent/macosx/native/libsaproc/ps_core.c
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -1,5 +1,6 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- /*
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * Copyright (c) 2003, 2021, Oracle and/or its affiliates. All rights reserved.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * Copyright (c) 2021, Azul Systems, Inc. All rights reserved.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- *
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- * This code is free software; you can redistribute it and/or modify it
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -32,8 +33,14 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #include "cds.h"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #ifdef __APPLE__
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#if defined(amd64)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #include "sun_jvm_hotspot_debugger_amd64_AMD64ThreadContext.h"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#elif defined(aarch64)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#include "sun_jvm_hotspot_debugger_aarch64_AARCH64ThreadContext.h"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#else
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#error UNSUPPORTED_ARCH
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #endif
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#endif /* __APPLE__ */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- // This file has the libproc implementation to read core files.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- // For live processes, refer to ps_proc.c. Portions of this is adapted
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -520,6 +527,8 @@ static ps_prochandle_ops core_ops = {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- void print_thread(sa_thread_info *threadinfo) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- print_debug("thread added: %d\n", threadinfo->lwp_id);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- print_debug("registers:\n");
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#if defined(amd64)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- print_debug(" r_r15: 0x%" PRIx64 "\n", threadinfo->regs.r_r15);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- print_debug(" r_r14: 0x%" PRIx64 "\n", threadinfo->regs.r_r14);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- print_debug(" r_r13: 0x%" PRIx64 "\n", threadinfo->regs.r_r13);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -541,6 +550,45 @@ void print_thread(sa_thread_info *threadinfo) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- print_debug(" r_cs: 0x%" PRIx64 "\n", threadinfo->regs.r_cs);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- print_debug(" r_rsp: 0x%" PRIx64 "\n", threadinfo->regs.r_rsp);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- print_debug(" r_rflags: 0x%" PRIx64 "\n", threadinfo->regs.r_rflags);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#elif defined(aarch64)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ print_debug(" r_r0: 0x%" PRIx64 "\n", threadinfo->regs.r_r0);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ print_debug(" r_r1: 0x%" PRIx64 "\n", threadinfo->regs.r_r1);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ print_debug(" r_r2: 0x%" PRIx64 "\n", threadinfo->regs.r_r2);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ print_debug(" r_r3: 0x%" PRIx64 "\n", threadinfo->regs.r_r3);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ print_debug(" r_r4: 0x%" PRIx64 "\n", threadinfo->regs.r_r4);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ print_debug(" r_r5: 0x%" PRIx64 "\n", threadinfo->regs.r_r5);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ print_debug(" r_r6: 0x%" PRIx64 "\n", threadinfo->regs.r_r6);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ print_debug(" r_r7: 0x%" PRIx64 "\n", threadinfo->regs.r_r7);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ print_debug(" r_r8: 0x%" PRIx64 "\n", threadinfo->regs.r_r8);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ print_debug(" r_r9: 0x%" PRIx64 "\n", threadinfo->regs.r_r9);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ print_debug(" r_r10: 0x%" PRIx64 "\n", threadinfo->regs.r_r10);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ print_debug(" r_r11: 0x%" PRIx64 "\n", threadinfo->regs.r_r11);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ print_debug(" r_r12: 0x%" PRIx64 "\n", threadinfo->regs.r_r12);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ print_debug(" r_r13: 0x%" PRIx64 "\n", threadinfo->regs.r_r13);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ print_debug(" r_r14: 0x%" PRIx64 "\n", threadinfo->regs.r_r14);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ print_debug(" r_r15: 0x%" PRIx64 "\n", threadinfo->regs.r_r15);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ print_debug(" r_r16: 0x%" PRIx64 "\n", threadinfo->regs.r_r16);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ print_debug(" r_r17: 0x%" PRIx64 "\n", threadinfo->regs.r_r17);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ print_debug(" r_r18: 0x%" PRIx64 "\n", threadinfo->regs.r_r18);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ print_debug(" r_r19: 0x%" PRIx64 "\n", threadinfo->regs.r_r19);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ print_debug(" r_r20: 0x%" PRIx64 "\n", threadinfo->regs.r_r20);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ print_debug(" r_r21: 0x%" PRIx64 "\n", threadinfo->regs.r_r21);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ print_debug(" r_r22: 0x%" PRIx64 "\n", threadinfo->regs.r_r22);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ print_debug(" r_r23: 0x%" PRIx64 "\n", threadinfo->regs.r_r23);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ print_debug(" r_r24: 0x%" PRIx64 "\n", threadinfo->regs.r_r24);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ print_debug(" r_r25: 0x%" PRIx64 "\n", threadinfo->regs.r_r25);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ print_debug(" r_r26: 0x%" PRIx64 "\n", threadinfo->regs.r_r26);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ print_debug(" r_r27: 0x%" PRIx64 "\n", threadinfo->regs.r_r27);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ print_debug(" r_r28: 0x%" PRIx64 "\n", threadinfo->regs.r_r28);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ print_debug(" r_fp: 0x%" PRIx64 "\n", threadinfo->regs.r_fp);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ print_debug(" r_lr: 0x%" PRIx64 "\n", threadinfo->regs.r_lr);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ print_debug(" r_sp: 0x%" PRIx64 "\n", threadinfo->regs.r_sp);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ print_debug(" r_pc: 0x%" PRIx64 "\n", threadinfo->regs.r_pc);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#else
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#error UNSUPPORTED_ARCH
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#endif
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- // read all segments64 commands from core file
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -592,6 +640,7 @@ static bool read_core_segments(struct ps_prochandle* ph) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- goto err;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- size += sizeof(thread_fc);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#if defined(amd64)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if (fc.flavor == x86_THREAD_STATE) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- x86_thread_state_t thrstate;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if (read(fd, (void *)&thrstate, sizeof(x86_thread_state_t)) != sizeof(x86_thread_state_t)) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -651,6 +700,90 @@ static bool read_core_segments(struct ps_prochandle* ph) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- size += sizeof(x86_exception_state_t);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#elif defined(aarch64)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (fc.flavor == ARM_THREAD_STATE64) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ arm_thread_state64_t thrstate;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (read(fd, (void *)&thrstate, sizeof(arm_thread_state64_t)) != sizeof(arm_thread_state64_t)) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ printf("Reading flavor, count failed.\n");
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ goto err;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ size += sizeof(arm_thread_state64_t);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // create thread info list, update lwp_id later
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ sa_thread_info* newthr = add_thread_info(ph, (pthread_t) -1, (lwpid_t) num_threads++);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (newthr == NULL) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ printf("create thread_info failed\n");
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ goto err;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // note __DARWIN_UNIX03 depengs on other definitions
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#if __DARWIN_UNIX03
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#define get_register_v(regst, regname) \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ regst.__##regname
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#else
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#define get_register_v(regst, regname) \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ regst.##regname
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#endif // __DARWIN_UNIX03
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ newthr->regs.r_r0 = get_register_v(thrstate, x[0]);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ newthr->regs.r_r1 = get_register_v(thrstate, x[1]);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ newthr->regs.r_r2 = get_register_v(thrstate, x[2]);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ newthr->regs.r_r3 = get_register_v(thrstate, x[3]);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ newthr->regs.r_r4 = get_register_v(thrstate, x[4]);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ newthr->regs.r_r5 = get_register_v(thrstate, x[5]);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ newthr->regs.r_r6 = get_register_v(thrstate, x[6]);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ newthr->regs.r_r7 = get_register_v(thrstate, x[7]);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ newthr->regs.r_r8 = get_register_v(thrstate, x[8]);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ newthr->regs.r_r9 = get_register_v(thrstate, x[9]);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ newthr->regs.r_r10 = get_register_v(thrstate, x[10]);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ newthr->regs.r_r11 = get_register_v(thrstate, x[11]);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ newthr->regs.r_r12 = get_register_v(thrstate, x[12]);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ newthr->regs.r_r13 = get_register_v(thrstate, x[13]);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ newthr->regs.r_r14 = get_register_v(thrstate, x[14]);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ newthr->regs.r_r15 = get_register_v(thrstate, x[15]);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ newthr->regs.r_r16 = get_register_v(thrstate, x[16]);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ newthr->regs.r_r17 = get_register_v(thrstate, x[17]);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ newthr->regs.r_r18 = get_register_v(thrstate, x[18]);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ newthr->regs.r_r19 = get_register_v(thrstate, x[19]);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ newthr->regs.r_r20 = get_register_v(thrstate, x[20]);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ newthr->regs.r_r21 = get_register_v(thrstate, x[21]);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ newthr->regs.r_r22 = get_register_v(thrstate, x[22]);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ newthr->regs.r_r23 = get_register_v(thrstate, x[23]);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ newthr->regs.r_r24 = get_register_v(thrstate, x[24]);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ newthr->regs.r_r25 = get_register_v(thrstate, x[25]);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ newthr->regs.r_r26 = get_register_v(thrstate, x[26]);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ newthr->regs.r_r27 = get_register_v(thrstate, x[27]);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ newthr->regs.r_r28 = get_register_v(thrstate, x[28]);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ newthr->regs.r_fp = get_register_v(thrstate, fp);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ newthr->regs.r_lr = get_register_v(thrstate, lr);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ newthr->regs.r_sp = get_register_v(thrstate, sp);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ newthr->regs.r_pc = get_register_v(thrstate, pc);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ print_thread(newthr);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ } else if (fc.flavor == ARM_NEON_STATE64) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ arm_neon_state64_t flstate;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (read(fd, (void *)&flstate, sizeof(arm_neon_state64_t)) != sizeof(arm_neon_state64_t)) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ printf("Reading flavor, count failed.\n");
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ goto err;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ size += sizeof(arm_neon_state64_t);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ } else if (fc.flavor == ARM_EXCEPTION_STATE64) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ arm_exception_state64_t excpstate;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (read(fd, (void *)&excpstate, sizeof(arm_exception_state64_t)) != sizeof(arm_exception_state64_t)) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ printf("Reading flavor, count failed.\n");
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ goto err;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ size += sizeof(arm_exception_state64_t);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ } else if (fc.flavor == ARM_DEBUG_STATE64) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ arm_debug_state64_t dbgstate;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (read(fd, (void *)&dbgstate, sizeof(arm_debug_state64_t)) != sizeof(arm_debug_state64_t)) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ printf("Reading flavor, count failed.\n");
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ goto err;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ size += sizeof(arm_debug_state64_t);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#else
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#error UNSUPPORTED_ARCH
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#endif
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/HotSpotAgent.java
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/HotSpotAgent.java
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -1,5 +1,6 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- /*
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * Copyright (c) 2021, Azul Systems, Inc. All rights reserved.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- *
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- * This code is free software; you can redistribute it and/or modify it
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -652,8 +653,10 @@ private void setupDebuggerDarwin() {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if (cpu.equals("amd64") || cpu.equals("x86_64")) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- machDesc = new MachineDescriptionAMD64();
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ } else if (cpu.equals("aarch64")) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ machDesc = new MachineDescriptionAArch64();
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- } else {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- throw new DebuggerException("Darwin only supported on x86_64. Current arch: " + cpu);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ throw new DebuggerException("Darwin only supported on x86_64/aarch64. Current arch: " + cpu);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- BsdDebuggerLocal dbg = new BsdDebuggerLocal(machDesc, !isServer);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/bsd/BsdCDebugger.java.orig
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/bsd/BsdCDebugger.java
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -1,5 +1,6 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- /*
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * Copyright (c) 2003, 2021, Oracle and/or its affiliates. All rights reserved.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * Copyright (c) 2021, Azul Systems, Inc. All rights reserved.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- *
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- * This code is free software; you can redistribute it and/or modify it
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -30,8 +31,10 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- import sun.jvm.hotspot.debugger.cdbg.*;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- import sun.jvm.hotspot.debugger.x86.*;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- import sun.jvm.hotspot.debugger.amd64.*;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+import sun.jvm.hotspot.debugger.aarch64.*;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- import sun.jvm.hotspot.debugger.bsd.x86.*;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- import sun.jvm.hotspot.debugger.bsd.amd64.*;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+import sun.jvm.hotspot.debugger.bsd.aarch64.*;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- import sun.jvm.hotspot.utilities.*;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- class BsdCDebugger implements CDebugger {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -97,6 +100,13 @@ public CFrame topFrameForThread(ThreadProxy thread) throws DebuggerException {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- Address pc = context.getRegisterAsAddress(AMD64ThreadContext.RIP);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if (pc == null) return null;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- return new BsdAMD64CFrame(dbg, rbp, pc);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ } else if (cpu.equals("aarch64")) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ AARCH64ThreadContext context = (AARCH64ThreadContext) thread.getContext();
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ Address fp = context.getRegisterAsAddress(AARCH64ThreadContext.FP);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (fp == null) return null;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ Address pc = context.getRegisterAsAddress(AARCH64ThreadContext.PC);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (pc == null) return null;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ return new BsdAARCH64CFrame(dbg, fp, pc);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- } else {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- throw new DebuggerException(cpu + " is not yet supported");
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/bsd/BsdThreadContextFactory.java.orig
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/bsd/BsdThreadContextFactory.java
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -1,5 +1,5 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- /*
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- * Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * Copyright (c) 2002, 2021, Oracle and/or its affiliates. All rights reserved.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- *
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- * This code is free software; you can redistribute it and/or modify it
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -25,6 +25,7 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- package sun.jvm.hotspot.debugger.bsd;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- import sun.jvm.hotspot.debugger.*;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+import sun.jvm.hotspot.debugger.bsd.aarch64.*;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- import sun.jvm.hotspot.debugger.bsd.amd64.*;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- import sun.jvm.hotspot.debugger.bsd.x86.*;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -35,6 +36,8 @@ static ThreadContext createThreadContext(BsdDebugger dbg) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- return new BsdX86ThreadContext(dbg);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- } else if (cpu.equals("amd64") || cpu.equals("x86_64")) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- return new BsdAMD64ThreadContext(dbg);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ } else if (cpu.equals("aarch64")) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ return new BsdAARCH64ThreadContext(dbg);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- } else {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- throw new RuntimeException("cpu " + cpu + " is not yet supported");
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- /dev/null
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/bsd/aarch64/BsdAARCH64CFrame.java
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -0,0 +1,87 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+/*
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * Copyright (c) 2003, 2021, Oracle and/or its affiliates. All rights reserved.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * Copyright (c) 2015, Red Hat Inc.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * Copyright (c) 2021, Azul Systems, Inc. All rights reserved.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ *
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * This code is free software; you can redistribute it and/or modify it
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * under the terms of the GNU General Public License version 2 only, as
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * published by the Free Software Foundation.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ *
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * This code is distributed in the hope that it will be useful, but WITHOUT
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * version 2 for more details (a copy is included in the LICENSE file that
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * accompanied this code).
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ *
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * You should have received a copy of the GNU General Public License version
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * 2 along with this work; if not, write to the Free Software Foundation,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ *
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * or visit www.oracle.com if you need additional information or have any
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * questions.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ *
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+package sun.jvm.hotspot.debugger.bsd.aarch64;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+import sun.jvm.hotspot.debugger.*;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+import sun.jvm.hotspot.debugger.aarch64.*;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+import sun.jvm.hotspot.debugger.bsd.*;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+import sun.jvm.hotspot.debugger.cdbg.*;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+import sun.jvm.hotspot.debugger.cdbg.basic.*;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+final public class BsdAARCH64CFrame extends BasicCFrame {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ public BsdAARCH64CFrame(BsdDebugger dbg, Address fp, Address pc) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ super(dbg.getCDebugger());
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ this.fp = fp;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ this.pc = pc;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ this.dbg = dbg;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // override base class impl to avoid ELF parsing
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ public ClosestSymbol closestSymbolToPC() {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // try native lookup in debugger.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ return dbg.lookup(dbg.getAddressValue(pc()));
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ public Address pc() {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ return pc;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ public Address localVariableBase() {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ return fp;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ public CFrame sender(ThreadProxy thread) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ AARCH64ThreadContext context = (AARCH64ThreadContext) thread.getContext();
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ Address rsp = context.getRegisterAsAddress(AARCH64ThreadContext.SP);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if ((fp == null) || fp.lessThan(rsp)) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ return null;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // Check alignment of fp
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (dbg.getAddressValue(fp) % (2 * ADDRESS_SIZE) != 0) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ return null;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ Address nextFP = fp.getAddressAt(0 * ADDRESS_SIZE);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (nextFP == null || nextFP.lessThanOrEqual(fp)) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ return null;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ Address nextPC = fp.getAddressAt(1 * ADDRESS_SIZE);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (nextPC == null) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ return null;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ return new BsdAARCH64CFrame(dbg, nextFP, nextPC);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // package/class internals only
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ private static final int ADDRESS_SIZE = 8;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ private Address pc;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ private Address sp;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ private Address fp;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ private BsdDebugger dbg;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- /dev/null
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/bsd/aarch64/BsdAARCH64ThreadContext.java
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -0,0 +1,47 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+/*
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * Copyright (c) 2003, 2021, Oracle and/or its affiliates. All rights reserved.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * Copyright (c) 2021, Azul Systems, Inc. All rights reserved.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ *
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * This code is free software; you can redistribute it and/or modify it
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * under the terms of the GNU General Public License version 2 only, as
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * published by the Free Software Foundation.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ *
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * This code is distributed in the hope that it will be useful, but WITHOUT
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * version 2 for more details (a copy is included in the LICENSE file that
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * accompanied this code).
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ *
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * You should have received a copy of the GNU General Public License version
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * 2 along with this work; if not, write to the Free Software Foundation,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ *
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * or visit www.oracle.com if you need additional information or have any
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * questions.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ *
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+package sun.jvm.hotspot.debugger.bsd.aarch64;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+import sun.jvm.hotspot.debugger.*;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+import sun.jvm.hotspot.debugger.aarch64.*;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+import sun.jvm.hotspot.debugger.bsd.*;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+public class BsdAARCH64ThreadContext extends AARCH64ThreadContext {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ private BsdDebugger debugger;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ public BsdAARCH64ThreadContext(BsdDebugger debugger) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ super();
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ this.debugger = debugger;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ public void setRegisterAsAddress(int index, Address value) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ setRegister(index, debugger.getAddressValue(value));
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ public Address getRegisterAsAddress(int index) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ return debugger.newAddress(getRegister(index));
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/Threads.java.orig
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/Threads.java
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -1,5 +1,5 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- /*
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- * Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * Copyright (c) 2000, 2021, Oracle and/or its affiliates. All rights reserved.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- *
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- * This code is free software; you can redistribute it and/or modify it
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -42,6 +42,7 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- import sun.jvm.hotspot.runtime.linux_sparc.LinuxSPARCJavaThreadPDAccess;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- import sun.jvm.hotspot.runtime.bsd_x86.BsdX86JavaThreadPDAccess;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- import sun.jvm.hotspot.runtime.bsd_amd64.BsdAMD64JavaThreadPDAccess;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+import sun.jvm.hotspot.runtime.bsd_aarch64.BsdAARCH64JavaThreadPDAccess;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- import sun.jvm.hotspot.utilities.*;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- public class Threads {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -118,6 +119,8 @@ private static synchronized void initialize(TypeDataBase db) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- } else if (os.equals("darwin")) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if (cpu.equals("amd64") || cpu.equals("x86_64")) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- access = new BsdAMD64JavaThreadPDAccess();
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ } else if (cpu.equals("aarch64")) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ access = new BsdAARCH64JavaThreadPDAccess();
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- /dev/null
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/bsd_aarch64/BsdAARCH64JavaThreadPDAccess.java
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -0,0 +1,137 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+/*
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * Copyright (c) 2003, 2021, Oracle and/or its affiliates. All rights reserved.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * Copyright (c) 2021, Azul Systems, Inc. All rights reserved.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ *
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * This code is free software; you can redistribute it and/or modify it
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * under the terms of the GNU General Public License version 2 only, as
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * published by the Free Software Foundation.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ *
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * This code is distributed in the hope that it will be useful, but WITHOUT
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * version 2 for more details (a copy is included in the LICENSE file that
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * accompanied this code).
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ *
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * You should have received a copy of the GNU General Public License version
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * 2 along with this work; if not, write to the Free Software Foundation,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ *
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * or visit www.oracle.com if you need additional information or have any
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * questions.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ *
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+package sun.jvm.hotspot.runtime.bsd_aarch64;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+import java.io.*;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+import java.util.*;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+import sun.jvm.hotspot.debugger.*;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+import sun.jvm.hotspot.debugger.aarch64.*;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+import sun.jvm.hotspot.debugger.bsd.BsdDebugger;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+import sun.jvm.hotspot.debugger.bsd.BsdDebuggerLocal;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+import sun.jvm.hotspot.runtime.*;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+import sun.jvm.hotspot.runtime.aarch64.*;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+import sun.jvm.hotspot.types.*;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+import sun.jvm.hotspot.utilities.*;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+public class BsdAARCH64JavaThreadPDAccess implements JavaThreadPDAccess {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ private static AddressField lastJavaFPField;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ private static AddressField osThreadField;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // Field from OSThread
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ private static CIntegerField osThreadThreadIDField;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ private static CIntegerField osThreadUniqueThreadIDField;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // This is currently unneeded but is being kept in case we change
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // the currentFrameGuess algorithm
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ private static final long GUESS_SCAN_RANGE = 128 * 1024;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ static {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ VM.registerVMInitializedObserver(new Observer() {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ public void update(Observable o, Object data) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ initialize(VM.getVM().getTypeDataBase());
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ });
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ private static synchronized void initialize(TypeDataBase db) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ Type type = db.lookupType("JavaThread");
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ osThreadField = type.getAddressField("_osthread");
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ Type anchorType = db.lookupType("JavaFrameAnchor");
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ lastJavaFPField = anchorType.getAddressField("_last_Java_fp");
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ Type osThreadType = db.lookupType("OSThread");
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ osThreadThreadIDField = osThreadType.getCIntegerField("_thread_id");
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ osThreadUniqueThreadIDField = osThreadType.getCIntegerField("_unique_thread_id");
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ public Address getLastJavaFP(Address addr) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ return lastJavaFPField.getValue(addr.addOffsetTo(sun.jvm.hotspot.runtime.JavaThread.getAnchorField().getOffset()));
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ public Address getLastJavaPC(Address addr) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ return null;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ public Address getBaseOfStackPointer(Address addr) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ return null;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ public Frame getLastFramePD(JavaThread thread, Address addr) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ Address fp = thread.getLastJavaFP();
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (fp == null) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ return null; // no information
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ return new AARCH64Frame(thread.getLastJavaSP(), fp);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ public RegisterMap newRegisterMap(JavaThread thread, boolean updateMap) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ return new AARCH64RegisterMap(thread, updateMap);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ public Frame getCurrentFrameGuess(JavaThread thread, Address addr) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ ThreadProxy t = getThreadProxy(addr);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ AARCH64ThreadContext context = (AARCH64ThreadContext) t.getContext();
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ AARCH64CurrentFrameGuess guesser = new AARCH64CurrentFrameGuess(context, thread);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (!guesser.run(GUESS_SCAN_RANGE)) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ return null;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (guesser.getPC() == null) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ return new AARCH64Frame(guesser.getSP(), guesser.getFP());
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ } else {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ return new AARCH64Frame(guesser.getSP(), guesser.getFP(), guesser.getPC());
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ public void printThreadIDOn(Address addr, PrintStream tty) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ tty.print(getThreadProxy(addr));
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ public void printInfoOn(Address threadAddr, PrintStream tty) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ tty.print("Thread id: ");
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ printThreadIDOn(threadAddr, tty);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+// tty.println("\nPostJavaState: " + getPostJavaState(threadAddr));
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ public Address getLastSP(Address addr) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ ThreadProxy t = getThreadProxy(addr);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ AARCH64ThreadContext context = (AARCH64ThreadContext) t.getContext();
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ return context.getRegisterAsAddress(AARCH64ThreadContext.SP);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ public ThreadProxy getThreadProxy(Address addr) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // Addr is the address of the JavaThread.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // Fetch the OSThread (for now and for simplicity, not making a
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // separate "OSThread" class in this package)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ Address osThreadAddr = osThreadField.getValue(addr);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // Get the address of the _thread_id from the OSThread
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ Address threadIdAddr = osThreadAddr.addOffsetTo(osThreadThreadIDField.getOffset());
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ Address uniqueThreadIdAddr = osThreadAddr.addOffsetTo(osThreadUniqueThreadIDField.getOffset());
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ BsdDebuggerLocal debugger = (BsdDebuggerLocal) VM.getVM().getDebugger();
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ return debugger.getThreadForIdentifierAddress(threadIdAddr, uniqueThreadIdAddr);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- src/utils/hsdis/Makefile.orig
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ src/utils/hsdis/Makefile
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -1,5 +1,6 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--# Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+# Copyright (c) 2008, 2021, Oracle and/or its affiliates. All rights reserved.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+# Copyright (c) 2021, Azul Systems, Inc. All rights reserved.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- # This code is free software; you can redistribute it and/or modify it
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -112,15 +113,21 @@ else
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- ifeq ($(OS),Darwin)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- CPU = $(shell uname -m)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- ARCH1=$(CPU:x86_64=amd64)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--ARCH=$(ARCH1:i686=i386)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ARCH2=$(ARCH1:arm64=aarch64)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ARCH=$(ARCH2:i686=i386)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+CONFIGURE_ARGS/aarch64= --enable-targets=aarch64-darwin
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+CONFIGURE_ARGS = $(CONFIGURE_ARGS/$(ARCH))
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- ifdef LP64
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- CFLAGS/sparcv9 += -m64
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- CFLAGS/amd64 += -m64
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- else
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--ARCH=$(ARCH1:amd64=i386)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ARCH=$(ARCH2:amd64=i386)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- CFLAGS/i386 += -m32
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- CFLAGS/sparc += -m32
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- endif # LP64
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ifeq ($(CPU), arm64)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+CFLAGS/aarch64 += -m64
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+endif # arm64
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- CFLAGS += $(CFLAGS/$(ARCH))
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- CFLAGS += -fPIC
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- OS = macosx
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- test/hotspot/gtest/gtestMain.cpp.orig
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ test/hotspot/gtest/gtestMain.cpp
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -1,5 +1,5 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- /*
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- *
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- * This code is free software; you can redistribute it and/or modify it
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -38,6 +38,8 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #include "jni.h"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #include "unittest.hpp"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#include "runtime/thread.inline.hpp"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- // Default value for -new-thread option: true on AIX because we run into
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- // problems when attempting to initialize the JVM on the primordial thread.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #ifdef _AIX
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -91,7 +93,14 @@ static int init_jvm(int argc, char **argv, bool disable_error_handling) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- JavaVM* jvm;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- JNIEnv* env;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- return JNI_CreateJavaVM(&jvm, (void**)&env, &args);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ int ret = JNI_CreateJavaVM(&jvm, (void**)&env, &args);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (ret == JNI_OK) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // CreateJavaVM leaves WXExec context, while gtests
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // calls internal functions assuming running in WXWwrite.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // Switch to WXWrite once for all test cases.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ MACOS_AARCH64_ONLY(Thread::current()->enable_wx(WXWrite));
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ return ret;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- class JVMInitializerListener : public ::testing::EmptyTestEventListener {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- test/hotspot/jtreg/runtime/CompressedOops/CompressedClassPointers.java.orig
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ test/hotspot/jtreg/runtime/CompressedOops/CompressedClassPointers.java
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -1,5 +1,5 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- /*
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- * Copyright (c) 2013, 2019, Oracle and/or its affiliates. All rights reserved.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * Copyright (c) 2013, 2021, Oracle and/or its affiliates. All rights reserved.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- *
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- * This code is free software; you can redistribute it and/or modify it
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -25,7 +25,7 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- * @test
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- * @bug 8024927
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- * @summary Testing address of compressed class pointer space as best as possible.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- * @requires vm.bits == 64 & vm.opt.final.UseCompressedOops == true & os.family != "windows"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * @requires vm.bits == 64 & vm.opt.final.UseCompressedOops == true & os.family != "windows" & !(os.family == "mac" & os.arch=="aarch64")
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- * @library /test/lib
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- * @modules java.base/jdk.internal.misc
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- * java.management
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- test/hotspot/jtreg/runtime/ErrorHandling/TestOnError.java.orig
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ test/hotspot/jtreg/runtime/ErrorHandling/TestOnError.java
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -25,9 +25,12 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- * @test TestOnError
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- * @bug 8078470
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- * @summary Test using -XX:OnError=<cmd>
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * COMMENTS
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * Macos_aarch64 (unlike macos_intel) doesn't let the java to create
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * core file with ErrorHandlerTest=12. so need to ignore this test there.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- * @modules java.base/jdk.internal.misc
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- * @library /test/lib
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- * @requires vm.debug
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * @requires vm.debug & !(os.arch == "aarch64" & os.family == "mac")
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- * @run main TestOnError
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- /dev/null
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ test/hotspot/jtreg/runtime/jni/codegenAttachThread/TestCodegenAttach.java
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -0,0 +1,42 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+/*
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * Copyright (c) 2018, 2021, Oracle and/or its affiliates. All rights reserved.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * Copyright (c) 2021, Azul Systems, Inc. All rights reserved.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ *
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * This code is free software; you can redistribute it and/or modify it
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * under the terms of the GNU General Public License version 2 only, as
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * published by the Free Software Foundation.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ *
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * This code is distributed in the hope that it will be useful, but WITHOUT
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * version 2 for more details (a copy is included in the LICENSE file that
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * accompanied this code).
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ *
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * You should have received a copy of the GNU General Public License version
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * 2 along with this work; if not, write to the Free Software Foundation,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ *
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * or visit www.oracle.com if you need additional information or have any
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * questions.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+/*
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * @test
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * @requires os.arch == "aarch64" & os.family == "mac"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * @run main/othervm/native TestCodegenAttach
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+public class TestCodegenAttach {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ static native void testCodegenAttach();
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ static {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ System.loadLibrary("codegenAttach");
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ public static void main(String[] args) throws Throwable {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ testCodegenAttach();
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- /dev/null
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ test/hotspot/jtreg/runtime/jni/codegenAttachThread/libcodegenAttach.c
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -0,0 +1,124 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+/*
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * Copyright (c) 2018, 2021, Oracle and/or its affiliates. All rights reserved.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * Copyright (c) 2021, Azul Systems, Inc. All rights reserved.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ *
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * This code is free software; you can redistribute it and/or modify it
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * under the terms of the GNU General Public License version 2 only, as
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * published by the Free Software Foundation.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ *
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * This code is distributed in the hope that it will be useful, but WITHOUT
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * version 2 for more details (a copy is included in the LICENSE file that
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * accompanied this code).
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ *
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * You should have received a copy of the GNU General Public License version
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * 2 along with this work; if not, write to the Free Software Foundation,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ *
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * or visit www.oracle.com if you need additional information or have any
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * questions.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#include <stdio.h>
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#include <stdlib.h>
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#include <stdbool.h>
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#include <string.h>
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#include "jni.h"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#if defined(__APPLE__) && defined(__aarch64__)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#include <pthread.h>
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#include <sys/mman.h>
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+JavaVM* jvm;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+static void* codegen;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+static int thread_start2(int val) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ JNIEnv *env;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ jclass class_id;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ jmethodID method_id;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ int res;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ printf("Native thread is running and attaching ...\n");
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ res = (*jvm)->AttachCurrentThread(jvm, (void **)&env, NULL);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (res != JNI_OK) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ fprintf(stderr, "Test ERROR. Can't attach current thread: %d\n", res);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ exit(1);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ res = (*jvm)->DetachCurrentThread(jvm);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (res != JNI_OK) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ fprintf(stderr, "Test ERROR. Can't detach current thread: %d\n", res);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ exit(1);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ printf("Native thread is about to finish\n");
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ return 1 + val;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+static int trampoline(int(*fn)(int), int arg) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ int val = fn(arg);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ // ensure code in MAP_JIT area after target function returns
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ return 1 + val;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+static void * thread_start(void* unused) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ int val = ((int(*)(int(*)(int),int))codegen)(thread_start2, 10);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ printf("return val = %d\n", val);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ return NULL;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+JNIEXPORT void JNICALL
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+Java_TestCodegenAttach_testCodegenAttach
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+(JNIEnv *env, jclass cls) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ codegen = mmap(NULL, 0x1000,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ PROT_READ | PROT_WRITE | PROT_EXEC,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ MAP_PRIVATE | MAP_ANONYMOUS | MAP_JIT, -1, 0);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (codegen == MAP_FAILED) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ perror("mmap");
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ exit(1);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ pthread_jit_write_protect_np(false);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ memcpy(codegen, trampoline, 128);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ pthread_jit_write_protect_np(true);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ pthread_t thread;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ int res = (*env)->GetJavaVM(env, &jvm);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (res != JNI_OK) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ fprintf(stderr, "Test ERROR. Can't extract JavaVM: %d\n", res);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ exit(1);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if ((res = pthread_create(&thread, NULL, thread_start, NULL)) != 0) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ fprintf(stderr, "TEST ERROR: pthread_create failed: %s (%d)\n", strerror(res), res);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ exit(1);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if ((res = pthread_join(thread, NULL)) != 0) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ fprintf(stderr, "TEST ERROR: pthread_join failed: %s (%d)\n", strerror(res), res);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ exit(1);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#else
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+JNIEXPORT void JNICALL
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+Java_TestCodegenAttach_testCodegenAttach
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+(JNIEnv *env, jclass cls) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ printf("should not reach here\n");
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ exit(1);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#endif // __APPLE__ && __aarch64__
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- test/hotspot/jtreg/vmTestbase/nsk/share/jdi/ArgumentHandler.java.orig
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ test/hotspot/jtreg/vmTestbase/nsk/share/jdi/ArgumentHandler.java
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -1,5 +1,5 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- /*
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * Copyright (c) 2001, 2021, Oracle and/or its affiliates. All rights reserved.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- *
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- * This code is free software; you can redistribute it and/or modify it
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -538,6 +538,8 @@ protected void checkOptions() {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- {"linux-s390x", "com.sun.jdi.SharedMemoryAttach"},
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- {"macosx-amd64", "com.sun.jdi.SharedMemoryAttach"},
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- {"mac-x64", "com.sun.jdi.SharedMemoryAttach"},
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ {"macosx-aarch64", "com.sun.jdi.SharedMemoryAttach"},
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ {"mac-aarch64", "com.sun.jdi.SharedMemoryAttach"},
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- {"aix-ppc64", "com.sun.jdi.SharedMemoryAttach"},
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- // listening connectors
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -568,6 +570,8 @@ protected void checkOptions() {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- {"linux-s390x", "com.sun.jdi.SharedMemoryListen"},
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- {"macosx-amd64", "com.sun.jdi.SharedMemoryListen"},
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- {"mac-x64", "com.sun.jdi.SharedMemoryListen"},
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ {"macosx-aarch64", "com.sun.jdi.SharedMemoryListen"},
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ {"mac-aarch64", "com.sun.jdi.SharedMemoryListen"},
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- {"aix-ppc64", "com.sun.jdi.SharedMemoryListen"},
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- // launching connectors
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -647,8 +651,14 @@ protected void checkOptions() {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- {"macosx-amd64", "com.sun.jdi.CommandLineLaunch", "dt_shmem"},
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- {"macosx-amd64", "com.sun.jdi.RawCommandLineLaunch", "dt_shmem"},
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- {"mac-x64", "com.sun.jdi.CommandLineLaunch", "dt_shmem"},
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- {"mac-x64", "com.sun.jdi.RawCommandLineLaunch", "dt_shmem"},
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ {"mac-x64", "com.sun.jdi.CommandLineLaunch", "dt_shmem"},
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ {"mac-x64", "com.sun.jdi.RawCommandLineLaunch", "dt_shmem"},
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ {"macosx-aarch64", "com.sun.jdi.CommandLineLaunch", "dt_shmem"},
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ {"macosx-aarch64", "com.sun.jdi.RawCommandLineLaunch", "dt_shmem"},
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ {"mac-aarch64", "com.sun.jdi.CommandLineLaunch", "dt_shmem"},
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ {"mac-aarch64", "com.sun.jdi.RawCommandLineLaunch", "dt_shmem"},
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- {"aix-ppc64", "com.sun.jdi.CommandLineLaunch", "dt_shmem"},
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- {"aix-ppc64", "com.sun.jdi.RawCommandLineLaunch", "dt_shmem"},
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -672,6 +682,8 @@ protected void checkOptions() {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- {"linux-s390x", "dt_shmem"},
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- {"macosx-amd64", "dt_shmem"},
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- {"mac-x64", "dt_shmem"},
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ {"macosx-aarch64", "dt_shmem"},
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ {"mac-aarch64", "dt_shmem"},
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- {"aix-ppc64", "dt_shmem"},
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- };
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;color:#808080;'>diff --git a/java/openjdk11/files/patch-openjdk11-build1.diff b/java/openjdk11/files/patch-openjdk11-build1.diff
</span>deleted file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index 7d2133bbc58..00000000000
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/java/openjdk11/files/patch-openjdk11-build1.diff
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ /dev/null
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -1,11 +0,0 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- make/autoconf/toolchain.m4.orig
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ make/autoconf/toolchain.m4
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -229,7 +229,7 @@ AC_DEFUN_ONCE([TOOLCHAIN_DETERMINE_TOOLCHAIN_TYPE],
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if test "x$OPENJDK_TARGET_OS" = xmacosx; then
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if test -n "$XCODEBUILD"; then
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- # On Mac OS X, default toolchain to clang after Xcode 5
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- XCODE_VERSION_OUTPUT=`"$XCODEBUILD" -version 2>&1 | $HEAD -n 1`
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ XCODE_VERSION_OUTPUT=`"$XCODEBUILD" -version | $HEAD -n 1`
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- $ECHO "$XCODE_VERSION_OUTPUT" | $GREP "Xcode " > /dev/null
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if test $? -ne 0; then
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- AC_MSG_ERROR([Failed to determine Xcode version.])
</span></pre><pre style='margin:0'>
</pre>