diff options
author | Andrew Morrow <acm@mongodb.com> | 2021-02-22 16:37:22 -0500 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2021-02-26 18:54:09 +0000 |
commit | 16e8cfc7eec8d270e328f4162accb23def2e25a5 (patch) | |
tree | f330c9568cf60f5e4d4f0a786042bc3df4edf1df | |
parent | a64233e90499f6e3d94c21fbe58c91e7bd744ba1 (diff) | |
download | mongo-16e8cfc7eec8d270e328f4162accb23def2e25a5.tar.gz |
SERVER-54684 Apply upstream fix for MozJS bug 1442583
Please see https://bugzilla.mozilla.org/show_bug.cgi?id=1442583 for
the upstream bug. The patch applied here was derived from the
following commit:
https://github.com/mozilla/gecko-dev/commit/7371a080accd8dfcaf0d24072b787e143846973a
(cherry picked from commit 25d0ab84369a09112978d399ccc09b55b7009023)
(cherry picked from commit 775f2dfe30552cb2b808bcc320021c01eb5bb518)
-rwxr-xr-x | src/third_party/mozjs-60/extract.sh | 1 | ||||
-rw-r--r-- | src/third_party/mozjs-60/extract/js/src/jit/ProcessExecutableMemory.cpp | 7 | ||||
-rw-r--r-- | src/third_party/mozjs-60/patches/moz-bug-1442583.patch | 29 |
3 files changed, 37 insertions, 0 deletions
diff --git a/src/third_party/mozjs-60/extract.sh b/src/third_party/mozjs-60/extract.sh index 348a8182aa7..b8363d48cdc 100755 --- a/src/third_party/mozjs-60/extract.sh +++ b/src/third_party/mozjs-60/extract.sh @@ -219,3 +219,4 @@ __XARGS_RM__ patch -p4 < patches/big-endian-fixes.patch patch -p4 < patches/windows-Time.cpp-GetModuleHandle.patch patch -p4 < patches/JSGCConfig.patch +patch -p4 < patches/moz-bug-1442583.patch diff --git a/src/third_party/mozjs-60/extract/js/src/jit/ProcessExecutableMemory.cpp b/src/third_party/mozjs-60/extract/js/src/jit/ProcessExecutableMemory.cpp index e763a9d68dc..8a6d50b6a78 100644 --- a/src/third_party/mozjs-60/extract/js/src/jit/ProcessExecutableMemory.cpp +++ b/src/third_party/mozjs-60/extract/js/src/jit/ProcessExecutableMemory.cpp @@ -20,6 +20,9 @@ #include "jsutil.h" #include "gc/Memory.h" +#ifdef JS_CODEGEN_ARM64 +# include "jit/arm64/vixl/Cpu-vixl.h" +#endif #include "threading/LockGuard.h" #include "threading/Mutex.h" #include "util/Windows.h" @@ -621,6 +624,10 @@ js::jit::DeallocateExecutableMemory(void* addr, size_t bytes) bool js::jit::InitProcessExecutableMemory() { +#ifdef JS_CODEGEN_ARM64 + // Initialize instruction cache flushing. + vixl::CPU::SetUp(); +#endif return execMemory.init(); } diff --git a/src/third_party/mozjs-60/patches/moz-bug-1442583.patch b/src/third_party/mozjs-60/patches/moz-bug-1442583.patch new file mode 100644 index 00000000000..93852c0b29a --- /dev/null +++ b/src/third_party/mozjs-60/patches/moz-bug-1442583.patch @@ -0,0 +1,29 @@ +# Fix https://jira.mongodb.org/browse/SERVER-54684 by applying upstream changes from ESR 69 +# - https://bugzilla.mozilla.org/show_bug.cgi?id=1442583 +# - https://github.com/mozilla/gecko-dev/commit/7371a080accd8dfcaf0d24072b787e143846973a + +diff --git a/src/third_party/mozjs-60/extract/js/src/jit/ProcessExecutableMemory.cpp b/src/third_party/mozjs-60/extract/js/src/jit/ProcessExecutableMemory.cpp +index e763a9d68d..8a6d50b6a7 100644 +--- a/src/third_party/mozjs-60/extract/js/src/jit/ProcessExecutableMemory.cpp ++++ b/src/third_party/mozjs-60/extract/js/src/jit/ProcessExecutableMemory.cpp +@@ -20,6 +20,9 @@ + #include "jsutil.h" + + #include "gc/Memory.h" ++#ifdef JS_CODEGEN_ARM64 ++# include "jit/arm64/vixl/Cpu-vixl.h" ++#endif + #include "threading/LockGuard.h" + #include "threading/Mutex.h" + #include "util/Windows.h" +@@ -621,6 +624,10 @@ js::jit::DeallocateExecutableMemory(void* addr, size_t bytes) + bool + js::jit::InitProcessExecutableMemory() + { ++#ifdef JS_CODEGEN_ARM64 ++ // Initialize instruction cache flushing. ++ vixl::CPU::SetUp(); ++#endif + return execMemory.init(); + } + |