Changeset 154747 in webkit


Ignore:
Timestamp:
Aug 28, 2013 7:52:48 AM (11 years ago)
Author:
zandobersek@gmail.com
Message:

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

Location:
trunk
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/ChangeLog

    r154723 r154747  
     12013-08-28  Zan Dobersek  <zdobersek@igalia.com>
     2
     3        [GTK] Add support for building JSC with FTL JIT enabled
     4        https://bugs.webkit.org/show_bug.cgi?id=120270
     5
     6        Reviewed by Filip Pizlo.
     7
     8        * Source/autotools/FindDependencies.m4: Disable FTL JIT if the JIT itself is disabled or if the C++ compiler
     9        being used is not Clang. Check for llvm-config and use it to properly test for the LLVM >= 3.4 dependency.
     10        * Source/autotools/PrintBuildConfiguration.m4: Print out the status of the FTL JIT support.
     11        * Source/autotools/ReadCommandLineArguments.m4: Add a configuration flag for enabling the feature, defaulting
     12        to 'no' used as the default value for now. This should switch to 'auto' at some point in future.
     13        * Source/autotools/SetupAutoconfHeader.m4: Define ENABLE_FTL_JIT to a specific value if possible.
     14        Also define HAVE_LLVM to 1 if the LLVM dependency was satisfied.
     15
    1162013-08-28  Simon Hausmann  <simon.hausmann@digia.com>
    217
  • trunk/Source/JavaScriptCore/ChangeLog

    r154647 r154747  
     12013-08-28  Zan Dobersek  <zdobersek@igalia.com>
     2
     3        [GTK] Add support for building JSC with FTL JIT enabled
     4        https://bugs.webkit.org/show_bug.cgi?id=120270
     5
     6        Reviewed by Filip Pizlo.
     7
     8        * GNUmakefile.am: Add LLVM_LIBS to the list of linker flags and LLVM_CFLAGS to the list of
     9        compiler flags for the JSC library.
     10        * GNUmakefile.list.am: Add the missing build targets.
     11        * ftl/FTLAbbreviations.h: Include the <cstring> header and use std::strlen. This avoids compilation
     12        failures when using the Clang compiler with the libstdc++ standard library.
     13        (JSC::FTL::mdKindID):
     14        (JSC::FTL::mdString):
     15
    1162013-08-23  Andy Estes  <aestes@apple.com>
    217
  • trunk/Source/JavaScriptCore/GNUmakefile.am

    r153703 r154747  
    2929        -lpthread \
    3030        libWTF.la \
     31        $(GLIB_LIBS) \
     32        $(LLVM_LIBS) \
    3133        $(UNICODE_LIBS) \
    32         $(GLIB_LIBS) \
    3334        $(WINMM_LIBS)
    3435
     
    6768        -I$(srcdir)/Source/JavaScriptCore/tools \
    6869        -I$(srcdir)/Source/JavaScriptCore/yarr \
    69         -I$(top_builddir)/DerivedSources/JavaScriptCore
    70 
    71 javascriptcore_cppflags += \
    72         -I$(srcdir)/Source/WTF
     70        -I$(top_builddir)/DerivedSources/JavaScriptCore \
     71        -I$(srcdir)/Source/WTF \
     72        $(LLVM_CFLAGS)
    7373
    7474javascriptcore_cflags += \
    7575        $(global_cflags) \
    7676        $(GLIB_CFLAGS) \
     77        $(LLVM_CFLAGS) \
    7778        $(UNICODE_CFLAGS)
    7879
  • trunk/Source/JavaScriptCore/GNUmakefile.list.am

    r154629 r154747  
    378378        Source/JavaScriptCore/disassembler/Disassembler.cpp \
    379379        Source/JavaScriptCore/disassembler/Disassembler.h \
     380        Source/JavaScriptCore/disassembler/LLVMDisassembler.cpp \
     381        Source/JavaScriptCore/disassembler/LLVMDisassembler.h \
     382        Source/JavaScriptCore/disassembler/X86Disassembler.cpp \
     383        Source/JavaScriptCore/ftl/FTLAbbreviatedTypes.h \
     384        Source/JavaScriptCore/ftl/FTLAbbreviations.h \
     385        Source/JavaScriptCore/ftl/FTLAbstractHeap.cpp \
     386        Source/JavaScriptCore/ftl/FTLAbstractHeap.h \
     387        Source/JavaScriptCore/ftl/FTLAbstractHeapRepository.cpp \
     388        Source/JavaScriptCore/ftl/FTLAbstractHeapRepository.h \
     389        Source/JavaScriptCore/ftl/FTLCapabilities.cpp \
     390        Source/JavaScriptCore/ftl/FTLCapabilities.h \
     391        Source/JavaScriptCore/ftl/FTLCArgumentGetter.cpp \
     392        Source/JavaScriptCore/ftl/FTLCArgumentGetter.h \
     393        Source/JavaScriptCore/ftl/FTLCommonValues.cpp \
     394        Source/JavaScriptCore/ftl/FTLCommonValues.h \
     395        Source/JavaScriptCore/ftl/FTLCompile.cpp \
     396        Source/JavaScriptCore/ftl/FTLCompile.h \
     397        Source/JavaScriptCore/ftl/FTLExitArgument.cpp \
     398        Source/JavaScriptCore/ftl/FTLExitArgumentForOperand.cpp \
     399        Source/JavaScriptCore/ftl/FTLExitArgumentForOperand.h \
     400        Source/JavaScriptCore/ftl/FTLExitArgument.h \
     401        Source/JavaScriptCore/ftl/FTLExitArgumentList.h \
     402        Source/JavaScriptCore/ftl/FTLExitThunkGenerator.cpp \
     403        Source/JavaScriptCore/ftl/FTLExitThunkGenerator.h \
     404        Source/JavaScriptCore/ftl/FTLExitValue.cpp \
     405        Source/JavaScriptCore/ftl/FTLExitValue.h \
     406        Source/JavaScriptCore/ftl/FTLFail.cpp \
     407        Source/JavaScriptCore/ftl/FTLFail.h \
     408        Source/JavaScriptCore/ftl/FTLFormattedValue.h \
     409        Source/JavaScriptCore/ftl/FTLGeneratedFunction.h \
     410        Source/JavaScriptCore/ftl/FTLIntrinsicRepository.cpp \
     411        Source/JavaScriptCore/ftl/FTLIntrinsicRepository.h \
     412        Source/JavaScriptCore/ftl/FTLJITCode.cpp \
     413        Source/JavaScriptCore/ftl/FTLJITCode.h \
     414        Source/JavaScriptCore/ftl/FTLJITFinalizer.cpp \
     415        Source/JavaScriptCore/ftl/FTLJITFinalizer.h \
     416        Source/JavaScriptCore/ftl/FTLLink.cpp \
     417        Source/JavaScriptCore/ftl/FTLLink.h \
     418        Source/JavaScriptCore/ftl/FTLLowerDFGToLLVM.cpp \
     419        Source/JavaScriptCore/ftl/FTLLowerDFGToLLVM.h \
     420        Source/JavaScriptCore/ftl/FTLLoweredNodeValue.h \
     421        Source/JavaScriptCore/ftl/FTLOSRExitCompilationInfo.h \
     422        Source/JavaScriptCore/ftl/FTLOSRExitCompiler.cpp \
     423        Source/JavaScriptCore/ftl/FTLOSRExitCompiler.h \
     424        Source/JavaScriptCore/ftl/FTLOSRExit.cpp \
     425        Source/JavaScriptCore/ftl/FTLOSRExit.h \
     426        Source/JavaScriptCore/ftl/FTLOutput.cpp \
     427        Source/JavaScriptCore/ftl/FTLOutput.h \
     428        Source/JavaScriptCore/ftl/FTLState.cpp \
     429        Source/JavaScriptCore/ftl/FTLState.h \
     430        Source/JavaScriptCore/ftl/FTLSwitchCase.h \
     431        Source/JavaScriptCore/ftl/FTLThunks.cpp \
     432        Source/JavaScriptCore/ftl/FTLThunks.h \
     433        Source/JavaScriptCore/ftl/FTLTypedPointer.h \
     434        Source/JavaScriptCore/ftl/FTLValueFormat.cpp \
     435        Source/JavaScriptCore/ftl/FTLValueFormat.h \
     436        Source/JavaScriptCore/ftl/FTLValueFromBlock.h \
     437        Source/JavaScriptCore/ftl/FTLValueSource.cpp \
     438        Source/JavaScriptCore/ftl/FTLValueSource.h \
    380439        Source/JavaScriptCore/heap/CopiedAllocator.h \
    381440        Source/JavaScriptCore/heap/CopiedBlock.h \
  • trunk/Source/JavaScriptCore/ftl/FTLAbbreviations.h

    r153254 r154747  
    3434#include "FTLSwitchCase.h"
    3535#include "FTLValueFromBlock.h"
     36#include <cstring>
    3637
    3738namespace JSC { namespace FTL {
     
    112113static inline LType typeOf(LValue value) { return LLVMTypeOf(value); }
    113114
    114 static inline unsigned mdKindID(LContext context, const char* string) { return LLVMGetMDKindIDInContext(context, string, strlen(string)); }
     115static inline unsigned mdKindID(LContext context, const char* string) { return LLVMGetMDKindIDInContext(context, string, std::strlen(string)); }
    115116static inline LValue mdString(LContext context, const char* string, unsigned length) { return LLVMMDStringInContext(context, string, length); }
    116 static inline LValue mdString(LContext context, const char* string) { return mdString(context, string, strlen(string)); }
     117static inline LValue mdString(LContext context, const char* string) { return mdString(context, string, std::strlen(string)); }
    117118static inline LValue mdNode(LContext context, LValue* args, unsigned numArgs) { return LLVMMDNodeInContext(context, args, numArgs); }
    118119static inline LValue mdNode(LContext context) { return mdNode(context, 0, 0); }
  • trunk/Source/WTF/ChangeLog

    r154706 r154747  
     12013-08-28  Zan Dobersek  <zdobersek@igalia.com>
     2
     3        [GTK] Add support for building JSC with FTL JIT enabled
     4        https://bugs.webkit.org/show_bug.cgi?id=120270
     5
     6        Reviewed by Filip Pizlo.
     7
     8        * wtf/Platform.h: Define ENABLE_FTL_JIT to the value of 1 for the GTK port if building for the x86-64
     9        architecture with LLVM present and the define not being previously defined. This is applicable when
     10        configuring the Automake build with '--enable-ftl-jit=auto'.
     11
    1122013-08-27  Arunprasad Rajkumar  <arurajku@cisco.com>
    213
  • trunk/Source/WTF/wtf/Platform.h

    r154325 r154747  
    719719#endif
    720720
     721#if PLATFORM(GTK) && HAVE(LLVM) && ENABLE(JIT) && !defined(ENABLE_FTL_JIT) && CPU(X86_64)
     722#define ENABLE_FTL_JIT 1
     723#endif
     724
    721725/* If possible, try to enable the LLVM disassembler. This is optional and we can
    722726   fall back on UDis86 if necessary. */
  • trunk/Source/autotools/FindDependencies.m4

    r154008 r154747  
    502502fi
    503503
     504if test "$enable_jit" = "no"; then
     505    AC_MSG_NOTICE([JIT compilation is disabled, also disabling FTL JIT support.])
     506    enable_ftl_jit=no
     507fi
     508
     509if test "$enable_ftl_jit" != no && test "$cxx_compiler" != "clang++"; then
     510    if test "$enable_ftl_jit" = "yes"; then
     511        AC_MSG_ERROR([Clang C++ compiler is required for FTL JIT support.])
     512    else
     513        AC_MSG_WARN([Clang C++ compiler is not used, disabling FTL JIT support.])
     514        enable_ftl_jit=no
     515    fi
     516fi
     517
     518if test "$enable_ftl_jit" != "no"; then
     519    AC_PATH_PROG(llvm_config, llvm-config, no)
     520    if test "$llvm_config" = "no"; then
     521        if test "$enable_ftl_jit" = "yes"; then
     522            AC_MSG_ERROR([Cannot find llvm-config. LLVM >= 3.4 is needed for FTL JIT support.])
     523        else
     524            AC_MSG_WARN([Cannot find llvm-config. LLVM >= 3.4 is not present, disabling FTL JIT support.])
     525            enable_ftl_jit=no
     526        fi
     527    else
     528        LLVM_VERSION=`$llvm_config --version`
     529        AX_COMPARE_VERSION([$LLVM_VERSION], [ge], [3.4], [have_llvm=yes], [have_llvm=no])
     530        if test "$have_llvm" = "no"; then
     531            if test "$enable_ftl_jit" = "yes"; then
     532                AC_MSG_ERROR([LLVM >= 3.4 is needed for FTL JIT support.])
     533            else
     534                AC_MSG_WARN([LLVM >= 3.4 is not present, disabling FTL JIT support.])
     535                enable_ftl_jit=no
     536            fi
     537        else
     538            LLVM_CFLAGS=`$llvm_config --cppflags`
     539            LLVM_LIBS="`$llvm_config --ldflags` `$llvm_config --libs`"
     540            AC_SUBST([LLVM_CFLAGS])
     541            AC_SUBST([LLVM_LIBS])
     542        fi
     543    fi
     544fi
     545
    504546m4_ifdef([GTK_DOC_CHECK], [
    505547GTK_DOC_CHECK([1.10])
  • trunk/Source/autotools/PrintBuildConfiguration.m4

    r152455 r154747  
    2323 HTML5 video element support                              : $enable_video
    2424 JIT compilation                                          : $enable_jit
     25 FTL JIT compilation                                      : $enable_ftl_jit
    2526 Opcode stats                                             : $enable_opcode_stats
    2627 SVG fonts support                                        : $enable_svg_fonts
  • trunk/Source/autotools/ReadCommandLineArguments.m4

    r153979 r154747  
    186186AC_MSG_RESULT([$enable_jit])
    187187
     188AC_MSG_CHECKING([whether to enable FTL JIT])
     189AC_ARG_ENABLE(ftl-jit, AS_HELP_STRING([--enable-ftl-jit], [Enable FTL JIT (experimental) (default: no)]), [], [enable_ftl_jit=no])
     190AC_MSG_RESULT([$enable_ftl_jit])
     191
    188192AC_MSG_CHECKING([whether to enable opcode stats])
    189193AC_ARG_ENABLE([opcode-stats],
  • trunk/Source/autotools/SetupAutoconfHeader.m4

    r153703 r154747  
    100100    AC_DEFINE([ENABLE_JIT], [0], [ ])
    101101fi
     102
     103if test "$enable_ftl_jit" = "yes"; then
     104    AC_DEFINE([ENABLE_FTL_JIT], [1], [ ])
     105elif test "$enable_ftl_jit" = "no"; then
     106    AC_DEFINE([ENABLE_FTL_JIT], [0], [ ])
     107fi
     108
     109if test "$have_llvm" = "yes"; then
     110    AC_DEFINE([HAVE_LLVM], [1], [ ])
     111fi
Note: See TracChangeset for help on using the changeset viewer.