On Fri, 16 Oct 2015, Landry Breuil wrote:

> On Fri, Oct 16, 2015 at 02:28:45PM +0200, David Coppa wrote:
> > 
> > So, the only downside seems to be performance related.
> > 
> > See: https://bugzilla.mozilla.org/show_bug.cgi?id=1215479
> > 
> > <<iOS requires it (because it doesn't allow allocating RWX memory), but 
> > it's not
> > enabled elsewhere because it's a performance hit (we should remeasure how 
> > much
> > though). This is because we have to toggle pages from executable to writable
> > and back whenever we patch JIT code>>
> > 
> > What about enabling it in our port and see how it will end up?
> > We can always re-disable it at any time if people complain...
> 
> Commit it but please make the diff eventually upstreamable by adding
> openbsd to the ios case, not removing the ifdefs... and link to the
> bug#.

Here's the diff I'd like to commit:

Index: Makefile
===================================================================
RCS file: /cvs/ports/www/mozilla-firefox/Makefile,v
retrieving revision 1.280
diff -u -p -u -p -r1.280 Makefile
--- Makefile    5 Oct 2015 08:48:14 -0000       1.280
+++ Makefile    16 Oct 2015 15:45:16 -0000
@@ -8,6 +8,7 @@ MOZILLA_VERSION =       41.0.1
 MOZILLA_BRANCH =       release
 MOZILLA_PROJECT =      firefox
 MOZILLA_CODENAME =     browser
+REVISION =             0
 BROKEN-sparc64 =       xpcshell SIGBUS during fake
 EXTRACT_SUFX =         .tar.xz
 
Index: patches/patch-js_src_jit_ExecutableAllocator_cpp
===================================================================
RCS file: patches/patch-js_src_jit_ExecutableAllocator_cpp
diff -N patches/patch-js_src_jit_ExecutableAllocator_cpp
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-js_src_jit_ExecutableAllocator_cpp    16 Oct 2015 15:45:16 
-0000
@@ -0,0 +1,17 @@
+$OpenBSD$
+
+Mark JIT pages as non-writable
+
+https://bugzilla.mozilla.org/show_bug.cgi?id=1215479
+
+--- js/src/jit/ExecutableAllocator.cpp.orig    Tue Sep 29 23:44:56 2015
++++ js/src/jit/ExecutableAllocator.cpp Fri Oct 16 17:02:15 2015
+@@ -88,7 +88,7 @@ ExecutableAllocator::addSizeOfCode(JS::CodeSizes* size
+     }
+ }
+ 
+-#if TARGET_OS_IPHONE
++#if defined(__OpenBSD__) || TARGET_OS_IPHONE
+ bool ExecutableAllocator::nonWritableJitCode = true;
+ #else
+ bool ExecutableAllocator::nonWritableJitCode = false;

Reply via email to