summaryrefslogtreecommitdiff
path: root/www
diff options
context:
space:
mode:
authorryoon <ryoon@pkgsrc.org>2013-06-21 23:11:42 +0000
committerryoon <ryoon@pkgsrc.org>2013-06-21 23:11:42 +0000
commit15b854435dcbeeecb05ff0fd5c7464c3cbc001fb (patch)
tree13231ef0cd06f5b22ed36988b8474f1e61d52be6 /www
parenteb6a848185f8cd5776037c0af4588f474352db56 (diff)
downloadpkgsrc-15b854435dcbeeecb05ff0fd5c7464c3cbc001fb.tar.gz
Bump PKGREVISION.
* Add NetBSD/sparc64 support from martin@. Almost all functionalities work fine, but https handling. * Enable system jpeg support. This is accidentally disabled.
Diffstat (limited to 'www')
-rw-r--r--www/firefox/Makefile4
-rw-r--r--www/firefox/PLIST8
-rw-r--r--www/firefox/distinfo18
-rw-r--r--www/firefox/mozilla-common.mk5
-rw-r--r--www/firefox/patches/patch-gfx__2d__Blur.cpp23
-rw-r--r--www/firefox/patches/patch-gfx__skia__include__core__SkPreConfig.h16
-rw-r--r--www/firefox/patches/patch-js__public__HeapAPI.h36
-rw-r--r--www/firefox/patches/patch-js__src__gc__Marking.cpp32
-rw-r--r--www/firefox/patches/patch-js__src__gc__Memory.cpp319
-rw-r--r--www/firefox/patches/patch-js__src__gc__Memory.h59
-rw-r--r--www/firefox/patches/patch-js__src__jsapi.cpp30
-rw-r--r--www/firefox/patches/patch-js__src__jscntxt.h37
-rw-r--r--www/firefox/patches/patch-js__src__jsgc.cpp134
-rw-r--r--www/firefox/patches/patch-js__src__jsscript.cpp37
-rw-r--r--www/firefox/patches/patch-js__src__vm__SPSProfiler.cpp16
-rw-r--r--www/firefox/patches/patch-js__src__yarr__YarrInterpreter.cpp15
-rw-r--r--www/firefox/patches/patch-mb4
-rw-r--r--www/firefox/patches/patch-netwerk__protocol__websocket__WebSocketChannel.cpp73
-rw-r--r--www/firefox/patches/patch-xd126
-rw-r--r--www/firefox/patches/patch-xpcom__reflect__xptcall__src__md__unix__xptcstubs_sparc64_openbsd.cpp34
20 files changed, 884 insertions, 142 deletions
diff --git a/www/firefox/Makefile b/www/firefox/Makefile
index ff0479ef0fc..4ef3bcdfe29 100644
--- a/www/firefox/Makefile
+++ b/www/firefox/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.130 2013/06/06 14:08:46 ryoon Exp $
+# $NetBSD: Makefile,v 1.131 2013/06/21 23:11:42 ryoon Exp $
FIREFOX_VER= ${MOZ_BRANCH}${MOZ_BRANCH_MINOR}
MOZ_BRANCH= 21.0
@@ -6,7 +6,7 @@ MOZ_BRANCH_MINOR=
DISTNAME= firefox-${FIREFOX_VER}.source
PKGNAME= firefox-${MOZ_BRANCH}${MOZ_BRANCH_MINOR}
-PKGREVISION= 6
+PKGREVISION= 7
CATEGORIES= www
MASTER_SITES= ${MASTER_SITE_MOZILLA:=firefox/releases/${FIREFOX_VER}/source/} \
${MASTER_SITE_MOZILLA_ALL:=firefox/releases/${FIREFOX_VER}/source/}
diff --git a/www/firefox/PLIST b/www/firefox/PLIST
index 45996c699b1..7ebdfa6eab9 100644
--- a/www/firefox/PLIST
+++ b/www/firefox/PLIST
@@ -1,4 +1,4 @@
-@comment $NetBSD: PLIST,v 1.65 2013/05/23 13:12:13 ryoon Exp $
+@comment $NetBSD: PLIST,v 1.66 2013/06/21 23:11:42 ryoon Exp $
bin/firefox
include/firefox/AbstractMediaDecoder.h
include/firefox/AccEvent.h
@@ -216,12 +216,6 @@ include/firefox/inISearchObserver.h
include/firefox/inISearchProcess.h
include/firefox/ipc/IPCMessageUtils.h
include/firefox/jArray.h
-include/firefox/jconfig.h
-include/firefox/jerror.h
-include/firefox/jinclude.h
-include/firefox/jmorecfg.h
-include/firefox/jpegint.h
-include/firefox/jpeglib.h
include/firefox/js-config.h
include/firefox/js.msg
include/firefox/js/Anchor.h
diff --git a/www/firefox/distinfo b/www/firefox/distinfo
index f314b80b5fa..74c006e0176 100644
--- a/www/firefox/distinfo
+++ b/www/firefox/distinfo
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.101 2013/06/02 06:48:37 ryoon Exp $
+$NetBSD: distinfo,v 1.102 2013/06/21 23:11:42 ryoon Exp $
SHA1 (firefox-21.0.source.tar.bz2) = e63b5488eaec1956947f59609d5839332ba7ffe1
RMD160 (firefox-21.0.source.tar.bz2) = 3a62e242a7829f98978436464ab3306c96e58cdd
@@ -25,6 +25,8 @@ SHA1 (patch-config_system-headers) = 5957acc2b4d14a1a9e71791bca3eb76c448a02b2
SHA1 (patch-config_system__wrappers_unwind.h) = b3bdac0710179b9c8f8eabd824216d0114504491
SHA1 (patch-content_media_AudioStream.cpp) = 28533c67c744ed8c721c81b90250acad8251fd14
SHA1 (patch-extensions_auth_nsAuthGSSAPI.cpp) = 548886fc4a86a988f3f91650061ddc04f37653a8
+SHA1 (patch-gfx__2d__Blur.cpp) = 7dc3825acc303f5a67a46249da7656ec653e2721
+SHA1 (patch-gfx__skia__include__core__SkPreConfig.h) = 447b3a311bfb25a0519b60b105ac360d3fe74370
SHA1 (patch-gfx_skia_Makefile.in) = ddc7e4a375f4cfd7dd76c5b37835bbcd3ad13cf1
SHA1 (patch-gfx_skia_src_sfnt_SkOTTable__head.h) = 493fced792610ea1ce5ab6b1e043ef36b33f8279
SHA1 (patch-gfx_skia_src_sfnt_SkOTTable__name.h) = 61a6611b3dd08f5bd56681244eefbfa3f209f6a1
@@ -35,13 +37,23 @@ SHA1 (patch-ipc_chromium_src_base_message__pump__libevent.cc) = 12f3e063cf3fef23
SHA1 (patch-ipc_chromium_src_base_platform__thread__posix.cc) = a6175d1e97966944f14cb96ed3527e879412534b
SHA1 (patch-ipc_glue_GeckoChildProcessHost.cpp) = faed34d94646453cd01acbdec1da2d9ec0f3d05f
SHA1 (patch-ipc_ipdl_ipdl_lower.py) = 4025c0a4e149d9b2087331e10b342734fa77a905
+SHA1 (patch-js__public__HeapAPI.h) = bb0d0080cf4d24ddd6e445cd2bfe2279e583de1e
+SHA1 (patch-js__src__gc__Marking.cpp) = 21a03607db1f92def4f0cfff2b32fda3ab650515
+SHA1 (patch-js__src__gc__Memory.cpp) = 905b99349d6c40b402b52cac53b4d9afa732b13a
+SHA1 (patch-js__src__gc__Memory.h) = 0baa0a5ba45d2150cf53a3325b03f3d1d3ec6f4c
+SHA1 (patch-js__src__jsapi.cpp) = bfd7b0b79d78466841dfed7fb8b776ac76bdc874
+SHA1 (patch-js__src__jscntxt.h) = 70bba103b256285e9a8979eea3790cb468585aea
+SHA1 (patch-js__src__jsgc.cpp) = 37e3c38e6e4fb2a5df2b8c8f69d47ab784675fd6
+SHA1 (patch-js__src__jsscript.cpp) = a64e8b1211dac3021d6816879c648d7cfc65e6c0
+SHA1 (patch-js__src__vm__SPSProfiler.cpp) = bccdd60262f9f652351053b6dd2045821a993b32
+SHA1 (patch-js__src__yarr__YarrInterpreter.cpp) = a9bd5bd9f55f97cb9623e35e09b7bfaf8e4499b3
SHA1 (patch-js_src_Makefile.in) = 98734e93974965419da3d3706f94e1be515799e1
SHA1 (patch-js_src_config_system-headers) = ea170db4562cd69913e91d186b238ecbea9a3f83
SHA1 (patch-js_src_jscompartment.h) = a29ec049ce085ec2a70fffd34647fc78062b7a2e
SHA1 (patch-js_src_jspropertycacheinlines.h) = a34a82193212e945dcba6f0310973117a6c22941
SHA1 (patch-js_src_methodjit_MethodJIT.cpp) = 77685fc735bde4e592a3ddc29fa05b13a694fa8a
SHA1 (patch-js_src_vm_ObjectImpl-inl.h) = 7b9f7c87980e13a7b801de473737489c5f57921d
-SHA1 (patch-mb) = d6f624296ac83bebfdb4ad5e06e64d6d0c2541a3
+SHA1 (patch-mb) = 4e268868b6a526a0911d677875bda7ef975afc1c
SHA1 (patch-md) = 7fd607a3edd2ea5f7a5671fc6d06fba69c46c36f
SHA1 (patch-me) = 2ff755782bd35caded8934000d039976dad44103
SHA1 (patch-media_libsoundtouch_src_cpu__detect__x86.cpp) = e4472576ec9e8c46fb0a2d5622986503cf2767aa
@@ -89,6 +101,7 @@ SHA1 (patch-media_webrtc_trunk_webrtc_voice__engine_voe__network__impl.cc) = 42a
SHA1 (patch-media_webrtc_trunk_webrtc_voice__engine_voice__engine__defines.h) = 8606dfda5b8a3090789e5599b12d0668632fd945
SHA1 (patch-media_webrtc_webrtc__config.gypi) = be2e3128d84b2acdbf7754c71752453f42482c6b
SHA1 (patch-mp) = bc64a6d75df5cf9482d96895f0270b729ff57997
+SHA1 (patch-netwerk__protocol__websocket__WebSocketChannel.cpp) = 0d5929e80f58ac0474b11fcf1f1b1b22f47bd6c7
SHA1 (patch-netwerk_sctp_src_Makefile.in) = e86199357b57c64dac95e5eff5c0d29509dce628
SHA1 (patch-netwerk_sctp_src_netinet_sctp__os__userspace.h) = d1af7cc0eaf201041e3de4128c516a6f71d7b773
SHA1 (patch-netwerk_sctp_src_user__recv__thread.c) = cf26945441f74c581aeb5a8d7435780f4a48a607
@@ -116,6 +129,7 @@ SHA1 (patch-xm) = 81e02e410c00175cbb98c646dda90c7adf199657
SHA1 (patch-xn) = c042e39d93706934ec03c78be3dc6e224ac62c0e
SHA1 (patch-xo) = aae6107dcfaf731bd3e9962d953fb8701fc5f163
SHA1 (patch-xpcom_Makefile.in) = e5f77ed56ed4ad26a08a67085e3dfec0e7af3fa6
+SHA1 (patch-xpcom__reflect__xptcall__src__md__unix__xptcstubs_sparc64_openbsd.cpp) = 85f66fa6dadc9e0a819ed67065ea6b1944fde70b
SHA1 (patch-xpcom_ds_TimeStamp.h) = a1fb060f91720eb330f102b28d9373bbdbe96e30
SHA1 (patch-xpcom_io_nsMultiplexInputStream_cpp) = 899e4797dcef5c295cc7afd7cc31f593a7d46a19
SHA1 (patch-xpcom_reflect_xptcall_src_md_unix_xptcinvoke__gcc__x86__unix.cpp) = 8cd42915cd32756b55894a773a1e6d7c012b4467
diff --git a/www/firefox/mozilla-common.mk b/www/firefox/mozilla-common.mk
index 1a7d7cc244e..ea56f32d43e 100644
--- a/www/firefox/mozilla-common.mk
+++ b/www/firefox/mozilla-common.mk
@@ -1,4 +1,4 @@
-# $NetBSD: mozilla-common.mk,v 1.5 2013/06/07 15:15:23 ryoon Exp $
+# $NetBSD: mozilla-common.mk,v 1.6 2013/06/21 23:11:42 ryoon Exp $
#
# common Makefile fragment for mozilla packages based on gecko 2.0.
#
@@ -131,8 +131,7 @@ BUILDLINK_API_DEPENDS.nspr+= nspr>=4.9.6
BUILDLINK_API_DEPENDS.nss+= nss>=3.14.3
.include "../../devel/nss/buildlink3.mk"
.include "../../devel/zlib/buildlink3.mk"
-## xulrunner-18.0 or later really requires libjpeg-turbo
-#.include "../../mk/jpeg.buildlink3.mk"
+.include "../../mk/jpeg.buildlink3.mk"
.include "../../graphics/MesaLib/buildlink3.mk"
BUILDLINK_API_DEPENDS.cairo+= cairo>=1.10.2nb4
.include "../../graphics/cairo/buildlink3.mk"
diff --git a/www/firefox/patches/patch-gfx__2d__Blur.cpp b/www/firefox/patches/patch-gfx__2d__Blur.cpp
new file mode 100644
index 00000000000..d44118914a5
--- /dev/null
+++ b/www/firefox/patches/patch-gfx__2d__Blur.cpp
@@ -0,0 +1,23 @@
+$NetBSD: patch-gfx__2d__Blur.cpp,v 1.1 2013/06/21 23:11:42 ryoon Exp $
+
+Bugzilla #883624:
+Force pointer/offset arithmetic to be done as ptrdiff_t, to avoid 32bit
+underflows on 64bit archs.
+
+--- gfx/2d/Blur.cpp.orig 2013-05-11 21:19:29.000000000 +0200
++++ gfx/2d/Blur.cpp 2013-06-16 11:24:47.000000000 +0200
+@@ -670,10 +670,10 @@
+ for (int32_t y = 0; y < size.height; y++) {
+ bool inSkipRectY = y > skipRect.y && y < skipRect.YMost();
+
+- uint32_t *topLeftBase = innerIntegral + ((y - aTopLobe) * stride32bit - aLeftLobe);
+- uint32_t *topRightBase = innerIntegral + ((y - aTopLobe) * stride32bit + aRightLobe);
+- uint32_t *bottomRightBase = innerIntegral + ((y + aBottomLobe) * stride32bit + aRightLobe);
+- uint32_t *bottomLeftBase = innerIntegral + ((y + aBottomLobe) * stride32bit - aLeftLobe);
++ uint32_t *topLeftBase = innerIntegral + ((ptrdiff_t)(y - aTopLobe) * stride32bit - aLeftLobe);
++ uint32_t *topRightBase = innerIntegral + ((ptrdiff_t)(y - aTopLobe) * stride32bit + aRightLobe);
++ uint32_t *bottomRightBase = innerIntegral + ((ptrdiff_t)(y + aBottomLobe) * stride32bit + aRightLobe);
++ uint32_t *bottomLeftBase = innerIntegral + ((ptrdiff_t)(y + aBottomLobe) * stride32bit - aLeftLobe);
+
+ for (int32_t x = 0; x < size.width; x++) {
+ if (inSkipRectY && x > skipRect.x && x < skipRect.XMost()) {
diff --git a/www/firefox/patches/patch-gfx__skia__include__core__SkPreConfig.h b/www/firefox/patches/patch-gfx__skia__include__core__SkPreConfig.h
new file mode 100644
index 00000000000..0d03a9e70d4
--- /dev/null
+++ b/www/firefox/patches/patch-gfx__skia__include__core__SkPreConfig.h
@@ -0,0 +1,16 @@
+$NetBSD: patch-gfx__skia__include__core__SkPreConfig.h,v 1.1 2013/06/21 23:11:42 ryoon Exp $
+
+Configure sparc cpus as big endian (Bugzilla #884376)
+
+diff -r 581ea0e6531e gfx/skia/include/core/SkPreConfig.h
+--- gfx/skia/include/core/SkPreConfig.h Tue May 07 09:47:43 2013 -0400
++++ gfx/skia/include/core/SkPreConfig.h Tue Jun 18 17:36:55 2013 +0200
+@@ -94,7 +94,7 @@
+ //////////////////////////////////////////////////////////////////////
+
+ #if !defined(SK_CPU_BENDIAN) && !defined(SK_CPU_LENDIAN)
+-#if defined (__ppc__) || defined(__PPC__) || defined(__ppc64__) || defined(__PPC64__)
++#if defined (__ppc__) || defined(__PPC__) || defined(__ppc64__) || defined(__PPC64__) || defined(__sparc) || defined(__sparc__)
+ #define SK_CPU_BENDIAN
+ #else
+ #define SK_CPU_LENDIAN
diff --git a/www/firefox/patches/patch-js__public__HeapAPI.h b/www/firefox/patches/patch-js__public__HeapAPI.h
new file mode 100644
index 00000000000..29f8ff9f91b
--- /dev/null
+++ b/www/firefox/patches/patch-js__public__HeapAPI.h
@@ -0,0 +1,36 @@
+$NetBSD: patch-js__public__HeapAPI.h,v 1.1 2013/06/21 23:11:42 ryoon Exp $
+
+From bugzilla, bug 840242, attachment v1
+Use the runtime page size to control arena decommit.
+
+As a side effect, this removes the hard coded page-size == 4k requirement.
+
+
++++ js/public/HeapAPI.h
+--- js/public/HeapAPI.h.orig 2013-05-11 21:19:32.000000000 +0200
++++ js/public/HeapAPI.h 2013-06-09 21:27:12.000000000 +0200
+@@ -11,24 +11,7 @@
+ namespace js {
+ namespace gc {
+
+-/*
+- * Page size must be static to support our arena pointer optimizations, so we
+- * are forced to support each platform with non-4096 pages as a special case.
+- * Note: The freelist supports a maximum arena shift of 15.
+- * Note: Do not use JS_CPU_SPARC here, this header is used outside JS.
+- */
+-#if (defined(SOLARIS) || defined(__FreeBSD__)) && \
+- (defined(__sparc) || defined(__sparcv9) || defined(__ia64))
+-const size_t PageShift = 13;
+-const size_t ArenaShift = PageShift;
+-#elif defined(__powerpc64__)
+-const size_t PageShift = 16;
+ const size_t ArenaShift = 12;
+-#else
+-const size_t PageShift = 12;
+-const size_t ArenaShift = PageShift;
+-#endif
+-const size_t PageSize = size_t(1) << PageShift;
+ const size_t ArenaSize = size_t(1) << ArenaShift;
+ const size_t ArenaMask = ArenaSize - 1;
+
diff --git a/www/firefox/patches/patch-js__src__gc__Marking.cpp b/www/firefox/patches/patch-js__src__gc__Marking.cpp
new file mode 100644
index 00000000000..7e12924b1fb
--- /dev/null
+++ b/www/firefox/patches/patch-js__src__gc__Marking.cpp
@@ -0,0 +1,32 @@
+$NetBSD: patch-js__src__gc__Marking.cpp,v 1.1 2013/06/21 23:11:42 ryoon Exp $
+
+# HG changeset patch
+# User Martin Husemann <martin@netbsd.org>
+# Date 1370038993 -7200
+# Node ID d16914942a9c502dde37dce2a1deb09050218ba8
+# Parent d296fcc8f3dd6254c862cdfd47a5580ee05a94f4
+Bug 871101: Make "kind" a full uintptr_t value so it overwrites its pointer union counterpart for sure r=billm
+
+diff js/src/gc/Marking.cpp js/src/gc/Marking.cpp
+--- js/src/gc/Marking.cpp
++++ js/src/gc/Marking.cpp
+@@ -1199,17 +1199,17 @@ gc::PushArena(GCMarker *gcmarker, ArenaH
+ break;
+ }
+ }
+
+ struct SlotArrayLayout
+ {
+ union {
+ HeapSlot *end;
+- HeapSlot::Kind kind;
++ uintptr_t kind;
+ };
+ union {
+ HeapSlot *start;
+ uintptr_t index;
+ };
+ JSObject *obj;
+
+ static void staticAsserts() {
+
diff --git a/www/firefox/patches/patch-js__src__gc__Memory.cpp b/www/firefox/patches/patch-js__src__gc__Memory.cpp
new file mode 100644
index 00000000000..cd4734fe3ff
--- /dev/null
+++ b/www/firefox/patches/patch-js__src__gc__Memory.cpp
@@ -0,0 +1,319 @@
+$NetBSD: patch-js__src__gc__Memory.cpp,v 1.1 2013/06/21 23:11:42 ryoon Exp $
+
+From bugzilla, bug 840242, attachment v1
+Use the runtime page size to control arena decommit.
+
+As a side effect, this removes the hard coded page-size == 4k requirement.
+
+
+diff js/src/gc/Memory.cpp js/src/gc/Memory.cpp
+--- js/src/gc/Memory.cpp.orig 2013-05-11 21:19:33.000000000 +0200
++++ js/src/gc/Memory.cpp 2013-06-10 13:45:26.000000000 +0200
+@@ -8,6 +8,7 @@
+ #include "mozilla/Assertions.h"
+
+ #include "jsapi.h"
++#include "jscntxt.h"
+
+ #include "js/HeapAPI.h"
+ #include "js/Utility.h"
+@@ -17,40 +18,35 @@
+ using namespace js::gc;
+
+ /* Unused memory decommiting requires the arena size match the page size. */
+-static bool
+-DecommitEnabled()
++bool
++gc::DecommitEnabled(JSRuntime *rt)
+ {
+- return PageSize == ArenaSize;
++ return rt->gcSystemPageSize == ArenaSize;
+ }
+
+ #if defined(XP_WIN)
+ #include "jswin.h"
+ #include <psapi.h>
+
+-static size_t AllocationGranularity = 0;
+-
+ void
+ gc::InitMemorySubsystem()
+ {
+ SYSTEM_INFO sysinfo;
+ GetSystemInfo(&sysinfo);
+- if (sysinfo.dwPageSize != PageSize) {
+- fprintf(stderr,"SpiderMonkey compiled with incorrect page size; please update js/public/HeapAPI.h.\n");
+- MOZ_CRASH();
+- }
+- AllocationGranularity = sysinfo.dwAllocationGranularity;
++ rt->gcSystemPageSize = sysinfo.dwPageSize;
++ rt->gcSystemAllocGranularity = sysinfo.dwAllocationGranularity;
+ }
+
+ void *
+-gc::MapAlignedPages(size_t size, size_t alignment)
++gc::MapAlignedPages(JSRuntime *rt, size_t size, size_t alignment)
+ {
+ JS_ASSERT(size >= alignment);
+ JS_ASSERT(size % alignment == 0);
+- JS_ASSERT(size % PageSize == 0);
+- JS_ASSERT(alignment % AllocationGranularity == 0);
++ JS_ASSERT(size % rt->gcSystemPageSize == 0);
++ JS_ASSERT(alignment % rt->gcSystemAllocGranularity == 0);
+
+ /* Special case: If we want allocation alignment, no further work is needed. */
+- if (alignment == AllocationGranularity) {
++ if (alignment == rt->gcSystemAllocGranularity) {
+ return VirtualAlloc(NULL, size, MEM_COMMIT | MEM_RESERVE, PAGE_READWRITE);
+ }
+
+@@ -74,7 +70,7 @@
+ if (!p)
+ return NULL;
+ void *chunkStart = (void *)(uintptr_t(p) + (alignment - (uintptr_t(p) % alignment)));
+- UnmapPages(p, size * 2);
++ UnmapPages(rt, p, size * 2);
+ p = VirtualAlloc(chunkStart, size, MEM_COMMIT | MEM_RESERVE, PAGE_READWRITE);
+
+ /* Failure here indicates a race with another thread, so try again. */
+@@ -85,26 +81,26 @@
+ }
+
+ void
+-gc::UnmapPages(void *p, size_t size)
++gc::UnmapPages(JSRuntime *rt, void *p, size_t size)
+ {
+ JS_ALWAYS_TRUE(VirtualFree(p, 0, MEM_RELEASE));
+ }
+
+ bool
+-gc::MarkPagesUnused(void *p, size_t size)
++gc::MarkPagesUnused(JSRuntime *rt, void *p, size_t size)
+ {
+- if (!DecommitEnabled())
+- return false;
++ if (!DecommitEnabled(rt))
++ return true;
+
+- JS_ASSERT(uintptr_t(p) % PageSize == 0);
++ JS_ASSERT(uintptr_t(p) % rt->gcSystemPageSize == 0);
+ LPVOID p2 = VirtualAlloc(p, size, MEM_RESET, PAGE_READWRITE);
+ return p2 == p;
+ }
+
+ bool
+-gc::MarkPagesInUse(void *p, size_t size)
++gc::MarkPagesInUse(JSRuntime *rt, void *p, size_t size)
+ {
+- JS_ASSERT(uintptr_t(p) % PageSize == 0);
++ JS_ASSERT(uintptr_t(p) % rt->gcSystemPageSize == 0);
+ return true;
+ }
+
+@@ -126,12 +122,13 @@
+ #define OS2_MAX_RECURSIONS 16
+
+ void
+-gc::InitMemorySubsystem()
++gc::InitMemorySubsystem(JSRuntime *rt)
+ {
++ rt->gcSystemPageSize = rt->gcSystemAllocGranularity = ArenaSize;
+ }
+
+ void
+-gc::UnmapPages(void *addr, size_t size)
++gc::UnmapPages(JSRuntime *rt, void *addr, size_t size)
+ {
+ if (!DosFreeMem(addr))
+ return;
+@@ -152,7 +149,7 @@
+ }
+
+ static void *
+-gc::MapAlignedPagesRecursively(size_t size, size_t alignment, int& recursions)
++gc::MapAlignedPagesRecursively(JSRuntime *rt, size_t size, size_t alignment, int& recursions)
+ {
+ if (++recursions >= OS2_MAX_RECURSIONS)
+ return NULL;
+@@ -178,7 +175,7 @@
+ unsigned long rc = DosQueryMem(&(static_cast<char*>(tmp))[size],
+ &cb, &flags);
+ if (!rc && (flags & PAG_FREE) && cb >= filler) {
+- UnmapPages(tmp, 0);
++ UnmapPages(rt, tmp, 0);
+ if (DosAllocMem(&tmp, filler,
+ OBJ_ANY | PAG_COMMIT | PAG_READ | PAG_WRITE)) {
+ JS_ALWAYS_TRUE(DosAllocMem(&tmp, filler,
+@@ -186,19 +183,19 @@
+ }
+ }
+
+- void *p = MapAlignedPagesRecursively(size, alignment, recursions);
+- UnmapPages(tmp, 0);
++ void *p = MapAlignedPagesRecursively(rt, size, alignment, recursions);
++ UnmapPages(rt, tmp, 0);
+
+ return p;
+ }
+
+ void *
+-gc::MapAlignedPages(size_t size, size_t alignment)
++gc::MapAlignedPages(JSRuntime *rt, size_t size, size_t alignment)
+ {
+ JS_ASSERT(size >= alignment);
+ JS_ASSERT(size % alignment == 0);
+- JS_ASSERT(size % PageSize == 0);
+- JS_ASSERT(alignment % PageSize == 0);
++ JS_ASSERT(size % rt->gcSystemPageSize == 0);
++ JS_ASSERT(alignment % rt->gcSystemAllocGranularity == 0);
+
+ int recursions = -1;
+
+@@ -207,7 +204,7 @@
+ * of the right size by recursively allocating blocks of unaligned
+ * free memory until only an aligned allocation is possible.
+ */
+- void *p = MapAlignedPagesRecursively(size, alignment, recursions);
++ void *p = MapAlignedPagesRecursively(rt, size, alignment, recursions);
+ if (p)
+ return p;
+
+@@ -229,16 +226,16 @@
+ }
+
+ bool
+-gc::MarkPagesUnused(void *p, size_t size)
++gc::MarkPagesUnused(JSRuntime *rt, void *p, size_t size)
+ {
+- JS_ASSERT(uintptr_t(p) % PageSize == 0);
++ JS_ASSERT(uintptr_t(p) % rt->gcSystemPageSize == 0);
+ return true;
+ }
+
+ bool
+-gc::MarkPagesInUse(void *p, size_t size)
++gc::MarkPagesInUse(JSRuntime *rt, void *p, size_t size)
+ {
+- JS_ASSERT(uintptr_t(p) % PageSize == 0);
++ JS_ASSERT(uintptr_t(p) % rt->gcSystemPageSize == 0);
+ return true;
+ }
+
+@@ -258,17 +255,18 @@
+ #endif
+
+ void
+-gc::InitMemorySubsystem()
++gc::InitMemorySubsystem(JSRuntime *rt)
+ {
++ rt->gcSystemPageSize = rt->gcSystemAllocGranularity = size_t(sysconf(_SC_PAGESIZE));
+ }
+
+ void *
+-gc::MapAlignedPages(size_t size, size_t alignment)
++gc::MapAlignedPages(JSRuntime *rt, size_t size, size_t alignment)
+ {
+ JS_ASSERT(size >= alignment);
+ JS_ASSERT(size % alignment == 0);
+- JS_ASSERT(size % PageSize == 0);
+- JS_ASSERT(alignment % PageSize == 0);
++ JS_ASSERT(size % rt->gcSystemPageSize == 0);
++ JS_ASSERT(alignment % rt->gcSystemAllocGranularity == 0);
+
+ int prot = PROT_READ | PROT_WRITE;
+ int flags = MAP_PRIVATE | MAP_ANON | MAP_ALIGN | MAP_NOSYNC;
+@@ -280,22 +278,22 @@
+ }
+
+ void
+-gc::UnmapPages(void *p, size_t size)
++gc::UnmapPages(JSRuntime *rt, void *p, size_t size)
+ {
+ JS_ALWAYS_TRUE(0 == munmap((caddr_t)p, size));
+ }
+
+ bool
+-gc::MarkPagesUnused(void *p, size_t size)
++gc::MarkPagesUnused(JSRuntime *rt, void *p, size_t size)
+ {
+- JS_ASSERT(uintptr_t(p) % PageSize == 0);
++ JS_ASSERT(uintptr_t(p) % rt->gcSystemPageSize == 0);
+ return true;
+ }
+
+ bool
+-gc::MarkPagesInUse(void *p, size_t size)
++gc::MarkPagesInUse(JSRuntime *rt, void *p, size_t size)
+ {
+- JS_ASSERT(uintptr_t(p) % PageSize == 0);
++ JS_ASSERT(uintptr_t(p) % rt->gcSystemPageSize == 0);
+ return true;
+ }
+
+@@ -313,27 +311,24 @@
+ #include <unistd.h>
+
+ void
+-gc::InitMemorySubsystem()
++gc::InitMemorySubsystem(JSRuntime *rt)
+ {
+- if (size_t(sysconf(_SC_PAGESIZE)) != PageSize) {
+- fprintf(stderr,"SpiderMonkey compiled with incorrect page size; please update js/public/HeapAPI.h.\n");
+- MOZ_CRASH();
+- }
++ rt->gcSystemPageSize = rt->gcSystemAllocGranularity = size_t(sysconf(_SC_PAGESIZE));
+ }
+
+ void *
+-gc::MapAlignedPages(size_t size, size_t alignment)
++gc::MapAlignedPages(JSRuntime *rt, size_t size, size_t alignment)
+ {
+ JS_ASSERT(size >= alignment);
+ JS_ASSERT(size % alignment == 0);
+- JS_ASSERT(size % PageSize == 0);
+- JS_ASSERT(alignment % PageSize == 0);
++ JS_ASSERT(size % rt->gcSystemPageSize == 0);
++ JS_ASSERT(alignment % rt->gcSystemAllocGranularity == 0);
+
+ int prot = PROT_READ | PROT_WRITE;
+ int flags = MAP_PRIVATE | MAP_ANON;
+
+ /* Special case: If we want page alignment, no further work is needed. */
+- if (alignment == PageSize) {
++ if (alignment == rt->gcSystemAllocGranularity) {
+ return mmap(NULL, size, prot, flags, -1, 0);
+ }
+
+@@ -359,26 +354,26 @@
+ }
+
+ void
+-gc::UnmapPages(void *p, size_t size)
++gc::UnmapPages(JSRuntime *rt, void *p, size_t size)
+ {
+ JS_ALWAYS_TRUE(0 == munmap(p, size));
+ }
+
+ bool
+-gc::MarkPagesUnused(void *p, size_t size)
++gc::MarkPagesUnused(JSRuntime *rt, void *p, size_t size)
+ {
+- if (!DecommitEnabled())
++ if (!DecommitEnabled(rt))
+ return false;
+
+- JS_ASSERT(uintptr_t(p) % PageSize == 0);
++ JS_ASSERT(uintptr_t(p) % rt->gcSystemPageSize == 0);
+ int result = madvise(p, size, MADV_DONTNEED);
+ return result != -1;
+ }
+
+ bool
+-gc::MarkPagesInUse(void *p, size_t size)
++gc::MarkPagesInUse(JSRuntime *rt, void *p, size_t size)
+ {
+- JS_ASSERT(uintptr_t(p) % PageSize == 0);
++ JS_ASSERT(uintptr_t(p) % rt->gcSystemPageSize == 0);
+ return true;
+ }
+
diff --git a/www/firefox/patches/patch-js__src__gc__Memory.h b/www/firefox/patches/patch-js__src__gc__Memory.h
new file mode 100644
index 00000000000..bf27862c58f
--- /dev/null
+++ b/www/firefox/patches/patch-js__src__gc__Memory.h
@@ -0,0 +1,59 @@
+$NetBSD: patch-js__src__gc__Memory.h,v 1.1 2013/06/21 23:11:42 ryoon Exp $
+
+From bugzilla, bug 840242, attachment v1
+Use the runtime page size to control arena decommit.
+
+As a side effect, this removes the hard coded page-size == 4k requirement.
+
+
+diff js/src/gc/Memory.h js/src/gc/Memory.h
+--- js/src/gc/Memory.h
++++ js/src/gc/Memory.h
+@@ -10,30 +10,41 @@
+ #include <stddef.h>
+ #include "jsgc.h"
+
+ namespace js {
+ namespace gc {
+
+ // Sanity check that our compiled configuration matches the currently running
+ // instance and initialize any runtime data needed for allocation.
+-void InitMemorySubsystem();
++void
++InitMemorySubsystem(JSRuntime *rt);
++
++// Decommiting unused memory requires the arena size match the page size.
++bool
++DecommitEnabled(JSRuntime *rt);
+
+ // Allocate or deallocate pages from the system with the given alignment.
+-void *MapAlignedPages(size_t size, size_t alignment);
+-void UnmapPages(void *p, size_t size);
++void *
++MapAlignedPages(JSRuntime *rt, size_t size, size_t alignment);
++
++void
++UnmapPages(JSRuntime *rt, void *p, size_t size);
+
+ // Tell the OS that the given pages are not in use, so they should not
+ // be written to a paging file. This may be a no-op on some platforms.
+-bool MarkPagesUnused(void *p, size_t size);
++bool
++MarkPagesUnused(JSRuntime *rt, void *p, size_t size);
+
+ // Undo |MarkPagesUnused|: tell the OS that the given pages are of interest
+ // and should be paged in and out normally. This may be a no-op on some
+ // platforms.
+-bool MarkPagesInUse(void *p, size_t size);
++bool
++MarkPagesInUse(JSRuntime *rt, void *p, size_t size);
+
+ // Returns #(hard faults) + #(soft faults)
+-size_t GetPageFaultCount();
++size_t
++GetPageFaultCount();
+
+ } // namespace gc
+ } // namespace js
+
+ #endif // jsgc_memory_h___
diff --git a/www/firefox/patches/patch-js__src__jsapi.cpp b/www/firefox/patches/patch-js__src__jsapi.cpp
new file mode 100644
index 00000000000..e2b31f78c47
--- /dev/null
+++ b/www/firefox/patches/patch-js__src__jsapi.cpp
@@ -0,0 +1,30 @@
+$NetBSD: patch-js__src__jsapi.cpp,v 1.1 2013/06/21 23:11:42 ryoon Exp $
+
+From bugzilla, bug 840242, attachment v1
+Use the runtime page size to control arena decommit.
+
+As a side effect, this removes the hard coded page-size == 4k requirement.
+
+
+diff js/src/jsapi.cpp js/src/jsapi.cpp
+--- js/src/jsapi.cpp
++++ js/src/jsapi.cpp
+@@ -1138,18 +1138,16 @@ JS_NewRuntime(uint32_t maxbytes, JSUseHe
+ ++numfmtspecs; \
+ } \
+ JS_ASSERT(count == numfmtspecs); \
+ JS_END_MACRO;
+ #include "js.msg"
+ #undef MSG_DEF
+ #endif /* DEBUG */
+
+- InitMemorySubsystem();
+-
+ if (!js::TlsPerThreadData.init())
+ return NULL;
+
+ js_NewRuntimeWasCalled = JS_TRUE;
+ }
+
+ JSRuntime *rt = js_new<JSRuntime>(useHelperThreads);
+ if (!rt)
diff --git a/www/firefox/patches/patch-js__src__jscntxt.h b/www/firefox/patches/patch-js__src__jscntxt.h
new file mode 100644
index 00000000000..700ada8b3c6
--- /dev/null
+++ b/www/firefox/patches/patch-js__src__jscntxt.h
@@ -0,0 +1,37 @@
+$NetBSD: patch-js__src__jscntxt.h,v 1.1 2013/06/21 23:11:42 ryoon Exp $
+
+From bugzilla, bug 840242, attachment v1
+Use the runtime page size to control arena decommit.
+
+As a side effect, this removes the hard coded page-size == 4k requirement.
+
+
+diff js/src/jscntxt.h js/src/jscntxt.h
+--- js/src/jscntxt.h
++++ js/src/jscntxt.h
+@@ -1132,16 +1132,25 @@ struct JSRuntime : public JS::shadow::Ru
+ JSTraceDataOp gcBlackRootsTraceOp;
+ void *gcBlackRootsData;
+ JSTraceDataOp gcGrayRootsTraceOp;
+ void *gcGrayRootsData;
+
+ /* Stack of thread-stack-allocated GC roots. */
+ js::AutoGCRooter *autoGCRooters;
+
++ /*
++ * The GC can only safely decommit memory when the page size of the
++ * running process matches the compiled arena size.
++ */
++ size_t gcSystemPageSize;
++
++ /* The OS allocation granularity may not match the page size. */
++ size_t gcSystemAllocGranularity;
++
+ /* Strong references on scripts held for PCCount profiling API. */
+ js::ScriptAndCountsVector *scriptAndCountsVector;
+
+ /* Well-known numbers held for use by this runtime's contexts. */
+ js::Value NaNValue;
+ js::Value negativeInfinityValue;
+ js::Value positiveInfinityValue;
+
diff --git a/www/firefox/patches/patch-js__src__jsgc.cpp b/www/firefox/patches/patch-js__src__jsgc.cpp
new file mode 100644
index 00000000000..fe679e4d7f0
--- /dev/null
+++ b/www/firefox/patches/patch-js__src__jsgc.cpp
@@ -0,0 +1,134 @@
+$NetBSD: patch-js__src__jsgc.cpp,v 1.1 2013/06/21 23:11:42 ryoon Exp $
+
+From bugzilla, bug 840242, attachment v1
+Use the runtime page size to control arena decommit.
+
+As a side effect, this removes the hard coded page-size == 4k requirement.
+
+
+diff js/src/jsgc.cpp js/src/jsgc.cpp
+--- js/src/jsgc.cpp.orig 2013-05-11 21:19:34.000000000 +0200
++++ js/src/jsgc.cpp 2013-06-10 13:49:13.000000000 +0200
+@@ -465,13 +465,15 @@ FinalizeArenas(FreeOp *fop,
+ }
+
+ static inline Chunk *
+-AllocChunk() {
+- return static_cast<Chunk *>(MapAlignedPages(ChunkSize, ChunkSize));
++AllocChunk(JSRuntime *rt)
++{
++ return static_cast<Chunk *>(MapAlignedPages(rt, ChunkSize, ChunkSize));
+ }
+
+ static inline void
+-FreeChunk(Chunk *p) {
+- UnmapPages(static_cast<void *>(p), ChunkSize);
++FreeChunk(JSRuntime *rt, Chunk *p)
++{
++ UnmapPages(rt, static_cast<void *>(p), ChunkSize);
+ }
+
+ inline bool
+@@ -561,25 +563,25 @@ ChunkPool::expire(JSRuntime *rt, bool re
+ }
+
+ static void
+-FreeChunkList(Chunk *chunkListHead)
++FreeChunkList(JSRuntime *rt, Chunk *chunkListHead)
+ {
+ while (Chunk *chunk = chunkListHead) {
+ JS_ASSERT(!chunk->info.numArenasFreeCommitted);
+ chunkListHead = chunk->info.next;
+- FreeChunk(chunk);
++ FreeChunk(rt, chunk);
+ }
+ }
+
+ void
+ ChunkPool::expireAndFree(JSRuntime *rt, bool releaseAll)
+ {
+- FreeChunkList(expire(rt, releaseAll));
++ FreeChunkList(rt, expire(rt, releaseAll));
+ }
+
+ /* static */ Chunk *
+ Chunk::allocate(JSRuntime *rt)
+ {
+- Chunk *chunk = static_cast<Chunk *>(AllocChunk());
++ Chunk *chunk = AllocChunk(rt);
+
+ #ifdef JSGC_ROOT_ANALYSIS
+ // Our poison pointers are not guaranteed to be invalid on 64-bit
+@@ -592,7 +594,7 @@ Chunk::allocate(JSRuntime *rt)
+ // were marked as uncommitted, but it's a little complicated to avoid
+ // clobbering pre-existing unrelated mappings.
+ while (IsPoisonedPtr(chunk))
+- chunk = static_cast<Chunk *>(AllocChunk());
++ chunk = AllocChunk(rt);
+ #endif
+
+ if (!chunk)
+@@ -608,7 +610,7 @@ Chunk::release(JSRuntime *rt, Chunk *chu
+ {
+ JS_ASSERT(chunk);
+ chunk->prepareToBeFreed(rt);
+- FreeChunk(chunk);
++ FreeChunk(rt, chunk);
+ }
+
+ inline void
+@@ -736,7 +738,7 @@ Chunk::fetchNextDecommittedArena()
+ decommittedArenas.unset(offset);
+
+ Arena *arena = &arenas[offset];
+- MarkPagesInUse(arena, ArenaSize);
++ MarkPagesInUse(info.runtime, arena, ArenaSize);
+ arena->aheader.setAsNotAllocated();
+
+ return &arena->aheader;
+@@ -937,6 +939,8 @@ static const int64_t JIT_SCRIPT_RELEASE_
+ JSBool
+ js_InitGC(JSRuntime *rt, uint32_t maxbytes)
+ {
++ InitMemorySubsystem(rt);
++
+ if (!rt->gcChunkSet.init(INITIAL_CHUNK_CAPACITY))
+ return false;
+
+@@ -2051,6 +2055,9 @@ js::MaybeGC(JSContext *cx)
+ static void
+ DecommitArenasFromAvailableList(JSRuntime *rt, Chunk **availableListHeadp)
+ {
++ if (!DecommitEnabled(rt))
++ return;
++
+ Chunk *chunk = *availableListHeadp;
+ if (!chunk)
+ return;
+@@ -2102,7 +2109,7 @@ DecommitArenasFromAvailableList(JSRuntim
+ Maybe<AutoUnlockGC> maybeUnlock;
+ if (!rt->isHeapBusy())
+ maybeUnlock.construct(rt);
+- ok = MarkPagesUnused(aheader->getArena(), ArenaSize);
++ ok = MarkPagesUnused(rt, aheader->getArena(), ArenaSize);
+ }
+
+ if (ok) {
+@@ -2132,7 +2139,7 @@ DecommitArenasFromAvailableList(JSRuntim
+ JS_ASSERT(chunk->info.prevp);
+ }
+
+- if (rt->gcChunkAllocationSinceLastGC) {
++ if (rt->gcChunkAllocationSinceLastGC || !ok) {
+ /*
+ * The allocator thread has started to get new chunks. We should stop
+ * to avoid decommitting arenas in just allocated chunks.
+@@ -2170,7 +2177,7 @@ ExpireChunksAndArenas(JSRuntime *rt, boo
+ {
+ if (Chunk *toFree = rt->gcChunkPool.expire(rt, shouldShrink)) {
+ AutoUnlockGC unlock(rt);
+- FreeChunkList(toFree);
++ FreeChunkList(rt, toFree);
+ }
+
+ if (shouldShrink)
diff --git a/www/firefox/patches/patch-js__src__jsscript.cpp b/www/firefox/patches/patch-js__src__jsscript.cpp
new file mode 100644
index 00000000000..b389c7ae90c
--- /dev/null
+++ b/www/firefox/patches/patch-js__src__jsscript.cpp
@@ -0,0 +1,37 @@
+$NetBSD: patch-js__src__jsscript.cpp,v 1.1 2013/06/21 23:11:42 ryoon Exp $
+
+# HG changeset patch
+# User Martin Husemann <martin@netbsd.org>
+# Date 1370581392 25200
+# Node ID 88d63d06dec9a9d12a8e1200f1117d648fc386e2
+# Parent 1c14b70442b380d63119dbc7d3c465e9c0e655fd
+Bug 870325 - Fix alignment of Bindings on SPARC64. r=nnethercote.
+
+diff js/src/jsscript.cpp js/src/jsscript.cpp
+--- js/src/jsscript.cpp.orig 2013-05-11 21:19:34.000000000 +0200
++++ js/src/jsscript.cpp 2013-06-10 13:58:15.000000000 +0200
+@@ -1695,7 +1695,11 @@
+ if (ntrynotes != 0)
+ size += sizeof(TryNoteArray) + ntrynotes * sizeof(JSTryNote);
+
+- size += nbindings * sizeof(Binding);
++ if (nbindings != 0) {
++ // account for padding pre bindings
++ size = JS_ROUNDUP(size, JS_ALIGNMENT_OF(Binding)) + nbindings * sizeof(Binding);
++ }
++
+ return size;
+ }
+
+@@ -1822,6 +1826,11 @@
+ cursor += vectorSize;
+ }
+
++ if (script->bindings.count() != 0) {
++ // Make sure bindings are sufficiently aligned.
++ cursor = reinterpret_cast<uint8_t*>
++ (JS_ROUNDUP(reinterpret_cast<uintptr_t>(cursor), JS_ALIGNMENT_OF(Binding)));
++ }
+ cursor = script->bindings.switchToScriptStorage(reinterpret_cast<Binding *>(cursor));
+
+ JS_ASSERT(cursor == script->data + size);
diff --git a/www/firefox/patches/patch-js__src__vm__SPSProfiler.cpp b/www/firefox/patches/patch-js__src__vm__SPSProfiler.cpp
new file mode 100644
index 00000000000..c0b9acfcfda
--- /dev/null
+++ b/www/firefox/patches/patch-js__src__vm__SPSProfiler.cpp
@@ -0,0 +1,16 @@
+$NetBSD: patch-js__src__vm__SPSProfiler.cpp,v 1.1 2013/06/21 23:11:42 ryoon Exp $
+
+Unclear fallout from our version of bug 840242, attachment v1: some architectures
+fail to link if we do not add the inlines here - might be compiler/arch specific.
+
+
+--- js/src/vm/SPSProfiler.cpp.orig 2013-05-11 21:19:36.000000000 +0200
++++ js/src/vm/SPSProfiler.cpp 2013-06-15 11:49:39.000000000 +0200
+@@ -9,6 +9,7 @@
+
+ #include "jsnum.h"
+ #include "jsscript.h"
++#include "jscntxtinlines.h"
+
+ #include "methodjit/MethodJIT.h"
+ #include "methodjit/Compiler.h"
diff --git a/www/firefox/patches/patch-js__src__yarr__YarrInterpreter.cpp b/www/firefox/patches/patch-js__src__yarr__YarrInterpreter.cpp
new file mode 100644
index 00000000000..7fe8125ce8d
--- /dev/null
+++ b/www/firefox/patches/patch-js__src__yarr__YarrInterpreter.cpp
@@ -0,0 +1,15 @@
+$NetBSD: patch-js__src__yarr__YarrInterpreter.cpp,v 1.1 2013/06/21 23:11:42 ryoon Exp $
+
+Bugzilla ticket #871444
+
+diff -r 581ea0e6531e js/src/yarr/YarrInterpreter.cpp
+--- js/src/yarr/YarrInterpreter.cpp Tue May 07 09:47:43 2013 -0400
++++ js/src/yarr/YarrInterpreter.cpp Sun May 12 17:41:08 2013 +0200
+@@ -156,6 +156,7 @@
+ ParenthesesDisjunctionContext* allocParenthesesDisjunctionContext(ByteDisjunction* disjunction, unsigned* output, ByteTerm& term)
+ {
+ size_t size = sizeof(ParenthesesDisjunctionContext) - sizeof(unsigned) + (term.atom.parenthesesDisjunction->m_numSubpatterns << 1) * sizeof(unsigned) + sizeof(DisjunctionContext) - sizeof(uintptr_t) + disjunction->m_frameSize * sizeof(uintptr_t);
++ size = JS_ROUNDUP(size, JS_ALIGNMENT_OF(ParenthesesDisjunctionContext));
+ allocatorPool = allocatorPool->ensureCapacity(size);
+ if (!allocatorPool)
+ CRASH();
diff --git a/www/firefox/patches/patch-mb b/www/firefox/patches/patch-mb
index 9f0d85feeb0..03f87470f4c 100644
--- a/www/firefox/patches/patch-mb
+++ b/www/firefox/patches/patch-mb
@@ -1,4 +1,4 @@
-$NetBSD: patch-mb,v 1.3 2013/05/23 13:12:13 ryoon Exp $
+$NetBSD: patch-mb,v 1.4 2013/06/21 23:11:42 ryoon Exp $
--- xpcom/reflect/xptcall/src/md/unix/Makefile.in.orig 2013-02-15 21:15:14.000000000 +0000
+++ xpcom/reflect/xptcall/src/md/unix/Makefile.in
@@ -54,7 +54,7 @@ $NetBSD: patch-mb,v 1.3 2013/05/23 13:12:13 ryoon Exp $
+# NetBSD/SPARC64
+#
+ifeq ($(OS_ARCH)$(OS_TEST),NetBSDsparc64)
-+CPPSRCS := xptcinvoke_sparc64_netbsd.cpp xptcstubs_sparc64_netbsd.cpp
++CPPSRCS := xptcinvoke_sparc64_netbsd.cpp xptcstubs_sparc64_openbsd.cpp
+ASFILES := xptcinvoke_asm_sparc64_netbsd.s xptcstubs_asm_sparc64_netbsd.s
+endif
+#
diff --git a/www/firefox/patches/patch-netwerk__protocol__websocket__WebSocketChannel.cpp b/www/firefox/patches/patch-netwerk__protocol__websocket__WebSocketChannel.cpp
new file mode 100644
index 00000000000..cca3c637187
--- /dev/null
+++ b/www/firefox/patches/patch-netwerk__protocol__websocket__WebSocketChannel.cpp
@@ -0,0 +1,73 @@
+$NetBSD: patch-netwerk__protocol__websocket__WebSocketChannel.cpp,v 1.1 2013/06/21 23:11:42 ryoon Exp $
+
+# HG changeset patch
+# User Martin Husemann <martin@netbsd.org>
+# Date 1370038996 -7200
+# Node ID 4539a7706881edaedc2189cc0d2d9c7b7abedf1d
+# Parent d16914942a9c502dde37dce2a1deb09050218ba8
+Bug 871555: Use memcpy and properly aligned temporary variables instead of pointer casts with unclear alignment r=mcmanus
+
+diff netwerk/protocol/websocket/WebSocketChannel.cpp netwerk/protocol/websocket/WebSocketChannel.cpp
+--- netwerk/protocol/websocket/WebSocketChannel.cpp
++++ netwerk/protocol/websocket/WebSocketChannel.cpp
+@@ -1627,17 +1627,18 @@ WebSocketChannel::PrimeNewOutgoingMessag
+ // payload is offset 6 including 4 for the mask
+ payload = mOutHeader + 6;
+
+ // The close reason code sits in the first 2 bytes of payload
+ // If the channel user provided a code and reason during Close()
+ // and there isn't an internal error, use that.
+ if (NS_SUCCEEDED(mStopOnClose)) {
+ if (mScriptCloseCode) {
+- *((uint16_t *)payload) = PR_htons(mScriptCloseCode);
++ uint16_t temp = PR_htons(mScriptCloseCode);
++ memcpy(payload, &temp, 2);
+ mOutHeader[1] += 2;
+ mHdrOutToSend = 8;
+ if (!mScriptCloseReason.IsEmpty()) {
+ NS_ABORT_IF_FALSE(mScriptCloseReason.Length() <= 123,
+ "Close Reason Too Long");
+ mOutHeader[1] += mScriptCloseReason.Length();
+ mHdrOutToSend += mScriptCloseReason.Length();
+ memcpy (payload + 2,
+@@ -1646,17 +1647,18 @@ WebSocketChannel::PrimeNewOutgoingMessag
+ }
+ } else {
+ // No close code/reason, so payload length = 0. We must still send mask
+ // even though it's not used. Keep payload offset so we write mask
+ // below.
+ mHdrOutToSend = 6;
+ }
+ } else {
+- *((uint16_t *)payload) = PR_htons(ResultToCloseCode(mStopOnClose));
++ uint16_t temp = PR_htons(ResultToCloseCode(mStopOnClose));
++ memcpy(payload, &temp, 2);
+ mOutHeader[1] += 2;
+ mHdrOutToSend = 8;
+ }
+
+ if (mServerClosed) {
+ /* bidi close complete */
+ mReleaseOnTransmit = 1;
+ } else if (NS_FAILED(mStopOnClose)) {
+@@ -1734,17 +1736,18 @@ WebSocketChannel::PrimeNewOutgoingMessag
+ LOG(("WebSocketChannel::PrimeNewOutgoingMessage(): "
+ "GenerateRandomBytes failure %x\n", rv));
+ StopSession(rv);
+ return;
+ }
+ mask = * reinterpret_cast<uint32_t *>(buffer);
+ NS_Free(buffer);
+ } while (!mask);
+- *(((uint32_t *)payload) - 1) = PR_htonl(mask);
++ uint32_t temp = PR_htonl(mask);
++ memcpy(payload - 4, &temp, 4);
+
+ LOG(("WebSocketChannel::PrimeNewOutgoingMessage() using mask %08x\n", mask));
+
+ // We don't mask the framing, but occasionally we stick a little payload
+ // data in the buffer used for the framing. Close frames are the current
+ // example. This data needs to be masked, but it is never more than a
+ // handful of bytes and might rotate the mask, so we can just do it locally.
+ // For real data frames we ship the bulk of the payload off to ApplyMask()
+
diff --git a/www/firefox/patches/patch-xd b/www/firefox/patches/patch-xd
deleted file mode 100644
index d59e0de290c..00000000000
--- a/www/firefox/patches/patch-xd
+++ /dev/null
@@ -1,126 +0,0 @@
-$NetBSD: patch-xd,v 1.3 2013/05/23 13:12:13 ryoon Exp $
-
-NetBSD/sparc64 xptcall support code. From pkgsrc/www/firefox3/files/
-
---- xpcom/reflect/xptcall/src/md/unix/xptcstubs_sparc64_netbsd.cpp.orig 2013-01-09 15:25:54.000000000 +0000
-+++ xpcom/reflect/xptcall/src/md/unix/xptcstubs_sparc64_netbsd.cpp
-@@ -0,0 +1,119 @@
-+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
-+ *
-+ * The contents of this file are subject to the Netscape Public
-+ * License Version 1.1 (the "License"); you may not use this file
-+ * except in compliance with the License. You may obtain a copy of
-+ * the License at http://www.mozilla.org/NPL/
-+ *
-+ * Software distributed under the License is distributed on an "AS
-+ * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-+ * implied. See the License for the specific language governing
-+ * rights and limitations under the License.
-+ *
-+ * The Original Code is mozilla.org code.
-+ *
-+ * The Initial Developer of the Original Code is Netscape
-+ * Communications Corporation. Portions created by Netscape are
-+ * Copyright (C) 1999 Netscape Communications Corporation. All
-+ * Rights Reserved.
-+ *
-+ * Contributor(s):
-+ */
-+
-+/* Implement shared vtbl methods. */
-+
-+#include "xptcprivate.h"
-+#include "xptiprivate.h"
-+
-+#if defined(sparc) || defined(__sparc__)
-+
-+extern "C" nsresult
-+PrepareAndDispatch(nsXPTCStubBase* self, PRUint64 methodIndex, PRUint64* args)
-+{
-+
-+#define PARAM_BUFFER_COUNT 16
-+
-+ nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT];
-+ nsXPTCMiniVariant* dispatchParams = NULL;
-+ const nsXPTMethodInfo* info;
-+ PRUint8 paramCount;
-+ PRUint8 i;
-+ nsresult result = NS_ERROR_FAILURE;
-+
-+ NS_ASSERTION(self,"no self");
-+
-+ self->mEntry->GetMethodInfo(PRUint16(methodIndex), &info);
-+ NS_ASSERTION(info,"no interface info");
-+
-+ paramCount = info->GetParamCount();
-+
-+ // setup variant array pointer
-+ if(paramCount > PARAM_BUFFER_COUNT)
-+ dispatchParams = new nsXPTCMiniVariant[paramCount];
-+ else
-+ dispatchParams = paramBuffer;
-+ NS_ASSERTION(dispatchParams,"no place for params");
-+ if (!dispatchParams)
-+ return NS_ERROR_OUT_OF_MEMORY;
-+
-+ PRUint64* ap = args;
-+ for(i = 0; i < paramCount; i++, ap++)
-+ {
-+ const nsXPTParamInfo& param = info->GetParam(i);
-+ const nsXPTType& type = param.GetType();
-+ nsXPTCMiniVariant* dp = &dispatchParams[i];
-+
-+ if(param.IsOut() || !type.IsArithmetic())
-+ {
-+ dp->val.p = (void*) *ap;
-+ continue;
-+ }
-+ // else
-+ switch(type)
-+ {
-+ case nsXPTType::T_BOOL : dp->val.b = *((PRInt64*) ap); break;
-+ case nsXPTType::T_CHAR : dp->val.c = *((PRUint64*) ap); break;
-+ case nsXPTType::T_WCHAR : dp->val.wc = *((PRInt64*) ap); break;
-+ case nsXPTType::T_I8 : dp->val.i8 = *((PRInt64*) ap); break;
-+ case nsXPTType::T_I16 : dp->val.i16 = *((PRInt64*) ap); break;
-+ case nsXPTType::T_I32 : dp->val.i32 = *((PRInt64*) ap); break;
-+ case nsXPTType::T_I64 : dp->val.i64 = *((PRInt64*) ap); break;
-+ case nsXPTType::T_U8 : dp->val.u8 = *((PRUint64*) ap); break;
-+ case nsXPTType::T_U16 : dp->val.u16 = *((PRUint64*)ap); break;
-+ case nsXPTType::T_U32 : dp->val.u32 = *((PRUint64*)ap); break;
-+ case nsXPTType::T_U64 : dp->val.u64 = *((PRUint64*) ap); break;
-+ case nsXPTType::T_FLOAT : dp->val.f = ((float*) ap)[1]; break;
-+ case nsXPTType::T_DOUBLE : dp->val.d = *((double*) ap); break;
-+ default:
-+ NS_ASSERTION(0, "bad type");
-+ break;
-+ }
-+ }
-+
-+ result = self->mOuter->CallMethod((PRUint16)methodIndex, info, dispatchParams);
-+
-+ if(dispatchParams != paramBuffer)
-+ delete [] dispatchParams;
-+
-+ return result;
-+}
-+
-+extern "C" int SharedStub(int, int*);
-+
-+#define STUB_ENTRY(n) \
-+nsresult nsXPTCStubBase::Stub##n() \
-+{ \
-+ int dummy; /* defeat tail-call optimization */ \
-+ return SharedStub(n, &dummy); \
-+}
-+
-+#define SENTINEL_ENTRY(n) \
-+nsresult nsXPTCStubBase::Sentinel##n() \
-+{ \
-+ NS_ASSERTION(0,"nsXPTCStubBase::Sentinel called"); \
-+ return NS_ERROR_NOT_IMPLEMENTED; \
-+}
-+
-+#include "xptcstubsdef.inc"
-+
-+#endif /* sparc || __sparc__ */
diff --git a/www/firefox/patches/patch-xpcom__reflect__xptcall__src__md__unix__xptcstubs_sparc64_openbsd.cpp b/www/firefox/patches/patch-xpcom__reflect__xptcall__src__md__unix__xptcstubs_sparc64_openbsd.cpp
new file mode 100644
index 00000000000..1170aa070a1
--- /dev/null
+++ b/www/firefox/patches/patch-xpcom__reflect__xptcall__src__md__unix__xptcstubs_sparc64_openbsd.cpp
@@ -0,0 +1,34 @@
+$NetBSD: patch-xpcom__reflect__xptcall__src__md__unix__xptcstubs_sparc64_openbsd.cpp,v 1.1 2013/06/21 23:11:42 ryoon Exp $
+
+# HG changeset patch
+# User Martin Husemann <martin@netbsd.org>
+# Date 1370038989 -7200
+# Node ID d296fcc8f3dd6254c862cdfd47a5580ee05a94f4
+# Parent 52b02042b27f75acbcb2bd4822bedb00ab680e67
+Bug 867914: Declare SharedStub as returning nsresult in xptcstubs_sparc64_openbsd.cpp. r=landry
+
+Fixes a build issue on NetBSD/sparc64, no apparent fallout on OpenBSD/sparc64
+
+diff xpcom/reflect/xptcall/src/md/unix/xptcstubs_sparc64_openbsd.cpp xpcom/reflect/xptcall/src/md/unix/xptcstubs_sparc64_openbsd.cpp
+--- xpcom/reflect/xptcall/src/md/unix/xptcstubs_sparc64_openbsd.cpp
++++ xpcom/reflect/xptcall/src/md/unix/xptcstubs_sparc64_openbsd.cpp
+@@ -78,17 +78,17 @@ PrepareAndDispatch(nsXPTCStubBase* self,
+ result = self->mOuter->CallMethod((uint16_t)methodIndex, info, dispatchParams);
+
+ if(dispatchParams != paramBuffer)
+ delete [] dispatchParams;
+
+ return result;
+ }
+
+-extern "C" int SharedStub(int, int*);
++extern "C" nsresult SharedStub(int, int*);
+
+ #define STUB_ENTRY(n) \
+ nsresult nsXPTCStubBase::Stub##n() \
+ { \
+ int dummy; /* defeat tail-call optimization */ \
+ return SharedStub(n, &dummy); \
+ }
+
+