head 1.3; access; symbols pkgsrc-2013Q2:1.3.0.10 pkgsrc-2013Q2-base:1.3 pkgsrc-2012Q4:1.3.0.8 pkgsrc-2012Q4-base:1.3 pkgsrc-2011Q4:1.3.0.6 pkgsrc-2011Q4-base:1.3 pkgsrc-2011Q2:1.3.0.4 pkgsrc-2011Q2-base:1.3 pkgsrc-2009Q4:1.3.0.2 pkgsrc-2009Q4-base:1.3; locks; strict; comment @# @; 1.3 date 2009.09.16.19.06.19; author tnn; state dead; branches; next 1.2; 1.2 date 2009.08.26.21.42.25; author martin; state Exp; branches; next 1.1; 1.1 date 2009.08.23.23.56.19; author martin; state Exp; branches; next ; desc @@ 1.3 log @Build firefox against external runtime components from devel/xulrunner. Bump PKGREVISION. @ text @$NetBSD: patch-na,v 1.2 2009/08/26 21:42:25 martin Exp $ # reported upstream as: # https://bugzilla.mozilla.org/show_bug.cgi?id=512802 --- 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]); @ 1.2 log @New bugs reported upstream - add references @ text @d1 1 a1 1 $NetBSD: patch-na,v 1.1 2009/08/23 23:56:19 martin Exp $ @ 1.1 log @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) @ text @d1 1 a1 1 $NetBSD$ d3 2 a4 1 # not yet reported upstream @