forked from brl/citadel
removed
This commit is contained in:
parent
303da5093e
commit
3c40362b21
@ -1,32 +0,0 @@
|
||||
From f36c9476d2816e0d3e61c9e13c22ed73883cb54a Mon Sep 17 00:00:00 2001
|
||||
From: Khem Raj <raj.khem@gmail.com>
|
||||
Date: Mon, 24 Apr 2017 12:13:43 -0700
|
||||
Subject: [PATCH] compare the first character of string to be null or not
|
||||
|
||||
Fixes
|
||||
|
||||
error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
|
||||
| if (value[0] == '\0')
|
||||
| ^~~~
|
||||
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
---
|
||||
js/src/shell/jsoptparse.cpp | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/js/src/shell/jsoptparse.cpp b/js/src/shell/jsoptparse.cpp
|
||||
index b49d0a5..612aa00 100644
|
||||
--- a/js/src/shell/jsoptparse.cpp
|
||||
+++ b/js/src/shell/jsoptparse.cpp
|
||||
@@ -243,7 +243,7 @@ OptionParser::extractValue(size_t argc, char **argv, size_t *i, char **value)
|
||||
char *eq = strchr(argv[*i], '=');
|
||||
if (eq) {
|
||||
*value = eq + 1;
|
||||
- if (value[0] == '\0')
|
||||
+ if (value[0][0] == '\0')
|
||||
return error("A value is required for option %.*s", eq - argv[*i], argv[*i]);
|
||||
return Okay;
|
||||
}
|
||||
--
|
||||
2.12.2
|
||||
|
@ -1,35 +0,0 @@
|
||||
From 0a61b0b98c152f10404ccbdeeac583a486638a7a Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@googlemail.com>
|
||||
Date: Thu, 6 Jun 2013 18:36:01 +0200
|
||||
Subject: [PATCH] js.pc.in: do not include RequiredDefines.h for depending
|
||||
packages
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
in our cross environment the would fail with:
|
||||
|
||||
| cc1: fatal error: /usr/include/js-17.0/js/RequiredDefines.h: No such file or directory
|
||||
|
||||
and currently it only defines __STDC_LIMIT_MACROS
|
||||
|
||||
Upstream-Status: Inappropriate [embedded specific]
|
||||
|
||||
Signed-off-by: Andreas Müller <schnitzeltony@googlemail.com>
|
||||
---
|
||||
js.pc.in | 2 +-
|
||||
1 files changed, 1 insertions(+), 1 deletions(-)
|
||||
|
||||
diff --git a/js.pc.in b/js.pc.in
|
||||
index 13d761d..a95a7bd 100644
|
||||
--- a/js.pc.in
|
||||
+++ b/js.pc.in
|
||||
@@ -8,4 +8,4 @@ Description: The Mozilla library for JavaScript
|
||||
Version: @MOZILLA_VERSION@
|
||||
Requires.private: @NSPR_PKGCONF_CHECK@
|
||||
Libs: -L${libdir} -l@LIBRARY_NAME@
|
||||
-Cflags: -include ${includedir}/@MODULE@/js/RequiredDefines.h -I${includedir}/@MODULE@
|
||||
+Cflags: -I${includedir}/@MODULE@
|
||||
--
|
||||
1.7.6.5
|
||||
|
@ -1,36 +0,0 @@
|
||||
From da3929a96d9c74e11bf37d128890e18fcb745365 Mon Sep 17 00:00:00 2001
|
||||
From: Lei Maohui <leimaohui@cn.fujitsu.com>
|
||||
Date: Mon, 26 Jan 2015 08:53:19 +0900
|
||||
Subject: [PATCH] mozjs17.0.0: fix the compile bug of powerpc
|
||||
|
||||
To fix the bug as following
|
||||
|
||||
error: cannot convert '__va_list_tag**' to '__va_list_tag (*)[1]' for
|
||||
argument '5' to 'JSBool TryArgumentFormatter(JSContext*, const char**,
|
||||
JSBool, jsval**, __va_list_tag (*)[1])'
|
||||
|
||||
Signed-off-by: Lei Maohui <leimaohui@cn.fujitsu.com>
|
||||
---
|
||||
jscpucfg.h | 6 ++++++
|
||||
1 file changed, 6 insertions(+)
|
||||
|
||||
diff --git a/jscpucfg.h b/jscpucfg.h
|
||||
index dfb1c14..8683491 100644
|
||||
--- a/jscpucfg.h
|
||||
+++ b/jscpucfg.h
|
||||
@@ -47,6 +47,12 @@
|
||||
#elif defined(JS_HAVE_ENDIAN_H)
|
||||
# include <endian.h>
|
||||
|
||||
+#if defined(_POWER) || defined(__powerpc__) || \
|
||||
+ defined(__ppc__)
|
||||
+# define HAVE_VA_LIST_AS_ARRAY 1
|
||||
+# endif
|
||||
+
|
||||
+
|
||||
# if defined(__BYTE_ORDER)
|
||||
# if __BYTE_ORDER == __LITTLE_ENDIAN
|
||||
# define IS_LITTLE_ENDIAN 1
|
||||
--
|
||||
1.8.4.2
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,75 +0,0 @@
|
||||
From d4a15ad82292ff6d772dcc631df98754d20be31b Mon Sep 17 00:00:00 2001
|
||||
From: Colin Walters <walters@verbum.org>
|
||||
Date: Tue, 18 Mar 2014 11:46:05 -0400
|
||||
Subject: [PATCH 2/5] Move JS_BYTES_PER_WORD out of config.h
|
||||
|
||||
Instead define it in terms of the already extant GNU C extension
|
||||
__SIZEOF_POINTER__. This avoids multiarch conflicts when 32 and 64
|
||||
bit packages of js are co-installed.
|
||||
---
|
||||
|
||||
Upstream-status: Pending
|
||||
|
||||
js/src/configure.in | 9 ---------
|
||||
js/src/js-config.h.in | 1 -
|
||||
js/src/jstypes.h | 12 ++++++++++++
|
||||
3 files changed, 12 insertions(+), 10 deletions(-)
|
||||
|
||||
diff --git a/js/src/configure.in b/js/src/configure.in
|
||||
index 15605b2..64c7606 100644
|
||||
--- a/js/src/configure.in
|
||||
+++ b/js/src/configure.in
|
||||
@@ -2345,15 +2345,6 @@ else
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
|
||||
-MOZ_SIZE_OF_TYPE(JS_BYTES_PER_WORD, void*, 4 8)
|
||||
-if test "$moz_cv_size_of_JS_BYTES_PER_WORD" -eq "4"; then
|
||||
- AC_DEFINE(JS_BITS_PER_WORD_LOG2, 5)
|
||||
-elif test "$moz_cv_size_of_JS_BYTES_PER_WORD" -eq "8"; then
|
||||
- AC_DEFINE(JS_BITS_PER_WORD_LOG2, 6)
|
||||
-else
|
||||
- AC_MSG_ERROR([Unexpected JS_BYTES_PER_WORD])
|
||||
-fi
|
||||
-
|
||||
MOZ_ALIGN_OF_TYPE(JS_ALIGN_OF_POINTER, void*, 2 4 8 16)
|
||||
MOZ_SIZE_OF_TYPE(JS_BYTES_PER_DOUBLE, double, 6 8 10 12 14)
|
||||
|
||||
diff --git a/js/src/js-config.h.in b/js/src/js-config.h.in
|
||||
index 6889e00..4775420 100644
|
||||
--- a/js/src/js-config.h.in
|
||||
+++ b/js/src/js-config.h.in
|
||||
@@ -56,7 +56,6 @@
|
||||
#undef JS_INT32_TYPE
|
||||
#undef JS_INT64_TYPE
|
||||
#undef JS_INTPTR_TYPE
|
||||
-#undef JS_BYTES_PER_WORD
|
||||
|
||||
/* Some mozilla code uses JS-friend APIs that depend on JS_METHODJIT being
|
||||
correct. */
|
||||
diff --git a/js/src/jstypes.h b/js/src/jstypes.h
|
||||
index d0cf183..3e7928f 100644
|
||||
--- a/js/src/jstypes.h
|
||||
+++ b/js/src/jstypes.h
|
||||
@@ -24,6 +24,18 @@
|
||||
#include "mozilla/Util.h"
|
||||
|
||||
#include "js-config.h"
|
||||
+#ifndef JS_BYTES_PER_WORD
|
||||
+#define JS_BYTES_PER_WORD __SIZEOF_POINTER__
|
||||
+#endif
|
||||
+#ifndef JS_BITS_PER_WORD_LOG2
|
||||
+#if JS_BYTES_PER_WORD == 8
|
||||
+#define JS_BITS_PER_WORD_LOG2 6
|
||||
+#elif JS_BYTES_PER_WORD == 4
|
||||
+#define JS_BITS_PER_WORD_LOG2 5
|
||||
+#else
|
||||
+#error Unhandled JS_BYTES_PER_WORD
|
||||
+#endif
|
||||
+#endif
|
||||
|
||||
/***********************************************************************
|
||||
** MACROS: JS_EXTERN_API
|
||||
--
|
||||
1.9.3
|
||||
|
@ -1,76 +0,0 @@
|
||||
From 15e710e331d36eb279852b5cd1ba37a9a6005217 Mon Sep 17 00:00:00 2001
|
||||
From: Koen Kooi <koen.kooi@linaro.org>
|
||||
Date: Mon, 2 Mar 2015 19:08:22 +0800
|
||||
Subject: [PATCH 3/5] Add AArch64 support
|
||||
|
||||
---
|
||||
Upstream-status: Pending
|
||||
|
||||
js/src/assembler/jit/ExecutableAllocator.h | 6 ++++++
|
||||
js/src/assembler/wtf/Platform.h | 4 ++++
|
||||
js/src/configure.in | 4 ++++
|
||||
mfbt/double-conversion/utils.h | 1 +
|
||||
4 files changed, 15 insertions(+)
|
||||
|
||||
diff --git a/js/src/assembler/jit/ExecutableAllocator.h b/js/src/assembler/jit/ExecutableAllocator.h
|
||||
index c071c33..90764c3 100644
|
||||
--- a/js/src/assembler/jit/ExecutableAllocator.h
|
||||
+++ b/js/src/assembler/jit/ExecutableAllocator.h
|
||||
@@ -382,6 +382,12 @@ public:
|
||||
{
|
||||
reprotectRegion(start, size, Executable);
|
||||
}
|
||||
+#elif WTF_CPU_AARCH64 && WTF_PLATFORM_LINUX
|
||||
+ static void cacheFlush(void* code, size_t size)
|
||||
+ {
|
||||
+ intptr_t end = reinterpret_cast<intptr_t>(code) + size;
|
||||
+ __builtin___clear_cache(reinterpret_cast<char*>(code), reinterpret_cast<char*>(end));
|
||||
+ }
|
||||
#else
|
||||
static void makeWritable(void*, size_t) {}
|
||||
static void makeExecutable(void*, size_t) {}
|
||||
diff --git a/js/src/assembler/wtf/Platform.h b/js/src/assembler/wtf/Platform.h
|
||||
index 0c84896..e8763a7 100644
|
||||
--- a/js/src/assembler/wtf/Platform.h
|
||||
+++ b/js/src/assembler/wtf/Platform.h
|
||||
@@ -325,6 +325,10 @@
|
||||
#define WTF_THUMB_ARCH_VERSION 0
|
||||
#endif
|
||||
|
||||
+/* CPU(AArch64) - 64-bit ARM */
|
||||
+#if defined(__aarch64__)
|
||||
+#define WTF_CPU_AARCH64 1
|
||||
+#endif
|
||||
|
||||
/* WTF_CPU_ARMV5_OR_LOWER - ARM instruction set v5 or earlier */
|
||||
/* On ARMv5 and below the natural alignment is required.
|
||||
diff --git a/js/src/configure.in b/js/src/configure.in
|
||||
index 64c7606..0673aca 100644
|
||||
--- a/js/src/configure.in
|
||||
+++ b/js/src/configure.in
|
||||
@@ -1121,6 +1121,10 @@ arm*)
|
||||
CPU_ARCH=arm
|
||||
;;
|
||||
|
||||
+aarch64)
|
||||
+ CPU_ARCH=aarch64
|
||||
+ ;;
|
||||
+
|
||||
mips|mipsel)
|
||||
CPU_ARCH="mips"
|
||||
;;
|
||||
diff --git a/mfbt/double-conversion/utils.h b/mfbt/double-conversion/utils.h
|
||||
index 0eec2d9..fe26dab 100644
|
||||
--- a/mfbt/double-conversion/utils.h
|
||||
+++ b/mfbt/double-conversion/utils.h
|
||||
@@ -58,6 +58,7 @@
|
||||
defined(__mips__) || defined(__powerpc__) || \
|
||||
defined(__sparc__) || defined(__sparc) || defined(__s390__) || \
|
||||
defined(__SH4__) || defined(__alpha__) || \
|
||||
+ defined(__aarch64__) || \
|
||||
defined(_MIPS_ARCH_MIPS32R2)
|
||||
#define DOUBLE_CONVERSION_CORRECT_DOUBLE_OPERATIONS 1
|
||||
#elif defined(_M_IX86) || defined(__i386__) || defined(__i386)
|
||||
--
|
||||
1.9.3
|
||||
|
@ -1,103 +0,0 @@
|
||||
From 0128c5a9eeee0d3fc0deb9129dd20eb79338c8f4 Mon Sep 17 00:00:00 2001
|
||||
From: Koen Kooi <koen.kooi@linaro.org>
|
||||
Date: Mon, 2 Mar 2015 19:08:59 +0800
|
||||
Subject: [PATCH 4/5] mozbug746112-no-decommit-on-large-pages
|
||||
|
||||
---
|
||||
Upstream-status: Pending
|
||||
|
||||
js/src/gc/Heap.h | 15 ++++++++++-----
|
||||
js/src/jsgc.cpp | 15 ++++++++++++---
|
||||
2 files changed, 22 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/js/src/gc/Heap.h b/js/src/gc/Heap.h
|
||||
index b8f8c78..1cfd269 100644
|
||||
--- a/js/src/gc/Heap.h
|
||||
+++ b/js/src/gc/Heap.h
|
||||
@@ -103,26 +103,31 @@ struct Cell
|
||||
};
|
||||
|
||||
/*
|
||||
- * Page size is 4096 by default, except for SPARC, where it is 8192.
|
||||
+ * Page size must be static to support our arena pointer optimizations, so we
|
||||
+ * are forced to support each platform with non-4096 pages as a special case.
|
||||
+ * Note: The freelist supports a maximum arena shift of 15.
|
||||
* Note: Do not use JS_CPU_SPARC here, this header is used outside JS.
|
||||
* Bug 692267: Move page size definition to gc/Memory.h and include it
|
||||
* directly once jsgc.h is no longer an installed header.
|
||||
*/
|
||||
#if defined(SOLARIS) && (defined(__sparc) || defined(__sparcv9))
|
||||
const size_t PageShift = 13;
|
||||
+const size_t ArenaShift = PageShift;
|
||||
+#elif defined(__powerpc__)
|
||||
+const size_t PageShift = 16;
|
||||
+const size_t ArenaShift = 12;
|
||||
#else
|
||||
const size_t PageShift = 12;
|
||||
+const size_t ArenaShift = PageShift;
|
||||
#endif
|
||||
const size_t PageSize = size_t(1) << PageShift;
|
||||
+const size_t ArenaSize = size_t(1) << ArenaShift;
|
||||
+const size_t ArenaMask = ArenaSize - 1;
|
||||
|
||||
const size_t ChunkShift = 20;
|
||||
const size_t ChunkSize = size_t(1) << ChunkShift;
|
||||
const size_t ChunkMask = ChunkSize - 1;
|
||||
|
||||
-const size_t ArenaShift = PageShift;
|
||||
-const size_t ArenaSize = PageSize;
|
||||
-const size_t ArenaMask = ArenaSize - 1;
|
||||
-
|
||||
/*
|
||||
* This is the maximum number of arenas we allow in the FreeCommitted state
|
||||
* before we trigger a GC_SHRINK to release free arenas to the OS.
|
||||
diff --git a/js/src/jsgc.cpp b/js/src/jsgc.cpp
|
||||
index b3caf05..a258d2d 100644
|
||||
--- a/js/src/jsgc.cpp
|
||||
+++ b/js/src/jsgc.cpp
|
||||
@@ -251,6 +251,13 @@ static const int BackgroundPhaseLength[] = {
|
||||
sizeof(BackgroundPhaseStrings) / sizeof(AllocKind)
|
||||
};
|
||||
|
||||
+/* Unused memory decommiting requires the arena size match the page size. */
|
||||
+static bool
|
||||
+DecommitEnabled()
|
||||
+{
|
||||
+ return PageSize == ArenaSize;
|
||||
+}
|
||||
+
|
||||
#ifdef DEBUG
|
||||
void
|
||||
ArenaHeader::checkSynchronizedWithFreeList() const
|
||||
@@ -742,7 +749,8 @@ Chunk::fetchNextDecommittedArena()
|
||||
decommittedArenas.unset(offset);
|
||||
|
||||
Arena *arena = &arenas[offset];
|
||||
- MarkPagesInUse(arena, ArenaSize);
|
||||
+ if (DecommitEnabled())
|
||||
+ MarkPagesInUse(arena, ArenaSize);
|
||||
arena->aheader.setAsNotAllocated();
|
||||
|
||||
return &arena->aheader;
|
||||
@@ -2731,7 +2739,7 @@ DecommitArenasFromAvailableList(JSRuntime *rt, Chunk **availableListHeadp)
|
||||
chunk->removeFromAvailableList();
|
||||
|
||||
size_t arenaIndex = Chunk::arenaIndex(aheader->arenaAddress());
|
||||
- bool ok;
|
||||
+ bool ok = true;
|
||||
{
|
||||
/*
|
||||
* If the main thread waits for the decommit to finish, skip
|
||||
@@ -2741,7 +2749,8 @@ DecommitArenasFromAvailableList(JSRuntime *rt, Chunk **availableListHeadp)
|
||||
Maybe<AutoUnlockGC> maybeUnlock;
|
||||
if (!rt->isHeapBusy())
|
||||
maybeUnlock.construct(rt);
|
||||
- ok = MarkPagesUnused(aheader->getArena(), ArenaSize);
|
||||
+ if (DecommitEnabled())
|
||||
+ ok = MarkPagesUnused(aheader->getArena(), ArenaSize);
|
||||
}
|
||||
|
||||
if (ok) {
|
||||
--
|
||||
1.9.3
|
||||
|
@ -1,44 +0,0 @@
|
||||
From 9c42920c2b635a399bd1f93833efdeb1696f17ee Mon Sep 17 00:00:00 2001
|
||||
From: Koen Kooi <koen.kooi@linaro.org>
|
||||
Date: Mon, 2 Mar 2015 19:09:57 +0800
|
||||
Subject: [PATCH 5/5] aarch64-64k-page
|
||||
|
||||
---
|
||||
Upstream-status: Pending
|
||||
|
||||
js/src/gc/Heap.h | 2 +-
|
||||
js/src/gc/Memory.cpp | 3 +++
|
||||
2 files changed, 4 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/js/src/gc/Heap.h b/js/src/gc/Heap.h
|
||||
index 1cfd269..f4dbcda 100644
|
||||
--- a/js/src/gc/Heap.h
|
||||
+++ b/js/src/gc/Heap.h
|
||||
@@ -113,7 +113,7 @@ struct Cell
|
||||
#if defined(SOLARIS) && (defined(__sparc) || defined(__sparcv9))
|
||||
const size_t PageShift = 13;
|
||||
const size_t ArenaShift = PageShift;
|
||||
-#elif defined(__powerpc__)
|
||||
+#elif defined(__powerpc__) || defined(__aarch64__)
|
||||
const size_t PageShift = 16;
|
||||
const size_t ArenaShift = 12;
|
||||
#else
|
||||
diff --git a/js/src/gc/Memory.cpp b/js/src/gc/Memory.cpp
|
||||
index 5b386a2..e5ad018 100644
|
||||
--- a/js/src/gc/Memory.cpp
|
||||
+++ b/js/src/gc/Memory.cpp
|
||||
@@ -302,8 +302,11 @@ GetPageFaultCount()
|
||||
void
|
||||
InitMemorySubsystem()
|
||||
{
|
||||
+ /* aarch64 may have 64KB or 4KB pages */
|
||||
+#ifndef __aarch64__
|
||||
if (size_t(sysconf(_SC_PAGESIZE)) != PageSize)
|
||||
MOZ_CRASH();
|
||||
+#endif
|
||||
}
|
||||
|
||||
void *
|
||||
--
|
||||
1.9.3
|
||||
|
@ -1,46 +0,0 @@
|
||||
From a452138a1dd274bfad381a701729783360dc86fb Mon Sep 17 00:00:00 2001
|
||||
From: Maciej Borzecki <maciej.borzecki@open-rnd.pl>
|
||||
Date: Tue, 5 Jan 2016 22:04:17 +0100
|
||||
Subject: [PATCH] fix cross compilation on i586 targets
|
||||
|
||||
Remove offending -Wl,-rpath-link that may cause host libraries to be picked
|
||||
during linking. The patch applies a fix to configure.in. So as not to
|
||||
regenerate configure, similar fix is applied there.
|
||||
|
||||
Upstream-Status: Inappropriate [embedded specific]
|
||||
|
||||
Signed-off-by: Maciej Borzecki <maciej.borzecki@open-rnd.pl>
|
||||
---
|
||||
js/src/configure | 2 +-
|
||||
js/src/configure.in | 2 +-
|
||||
2 files changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/js/src/configure b/js/src/configure
|
||||
index d019b0fdba44233596541de94307010d85a8e32e..5aa40f757a3dbb7d6887175046f44212c15c2eac 100755
|
||||
--- a/js/src/configure
|
||||
+++ b/js/src/configure
|
||||
@@ -5555,7 +5555,7 @@ TARGET_MD_ARCH=unix
|
||||
DIRENT_INO=d_ino
|
||||
MOZ_USER_DIR=".mozilla"
|
||||
|
||||
-MOZ_FIX_LINK_PATHS='-Wl,-rpath-link,$(LIBXUL_DIST)/bin -Wl,-rpath-link,$(prefix)/lib'
|
||||
+MOZ_FIX_LINK_PATHS='-Wl,-rpath-link,$(LIBXUL_DIST)/bin'
|
||||
|
||||
MOZ_COMPONENT_NSPR_LIBS='-L$(LIBXUL_DIST)/bin $(NSPR_LIBS)'
|
||||
|
||||
diff --git a/js/src/configure.in b/js/src/configure.in
|
||||
index 0673aca12f6d83035549ade2a4a83906bf91f0f0..39b22724f9535ac1a6dba04658c91e4ef667fc47 100644
|
||||
--- a/js/src/configure.in
|
||||
+++ b/js/src/configure.in
|
||||
@@ -919,7 +919,7 @@ TARGET_MD_ARCH=unix
|
||||
DIRENT_INO=d_ino
|
||||
MOZ_USER_DIR=".mozilla"
|
||||
|
||||
-MOZ_FIX_LINK_PATHS='-Wl,-rpath-link,$(LIBXUL_DIST)/bin -Wl,-rpath-link,$(prefix)/lib'
|
||||
+MOZ_FIX_LINK_PATHS='-Wl,-rpath-link,$(LIBXUL_DIST)/bin'
|
||||
|
||||
MOZ_COMPONENT_NSPR_LIBS='-L$(LIBXUL_DIST)/bin $(NSPR_LIBS)'
|
||||
|
||||
--
|
||||
2.5.0
|
||||
|
@ -1,115 +0,0 @@
|
||||
From a0c0f32299419359b44ac0f880c1ea9073ae51e1 Mon Sep 17 00:00:00 2001
|
||||
From: Zheng Xu <zheng.xu@linaro.org>
|
||||
Date: Fri, 2 Sep 2016 17:40:05 +0800
|
||||
Subject: [PATCH] Bug 1143022 - Manually mmap on arm64 to ensure high 17 bits
|
||||
are clear. r=ehoogeveen
|
||||
|
||||
There might be 48-bit VA on arm64 depending on kernel configuration.
|
||||
Manually mmap heap memory to align with the assumption made by JS engine.
|
||||
|
||||
Change-Id: Ic5d2b2fe4b758b3c87cc0688348af7e71a991146
|
||||
|
||||
Upstream-status: Backport
|
||||
|
||||
---
|
||||
js/src/gc/Memory.cpp | 73 ++++++++++++++++++++++++++++++++++++++++++++++++++--
|
||||
1 file changed, 71 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/js/src/gc/Memory.cpp b/js/src/gc/Memory.cpp
|
||||
index 5b386a2..38101cf 100644
|
||||
--- a/js/src/gc/Memory.cpp
|
||||
+++ b/js/src/gc/Memory.cpp
|
||||
@@ -306,6 +306,75 @@ InitMemorySubsystem()
|
||||
MOZ_CRASH();
|
||||
}
|
||||
|
||||
+static inline void *
|
||||
+MapMemory(size_t length, int prot, int flags, int fd, off_t offset)
|
||||
+{
|
||||
+#if defined(__ia64__)
|
||||
+ /*
|
||||
+ * 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
|
||||
+ * mmap an "addr" parameter with those bits clear. The mmap will return that address,
|
||||
+ * or the nearest available memory above that address, providing a near-guarantee
|
||||
+ * that those bits are clear. If they are not, we return NULL below to indicate
|
||||
+ * out-of-memory.
|
||||
+ *
|
||||
+ * The addr is chosen as 0x0000070000000000, which still allows about 120TB of virtual
|
||||
+ * address space.
|
||||
+ *
|
||||
+ * See Bug 589735 for more information.
|
||||
+ */
|
||||
+ void *region = mmap((void*)0x0000070000000000, length, prot, flags, fd, offset);
|
||||
+ if (region == MAP_FAILED)
|
||||
+ return MAP_FAILED;
|
||||
+ /*
|
||||
+ * If the allocated memory doesn't have its upper 17 bits clear, consider it
|
||||
+ * as out of memory.
|
||||
+ */
|
||||
+ if ((uintptr_t(region) + (length - 1)) & 0xffff800000000000) {
|
||||
+ JS_ALWAYS_TRUE(0 == munmap(region, length));
|
||||
+ return MAP_FAILED;
|
||||
+ }
|
||||
+ return region;
|
||||
+#elif defined(__aarch64__)
|
||||
+ /*
|
||||
+ * There might be similar virtual address issue on arm64 which depends on
|
||||
+ * hardware and kernel configurations. But the work around is slightly
|
||||
+ * different due to the different mmap behavior.
|
||||
+ *
|
||||
+ * TODO: Merge with the above code block if this implementation works for
|
||||
+ * ia64 and sparc64.
|
||||
+ */
|
||||
+ const uintptr_t start = UINT64_C(0x0000070000000000);
|
||||
+ const uintptr_t end = UINT64_C(0x0000800000000000);
|
||||
+ const uintptr_t step = ChunkSize;
|
||||
+ /*
|
||||
+ * Optimization options if there are too many retries in practice:
|
||||
+ * 1. Examine /proc/self/maps to find an available address. This file is
|
||||
+ * not always available, however. In addition, even if we examine
|
||||
+ * /proc/self/maps, we may still need to retry several times due to
|
||||
+ * racing with other threads.
|
||||
+ * 2. Use a global/static variable with lock to track the addresses we have
|
||||
+ * allocated or tried.
|
||||
+ */
|
||||
+ uintptr_t hint;
|
||||
+ void* region = MAP_FAILED;
|
||||
+ for (hint = start; region == MAP_FAILED && hint + length <= end; hint += step) {
|
||||
+ region = mmap((void*)hint, length, prot, flags, fd, offset);
|
||||
+ if (region != MAP_FAILED) {
|
||||
+ if ((uintptr_t(region) + (length - 1)) & 0xffff800000000000) {
|
||||
+ if (munmap(region, length)) {
|
||||
+ MOZ_ASSERT(errno == ENOMEM);
|
||||
+ }
|
||||
+ region = MAP_FAILED;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ return region == MAP_FAILED ? NULL : region;
|
||||
+#else
|
||||
+ return mmap(NULL, length, prot, flags, fd, offset);
|
||||
+#endif
|
||||
+}
|
||||
+
|
||||
void *
|
||||
MapAlignedPages(size_t size, size_t alignment)
|
||||
{
|
||||
@@ -319,12 +388,12 @@ MapAlignedPages(size_t size, size_t alignment)
|
||||
|
||||
/* Special case: If we want page alignment, no further work is needed. */
|
||||
if (alignment == PageSize) {
|
||||
- return mmap(NULL, size, prot, flags, -1, 0);
|
||||
+ return MapMemory(size, prot, flags, -1, 0);
|
||||
}
|
||||
|
||||
/* Overallocate and unmap the region's edges. */
|
||||
size_t reqSize = Min(size + 2 * alignment, 2 * size);
|
||||
- void *region = mmap(NULL, reqSize, prot, flags, -1, 0);
|
||||
+ void *region = MapMemory(reqSize, prot, flags, -1, 0);
|
||||
if (region == MAP_FAILED)
|
||||
return NULL;
|
||||
|
||||
--
|
||||
1.9.1
|
||||
|
@ -1,18 +0,0 @@
|
||||
fix the compile error of powerpc64
|
||||
|
||||
Upstream-status: Accepted
|
||||
|
||||
fix the following error
|
||||
|error: 'jsuword' does not name a type
|
||||
|
||||
|
||||
--- a/js/src/jsval.hold 2015-04-24 01:15:06.692970731 -0500
|
||||
+++ b/js/src/jsval.h 2015-04-24 01:15:41.792969478 -0500
|
||||
@@ -304,7 +304,6 @@
|
||||
int32_t i32;
|
||||
uint32_t u32;
|
||||
JSWhyMagic why;
|
||||
- jsuword word;
|
||||
} payload;
|
||||
} s;
|
||||
double asDouble;
|
@ -1,20 +0,0 @@
|
||||
fix the compile error do to perl update
|
||||
|
||||
Upstream-status: Inappropriate
|
||||
|
||||
|
||||
Signed-of-by: Armin Kuster <akuster808@gmail.com>
|
||||
|
||||
Index: src/config/milestone.pl
|
||||
===================================================================
|
||||
--- src.orig/config/milestone.pl
|
||||
+++ src/config/milestone.pl
|
||||
@@ -55,7 +55,7 @@ $MILESTONE_FILE = "$TOPSRCDIR/config/mi
|
||||
#
|
||||
my $milestone = Moz::Milestone::getOfficialMilestone($MILESTONE_FILE);
|
||||
|
||||
-if (defined(@TEMPLATE_FILE)) {
|
||||
+if (@TEMPLATE_FILE) {
|
||||
my $TFILE;
|
||||
|
||||
foreach $TFILE (@TEMPLATE_FILE) {
|
@ -1,82 +0,0 @@
|
||||
SUMMARY = "SpiderMonkey is Mozilla's JavaScript engine written in C/C++"
|
||||
HOMEPAGE = "http://www.mozilla.org/js/"
|
||||
LICENSE = "MPL-2.0"
|
||||
LIC_FILES_CHKSUM = "file://../../LICENSE;md5=815ca599c9df247a0c7f619bab123dad"
|
||||
|
||||
SRC_URI = "http://ftp.mozilla.org/pub/mozilla.org/js/${BPN}${PV}.tar.gz \
|
||||
file://0001-mozjs17.0.0-fix-the-compile-bug-of-powerpc.patch \
|
||||
file://0001-js.pc.in-do-not-include-RequiredDefines.h-for-depend.patch \
|
||||
file://0002-Move-JS_BYTES_PER_WORD-out-of-config.h.patch;patchdir=../../ \
|
||||
file://0003-Add-AArch64-support.patch;patchdir=../../ \
|
||||
file://0004-mozbug746112-no-decommit-on-large-pages.patch;patchdir=../../ \
|
||||
file://0005-aarch64-64k-page.patch;patchdir=../../ \
|
||||
file://0001-regenerate-configure.patch;patchdir=../../ \
|
||||
file://fix-the-compile-error-of-powerpc64.patch;patchdir=../../ \
|
||||
file://fix_milestone_compile_issue.patch \
|
||||
file://0010-fix-cross-compilation-on-i586-targets.patch;patchdir=../../ \
|
||||
file://Manually_mmap_heap_memory_esr17.patch;patchdir=../../ \
|
||||
file://0001-compare-the-first-character-of-string-to-be-null-or-.patch;patchdir=../../ \
|
||||
"
|
||||
|
||||
SRC_URI[md5sum] = "20b6f8f1140ef6e47daa3b16965c9202"
|
||||
SRC_URI[sha256sum] = "321e964fe9386785d3bf80870640f2fa1c683e32fe988eeb201b04471c172fba"
|
||||
|
||||
S = "${WORKDIR}/${BPN}${PV}/js/src"
|
||||
|
||||
inherit autotools pkgconfig perlnative pythonnative
|
||||
|
||||
DEPENDS += "nspr zlib"
|
||||
|
||||
# Host specific flags need to be defined, otherwise target flags will be passed to the host
|
||||
export HOST_CFLAGS = "${BUILD_CFLAGS}"
|
||||
export HOST_CXXFLAGS = "${BUILD_CXXFLAGS}"
|
||||
export HOST_LDFLAGS = "${BUILD_LDFLAGS}"
|
||||
|
||||
# nspr's package-config is ignored so set libs manually
|
||||
EXTRA_OECONF = " \
|
||||
--target=${TARGET_SYS} \
|
||||
--host=${BUILD_SYS} \
|
||||
--build=${BUILD_SYS} \
|
||||
--prefix=${prefix} \
|
||||
--libdir=${libdir} \
|
||||
--with-nspr-libs='-lplds4 -lplc4 -lnspr4' \
|
||||
--enable-threadsafe \
|
||||
--disable-static \
|
||||
"
|
||||
EXTRA_OECONF_append_armv4 = " \
|
||||
--disable-methodjit \
|
||||
"
|
||||
|
||||
PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'x11', d)}"
|
||||
PACKAGECONFIG[x11] = "--with-x --x-includes=${STAGING_INCDIR} --x-libraries=${STAGING_LIBDIR},--without-x,virtual/libx11"
|
||||
|
||||
# mozjs requires autoreconf 2.13
|
||||
do_configure() {
|
||||
export HOST_CFLAGS="${BUILD_CFLAGS}"
|
||||
export HOST_CXXFLAGS="${BUILD_CPPFLAGS}"
|
||||
export HOST_LDFLAGS="${BUILD_LDFLAGS}"
|
||||
( cd ${S}
|
||||
gnu-configize --force
|
||||
mv config.guess config.sub build/autoconf )
|
||||
${S}/configure ${EXTRA_OECONF}
|
||||
}
|
||||
|
||||
# patch.bbclass will try to apply the patches already present and fail, so clean them out
|
||||
do_unpack() {
|
||||
tar -xvf ${DL_DIR}/mozjs17.0.0.tar.gz -C ${WORKDIR}/
|
||||
rm -rf ${WORKDIR}/${BPN}${PV}/patches
|
||||
}
|
||||
|
||||
|
||||
PACKAGES =+ "lib${BPN}"
|
||||
FILES_lib${BPN} += "${libdir}/lib*.so"
|
||||
FILES_${PN}-dev += "${bindir}/js17-config"
|
||||
|
||||
# Fails to build with thumb-1 (qemuarm)
|
||||
#| {standard input}: Assembler messages:
|
||||
#| {standard input}:2172: Error: shifts in CMP/MOV instructions are only supported in unified syntax -- `mov r2,r1,LSR#20'
|
||||
#| {standard input}:2173: Error: unshifted register required -- `bic r2,r2,#(1<<11)'
|
||||
#| {standard input}:2174: Error: unshifted register required -- `orr r1,r1,#(1<<20)'
|
||||
#| {standard input}:2176: Error: instruction not supported in Thumb16 mode -- `subs r2,r2,#0x300'
|
||||
#| {standard input}:2178: Error: instruction not supported in Thumb16 mode -- `subs r5,r2,#52'
|
||||
ARM_INSTRUCTION_SET = "arm"
|
Loading…
Reference in New Issue
Block a user