diff options
author | Raúl Porcel <armin76@gentoo.org> | 2013-01-06 16:50:09 +0000 |
---|---|---|
committer | Raúl Porcel <armin76@gentoo.org> | 2013-01-06 16:50:09 +0000 |
commit | 8c122de515dd29eea56bae12f87263bf0ff50a51 (patch) | |
tree | 0392ad0aa9c3fd76e5c193653bfe4287759fcf58 /dev-lang/spidermonkey | |
parent | fix bug# from last comment (diff) | |
download | gentoo-2-8c122de515dd29eea56bae12f87263bf0ff50a51.tar.gz gentoo-2-8c122de515dd29eea56bae12f87263bf0ff50a51.tar.bz2 gentoo-2-8c122de515dd29eea56bae12f87263bf0ff50a51.zip |
Add patches for ia64, mark stable, bug #441934
(Portage version: 2.1.11.38/cvs/Linux ia64, signed Manifest commit with key F6AD3240)
Diffstat (limited to 'dev-lang/spidermonkey')
4 files changed, 445 insertions, 3 deletions
diff --git a/dev-lang/spidermonkey/ChangeLog b/dev-lang/spidermonkey/ChangeLog index 54cc2477807b..a91668702352 100644 --- a/dev-lang/spidermonkey/ChangeLog +++ b/dev-lang/spidermonkey/ChangeLog @@ -1,6 +1,11 @@ # ChangeLog for dev-lang/spidermonkey # Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/dev-lang/spidermonkey/ChangeLog,v 1.99 2013/01/01 11:41:30 ago Exp $ +# $Header: /var/cvsroot/gentoo-x86/dev-lang/spidermonkey/ChangeLog,v 1.100 2013/01/06 16:50:09 armin76 Exp $ + + 06 Jan 2013; Raúl Porcel <armin76@gentoo.org> spidermonkey-1.8.5-r4.ebuild, + +files/spidermonkey-1.8.5-ia64-fix.patch, + +files/spidermonkey-1.8.5-ia64-static-strings.patch: + Add patches for ia64, mark stable, bug #441934 01 Jan 2013; Agostino Sarubbo <ago@gentoo.org> spidermonkey-1.8.5-r4.ebuild: Add ~ia64, wrt bug #449220 diff --git a/dev-lang/spidermonkey/files/spidermonkey-1.8.5-ia64-fix.patch b/dev-lang/spidermonkey/files/spidermonkey-1.8.5-ia64-fix.patch new file mode 100644 index 000000000000..bebe5587180f --- /dev/null +++ b/dev-lang/spidermonkey/files/spidermonkey-1.8.5-ia64-fix.patch @@ -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; diff --git a/dev-lang/spidermonkey/files/spidermonkey-1.8.5-ia64-static-strings.patch b/dev-lang/spidermonkey/files/spidermonkey-1.8.5-ia64-static-strings.patch new file mode 100644 index 000000000000..5cfed32ae68e --- /dev/null +++ b/dev-lang/spidermonkey/files/spidermonkey-1.8.5-ia64-static-strings.patch @@ -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; + } diff --git a/dev-lang/spidermonkey/spidermonkey-1.8.5-r4.ebuild b/dev-lang/spidermonkey/spidermonkey-1.8.5-r4.ebuild index 27f7be047a1c..f5832c2971ee 100644 --- a/dev-lang/spidermonkey/spidermonkey-1.8.5-r4.ebuild +++ b/dev-lang/spidermonkey/spidermonkey-1.8.5-r4.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2013 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/dev-lang/spidermonkey/spidermonkey-1.8.5-r4.ebuild,v 1.2 2013/01/01 11:41:30 ago Exp $ +# $Header: /var/cvsroot/gentoo-x86/dev-lang/spidermonkey/spidermonkey-1.8.5-r4.ebuild,v 1.3 2013/01/06 16:50:09 armin76 Exp $ EAPI="5" WANT_AUTOCONF="2.1" @@ -16,7 +16,7 @@ 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 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd" +KEYWORDS="~alpha ~amd64 ~arm ~hppa ia64 ~mips ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd" IUSE="debug minimal static-libs test" S="${WORKDIR}/${MY_P}" @@ -50,6 +50,9 @@ src_prepare() { 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 epatch_user |