mirror of
https://github.com/flatcar/scripts.git
synced 2025-08-22 15:01:00 +02:00
spidermonkey: import upstream 1.8.5 ebuild
This commit is contained in:
parent
56b21dd2aa
commit
a1a6707d80
@ -1 +1,2 @@
|
||||
DIST js185-1.0.0.tar.gz 6164605 SHA256 5d12f7e1f5b4a99436685d97b9b7b75f094d33580227aa998c406bbae6f2a687 SHA512 2af7122a7c7007fd7b6668776fe1222515a810b3e43bbf0f76b8f94e1ef406ffd3fb5ccec393021b00274c05b38a77235bc8d6886994c56762fcaf0aa7cf6718 WHIRLPOOL 58b372713275874d3ae3c6b58c12c56bf8d17d024d591e321538bcdd8e615332e41655954368ce86b90e970209e3fd650c39d931000880f5ec22cb044b5d7a4e
|
||||
DIST mozjs17.0.0.tar.gz 6778934 SHA256 321e964fe9386785d3bf80870640f2fa1c683e32fe988eeb201b04471c172fba SHA512 39b68aeb9f712f146778d8b68ee795709a1372c8ab893a222af4eb34882427d6f5cf877e743d6cb2f1b4348c194d8f3774f00cb775b03515b34b49560b748be4 WHIRLPOOL 4df7b51577787194065162b09d2c3dda849c13fa901305f9925d4ca5d38bb7f8e2daa943099e003fb9d11f9264ae2d77ccf04e5eea11e3ddcb624b504b99d52f
|
||||
|
@ -0,0 +1,99 @@
|
||||
--- a/js-1.8.5/js/src/configure.in 2011-03-31 15:08:36.000000000 -0400
|
||||
+++ b/js-1.8.5/js/src/configure.in 2012-11-02 15:32:38.000000000 -0400
|
||||
@@ -3550,7 +3550,7 @@
|
||||
_SAVE_CFLAGS="$CFLAGS"
|
||||
if test "$GNU_CC"; then
|
||||
# gcc needs -mfpu=neon to recognize NEON instructions
|
||||
- CFLAGS="$CFLAGS -mfpu=neon -mfloat-abi=softfp"
|
||||
+ CFLAGS="$CFLAGS -mfpu=neon"
|
||||
fi
|
||||
AC_TRY_COMPILE([],
|
||||
[asm("vadd.i8 d0, d0, d0");],
|
||||
@@ -4654,12 +4654,6 @@
|
||||
dnl ========================================================
|
||||
MOZ_ARG_HEADER(Individual module options)
|
||||
|
||||
-dnl Setup default CPU arch for arm target
|
||||
-case "$target_cpu" in
|
||||
- arm*)
|
||||
- MOZ_ARM_ARCH=armv7
|
||||
- ;;
|
||||
-esac
|
||||
dnl ========================================================
|
||||
dnl = Enable building the Thumb2 instruction set
|
||||
dnl ========================================================
|
||||
@@ -4668,66 +4662,32 @@
|
||||
MOZ_THUMB2=1,
|
||||
MOZ_THUMB2=)
|
||||
if test -n "$MOZ_THUMB2"; then
|
||||
- MOZ_ARM_ARCH=armv7
|
||||
+ AC_MSG_WARN([thumb2 enabled instead of autodetected -- hope you know what you are doing])
|
||||
+else
|
||||
+ AC_MSG_CHECKING([whether to build for thumb2])
|
||||
+ AC_TRY_COMPILE([],[return sizeof(__thumb2__);],
|
||||
+ [MOZ_THUMB2=1
|
||||
+ AC_MSG_RESULT([yes])],
|
||||
+ [MOZ_THUMB2=
|
||||
+ AC_MSG_RESULT([no])])
|
||||
fi
|
||||
|
||||
dnl ========================================================
|
||||
dnl = Enable building for ARM specific CPU features
|
||||
dnl ========================================================
|
||||
-MOZ_ARG_WITH_STRING(cpu-arch,
|
||||
-[ --with-cpu-arch=arch Use specific arm architecture CPU features, default armv7],
|
||||
- MOZ_ARM_ARCH=$withval)
|
||||
-
|
||||
if test -n "$MOZ_THUMB2"; then
|
||||
case "$target_cpu" in
|
||||
arm*)
|
||||
- if test "$MOZ_ARM_ARCH" != "armv7"; then
|
||||
- AC_MSG_ERROR([--enable-thumb2 is not compatible with cpu-arch=$MOZ_ARM_ARCH])
|
||||
- fi
|
||||
if test "$GNU_CC"; then
|
||||
AC_DEFINE(MOZ_THUMB2)
|
||||
- AC_DEFINE(MOZ_ARM_ARCH)
|
||||
- CFLAGS="$CFLAGS -march=armv7-a -mthumb -mfloat-abi=softfp $MOZ_ARM_VFP_FLAGS"
|
||||
- CXXFLAGS="$CXXFLAGS -march=armv7-a -mthumb -mfloat-abi=softfp $MOZ_ARM_VFP_FLAGS"
|
||||
- ASFLAGS="$ASFLAGS -march=armv7-a -mthumb -mfloat-abi=softfp $MOZ_ARM_VFP_FLAGS"
|
||||
else
|
||||
AC_MSG_ERROR([--enable-thumb2 is not supported for non-GNU toolchains])
|
||||
fi
|
||||
;;
|
||||
- *)
|
||||
- AC_MSG_ERROR([--enable-thumb2 is not supported for non-ARM CPU architectures])
|
||||
- ;;
|
||||
- esac
|
||||
-elif test "$MOZ_ARM_ARCH" = "armv7"; then
|
||||
- case "$target_cpu" in
|
||||
- arm*)
|
||||
- if test "$GNU_CC"; then
|
||||
- AC_DEFINE(MOZ_ARM_ARCH)
|
||||
- CFLAGS="$CFLAGS -march=armv7-a -marm -mfloat-abi=softfp $MOZ_ARM_VFP_FLAGS"
|
||||
- CXXFLAGS="$CXXFLAGS -march=armv7-a -marm -mfloat-abi=softfp $MOZ_ARM_VFP_FLAGS"
|
||||
- ASFLAGS="$ASFLAGS -march=armv7-a -marm -mfloat-abi=softfp $MOZ_ARM_VFP_FLAGS"
|
||||
- else
|
||||
- AC_MSG_ERROR([--with-cpu-arch=armv7 is not supported for non-GNU toolchains])
|
||||
- fi
|
||||
- ;;
|
||||
- *)
|
||||
- AC_MSG_ERROR([--with-cpu-arch=armv7 is not supported for non-ARM CPU architectures])
|
||||
- ;;
|
||||
- esac
|
||||
-else
|
||||
- case "$target_cpu" in
|
||||
- arm*)
|
||||
- if test "$GNU_CC"; then
|
||||
- CFLAGS="$CFLAGS -march=armv5te -mthumb-interwork -msoft-float"
|
||||
- CXXFLAGS="$CXXFLAGS -march=armv5te -mthumb-interwork -msoft-float"
|
||||
- ASFLAGS="$ASFLAGS -march=armv5te -mthumb-interwork -msoft-float"
|
||||
- fi
|
||||
- ;;
|
||||
esac
|
||||
fi
|
||||
|
||||
AC_SUBST(MOZ_THUMB2)
|
||||
-AC_SUBST(MOZ_ARM_ARCH)
|
||||
|
||||
dnl ========================================================
|
||||
dnl =
|
@ -0,0 +1,15 @@
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=628723#c43
|
||||
|
||||
--- js/src/Makefile.in
|
||||
+++ js/src/Makefile.in
|
||||
@@ -888,8 +888,8 @@
|
||||
ifeq (,$(HOST_BIN_SUFFIX))
|
||||
mv -f $(SHLIB_ANY_VER) $(SHLIB_EXACT_VER)
|
||||
@[ ! -h $(SHLIB_ABI_VER) ] || rm -f $(SHLIB_ABI_VER)
|
||||
- ln -s $(SHLIB_EXACT_VER) $(SHLIB_ABI_VER)
|
||||
- ln -s $(SHLIB_ABI_VER) $(SHLIB_ANY_VER)
|
||||
+ ln -s $(notdir $(SHLIB_EXACT_VER)) $(SHLIB_ABI_VER)
|
||||
+ ln -s $(notdir $(SHLIB_ABI_VER)) $(SHLIB_ANY_VER)
|
||||
endif
|
||||
endif
|
||||
ifneq (,$(IMPORT_LIBRARY))
|
@ -0,0 +1,61 @@
|
||||
# HG changeset patch
|
||||
# User Mike Hommey <mh+mozilla@glandium.org>
|
||||
# Date 1303461188 -7200
|
||||
# Node ID 59771590e9203d48ef8cbcd7eaf2f8ae45dbb1c1
|
||||
# Parent c4b82ec27d6d6e1c02ef0abb3b6e805bfdd092ec
|
||||
Bug 638056 - Avoid "The cacheFlush support is missing on this platform" error on exotic platforms. r=cdleary
|
||||
|
||||
diff --git a/js/src/Makefile.in b/js/src/Makefile.in
|
||||
--- a/js/src/Makefile.in
|
||||
+++ b/js/src/Makefile.in
|
||||
@@ -383,17 +383,17 @@ CPPSRCS += checks.cc \
|
||||
platform.cc \
|
||||
utils.cc \
|
||||
$(NONE)
|
||||
|
||||
#
|
||||
# END enclude sources for V8 dtoa
|
||||
#############################################
|
||||
|
||||
-ifeq (,$(filter-out powerpc sparc,$(TARGET_CPU)))
|
||||
+ifeq (,$(filter arm% %86 x86_64,$(TARGET_CPU)))
|
||||
|
||||
VPATH += $(srcdir)/assembler \
|
||||
$(srcdir)/assembler/wtf \
|
||||
$(srcdir)/yarr/pcre \
|
||||
$(NULL)
|
||||
|
||||
CPPSRCS += pcre_compile.cpp \
|
||||
pcre_exec.cpp \
|
||||
|
||||
# HG changeset patch
|
||||
# User Luke Wagner <lw@mozilla.com>
|
||||
# Date 1299520258 28800
|
||||
# Node ID 68203913d04cf5be53fd16278816183d5670ba5c
|
||||
# Parent 27e5814815491ebb68e474e453aff6c2ea908c43
|
||||
Bug 618485 - Add missing 64-bit big-endian jsval_layout field (r=luke)
|
||||
|
||||
diff --git a/js/src/jsval.h b/js/src/jsval.h
|
||||
--- a/js/src/jsval.h
|
||||
+++ b/js/src/jsval.h
|
||||
@@ -342,16 +342,17 @@ typedef union jsval_layout
|
||||
JSValueTag tag : 17;
|
||||
uint64 payload47 : 47;
|
||||
} debugView;
|
||||
struct {
|
||||
union {
|
||||
int32 i32;
|
||||
uint32 u32;
|
||||
JSWhyMagic why;
|
||||
+ jsuword word;
|
||||
} payload;
|
||||
} s;
|
||||
double asDouble;
|
||||
void *asPtr;
|
||||
} jsval_layout;
|
||||
# endif /* JS_BITS_PER_WORD */
|
||||
#endif /* defined(IS_LITTLE_ENDIAN) */
|
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,53 @@
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=589735
|
||||
|
||||
--- a/js/src/jsgcchunk.cpp 2011-03-31 21:08:36.000000000 +0200
|
||||
+++ b/js/src/jsgcchunk.cpp 2012-11-02 10:36:08.324453878 +0100
|
||||
@@ -318,15 +318,48 @@
|
||||
static void *
|
||||
MapPages(void *addr, size_t size)
|
||||
{
|
||||
+#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.
|
||||
+ */
|
||||
+#endif
|
||||
+
|
||||
/*
|
||||
* We don't use MAP_FIXED here, because it can cause the *replacement*
|
||||
* of existing mappings, and we only want to create new mappings.
|
||||
*/
|
||||
+#if defined(__ia64__)
|
||||
+ void *p = mmap(addr ? addr : (void*)0x0000070000000000,
|
||||
+ size, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON,
|
||||
+ -1, 0);
|
||||
+#else
|
||||
void *p = mmap(addr, size, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON,
|
||||
-1, 0);
|
||||
+#endif
|
||||
if (p == MAP_FAILED)
|
||||
return NULL;
|
||||
+#if defined(__ia64__)
|
||||
+ /*
|
||||
+ * If the caller requested a specific memory location, verify that's what mmap returned.
|
||||
+ * Otherwise: If the allocated memory doesn't have its upper 17 bits clear, consider it
|
||||
+ * as out of memory.
|
||||
+ */
|
||||
+ if (addr && p != addr
|
||||
+ || !addr && ((long long)p & 0xffff800000000000)) {
|
||||
+#else
|
||||
+ /* If the caller requested a specific memory location, verify that's what mmap returned. */
|
||||
if (addr && p != addr) {
|
||||
+#endif
|
||||
/* We succeeded in mapping memory, but not in the right place. */
|
||||
JS_ALWAYS_TRUE(munmap(p, size) == 0);
|
||||
return NULL;
|
@ -0,0 +1,381 @@
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=589735
|
||||
|
||||
--- a/js/src/jsatom.cpp 2011-03-31 21:08:36.000000000 +0200
|
||||
+++ b/js/src/jsatom.cpp 2012-11-02 10:43:16.970562590 +0100
|
||||
@@ -603,11 +603,13 @@
|
||||
JSString str, *str2;
|
||||
JSAtomState *state;
|
||||
|
||||
+#ifdef JS_HAS_STATIC_STRINGS
|
||||
if (length == 1) {
|
||||
jschar c = *chars;
|
||||
if (c < UNIT_STRING_LIMIT)
|
||||
return STRING_TO_ATOM(JSString::unitString(c));
|
||||
}
|
||||
+#endif
|
||||
|
||||
str.initFlatNotTerminated((jschar *)chars, length);
|
||||
state = &cx->runtime->atomState;
|
||||
--- a/js/src/jsiter.cpp 2011-03-31 21:08:36.000000000 +0200
|
||||
+++ b/js/src/jsiter.cpp 2012-11-02 10:43:16.974562590 +0100
|
||||
@@ -1002,9 +1002,12 @@
|
||||
|
||||
JSString *str;
|
||||
jsint i;
|
||||
+#ifdef JS_HAS_STATIC_STRINGS
|
||||
if (rval->isInt32() && (jsuint(i = rval->toInt32()) < INT_STRING_LIMIT)) {
|
||||
str = JSString::intString(i);
|
||||
- } else {
|
||||
+ } else
|
||||
+#endif
|
||||
+ {
|
||||
str = js_ValueToString(cx, *rval);
|
||||
if (!str)
|
||||
return false;
|
||||
--- a/js/src/jsnum.cpp 2011-03-31 21:08:36.000000000 +0200
|
||||
+++ b/js/src/jsnum.cpp 2012-11-02 10:43:16.982562589 +0100
|
||||
@@ -605,8 +605,10 @@
|
||||
{
|
||||
uint32 ui;
|
||||
if (si >= 0) {
|
||||
+#ifdef JS_HAS_STATIC_STRINGS
|
||||
if (si < INT_STRING_LIMIT)
|
||||
return JSString::intString(si);
|
||||
+#endif
|
||||
ui = si;
|
||||
} else {
|
||||
ui = uint32(-si);
|
||||
@@ -1169,6 +1171,7 @@
|
||||
|
||||
int32_t i;
|
||||
if (JSDOUBLE_IS_INT32(d, &i)) {
|
||||
+#ifdef JS_HAS_STATIC_STRINGS
|
||||
if (base == 10 && jsuint(i) < INT_STRING_LIMIT)
|
||||
return JSString::intString(i);
|
||||
if (jsuint(i) < jsuint(base)) {
|
||||
@@ -1176,6 +1179,7 @@
|
||||
return JSString::intString(i);
|
||||
return JSString::unitString(jschar('a' + i - 10));
|
||||
}
|
||||
+#endif
|
||||
|
||||
if (JSString *str = c->dtoaCache.lookup(base, d))
|
||||
return str;
|
||||
--- a/js/src/jsstr.cpp 2011-03-31 21:08:36.000000000 +0200
|
||||
+++ b/js/src/jsstr.cpp 2012-11-02 10:43:16.990562588 +0100
|
||||
@@ -3121,6 +3121,8 @@
|
||||
JS_FS_END
|
||||
};
|
||||
|
||||
+#ifdef JS_HAS_STATIC_STRINGS
|
||||
+
|
||||
/*
|
||||
* Set up some tools to make it easier to generate large tables. After constant
|
||||
* folding, for each n, Rn(0) is the comma-separated list R(0), R(1), ..., R(2^n-1).
|
||||
@@ -3291,6 +3293,8 @@
|
||||
#undef R3
|
||||
#undef R7
|
||||
|
||||
+#endif /* defined(JS_HAS_STATIC_STRINGS) */
|
||||
+
|
||||
JSBool
|
||||
js_String(JSContext *cx, uintN argc, Value *vp)
|
||||
{
|
||||
@@ -3331,6 +3335,7 @@
|
||||
uint16_t code;
|
||||
if (!ValueToUint16(cx, argv[0], &code))
|
||||
return JS_FALSE;
|
||||
+#ifdef JS_HAS_STATIC_STRINGS
|
||||
if (code < UNIT_STRING_LIMIT) {
|
||||
str = JSString::unitString(code);
|
||||
if (!str)
|
||||
@@ -3338,6 +3343,7 @@
|
||||
vp->setString(str);
|
||||
return JS_TRUE;
|
||||
}
|
||||
+#endif
|
||||
argv[0].setInt32(code);
|
||||
}
|
||||
chars = (jschar *) cx->malloc((argc + 1) * sizeof(jschar));
|
||||
@@ -3367,8 +3373,10 @@
|
||||
{
|
||||
JS_ASSERT(JS_ON_TRACE(cx));
|
||||
jschar c = (jschar)i;
|
||||
+#ifdef JS_HAS_STATIC_STRINGS
|
||||
if (c < UNIT_STRING_LIMIT)
|
||||
return JSString::unitString(c);
|
||||
+#endif
|
||||
return js_NewStringCopyN(cx, &c, 1);
|
||||
}
|
||||
#endif
|
||||
--- a/js/src/jsstr.h 2011-03-31 21:08:36.000000000 +0200
|
||||
+++ b/js/src/jsstr.h 2012-11-02 10:43:16.998562587 +0100
|
||||
@@ -57,6 +57,15 @@
|
||||
#include "jsvalue.h"
|
||||
#include "jscell.h"
|
||||
|
||||
+#if !defined(__ia64__)
|
||||
+/*
|
||||
+ * Don't use static strings on ia64 since the compiler may put the static
|
||||
+ * memory out of the acceptable 47-bit jsval pointer range.
|
||||
+ */
|
||||
+# define JS_HAS_STATIC_STRINGS
|
||||
+#endif
|
||||
+
|
||||
+#ifdef JS_HAS_STATIC_STRINGS
|
||||
enum {
|
||||
UNIT_STRING_LIMIT = 256U,
|
||||
SMALL_CHAR_LIMIT = 128U, /* Bigger chars cannot be in a length-2 string. */
|
||||
@@ -64,6 +73,7 @@
|
||||
INT_STRING_LIMIT = 256U,
|
||||
NUM_HUNDRED_STRINGS = 156U
|
||||
};
|
||||
+#endif
|
||||
|
||||
extern jschar *
|
||||
js_GetDependentStringChars(JSString *str);
|
||||
@@ -380,10 +390,15 @@
|
||||
typedef uint8 SmallChar;
|
||||
|
||||
static inline bool fitsInSmallChar(jschar c) {
|
||||
+#ifdef JS_HAS_STATIC_STRINGS
|
||||
return c < SMALL_CHAR_LIMIT && toSmallChar[c] != INVALID_SMALL_CHAR;
|
||||
+#else
|
||||
+ return false;
|
||||
+#endif
|
||||
}
|
||||
|
||||
static inline bool isUnitString(void *ptr) {
|
||||
+#ifdef JS_HAS_STATIC_STRINGS
|
||||
jsuword delta = reinterpret_cast<jsuword>(ptr) -
|
||||
reinterpret_cast<jsuword>(unitStringTable);
|
||||
if (delta >= UNIT_STRING_LIMIT * sizeof(JSString))
|
||||
@@ -392,9 +407,13 @@
|
||||
/* If ptr points inside the static array, it must be well-aligned. */
|
||||
JS_ASSERT(delta % sizeof(JSString) == 0);
|
||||
return true;
|
||||
+#else
|
||||
+ return false;
|
||||
+#endif
|
||||
}
|
||||
|
||||
static inline bool isLength2String(void *ptr) {
|
||||
+#ifdef JS_HAS_STATIC_STRINGS
|
||||
jsuword delta = reinterpret_cast<jsuword>(ptr) -
|
||||
reinterpret_cast<jsuword>(length2StringTable);
|
||||
if (delta >= NUM_SMALL_CHARS * NUM_SMALL_CHARS * sizeof(JSString))
|
||||
@@ -403,9 +422,13 @@
|
||||
/* If ptr points inside the static array, it must be well-aligned. */
|
||||
JS_ASSERT(delta % sizeof(JSString) == 0);
|
||||
return true;
|
||||
+#else
|
||||
+ return false;
|
||||
+#endif
|
||||
}
|
||||
|
||||
static inline bool isHundredString(void *ptr) {
|
||||
+#ifdef JS_HAS_STATIC_STRINGS
|
||||
jsuword delta = reinterpret_cast<jsuword>(ptr) -
|
||||
reinterpret_cast<jsuword>(hundredStringTable);
|
||||
if (delta >= NUM_HUNDRED_STRINGS * sizeof(JSString))
|
||||
@@ -414,6 +437,9 @@
|
||||
/* If ptr points inside the static array, it must be well-aligned. */
|
||||
JS_ASSERT(delta % sizeof(JSString) == 0);
|
||||
return true;
|
||||
+#else
|
||||
+ return false;
|
||||
+#endif
|
||||
}
|
||||
|
||||
static inline bool isStatic(void *ptr) {
|
||||
@@ -424,6 +450,7 @@
|
||||
#pragma align 8 (__1cIJSStringPunitStringTable_, __1cIJSStringSlength2StringTable_, __1cIJSStringShundredStringTable_)
|
||||
#endif
|
||||
|
||||
+#ifdef JS_HAS_STATIC_STRINGS
|
||||
static const SmallChar INVALID_SMALL_CHAR = -1;
|
||||
|
||||
static const jschar fromSmallChar[];
|
||||
@@ -436,6 +463,7 @@
|
||||
* strings, we keep a table to map from integer to the correct string.
|
||||
*/
|
||||
static const JSString *const intStringTable[];
|
||||
+#endif
|
||||
|
||||
static JSFlatString *unitString(jschar c);
|
||||
static JSLinearString *getUnitString(JSContext *cx, JSString *str, size_t index);
|
||||
--- a/js/src/jsstrinlines.h 2011-03-31 21:08:36.000000000 +0200
|
||||
+++ b/js/src/jsstrinlines.h 2012-11-02 10:43:17.010562586 +0100
|
||||
@@ -215,52 +215,75 @@
|
||||
inline JSFlatString *
|
||||
JSString::unitString(jschar c)
|
||||
{
|
||||
+#ifdef JS_HAS_STATIC_STRINGS
|
||||
JS_ASSERT(c < UNIT_STRING_LIMIT);
|
||||
return const_cast<JSString *>(&unitStringTable[c])->assertIsFlat();
|
||||
+#else
|
||||
+ JS_NOT_REACHED("no static strings");
|
||||
+ return NULL;
|
||||
+#endif
|
||||
}
|
||||
|
||||
inline JSLinearString *
|
||||
JSString::getUnitString(JSContext *cx, JSString *str, size_t index)
|
||||
{
|
||||
JS_ASSERT(index < str->length());
|
||||
+#ifdef JS_HAS_STATIC_STRINGS
|
||||
const jschar *chars = str->getChars(cx);
|
||||
if (!chars)
|
||||
return NULL;
|
||||
jschar c = chars[index];
|
||||
if (c < UNIT_STRING_LIMIT)
|
||||
return unitString(c);
|
||||
+#endif
|
||||
return js_NewDependentString(cx, str, index, 1);
|
||||
}
|
||||
|
||||
inline JSFlatString *
|
||||
JSString::length2String(jschar c1, jschar c2)
|
||||
{
|
||||
+#ifdef JS_HAS_STATIC_STRINGS
|
||||
JS_ASSERT(fitsInSmallChar(c1));
|
||||
JS_ASSERT(fitsInSmallChar(c2));
|
||||
return const_cast<JSString *> (
|
||||
&length2StringTable[(((size_t)toSmallChar[c1]) << 6) + toSmallChar[c2]]
|
||||
)->assertIsFlat();
|
||||
+#else
|
||||
+ JS_NOT_REACHED("no static strings");
|
||||
+ return NULL;
|
||||
+#endif
|
||||
}
|
||||
|
||||
inline JSFlatString *
|
||||
JSString::length2String(uint32 i)
|
||||
{
|
||||
+#ifdef JS_HAS_STATIC_STRINGS
|
||||
JS_ASSERT(i < 100);
|
||||
return length2String('0' + i / 10, '0' + i % 10);
|
||||
+#else
|
||||
+ JS_NOT_REACHED("no static strings");
|
||||
+ return NULL;
|
||||
+#endif
|
||||
}
|
||||
|
||||
inline JSFlatString *
|
||||
JSString::intString(jsint i)
|
||||
{
|
||||
+#ifdef JS_HAS_STATIC_STRINGS
|
||||
jsuint u = jsuint(i);
|
||||
JS_ASSERT(u < INT_STRING_LIMIT);
|
||||
return const_cast<JSString *>(JSString::intStringTable[u])->assertIsFlat();
|
||||
+#else
|
||||
+ JS_NOT_REACHED("no static strings");
|
||||
+ return NULL;
|
||||
+#endif
|
||||
}
|
||||
|
||||
/* Get a static atomized string for chars if possible. */
|
||||
inline JSFlatString *
|
||||
JSString::lookupStaticString(const jschar *chars, size_t length)
|
||||
{
|
||||
+#ifdef JS_HAS_STATIC_STRINGS
|
||||
if (length == 1) {
|
||||
if (chars[0] < UNIT_STRING_LIMIT)
|
||||
return unitString(chars[0]);
|
||||
@@ -290,6 +313,7 @@
|
||||
return intString(i);
|
||||
}
|
||||
}
|
||||
+#endif
|
||||
|
||||
return NULL;
|
||||
}
|
||||
--- a/js/src/jstracer.cpp 2011-03-31 21:08:36.000000000 +0200
|
||||
+++ b/js/src/jstracer.cpp 2012-11-02 10:43:17.022562584 +0100
|
||||
@@ -11505,6 +11505,7 @@
|
||||
}
|
||||
if (vp[1].isString()) {
|
||||
JSString *str = vp[1].toString();
|
||||
+#ifdef JS_HAS_STATIC_STRINGS
|
||||
if (native == js_str_charAt) {
|
||||
jsdouble i = vp[2].toNumber();
|
||||
if (JSDOUBLE_IS_NaN(i))
|
||||
@@ -11518,7 +11519,9 @@
|
||||
set(&vp[0], char_ins);
|
||||
pendingSpecializedNative = IGNORE_NATIVE_CALL_COMPLETE_CALLBACK;
|
||||
return RECORD_CONTINUE;
|
||||
- } else if (native == js_str_charCodeAt) {
|
||||
+ } else
|
||||
+#endif
|
||||
+ if (native == js_str_charCodeAt) {
|
||||
jsdouble i = vp[2].toNumber();
|
||||
if (JSDOUBLE_IS_NaN(i))
|
||||
i = 0;
|
||||
@@ -12967,6 +12970,7 @@
|
||||
JS_STATIC_ASSERT(sizeof(JSString) == 16 || sizeof(JSString) == 32);
|
||||
|
||||
|
||||
+#ifdef JS_HAS_STATIC_STRINGS
|
||||
JS_REQUIRES_STACK LIns*
|
||||
TraceRecorder::getUnitString(LIns* str_ins, LIns* idx_ins)
|
||||
{
|
||||
@@ -13010,6 +13014,7 @@
|
||||
}
|
||||
return RECORD_CONTINUE;
|
||||
}
|
||||
+#endif
|
||||
|
||||
// Typed array tracing depends on EXPANDED_LOADSTORE and F2I
|
||||
#if NJ_EXPANDED_LOADSTORE_SUPPORTED && NJ_F2I_SUPPORTED
|
||||
@@ -13044,6 +13049,7 @@
|
||||
LIns* obj_ins = get(&lval);
|
||||
LIns* idx_ins = get(&idx);
|
||||
|
||||
+#ifdef JS_HAS_STATIC_STRINGS
|
||||
// Special case for array-like access of strings.
|
||||
if (lval.isString() && hasInt32Repr(idx)) {
|
||||
if (call)
|
||||
@@ -13056,6 +13062,7 @@
|
||||
set(&lval, char_ins);
|
||||
return ARECORD_CONTINUE;
|
||||
}
|
||||
+#endif
|
||||
|
||||
if (lval.isPrimitive())
|
||||
RETURN_STOP_A("JSOP_GETLEM on a primitive");
|
||||
--- a/js/src/jstracer.h 2011-03-31 21:08:36.000000000 +0200
|
||||
+++ b/js/src/jstracer.h 2012-11-02 10:43:17.034562582 +0100
|
||||
@@ -1394,10 +1394,12 @@
|
||||
JS_REQUIRES_STACK RecordingStatus getCharCodeAt(JSString *str,
|
||||
nanojit::LIns* str_ins, nanojit::LIns* idx_ins,
|
||||
nanojit::LIns** out_ins);
|
||||
+#ifdef JS_HAS_STATIC_STRINGS
|
||||
JS_REQUIRES_STACK nanojit::LIns* getUnitString(nanojit::LIns* str_ins, nanojit::LIns* idx_ins);
|
||||
JS_REQUIRES_STACK RecordingStatus getCharAt(JSString *str,
|
||||
nanojit::LIns* str_ins, nanojit::LIns* idx_ins,
|
||||
JSOp mode, nanojit::LIns** out_ins);
|
||||
+#endif
|
||||
|
||||
JS_REQUIRES_STACK RecordingStatus initOrSetPropertyByName(nanojit::LIns* obj_ins,
|
||||
Value* idvalp, Value* rvalp,
|
||||
--- a/js/src/tracejit/Writer.cpp 2011-03-31 21:08:36.000000000 +0200
|
||||
+++ b/js/src/tracejit/Writer.cpp 2012-11-02 10:43:17.038562582 +0100
|
||||
@@ -246,7 +246,9 @@
|
||||
// ins = andq ins_oprnd1, ins_oprnd2
|
||||
ret = true;
|
||||
#endif
|
||||
- } else if (ins->isop(LIR_addp) &&
|
||||
+ }
|
||||
+#ifdef JS_HAS_STATIC_STRINGS
|
||||
+ else if (ins->isop(LIR_addp) &&
|
||||
((ins->oprnd1()->isImmP() &&
|
||||
(void *)ins->oprnd1()->immP() == JSString::unitStringTable) ||
|
||||
(ins->oprnd2()->isImmP() &&
|
||||
@@ -258,6 +260,7 @@
|
||||
// ins = addp JSString::unitStringTable, ...
|
||||
ret = true;
|
||||
}
|
||||
+#endif
|
||||
|
||||
return ret;
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
--- js/src/jsnum.h 2011-03-03 05:43:06.000000000 -0500
|
||||
+++ js/src/jsnum.h.new 2012-08-16 14:58:04.000000000 -0400
|
||||
@@ -97,6 +97,8 @@
|
||||
{
|
||||
#ifdef WIN32
|
||||
return _finite(d);
|
||||
+#elif defined(__UCLIBC__)
|
||||
+ return isfinite(d);
|
||||
#else
|
||||
return finite(d);
|
||||
#endif
|
@ -0,0 +1,21 @@
|
||||
--- a/js/src/configure.in 2012-11-01 19:42:20.130330321 +0100
|
||||
+++ b/js/src/configure.in 2012-11-01 20:34:03.561351492 +0100
|
||||
@@ -3477,7 +3477,16 @@
|
||||
esac
|
||||
|
||||
dnl Performance measurement headers.
|
||||
-AC_CHECK_HEADER(linux/perf_event.h, HAVE_LINUX_PERF_EVENT_H=1)
|
||||
+AC_CHECK_HEADER(linux/perf_event.h,
|
||||
+ [AC_CACHE_CHECK(for perf_event_open system call,ac_cv_perf_event_open,
|
||||
+ [AC_TRY_COMPILE([#include <sys/syscall.h>],[return sizeof(__NR_perf_event_open);],
|
||||
+ ac_cv_perf_event_open=yes,
|
||||
+ ac_cv_perf_event_open=no)])])
|
||||
+if test "$ac_cv_perf_event_open" = "yes"; then
|
||||
+ HAVE_LINUX_PERF_EVENT_H=1
|
||||
+else
|
||||
+ HAVE_LINUX_PERF_EVENT_H=
|
||||
+fi
|
||||
AC_SUBST(HAVE_LINUX_PERF_EVENT_H)
|
||||
|
||||
dnl Checks for libraries.
|
||||
|
@ -0,0 +1,32 @@
|
||||
diff -Naur js/src/configure.in js.new/src/configure.in
|
||||
--- a/js/src/symverscript.in 2012-11-07 09:36:16.000000000 -0500
|
||||
+++ b/js/src/symverscript.in 2012-11-07 09:37:05.000000000 -0500
|
||||
@@ -0,0 +1,4 @@
|
||||
+mozjs185 {
|
||||
+ global: *;
|
||||
+};
|
||||
+
|
||||
diff -Naur js/src/Makefile.in js.new/src/Makefile.in
|
||||
--- a/js/src/Makefile.in 2012-11-07 09:36:16.000000000 -0500
|
||||
+++ b/js/src/Makefile.in 2012-11-07 09:37:09.000000000 -0500
|
||||
@@ -837,7 +837,10 @@
|
||||
mozjs185.pc \
|
||||
$(NULL)
|
||||
|
||||
-GARBAGE += $(pkg_config_files)
|
||||
+symverscript: symverscript.in
|
||||
+ cat $< > $@
|
||||
+
|
||||
+GARBAGE += $(pkg_config_files) symverscript
|
||||
|
||||
%.pc: $(srcdir)/%.pc.in Makefile
|
||||
cat $< | sed \
|
||||
@@ -872,6 +875,8 @@
|
||||
SHLIB_ABI_VER := $(DESTDIR)$(libdir)/$(SHARED_LIBRARY).$(SRCREL_ABI_VERSION)
|
||||
SHLIB_EXACT_VER := $(DESTDIR)$(libdir)/$(SHARED_LIBRARY).$(SRCREL_VERSION)
|
||||
$(SHARED_LIBRARY): EXTRA_DSO_LDOPTS += -Wl,-soname,$(notdir $(SHLIB_ABI_VER))
|
||||
+$(SHARED_LIBRARY): EXTRA_DSO_LDOPTS += -Wl,-version-script,symverscript
|
||||
+$(SHARED_LIBRARY): symverscript
|
||||
endif
|
||||
endif
|
||||
|
@ -0,0 +1,11 @@
|
||||
--- a/js/src/config/system-headers
|
||||
+++ b/js/src/config/system-headers
|
||||
@@ -595,6 +595,7 @@ proto/exec.h
|
||||
psap.h
|
||||
Pt.h
|
||||
pthread.h
|
||||
+pthread_np.h
|
||||
pwd.h
|
||||
Python.h
|
||||
QDOffscreen.h
|
||||
|
@ -0,0 +1,11 @@
|
||||
--- a/js/src/config/milestone.pl 2013-02-11 17:33:22.000000000 -0500
|
||||
+++ b/js/src/config/milestone.pl 2015-07-15 10:44:31.676153600 -0400
|
||||
@@ -55,7 +55,7 @@
|
||||
#
|
||||
my $milestone = Moz::Milestone::getOfficialMilestone($MILESTONE_FILE);
|
||||
|
||||
-if (defined(@TEMPLATE_FILE)) {
|
||||
+if (@TEMPLATE_FILE) {
|
||||
my $TFILE;
|
||||
|
||||
foreach $TFILE (@TEMPLATE_FILE) {
|
136
sdk_container/src/third_party/coreos-overlay/dev-lang/spidermonkey/spidermonkey-1.8.5-r4.ebuild
vendored
Normal file
136
sdk_container/src/third_party/coreos-overlay/dev-lang/spidermonkey/spidermonkey-1.8.5-r4.ebuild
vendored
Normal file
@ -0,0 +1,136 @@
|
||||
# Copyright 1999-2015 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
# $Id$
|
||||
|
||||
EAPI="5"
|
||||
WANT_AUTOCONF="2.1"
|
||||
PYTHON_COMPAT=( python2_7 )
|
||||
PYTHON_REQ_USE="threads"
|
||||
inherit autotools eutils toolchain-funcs multilib python-any-r1 versionator pax-utils
|
||||
|
||||
MY_PN="js"
|
||||
TARBALL_PV="$(replace_all_version_separators '' $(get_version_component_range 1-3))"
|
||||
MY_P="${MY_PN}-${PV}"
|
||||
TARBALL_P="${MY_PN}${TARBALL_PV}-1.0.0"
|
||||
DESCRIPTION="Stand-alone JavaScript C library"
|
||||
HOMEPAGE="http://www.mozilla.org/js/spidermonkey/"
|
||||
SRC_URI="https://ftp.mozilla.org/pub/mozilla.org/js/${TARBALL_P}.tar.gz"
|
||||
|
||||
LICENSE="NPL-1.1"
|
||||
SLOT="0/mozjs185"
|
||||
KEYWORDS="alpha amd64 arm ~arm64 hppa ia64 ~mips ppc ppc64 s390 sh sparc x86 ~amd64-fbsd ~x86-fbsd ~x64-macos"
|
||||
IUSE="debug minimal static-libs test"
|
||||
|
||||
S="${WORKDIR}/${MY_P}"
|
||||
BUILDDIR="${S}/js/src"
|
||||
|
||||
RDEPEND=">=dev-libs/nspr-4.7.0
|
||||
x64-macos? ( dev-libs/jemalloc )"
|
||||
DEPEND="${RDEPEND}
|
||||
${PYTHON_DEPS}
|
||||
app-arch/zip
|
||||
virtual/pkgconfig"
|
||||
|
||||
pkg_setup(){
|
||||
if [[ ${MERGE_TYPE} != "binary" ]]; then
|
||||
export LC_ALL="C"
|
||||
fi
|
||||
}
|
||||
|
||||
src_prepare() {
|
||||
# https://bugzilla.mozilla.org/show_bug.cgi?id=628723#c43
|
||||
epatch "${FILESDIR}/${P}-fix-install-symlinks.patch"
|
||||
# https://bugzilla.mozilla.org/show_bug.cgi?id=638056#c9
|
||||
epatch "${FILESDIR}/${P}-fix-ppc64.patch"
|
||||
# https://bugs.gentoo.org/show_bug.cgi?id=400727
|
||||
# https://bugs.gentoo.org/show_bug.cgi?id=420471
|
||||
epatch "${FILESDIR}/${P}-arm_respect_cflags-3.patch"
|
||||
# https://bugs.gentoo.org/show_bug.cgi?id=438746
|
||||
epatch "${FILESDIR}"/${PN}-1.8.7-freebsd-pthreads.patch
|
||||
# https://bugs.gentoo.org/show_bug.cgi?id=441928
|
||||
epatch "${FILESDIR}"/${PN}-1.8.5-perf_event-check.patch
|
||||
# https://bugs.gentoo.org/show_bug.cgi?id=439260
|
||||
epatch "${FILESDIR}"/${P}-symbol-versions.patch
|
||||
# https://bugs.gentoo.org/show_bug.cgi?id=441934
|
||||
epatch "${FILESDIR}"/${PN}-1.8.5-ia64-fix.patch
|
||||
epatch "${FILESDIR}"/${PN}-1.8.5-ia64-static-strings.patch
|
||||
# https://bugs.gentoo.org/show_bug.cgi?id=431560
|
||||
epatch "${FILESDIR}"/${PN}-1.8.5-isfinite.patch
|
||||
# https://bugs.gentoo.org/show_bug.cgi?id=552786
|
||||
epatch "${FILESDIR}"/${PN}-perl-defined-array-check.patch
|
||||
|
||||
epatch_user
|
||||
|
||||
cd "${BUILDDIR}" || die
|
||||
eautoconf
|
||||
}
|
||||
|
||||
src_configure() {
|
||||
cd "${BUILDDIR}" || die
|
||||
|
||||
CC="$(tc-getCC)" CXX="$(tc-getCXX)" \
|
||||
AR="$(tc-getAR)" RANLIB="$(tc-getRANLIB)" \
|
||||
LD="$(tc-getLD)" \
|
||||
econf \
|
||||
${myopts} \
|
||||
--enable-jemalloc \
|
||||
--enable-readline \
|
||||
--enable-threadsafe \
|
||||
--with-system-nspr \
|
||||
$(use_enable debug) \
|
||||
$(use_enable static-libs static) \
|
||||
$(use_enable test tests)
|
||||
}
|
||||
|
||||
src_compile() {
|
||||
cd "${BUILDDIR}" || die
|
||||
if tc-is-cross-compiler; then
|
||||
make CFLAGS="" CXXFLAGS="" \
|
||||
CC=$(tc-getBUILD_CC) CXX=$(tc-getBUILD_CXX) \
|
||||
AR=$(tc-getBUILD_AR) RANLIB=$(tc-getBUILD_RANLIB) \
|
||||
jscpucfg host_jsoplengen host_jskwgen || die
|
||||
make CFLAGS="" CXXFLAGS="" \
|
||||
CC=$(tc-getBUILD_CC) CXX=$(tc-getBUILD_CXX) \
|
||||
AR=$(tc-getBUILD_AR) RANLIB=$(tc-getBUILD_RANLIB) \
|
||||
-C config nsinstall || die
|
||||
mv {,native-}jscpucfg || die
|
||||
mv {,native-}host_jskwgen || die
|
||||
mv {,native-}host_jsoplengen || die
|
||||
mv config/{,native-}nsinstall || die
|
||||
sed -e 's@./jscpucfg@./native-jscpucfg@' \
|
||||
-e 's@./host_jskwgen@./native-host_jskwgen@' \
|
||||
-e 's@./host_jsoplengen@./native-host_jsoplengen@' \
|
||||
-i Makefile || die
|
||||
sed -e 's@/nsinstall@/native-nsinstall@' -i config/config.mk || die
|
||||
rm -f config/host_nsinstall.o \
|
||||
config/host_pathsub.o \
|
||||
host_jskwgen.o \
|
||||
host_jsoplengen.o || die
|
||||
fi
|
||||
emake
|
||||
}
|
||||
|
||||
src_test() {
|
||||
cd "${BUILDDIR}/jsapi-tests" || die
|
||||
# for bug 415791
|
||||
pax-mark mr jsapi-tests
|
||||
emake check
|
||||
}
|
||||
|
||||
src_install() {
|
||||
cd "${BUILDDIR}" || die
|
||||
emake DESTDIR="${D}" install
|
||||
# bug 437520 , exclude js shell for small systems
|
||||
if ! use minimal ; then
|
||||
dobin shell/js
|
||||
pax-mark m "${ED}/usr/bin/js"
|
||||
fi
|
||||
dodoc ../../README
|
||||
dohtml README.html
|
||||
|
||||
if ! use static-libs; then
|
||||
# We can't actually disable building of static libraries
|
||||
# They're used by the tests and in a few other places
|
||||
find "${D}" -iname '*.a' -delete || die
|
||||
fi
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user