diff options
author | Moonchild <git-repo@palemoon.org> | 2020-03-28 16:50:07 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-28 16:50:07 +0100 |
commit | 1039487b75057f5414a26b584a04db395efb8070 (patch) | |
tree | c89d2c472932747d4c582ca2b83ba12063cf113c /js/src | |
parent | 6676a7d6f1feb9ca9013bf01281ca01f4a8cf4f3 (diff) | |
parent | f7c9359b2ac431ac99fb4e8a1ebd799e6e8fb21c (diff) | |
download | UXP-1039487b75057f5414a26b584a04db395efb8070.tar UXP-1039487b75057f5414a26b584a04db395efb8070.tar.gz UXP-1039487b75057f5414a26b584a04db395efb8070.tar.lz UXP-1039487b75057f5414a26b584a04db395efb8070.tar.xz UXP-1039487b75057f5414a26b584a04db395efb8070.zip |
Merge pull request #1472 from JMadgwick/master
Fix building on sparc64 Linux
Diffstat (limited to 'js/src')
-rw-r--r-- | js/src/gc/Memory.cpp | 6 | ||||
-rw-r--r-- | js/src/jsapi-tests/testGCAllocator.cpp | 7 |
2 files changed, 7 insertions, 6 deletions
diff --git a/js/src/gc/Memory.cpp b/js/src/gc/Memory.cpp index 418984057..17c964da0 100644 --- a/js/src/gc/Memory.cpp +++ b/js/src/gc/Memory.cpp @@ -423,7 +423,7 @@ MapMemoryAt(void* desired, size_t length, int prot = PROT_READ | PROT_WRITE, // possibly be correct on AMD64, but for Solaris/illumos it is. { -#if defined(__ia64__) || (defined(__sparc64__) && defined(__NetBSD__)) || defined(__aarch64__) || (defined(__sun) && defined(__x86_64__)) +#if defined(__ia64__) || defined(__aarch64__) || (defined(__sun) && defined(__x86_64__)) || (defined(__sparc__) && defined(__arch64__) && (defined(__NetBSD__) || defined(__linux__))) MOZ_ASSERT((0xffff800000000000ULL & (uintptr_t(desired) + length - 1)) == 0); #endif void* region = mmap(desired, length, prot, flags, fd, offset); @@ -446,7 +446,7 @@ static inline void* MapMemory(size_t length, int prot = PROT_READ | PROT_WRITE, int flags = MAP_PRIVATE | MAP_ANON, int fd = -1, off_t offset = 0) { -#if defined(__ia64__) || (defined(__sparc64__) && defined(__NetBSD__)) +#if defined(__ia64__) || (defined(__sparc__) && defined(__arch64__) && defined(__NetBSD__)) /* * The JS engine assumes that all allocated pointers have their high 17 bits clear, * which ia64's mmap doesn't support directly. However, we can emulate it by passing @@ -473,7 +473,7 @@ MapMemory(size_t length, int prot = PROT_READ | PROT_WRITE, return nullptr; } return region; -#elif defined(__aarch64__) || (defined(__sun) && defined(__x86_64__)) +#elif defined(__aarch64__) || (defined(__sun) && defined(__x86_64__)) || (defined(__sparc__) && defined(__arch64__) && defined(__linux__)) /* * There might be similar virtual address issue on arm64 which depends on * hardware and kernel configurations. But the work around is slightly diff --git a/js/src/jsapi-tests/testGCAllocator.cpp b/js/src/jsapi-tests/testGCAllocator.cpp index d203019ec..c7f430cb0 100644 --- a/js/src/jsapi-tests/testGCAllocator.cpp +++ b/js/src/jsapi-tests/testGCAllocator.cpp @@ -302,7 +302,8 @@ void unmapPages(void* p, size_t size) { } void* mapMemoryAt(void* desired, size_t length) { -#if defined(__ia64__) || (defined(__sparc64__) && defined(__NetBSD__)) || defined(__aarch64__) +#if defined(__ia64__) || defined(__aarch64__) || \ + (defined(__sparc__) && defined(__arch64__) && (defined(__NetBSD__) || defined(__linux__))) 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); @@ -324,7 +325,7 @@ mapMemory(size_t length) int fd = -1; off_t offset = 0; // The test code must be aligned with the implementation in gc/Memory.cpp. -#if defined(__ia64__) || (defined(__sparc64__) && defined(__NetBSD__)) +#if defined(__ia64__) || (defined(__sparc__) && defined(__arch64__) && defined(__NetBSD__)) void* region = mmap((void*)0x0000070000000000, length, prot, flags, fd, offset); if (region == MAP_FAILED) return nullptr; @@ -334,7 +335,7 @@ mapMemory(size_t length) return nullptr; } return region; -#elif defined(__aarch64__) +#elif defined(__aarch64__) || (defined(__sparc__) && defined(__arch64__) && defined(__linux__)) const uintptr_t start = UINT64_C(0x0000070000000000); const uintptr_t end = UINT64_C(0x0000800000000000); const uintptr_t step = js::gc::ChunkSize; |