From ba1ed4f32a4eeaed64a11d7f7dde707ef67f13ce Mon Sep 17 00:00:00 2001 From: robert Date: Tue, 31 May 2011 07:55:04 +0000 Subject: [PATCH] Make v8 pre-allocate at least 32M of virtual memory to avoid crashing with vmmap. This is needed because of their JIT is not fully 64-bit. --- www/chromium/Makefile | 4 ++-- www/chromium/patches/patch-v8_src_heap_cc | 18 +++++++++--------- www/node/Makefile | 10 ++++++---- www/node/patches/patch-deps_v8_src_heap_cc | 22 +++++++++++----------- 4 files changed, 28 insertions(+), 26 deletions(-) diff --git a/www/chromium/Makefile b/www/chromium/Makefile index 7aec2a451cc..5ada77aafd3 100644 --- a/www/chromium/Makefile +++ b/www/chromium/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.50 2011/05/26 11:39:14 robert Exp $ +# $OpenBSD: Makefile,v 1.51 2011/05/31 07:55:04 robert Exp $ ONLY_FOR_ARCHS= i386 amd64 @@ -7,7 +7,7 @@ COMMENT= Chromium browser V= 11.0.696.71 DISTNAME= chromium-${V} -REVISION= 0 +REVISION= 1 CATEGORIES= www diff --git a/www/chromium/patches/patch-v8_src_heap_cc b/www/chromium/patches/patch-v8_src_heap_cc index 5e2c8531e9c..6704d43db07 100644 --- a/www/chromium/patches/patch-v8_src_heap_cc +++ b/www/chromium/patches/patch-v8_src_heap_cc @@ -1,12 +1,12 @@ -$OpenBSD: patch-v8_src_heap_cc,v 1.1 2011/05/17 08:35:31 robert Exp $ ---- v8/src/heap.cc.orig Mon May 16 17:04:03 2011 -+++ v8/src/heap.cc Mon May 16 17:07:18 2011 -@@ -87,7 +87,7 @@ intptr_t Heap::max_old_generation_size_ = 192*MB; - int Heap::initial_semispace_size_ = 128*KB; - intptr_t Heap::code_range_size_ = 0; - intptr_t Heap::max_executable_size_ = max_old_generation_size_; --#elif defined(V8_TARGET_ARCH_X64) -+#elif defined(V8_TARGET_ARCH_X64) && !defined(__OpenBSD__) +$OpenBSD: patch-v8_src_heap_cc,v 1.2 2011/05/31 07:55:04 robert Exp $ +--- v8/src/heap.cc.orig Fri May 20 10:56:51 2011 ++++ v8/src/heap.cc Mon May 30 23:09:01 2011 +@@ -91,7 +91,7 @@ intptr_t Heap::max_executable_size_ = max_old_generati static const int default_max_semispace_size_ = 16*MB; intptr_t Heap::max_old_generation_size_ = 1*GB; int Heap::initial_semispace_size_ = 1*MB; +-intptr_t Heap::code_range_size_ = 512*MB; ++intptr_t Heap::code_range_size_ = 32*MB; + intptr_t Heap::max_executable_size_ = 256*MB; + #else + static const int default_max_semispace_size_ = 8*MB; diff --git a/www/node/Makefile b/www/node/Makefile index adf3fdc6e2c..f68c2f337d4 100644 --- a/www/node/Makefile +++ b/www/node/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.13 2011/05/21 20:32:54 sthen Exp $ +# $OpenBSD: Makefile,v 1.14 2011/05/31 07:55:16 robert Exp $ # XXX: # - Needs __ARM_NR_cacheflush (or the like) to work on arm-based ports. @@ -11,14 +11,16 @@ COMMENT= V8 JavaScript for clients and servers DISTNAME= node-v0.4.8 PKGNAME= ${DISTNAME:S/v//g} +REVISION= 0 + CATEGORIES= www devel HOMEPAGE= http://nodejs.org/ # MIT -PERMIT_PACKAGE_CDROM= Yes -PERMIT_PACKAGE_FTP= Yes -PERMIT_DISTFILES_CDROM= Yes +PERMIT_PACKAGE_CDROM= Yes +PERMIT_PACKAGE_FTP= Yes +PERMIT_DISTFILES_CDROM= Yes PERMIT_DISTFILES_FTP= Yes MASTER_SITES= ${HOMEPAGE}/dist/ diff --git a/www/node/patches/patch-deps_v8_src_heap_cc b/www/node/patches/patch-deps_v8_src_heap_cc index c8d5a821803..755c6689d61 100644 --- a/www/node/patches/patch-deps_v8_src_heap_cc +++ b/www/node/patches/patch-deps_v8_src_heap_cc @@ -1,16 +1,16 @@ -$OpenBSD: patch-deps_v8_src_heap_cc,v 1.1 2011/05/21 20:32:54 sthen Exp $ +$OpenBSD: patch-deps_v8_src_heap_cc,v 1.2 2011/05/31 07:55:16 robert Exp $ -Don't allocate a huge chunk of VM upfront on amd64, use the same allocation -policy as done on i386. +Don't allocate a huge chunk of VM upfront on amd64, but still use a bigger +code range size to avoid crashing with vmmap. ---- deps/v8/src/heap.cc.orig Sat May 21 09:07:11 2011 -+++ deps/v8/src/heap.cc Sat May 21 09:07:31 2011 -@@ -87,7 +87,7 @@ intptr_t Heap::max_old_generation_size_ = 192*MB; - int Heap::initial_semispace_size_ = 128*KB; - intptr_t Heap::code_range_size_ = 0; - intptr_t Heap::max_executable_size_ = max_old_generation_size_; --#elif defined(V8_TARGET_ARCH_X64) -+#elif defined(V8_TARGET_ARCH_X64) && !defined(__OpenBSD__) +--- deps/v8/src/heap.cc.orig Sat May 21 04:40:06 2011 ++++ deps/v8/src/heap.cc Mon May 30 22:57:26 2011 +@@ -91,7 +91,7 @@ intptr_t Heap::max_executable_size_ = max_old_generati static const int default_max_semispace_size_ = 16*MB; intptr_t Heap::max_old_generation_size_ = 1*GB; int Heap::initial_semispace_size_ = 1*MB; +-intptr_t Heap::code_range_size_ = 512*MB; ++intptr_t Heap::code_range_size_ = 32*MB; + intptr_t Heap::max_executable_size_ = 256*MB; + #else + static const int default_max_semispace_size_ = 8*MB;