diff options
author | martin <martin@pkgsrc.org> | 2009-08-23 23:56:19 +0000 |
---|---|---|
committer | martin <martin@pkgsrc.org> | 2009-08-23 23:56:19 +0000 |
commit | 8e82da2469cedb09e086c4f7a0ccf608207298bc (patch) | |
tree | 1401bfa308bfa6812cbea14f1ff6ad421205b923 /www/firefox | |
parent | 67cdf82a55b379ece869d32edd12249733f914e8 (diff) | |
download | pkgsrc-8e82da2469cedb09e086c4f7a0ccf608207298bc.tar.gz |
The aggregate allocator for JSScripts did not care about alignment at all -
make it deal properly at least on 64 bit archs (natural alignment seems
to fit for all substructures for 32bit archs)
Diffstat (limited to 'www/firefox')
-rw-r--r-- | www/firefox/distinfo | 3 | ||||
-rw-r--r-- | www/firefox/patches/patch-na | 121 |
2 files changed, 123 insertions, 1 deletions
diff --git a/www/firefox/distinfo b/www/firefox/distinfo index ebe46f6ea6e..391682cd728 100644 --- a/www/firefox/distinfo +++ b/www/firefox/distinfo @@ -1,4 +1,4 @@ -$NetBSD: distinfo,v 1.88 2009/08/05 02:43:47 tnn Exp $ +$NetBSD: distinfo,v 1.89 2009/08/23 23:56:19 martin Exp $ SHA1 (firefox-3.5.2-source.tar.bz2) = 6439923ff9d316297926ebe193bac3ac1a41b494 RMD160 (firefox-3.5.2-source.tar.bz2) = d5e0b5f0e8b19b216394584ccabf37d776b89a39 @@ -38,6 +38,7 @@ SHA1 (patch-ml) = 9003af056e5b671b2345d0a75e99836746369c00 SHA1 (patch-mm) = faabab8816522bd9a74c2e6e65b2ae3d791affe0 SHA1 (patch-mn) = 17641f46ecf1019f3cc02583a22baa9f9a327d1f SHA1 (patch-mp) = 33128f10b6146419bcebd85f7e6e7fa72e770be1 +SHA1 (patch-na) = 3f1a8919965cdc46359c2c7a4bce47f3feaf5778 SHA1 (patch-xa) = ae5ed1f0fb9a0fd45242a94739853b199ed7da72 SHA1 (patch-xb) = c09bd676d21bef02e04c68c2362e32f408ea9201 SHA1 (patch-xc) = 6e1d6b21d7ded744b082173ea6f35b45999fa965 diff --git a/www/firefox/patches/patch-na b/www/firefox/patches/patch-na new file mode 100644 index 00000000000..15e1cbde2ce --- /dev/null +++ b/www/firefox/patches/patch-na @@ -0,0 +1,121 @@ +$NetBSD: patch-na,v 1.1 2009/08/23 23:56:19 martin Exp $ + +# not yet reported upstream + +--- js/src/jsscript.cpp.orig 2009-08-24 01:32:14.000000000 +0200 ++++ js/src/jsscript.cpp 2009-08-24 01:36:20.000000000 +0200 +@@ -1370,19 +1370,49 @@ js_NewScript(JSContext *cx, uint32 lengt + size_t size, vectorSize; + JSScript *script; + uint8 *cursor; ++#ifdef _LP64 ++#define LP64_ALIGN(V) if ((V) & 7) (V) = (((V)|7) + 1) ++#define LP64_ALIGNP(P) if ((uintptr_t)(P) & 7) (P) = (uint8*)(((uintptr_t)(P)|7) + 1) ++#else ++#define LP64_ALIGN(V) ++#define LP64_ALIGNP(V) ++#endif + +- size = sizeof(JSScript) + +- sizeof(JSAtom *) * natoms + +- length * sizeof(jsbytecode) + +- nsrcnotes * sizeof(jssrcnote); +- if (nobjects != 0) +- size += sizeof(JSObjectArray) + nobjects * sizeof(JSObject *); +- if (nupvars != 0) +- size += sizeof(JSUpvarArray) + nupvars * sizeof(uint32); +- if (nregexps != 0) +- size += sizeof(JSObjectArray) + nregexps * sizeof(JSObject *); +- if (ntrynotes != 0) +- size += sizeof(JSTryNoteArray) + ntrynotes * sizeof(JSTryNote); ++ size = sizeof(JSScript); ++ if (nobjects != 0) { ++ LP64_ALIGN(size); ++ size += sizeof(JSObjectArray); ++ } ++ if (nupvars != 0) { ++ LP64_ALIGN(size); ++ size += sizeof(JSUpvarArray); ++ } ++ if (nregexps != 0) { ++ LP64_ALIGN(size); ++ size += sizeof(JSObjectArray); ++ } ++ if (ntrynotes != 0) { ++ LP64_ALIGN(size); ++ size += sizeof(JSTryNoteArray); ++ } ++ if (natoms != 0) { ++ LP64_ALIGN(size); ++ size += sizeof(JSAtom *) * natoms; ++ } ++ if (nobjects != 0) { ++ LP64_ALIGN(size); ++ size += nobjects * sizeof(JSObject *); ++ } ++ if (nupvars != 0) { ++ size += nupvars * sizeof(uint32); ++ } ++ if (nregexps != 0) { ++ LP64_ALIGN(size); ++ size += nregexps * sizeof(JSObject *); ++ } ++ size += length * sizeof(jsbytecode) + ++ nsrcnotes * sizeof(jssrcnote) + ++ ntrynotes * sizeof(JSTryNote); + + script = (JSScript *) JS_malloc(cx, size); + if (!script) +@@ -1393,23 +1423,28 @@ js_NewScript(JSContext *cx, uint32 lengt + + cursor = (uint8 *)script + sizeof(JSScript); + if (nobjects != 0) { ++ LP64_ALIGNP(cursor); + script->objectsOffset = (uint8)(cursor - (uint8 *)script); + cursor += sizeof(JSObjectArray); + } + if (nupvars != 0) { ++ LP64_ALIGNP(cursor); + script->upvarsOffset = (uint8)(cursor - (uint8 *)script); + cursor += sizeof(JSUpvarArray); + } + if (nregexps != 0) { ++ LP64_ALIGNP(cursor); + script->regexpsOffset = (uint8)(cursor - (uint8 *)script); + cursor += sizeof(JSObjectArray); + } + if (ntrynotes != 0) { ++ LP64_ALIGNP(cursor); + script->trynotesOffset = (uint8)(cursor - (uint8 *)script); + cursor += sizeof(JSTryNoteArray); + } + + if (natoms != 0) { ++ LP64_ALIGNP(cursor); + script->atomMap.length = natoms; + script->atomMap.vector = (JSAtom **)cursor; + vectorSize = natoms * sizeof(script->atomMap.vector[0]); +@@ -1423,6 +1458,7 @@ js_NewScript(JSContext *cx, uint32 lengt + } + + if (nobjects != 0) { ++ LP64_ALIGNP(cursor); + JS_SCRIPT_OBJECTS(script)->length = nobjects; + JS_SCRIPT_OBJECTS(script)->vector = (JSObject **)cursor; + vectorSize = nobjects * sizeof(JS_SCRIPT_OBJECTS(script)->vector[0]); +@@ -1431,6 +1467,7 @@ js_NewScript(JSContext *cx, uint32 lengt + } + + if (nupvars != 0) { ++ LP64_ALIGNP(cursor); + JS_SCRIPT_UPVARS(script)->length = nupvars; + JS_SCRIPT_UPVARS(script)->vector = (uint32 *)cursor; + vectorSize = nupvars * sizeof(JS_SCRIPT_UPVARS(script)->vector[0]); +@@ -1439,6 +1476,7 @@ js_NewScript(JSContext *cx, uint32 lengt + } + + if (nregexps != 0) { ++ LP64_ALIGNP(cursor); + JS_SCRIPT_REGEXPS(script)->length = nregexps; + JS_SCRIPT_REGEXPS(script)->vector = (JSObject **)cursor; + vectorSize = nregexps * sizeof(JS_SCRIPT_REGEXPS(script)->vector[0]); |