Diff
Modified: trunk/ChangeLog (154746 => 154747)
--- trunk/ChangeLog 2013-08-28 14:41:12 UTC (rev 154746)
+++ trunk/ChangeLog 2013-08-28 14:52:48 UTC (rev 154747)
@@ -1,3 +1,18 @@
+2013-08-28 Zan Dobersek <[email protected]>
+
+ [GTK] Add support for building JSC with FTL JIT enabled
+ https://bugs.webkit.org/show_bug.cgi?id=120270
+
+ Reviewed by Filip Pizlo.
+
+ * Source/autotools/FindDependencies.m4: Disable FTL JIT if the JIT itself is disabled or if the C++ compiler
+ being used is not Clang. Check for llvm-config and use it to properly test for the LLVM >= 3.4 dependency.
+ * Source/autotools/PrintBuildConfiguration.m4: Print out the status of the FTL JIT support.
+ * Source/autotools/ReadCommandLineArguments.m4: Add a configuration flag for enabling the feature, defaulting
+ to 'no' used as the default value for now. This should switch to 'auto' at some point in future.
+ * Source/autotools/SetupAutoconfHeader.m4: Define ENABLE_FTL_JIT to a specific value if possible.
+ Also define HAVE_LLVM to 1 if the LLVM dependency was satisfied.
+
2013-08-28 Simon Hausmann <[email protected]>
[Qt] Unreviewed trivial build adjustment
Modified: trunk/Source/_javascript_Core/ChangeLog (154746 => 154747)
--- trunk/Source/_javascript_Core/ChangeLog 2013-08-28 14:41:12 UTC (rev 154746)
+++ trunk/Source/_javascript_Core/ChangeLog 2013-08-28 14:52:48 UTC (rev 154747)
@@ -1,3 +1,18 @@
+2013-08-28 Zan Dobersek <[email protected]>
+
+ [GTK] Add support for building JSC with FTL JIT enabled
+ https://bugs.webkit.org/show_bug.cgi?id=120270
+
+ Reviewed by Filip Pizlo.
+
+ * GNUmakefile.am: Add LLVM_LIBS to the list of linker flags and LLVM_CFLAGS to the list of
+ compiler flags for the JSC library.
+ * GNUmakefile.list.am: Add the missing build targets.
+ * ftl/FTLAbbreviations.h: Include the <cstring> header and use std::strlen. This avoids compilation
+ failures when using the Clang compiler with the libstdc++ standard library.
+ (JSC::FTL::mdKindID):
+ (JSC::FTL::mdString):
+
2013-08-23 Andy Estes <[email protected]>
Fix issues found by the Clang Static Analyzer
Modified: trunk/Source/_javascript_Core/GNUmakefile.am (154746 => 154747)
--- trunk/Source/_javascript_Core/GNUmakefile.am 2013-08-28 14:41:12 UTC (rev 154746)
+++ trunk/Source/_javascript_Core/GNUmakefile.am 2013-08-28 14:52:48 UTC (rev 154747)
@@ -28,8 +28,9 @@
libjavascriptcoregtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_LIBADD = \
-lpthread \
libWTF.la \
+ $(GLIB_LIBS) \
+ $(LLVM_LIBS) \
$(UNICODE_LIBS) \
- $(GLIB_LIBS) \
$(WINMM_LIBS)
libjavascriptcoregtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_CXXFLAGS = \
@@ -66,14 +67,14 @@
-I$(srcdir)/Source/_javascript_Core/runtime \
-I$(srcdir)/Source/_javascript_Core/tools \
-I$(srcdir)/Source/_javascript_Core/yarr \
- -I$(top_builddir)/DerivedSources/_javascript_Core
+ -I$(top_builddir)/DerivedSources/_javascript_Core \
+ -I$(srcdir)/Source/WTF \
+ $(LLVM_CFLAGS)
-_javascript_core_cppflags += \
- -I$(srcdir)/Source/WTF
-
_javascript_core_cflags += \
$(global_cflags) \
$(GLIB_CFLAGS) \
+ $(LLVM_CFLAGS) \
$(UNICODE_CFLAGS)
pkgconfig_DATA += Source/_javascript_Core/_javascript_coregtk-@[email protected]
Modified: trunk/Source/_javascript_Core/GNUmakefile.list.am (154746 => 154747)
--- trunk/Source/_javascript_Core/GNUmakefile.list.am 2013-08-28 14:41:12 UTC (rev 154746)
+++ trunk/Source/_javascript_Core/GNUmakefile.list.am 2013-08-28 14:52:48 UTC (rev 154747)
@@ -377,6 +377,65 @@
Source/_javascript_Core/dfg/DFGWorklist.h \
Source/_javascript_Core/disassembler/Disassembler.cpp \
Source/_javascript_Core/disassembler/Disassembler.h \
+ Source/_javascript_Core/disassembler/LLVMDisassembler.cpp \
+ Source/_javascript_Core/disassembler/LLVMDisassembler.h \
+ Source/_javascript_Core/disassembler/X86Disassembler.cpp \
+ Source/_javascript_Core/ftl/FTLAbbreviatedTypes.h \
+ Source/_javascript_Core/ftl/FTLAbbreviations.h \
+ Source/_javascript_Core/ftl/FTLAbstractHeap.cpp \
+ Source/_javascript_Core/ftl/FTLAbstractHeap.h \
+ Source/_javascript_Core/ftl/FTLAbstractHeapRepository.cpp \
+ Source/_javascript_Core/ftl/FTLAbstractHeapRepository.h \
+ Source/_javascript_Core/ftl/FTLCapabilities.cpp \
+ Source/_javascript_Core/ftl/FTLCapabilities.h \
+ Source/_javascript_Core/ftl/FTLCArgumentGetter.cpp \
+ Source/_javascript_Core/ftl/FTLCArgumentGetter.h \
+ Source/_javascript_Core/ftl/FTLCommonValues.cpp \
+ Source/_javascript_Core/ftl/FTLCommonValues.h \
+ Source/_javascript_Core/ftl/FTLCompile.cpp \
+ Source/_javascript_Core/ftl/FTLCompile.h \
+ Source/_javascript_Core/ftl/FTLExitArgument.cpp \
+ Source/_javascript_Core/ftl/FTLExitArgumentForOperand.cpp \
+ Source/_javascript_Core/ftl/FTLExitArgumentForOperand.h \
+ Source/_javascript_Core/ftl/FTLExitArgument.h \
+ Source/_javascript_Core/ftl/FTLExitArgumentList.h \
+ Source/_javascript_Core/ftl/FTLExitThunkGenerator.cpp \
+ Source/_javascript_Core/ftl/FTLExitThunkGenerator.h \
+ Source/_javascript_Core/ftl/FTLExitValue.cpp \
+ Source/_javascript_Core/ftl/FTLExitValue.h \
+ Source/_javascript_Core/ftl/FTLFail.cpp \
+ Source/_javascript_Core/ftl/FTLFail.h \
+ Source/_javascript_Core/ftl/FTLFormattedValue.h \
+ Source/_javascript_Core/ftl/FTLGeneratedFunction.h \
+ Source/_javascript_Core/ftl/FTLIntrinsicRepository.cpp \
+ Source/_javascript_Core/ftl/FTLIntrinsicRepository.h \
+ Source/_javascript_Core/ftl/FTLJITCode.cpp \
+ Source/_javascript_Core/ftl/FTLJITCode.h \
+ Source/_javascript_Core/ftl/FTLJITFinalizer.cpp \
+ Source/_javascript_Core/ftl/FTLJITFinalizer.h \
+ Source/_javascript_Core/ftl/FTLLink.cpp \
+ Source/_javascript_Core/ftl/FTLLink.h \
+ Source/_javascript_Core/ftl/FTLLowerDFGToLLVM.cpp \
+ Source/_javascript_Core/ftl/FTLLowerDFGToLLVM.h \
+ Source/_javascript_Core/ftl/FTLLoweredNodeValue.h \
+ Source/_javascript_Core/ftl/FTLOSRExitCompilationInfo.h \
+ Source/_javascript_Core/ftl/FTLOSRExitCompiler.cpp \
+ Source/_javascript_Core/ftl/FTLOSRExitCompiler.h \
+ Source/_javascript_Core/ftl/FTLOSRExit.cpp \
+ Source/_javascript_Core/ftl/FTLOSRExit.h \
+ Source/_javascript_Core/ftl/FTLOutput.cpp \
+ Source/_javascript_Core/ftl/FTLOutput.h \
+ Source/_javascript_Core/ftl/FTLState.cpp \
+ Source/_javascript_Core/ftl/FTLState.h \
+ Source/_javascript_Core/ftl/FTLSwitchCase.h \
+ Source/_javascript_Core/ftl/FTLThunks.cpp \
+ Source/_javascript_Core/ftl/FTLThunks.h \
+ Source/_javascript_Core/ftl/FTLTypedPointer.h \
+ Source/_javascript_Core/ftl/FTLValueFormat.cpp \
+ Source/_javascript_Core/ftl/FTLValueFormat.h \
+ Source/_javascript_Core/ftl/FTLValueFromBlock.h \
+ Source/_javascript_Core/ftl/FTLValueSource.cpp \
+ Source/_javascript_Core/ftl/FTLValueSource.h \
Source/_javascript_Core/heap/CopiedAllocator.h \
Source/_javascript_Core/heap/CopiedBlock.h \
Source/_javascript_Core/heap/CopiedBlockInlines.h \
Modified: trunk/Source/_javascript_Core/ftl/FTLAbbreviations.h (154746 => 154747)
--- trunk/Source/_javascript_Core/ftl/FTLAbbreviations.h 2013-08-28 14:41:12 UTC (rev 154746)
+++ trunk/Source/_javascript_Core/ftl/FTLAbbreviations.h 2013-08-28 14:52:48 UTC (rev 154747)
@@ -33,6 +33,7 @@
#include "FTLAbbreviatedTypes.h"
#include "FTLSwitchCase.h"
#include "FTLValueFromBlock.h"
+#include <cstring>
namespace JSC { namespace FTL {
@@ -111,9 +112,9 @@
static inline LType typeOf(LValue value) { return LLVMTypeOf(value); }
-static inline unsigned mdKindID(LContext context, const char* string) { return LLVMGetMDKindIDInContext(context, string, strlen(string)); }
+static inline unsigned mdKindID(LContext context, const char* string) { return LLVMGetMDKindIDInContext(context, string, std::strlen(string)); }
static inline LValue mdString(LContext context, const char* string, unsigned length) { return LLVMMDStringInContext(context, string, length); }
-static inline LValue mdString(LContext context, const char* string) { return mdString(context, string, strlen(string)); }
+static inline LValue mdString(LContext context, const char* string) { return mdString(context, string, std::strlen(string)); }
static inline LValue mdNode(LContext context, LValue* args, unsigned numArgs) { return LLVMMDNodeInContext(context, args, numArgs); }
static inline LValue mdNode(LContext context) { return mdNode(context, 0, 0); }
static inline LValue mdNode(LContext context, LValue arg1) { return mdNode(context, &arg1, 1); }
Modified: trunk/Source/WTF/ChangeLog (154746 => 154747)
--- trunk/Source/WTF/ChangeLog 2013-08-28 14:41:12 UTC (rev 154746)
+++ trunk/Source/WTF/ChangeLog 2013-08-28 14:52:48 UTC (rev 154747)
@@ -1,3 +1,14 @@
+2013-08-28 Zan Dobersek <[email protected]>
+
+ [GTK] Add support for building JSC with FTL JIT enabled
+ https://bugs.webkit.org/show_bug.cgi?id=120270
+
+ Reviewed by Filip Pizlo.
+
+ * wtf/Platform.h: Define ENABLE_FTL_JIT to the value of 1 for the GTK port if building for the x86-64
+ architecture with LLVM present and the define not being previously defined. This is applicable when
+ configuring the Automake build with '--enable-ftl-jit=auto'.
+
2013-08-27 Arunprasad Rajkumar <[email protected]>
Replace currentTime() with monotonicallyIncreasingTime() in WebCore
Modified: trunk/Source/WTF/wtf/Platform.h (154746 => 154747)
--- trunk/Source/WTF/wtf/Platform.h 2013-08-28 14:41:12 UTC (rev 154746)
+++ trunk/Source/WTF/wtf/Platform.h 2013-08-28 14:52:48 UTC (rev 154747)
@@ -718,6 +718,10 @@
#define HAVE_LLVM 1
#endif
+#if PLATFORM(GTK) && HAVE(LLVM) && ENABLE(JIT) && !defined(ENABLE_FTL_JIT) && CPU(X86_64)
+#define ENABLE_FTL_JIT 1
+#endif
+
/* If possible, try to enable the LLVM disassembler. This is optional and we can
fall back on UDis86 if necessary. */
#if !defined(WTF_USE_LLVM_DISASSEMBLER) && HAVE(LLVM) && (CPU(X86_64) || CPU(X86))
Modified: trunk/Source/autotools/FindDependencies.m4 (154746 => 154747)
--- trunk/Source/autotools/FindDependencies.m4 2013-08-28 14:41:12 UTC (rev 154746)
+++ trunk/Source/autotools/FindDependencies.m4 2013-08-28 14:52:48 UTC (rev 154747)
@@ -501,6 +501,48 @@
AC_SUBST([ATSPI2_LIBS])
fi
+if test "$enable_jit" = "no"; then
+ AC_MSG_NOTICE([JIT compilation is disabled, also disabling FTL JIT support.])
+ enable_ftl_jit=no
+fi
+
+if test "$enable_ftl_jit" != no && test "$cxx_compiler" != "clang++"; then
+ if test "$enable_ftl_jit" = "yes"; then
+ AC_MSG_ERROR([Clang C++ compiler is required for FTL JIT support.])
+ else
+ AC_MSG_WARN([Clang C++ compiler is not used, disabling FTL JIT support.])
+ enable_ftl_jit=no
+ fi
+fi
+
+if test "$enable_ftl_jit" != "no"; then
+ AC_PATH_PROG(llvm_config, llvm-config, no)
+ if test "$llvm_config" = "no"; then
+ if test "$enable_ftl_jit" = "yes"; then
+ AC_MSG_ERROR([Cannot find llvm-config. LLVM >= 3.4 is needed for FTL JIT support.])
+ else
+ AC_MSG_WARN([Cannot find llvm-config. LLVM >= 3.4 is not present, disabling FTL JIT support.])
+ enable_ftl_jit=no
+ fi
+ else
+ LLVM_VERSION=`$llvm_config --version`
+ AX_COMPARE_VERSION([$LLVM_VERSION], [ge], [3.4], [have_llvm=yes], [have_llvm=no])
+ if test "$have_llvm" = "no"; then
+ if test "$enable_ftl_jit" = "yes"; then
+ AC_MSG_ERROR([LLVM >= 3.4 is needed for FTL JIT support.])
+ else
+ AC_MSG_WARN([LLVM >= 3.4 is not present, disabling FTL JIT support.])
+ enable_ftl_jit=no
+ fi
+ else
+ LLVM_CFLAGS=`$llvm_config --cppflags`
+ LLVM_LIBS="`$llvm_config --ldflags` `$llvm_config --libs`"
+ AC_SUBST([LLVM_CFLAGS])
+ AC_SUBST([LLVM_LIBS])
+ fi
+ fi
+fi
+
m4_ifdef([GTK_DOC_CHECK], [
GTK_DOC_CHECK([1.10])
],[
Modified: trunk/Source/autotools/PrintBuildConfiguration.m4 (154746 => 154747)
--- trunk/Source/autotools/PrintBuildConfiguration.m4 2013-08-28 14:41:12 UTC (rev 154746)
+++ trunk/Source/autotools/PrintBuildConfiguration.m4 2013-08-28 14:52:48 UTC (rev 154747)
@@ -22,6 +22,7 @@
Geolocation support : $enable_geolocation
HTML5 video element support : $enable_video
JIT compilation : $enable_jit
+ FTL JIT compilation : $enable_ftl_jit
Opcode stats : $enable_opcode_stats
SVG fonts support : $enable_svg_fonts
SVG support : $enable_svg
Modified: trunk/Source/autotools/ReadCommandLineArguments.m4 (154746 => 154747)
--- trunk/Source/autotools/ReadCommandLineArguments.m4 2013-08-28 14:41:12 UTC (rev 154746)
+++ trunk/Source/autotools/ReadCommandLineArguments.m4 2013-08-28 14:52:48 UTC (rev 154747)
@@ -185,6 +185,10 @@
AC_ARG_ENABLE(jit, AS_HELP_STRING([--enable-jit], [Enable JIT compilation (default: auto)]), [], [enable_jit=auto])
AC_MSG_RESULT([$enable_jit])
+AC_MSG_CHECKING([whether to enable FTL JIT])
+AC_ARG_ENABLE(ftl-jit, AS_HELP_STRING([--enable-ftl-jit], [Enable FTL JIT (experimental) (default: no)]), [], [enable_ftl_jit=no])
+AC_MSG_RESULT([$enable_ftl_jit])
+
AC_MSG_CHECKING([whether to enable opcode stats])
AC_ARG_ENABLE([opcode-stats],
AS_HELP_STRING([--enable-opcode-stats], [Enable Opcode statistics (default: disabled)]),
Modified: trunk/Source/autotools/SetupAutoconfHeader.m4 (154746 => 154747)
--- trunk/Source/autotools/SetupAutoconfHeader.m4 2013-08-28 14:41:12 UTC (rev 154746)
+++ trunk/Source/autotools/SetupAutoconfHeader.m4 2013-08-28 14:52:48 UTC (rev 154747)
@@ -99,3 +99,13 @@
elif test "$enable_jit" = "no"; then
AC_DEFINE([ENABLE_JIT], [0], [ ])
fi
+
+if test "$enable_ftl_jit" = "yes"; then
+ AC_DEFINE([ENABLE_FTL_JIT], [1], [ ])
+elif test "$enable_ftl_jit" = "no"; then
+ AC_DEFINE([ENABLE_FTL_JIT], [0], [ ])
+fi
+
+if test "$have_llvm" = "yes"; then
+ AC_DEFINE([HAVE_LLVM], [1], [ ])
+fi