Commit aa396195 authored by zandobersek@gmail.com's avatar zandobersek@gmail.com

[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.

Source/JavaScriptCore: 

* 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):

Source/WTF: 

* 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'.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154747 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent f2d976e6
2013-08-28 Zan Dobersek <zdobersek@igalia.com>
[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 <simon.hausmann@digia.com>
[Qt] Unreviewed trivial build adjustment
......
2013-08-28 Zan Dobersek <zdobersek@igalia.com>
[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 <aestes@apple.com>
Fix issues found by the Clang Static Analyzer
......
......@@ -28,8 +28,9 @@ libjavascriptcoregtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@
libjavascriptcoregtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_LIBADD = \
-lpthread \
libWTF.la \
$(UNICODE_LIBS) \
$(GLIB_LIBS) \
$(LLVM_LIBS) \
$(UNICODE_LIBS) \
$(WINMM_LIBS)
libjavascriptcoregtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_CXXFLAGS = \
......@@ -66,14 +67,14 @@ javascriptcore_cppflags += \
-I$(srcdir)/Source/JavaScriptCore/runtime \
-I$(srcdir)/Source/JavaScriptCore/tools \
-I$(srcdir)/Source/JavaScriptCore/yarr \
-I$(top_builddir)/DerivedSources/JavaScriptCore
javascriptcore_cppflags += \
-I$(srcdir)/Source/WTF
-I$(top_builddir)/DerivedSources/JavaScriptCore \
-I$(srcdir)/Source/WTF \
$(LLVM_CFLAGS)
javascriptcore_cflags += \
$(global_cflags) \
$(GLIB_CFLAGS) \
$(LLVM_CFLAGS) \
$(UNICODE_CFLAGS)
pkgconfig_DATA += Source/JavaScriptCore/javascriptcoregtk-@WEBKITGTK_API_VERSION@.pc
......
......@@ -377,6 +377,65 @@ javascriptcore_sources += \
Source/JavaScriptCore/dfg/DFGWorklist.h \
Source/JavaScriptCore/disassembler/Disassembler.cpp \
Source/JavaScriptCore/disassembler/Disassembler.h \
Source/JavaScriptCore/disassembler/LLVMDisassembler.cpp \
Source/JavaScriptCore/disassembler/LLVMDisassembler.h \
Source/JavaScriptCore/disassembler/X86Disassembler.cpp \
Source/JavaScriptCore/ftl/FTLAbbreviatedTypes.h \
Source/JavaScriptCore/ftl/FTLAbbreviations.h \
Source/JavaScriptCore/ftl/FTLAbstractHeap.cpp \
Source/JavaScriptCore/ftl/FTLAbstractHeap.h \
Source/JavaScriptCore/ftl/FTLAbstractHeapRepository.cpp \
Source/JavaScriptCore/ftl/FTLAbstractHeapRepository.h \
Source/JavaScriptCore/ftl/FTLCapabilities.cpp \
Source/JavaScriptCore/ftl/FTLCapabilities.h \
Source/JavaScriptCore/ftl/FTLCArgumentGetter.cpp \
Source/JavaScriptCore/ftl/FTLCArgumentGetter.h \
Source/JavaScriptCore/ftl/FTLCommonValues.cpp \
Source/JavaScriptCore/ftl/FTLCommonValues.h \
Source/JavaScriptCore/ftl/FTLCompile.cpp \
Source/JavaScriptCore/ftl/FTLCompile.h \
Source/JavaScriptCore/ftl/FTLExitArgument.cpp \
Source/JavaScriptCore/ftl/FTLExitArgumentForOperand.cpp \
Source/JavaScriptCore/ftl/FTLExitArgumentForOperand.h \
Source/JavaScriptCore/ftl/FTLExitArgument.h \
Source/JavaScriptCore/ftl/FTLExitArgumentList.h \
Source/JavaScriptCore/ftl/FTLExitThunkGenerator.cpp \
Source/JavaScriptCore/ftl/FTLExitThunkGenerator.h \
Source/JavaScriptCore/ftl/FTLExitValue.cpp \
Source/JavaScriptCore/ftl/FTLExitValue.h \
Source/JavaScriptCore/ftl/FTLFail.cpp \
Source/JavaScriptCore/ftl/FTLFail.h \
Source/JavaScriptCore/ftl/FTLFormattedValue.h \
Source/JavaScriptCore/ftl/FTLGeneratedFunction.h \
Source/JavaScriptCore/ftl/FTLIntrinsicRepository.cpp \
Source/JavaScriptCore/ftl/FTLIntrinsicRepository.h \
Source/JavaScriptCore/ftl/FTLJITCode.cpp \
Source/JavaScriptCore/ftl/FTLJITCode.h \
Source/JavaScriptCore/ftl/FTLJITFinalizer.cpp \
Source/JavaScriptCore/ftl/FTLJITFinalizer.h \
Source/JavaScriptCore/ftl/FTLLink.cpp \
Source/JavaScriptCore/ftl/FTLLink.h \
Source/JavaScriptCore/ftl/FTLLowerDFGToLLVM.cpp \
Source/JavaScriptCore/ftl/FTLLowerDFGToLLVM.h \
Source/JavaScriptCore/ftl/FTLLoweredNodeValue.h \
Source/JavaScriptCore/ftl/FTLOSRExitCompilationInfo.h \
Source/JavaScriptCore/ftl/FTLOSRExitCompiler.cpp \
Source/JavaScriptCore/ftl/FTLOSRExitCompiler.h \
Source/JavaScriptCore/ftl/FTLOSRExit.cpp \
Source/JavaScriptCore/ftl/FTLOSRExit.h \
Source/JavaScriptCore/ftl/FTLOutput.cpp \
Source/JavaScriptCore/ftl/FTLOutput.h \
Source/JavaScriptCore/ftl/FTLState.cpp \
Source/JavaScriptCore/ftl/FTLState.h \
Source/JavaScriptCore/ftl/FTLSwitchCase.h \
Source/JavaScriptCore/ftl/FTLThunks.cpp \
Source/JavaScriptCore/ftl/FTLThunks.h \
Source/JavaScriptCore/ftl/FTLTypedPointer.h \
Source/JavaScriptCore/ftl/FTLValueFormat.cpp \
Source/JavaScriptCore/ftl/FTLValueFormat.h \
Source/JavaScriptCore/ftl/FTLValueFromBlock.h \
Source/JavaScriptCore/ftl/FTLValueSource.cpp \
Source/JavaScriptCore/ftl/FTLValueSource.h \
Source/JavaScriptCore/heap/CopiedAllocator.h \
Source/JavaScriptCore/heap/CopiedBlock.h \
Source/JavaScriptCore/heap/CopiedBlockInlines.h \
......
......@@ -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 functionType(LType returnType, LType param1, LType param2, L
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); }
......
2013-08-28 Zan Dobersek <zdobersek@igalia.com>
[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 <arurajku@cisco.com>
Replace currentTime() with monotonicallyIncreasingTime() in WebCore
......
......@@ -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))
......
......@@ -501,6 +501,48 @@ if test "$enable_webkit2" = "yes"; then
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])
],[
......
......@@ -22,6 +22,7 @@ Features:
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
......
......@@ -185,6 +185,10 @@ AC_MSG_CHECKING([whether to enable JIT compilation])
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)]),
......
......@@ -99,3 +99,13 @@ if test "$enable_jit" = "yes"; then
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
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment