[kde-freebsd] qt4-webkit: phonon backend + enable JIT

Tijl Coosemans tijl at coosemans.org
Mon May 24 00:32:07 CEST 2010


Hi,

I've been experimenting with the javascript JIT compiler in
www/qt4-webkit today using Arora and it seems to work rather well, so
here's a patch to enable it. On the SunSpider test Arora is more than
twice as fast as Konqueror. With JIT compilation enabled it is more
than 6x faster and 1.7x faster than Firefox 3.6.3.

While playing with this port I also noticed it has a dependency on
phonon-gst. It isn't needed. However, the QT configure script disables
phonon support altogether if it can't find gstreamer unless you add
-no-phonon-backend to CONFIGURE_ARGS.

The next change in the patch removes -I/usr/local/include from CFLAGS
and CXXFLAGS in the WebCore Makefile. This path is added by configure
when it runs 'pkg-config --cflags fontconfig --cflags freetype2'. The
problem is that the JIT compiler has an internal header named pcre.h
which conflicts with a header file from the devel/pcre port. I'm not
sure if this is the best solution. I think that if CXXFLAGS can contain
system include paths it would be better if qmake passed CXXFLAGS after
INCPATH in this Makefile target (and some other targets):

.cxx.o:
        $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"

The last change in the patch adds a new patch under files/. It enables
JIT compilation like Linux. Note that it's i386 only.

Please check it out, and let me know what you think.
-------------- next part --------------
--- Makefile.orig	2010-05-23 15:23:57.000000000 +0200
+++ Makefile	2010-05-23 22:39:34.000000000 +0200
@@ -15,7 +15,7 @@
 
 USE_QT_VER=	4
 QT_COMPONENTS=	qmake_build moc_build rcc_build corelib gui network xml \
-		dbus phonon phonon-gst script scripttools xmlpatterns
+		dbus phonon script scripttools xmlpatterns
 QT_NONSTANDARD=	yes
 QT_DIST=	yes
 MAKE_JOBS_SAFE=	yes
@@ -43,7 +43,7 @@
 BUILD_WRKSRC=	${WRKSRC}/src/3rdparty/${PORTNAME}/WebCore
 INSTALL_WRKSRC=	${BUILD_WRKSRC}
 
-CONFIGURE_ARGS+=	-I../../../../include/Qt -I../../../../include
+CONFIGURE_ARGS+=	-I../../../../include/Qt -I../../../../include -no-phonon-backend
 
 EXTRA_PATCHES=	${.CURDIR}/../../devel/qt4/files/patch-configure
 
@@ -57,6 +57,8 @@
 	${REINPLACE_CMD} \
 		-e 's|${PREFIX}/lib/qt4/pkgconfig|${PREFIX}/libdata/pkgconfig|g' \
 		-e 's|.*$$(QMAKE).*||g' \
+		-e '/^CFLAGS/s|-I${LOCALBASE}/include ||g' \
+		-e '/^CXXFLAGS/s|-I${LOCALBASE}/include ||g' \
 		${BUILD_WRKSRC}/Makefile
 	${REINPLACE_CMD} -E -e 's|-L.[^[:space:]]*qt-x11-opensource.[^[:space:]]*lib||g' \
 			-E -e 's|(.*location=).*moc|\1${PREFIX}/bin/moc-qt4|g' \
--- /dev/null	2010-05-23 22:44:01.000000000 +0200
+++ files/patch-src-3rdparty-webkit-JavaScriptCore-wtf-Platform.h	2010-05-23 15:39:45.000000000 +0200
@@ -0,0 +1,20 @@
+--- src/3rdparty/webkit/JavaScriptCore/wtf/Platform.h.orig	2010-05-23 15:38:01.000000000 +0200
++++ src/3rdparty/webkit/JavaScriptCore/wtf/Platform.h	2010-05-23 15:38:09.000000000 +0200
+@@ -773,6 +773,9 @@
+ #elif PLATFORM(X86) && PLATFORM(LINUX) && GCC_VERSION >= 40100
+     #define ENABLE_JIT 1
+     #define WTF_USE_JIT_STUB_ARGUMENT_VA_LIST 1
++#elif PLATFORM(X86) && PLATFORM(FREEBSD) && GCC_VERSION >= 40100
++    #define ENABLE_JIT 1
++    #define WTF_USE_JIT_STUB_ARGUMENT_VA_LIST 1
+ #elif PLATFORM(ARM_TRADITIONAL) && PLATFORM(LINUX)
+     #define ENABLE_JIT 1
+     #if PLATFORM(ARM_THUMB2)
+@@ -832,6 +835,7 @@
+ #if (PLATFORM(X86) && PLATFORM(WIN_OS) && COMPILER(MINGW) && GCC_VERSION >= 40100) \
+  || (PLATFORM(X86) && PLATFORM(WIN_OS) && COMPILER(MSVC)) \
+  || (PLATFORM(X86) && PLATFORM(LINUX) && GCC_VERSION >= 40100) \
++ || (PLATFORM(X86) && PLATFORM(FREEBSD) && GCC_VERSION >= 40100) \
+  || (PLATFORM(ARM_TRADITIONAL) && PLATFORM(LINUX))
+ #define ENABLE_YARR 1
+ #define ENABLE_YARR_JIT 1


More information about the kde-freebsd mailing list