pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/www/firefox The aggregate allocator for JSScripts did ...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/69831e385d83
branches:  trunk
changeset: 563959:69831e385d83
user:      martin <martin%pkgsrc.org@localhost>
date:      Sun Aug 23 23:56:19 2009 +0000

description:
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:

 www/firefox/distinfo         |    3 +-
 www/firefox/patches/patch-na |  121 +++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 123 insertions(+), 1 deletions(-)

diffs (142 lines):

diff -r 843f1aa2f901 -r 69831e385d83 www/firefox/distinfo
--- a/www/firefox/distinfo      Sun Aug 23 23:12:52 2009 +0000
+++ b/www/firefox/distinfo      Sun Aug 23 23:56:19 2009 +0000
@@ -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-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 -r 843f1aa2f901 -r 69831e385d83 www/firefox/patches/patch-na
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/www/firefox/patches/patch-na      Sun Aug 23 23:56:19 2009 +0000
@@ -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]);



Home | Main Index | Thread Index | Old Index