summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Morrow <acm@mongodb.com>2021-02-22 16:37:22 -0500
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-02-26 18:13:45 +0000
commit775f2dfe30552cb2b808bcc320021c01eb5bb518 (patch)
treee00cc1ace2f843e9783fffe42d1a4f0ad2194354
parent82a03739b80bf1873ec620165a1d8cfea2edd46f (diff)
downloadmongo-775f2dfe30552cb2b808bcc320021c01eb5bb518.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)
-rwxr-xr-xsrc/third_party/mozjs-60/extract.sh1
-rw-r--r--src/third_party/mozjs-60/extract/js/src/jit/ProcessExecutableMemory.cpp7
-rw-r--r--src/third_party/mozjs-60/patches/moz-bug-1442583.patch29
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 4ae30ee6a78..be5604ff9b1 100755
--- a/src/third_party/mozjs-60/extract.sh
+++ b/src/third_party/mozjs-60/extract.sh
@@ -220,3 +220,4 @@ patch -p4 < patches/big-endian-fixes.patch
patch -p4 < patches/windows-Time.cpp-GetModuleHandle.patch
patch -p4 < patches/JSGCConfig.patch
patch -p4 < patches/struct-hasher.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();
+ }
+