summaryrefslogblamecommitdiff
path: root/user/mozjs/arm64.patch
blob: df1c8cc7e47d721c0db9533c135b6cc2780f9e3d (plain) (tree)



























































                                                                                                 
# HG changeset patch
# User Jim Chen <nchen@mozilla.com>
# Date 1493664360 14400
# Node ID 042d975f9355f711b058152691a44e458ba252b3
# Parent  fa7165dda22460795afe4ed27ecc57f454a3dfaa
Bug 1357874 - Add more AArch64 support to JS code; r=luke

* Fix a parentheses warning when compiling testGCAllocator.cpp.

* Define GETRANDOM_NR macro for AArch64.

* Disable Android workarounds in jsnativestack.cpp and
  WasmSignalHandlers.cpp for AArch64, because AArch64 is only supported
  on API 21+, in which case those workarounds don't apply.

* Enable trace logging in TraceLogging.cpp.

diff --git a/js/src/jsapi-tests/testGCAllocator.cpp b/js/src/jsapi-tests/testGCAllocator.cpp
--- a/js/src/jsapi-tests/testGCAllocator.cpp
+++ b/js/src/jsapi-tests/testGCAllocator.cpp
@@ -310,15 +310,15 @@ void unmapPages(void* p, size_t size) { 
 #elif defined(XP_UNIX)
 
 void*
 mapMemoryAt(void* desired, size_t length)
 {
 #if defined(__ia64__) || (defined(__sparc64__) && defined(__NetBSD__)) || defined(__aarch64__)
-    MOZ_RELEASE_ASSERT(0xffff800000000000ULL & (uintptr_t(desired) + length - 1) == 0);
+    MOZ_RELEASE_ASSERT((0xffff800000000000ULL & (uintptr_t(desired) + length - 1)) == 0);
 #endif
     void* region = mmap(desired, length, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON, -1, 0);
     if (region == MAP_FAILED)
         return nullptr;
     if (region != desired) {
         if (munmap(region, length))
             MOZ_RELEASE_ASSERT(errno == ENOMEM);
         return nullptr;
diff --git a/js/src/vm/TraceLogging.cpp b/js/src/vm/TraceLogging.cpp
--- a/js/src/vm/TraceLogging.cpp
+++ b/js/src/vm/TraceLogging.cpp
@@ -56,17 +56,17 @@ rdtsc(void)
             );
     result = upper;
     result = result<<32;
     result = result|lower;
 
     return result;
 
 }
-#elif defined(__arm__)
+#elif defined(__arm__) || defined(__aarch64__)
 
 #include <sys/time.h>
 
 static __inline__ uint64_t
 rdtsc(void)
 {
     struct timeval tv;
     gettimeofday(&tv, NULL);