Changeset 192469 in webkit


Ignore:
Timestamp:
Nov 16, 2015 5:02:00 AM (8 years ago)
Author:
Carlos Garcia Campos
Message:

[GTK] Use FTL by default when LLVM 3.7 is available
https://bugs.webkit.org/show_bug.cgi?id=142128

Reviewed by Csaba Osztrogonác.

.:

Enable FTL by default when architecture is X86_64. It requires
LLVM 3.7, but can be disabled manually as a cmake configure
argument.

  • Source/cmake/FindLLVM.cmake: In debian llvm-config is only

available if the metapackage is installed and it points to
llvm-config-3.5. So, here we check first if the llvm-config is
from a recent enough version, and if not we check several
llvm-config-<version> programs, so this should work on any distro.

  • Source/cmake/OptionsGTK.cmake: Enable FTL by default when

target architecture is X86_64, and check the LLVM is at least
3.7. The option is now public, since we want people to be able to
disable it manually.

Source/JavaScriptCore:

  • PlatformGTK.cmake: Install libllvmForJSC.so.
  • llvm/InitializeLLVMLinux.cpp:

(JSC::getLLVMInitializerFunction): For developer build try to load first
libllvmForJSC.so from standard paths since not installed binaries
have the RPATH set. If it fails try the installed one. For
production buils load always the installed one.

Tools:

  • Scripts/run-javascriptcore-tests: Enable FTL for GTK+ port when

architecture is x86_64.

  • Scripts/update-webkit-libs-jhbuild:

(cleanJhbuild): Remove also the separate Build directory used by
GTK+ port now.

  • Scripts/webkitdirs.pm:

(isX86_64):

  • Scripts/webkitperl/FeatureList.pm: Enable FTL by default for

GTK+ port when architecture is x86_64.

  • gtk/jhbuild-optional.modules: Remove llvm.
  • gtk/jhbuild.modules: Add llvm 3.7 and include it as dependecy

only when architecture is x86_64.

  • gtk/jhbuildrc: Set a buildroot to use a separate build

directory. LLVM 3.7 fails to build if configure script is run from
source dir. Since it's not possible to use a separate build dir
only for llvm, we do it now globally. Modules not supporting non
source build dirs are marked in the moduleset. Also set x86_64
condition when the architecture is x86_64.

  • gtk/patches/llvm-elf-add-stackmaps-arm64.patch: Removed.
  • gtk/patches/llvm-elf-add-stackmaps.patch: Removed.
  • gtk/patches/llvm-elf-allow-fde-references-outside-the-2gb-range-arm64.patch: Removed.
  • gtk/patches/llvm-elf-allow-fde-references-outside-the-2gb-range.patch: Removed.
  • jhbuild/jhbuild-wrapper: Use a newer jhbuild version to be able

to use conditions.

Location:
trunk
Files:
4 deleted
15 edited

Legend:

Unmodified
Added
Removed
  • trunk/ChangeLog

    r192376 r192469  
     12015-11-16  Carlos Garcia Campos  <cgarcia@igalia.com>
     2
     3        [GTK] Use FTL by default when LLVM 3.7 is available
     4        https://bugs.webkit.org/show_bug.cgi?id=142128
     5
     6        Reviewed by Csaba Osztrogonác.
     7
     8        Enable FTL by default when architecture is X86_64. It requires
     9        LLVM 3.7, but can be disabled manually as a cmake configure
     10        argument.
     11
     12        * Source/cmake/FindLLVM.cmake: In debian llvm-config is only
     13        available if the metapackage is installed and it points to
     14        llvm-config-3.5. So, here we check first if the llvm-config is
     15        from a recent enough version, and if not we check several
     16        llvm-config-<version> programs, so this should work on any distro.
     17        * Source/cmake/OptionsGTK.cmake: Enable FTL by default when
     18        target architecture is X86_64, and check the LLVM is at least
     19        3.7. The option is now public, since we want people to be able to
     20        disable it manually.
     21
    1222015-11-11  Anders Carlsson  <andersca@apple.com>
    223
  • trunk/Source/JavaScriptCore/ChangeLog

    r192465 r192469  
     12015-11-16  Carlos Garcia Campos  <cgarcia@igalia.com>
     2
     3        [GTK] Use FTL by default when LLVM 3.7 is available
     4        https://bugs.webkit.org/show_bug.cgi?id=142128
     5
     6        Reviewed by Csaba Osztrogonác.
     7
     8        * PlatformGTK.cmake: Install libllvmForJSC.so.
     9        * llvm/InitializeLLVMLinux.cpp:
     10        (JSC::getLLVMInitializerFunction): For developer build try to load first
     11        libllvmForJSC.so from standard paths since not installed binaries
     12        have the RPATH set. If it fails try the installed one. For
     13        production buils load always the installed one.
     14
    1152015-11-15  Saam barati  <sbarati@apple.com>
    216
  • trunk/Source/JavaScriptCore/PlatformGTK.cmake

    r188673 r192469  
    3939endif ()
    4040
     41if (ENABLE_FTL_JIT)
     42    install(TARGETS llvmForJSC
     43            DESTINATION "${LIB_INSTALL_DIR}/javascriptcoregtk-${WEBKITGTK_API_VERSION}"
     44    )
     45endif ()
     46
    4147add_definitions(-DSTATICALLY_LINKED_WITH_WTF)
     48add_definitions(-DLIBDIR="${LIB_INSTALL_DIR}")
    4249
    4350list(APPEND JavaScriptCore_LIBRARIES
  • trunk/Source/JavaScriptCore/llvm/InitializeLLVMLinux.cpp

    r182483 r192469  
    3333#include "InitializeLLVMPOSIX.h"
    3434
     35#if PLATFORM(GTK)
     36#include <wtf/glib/GUniquePtr.h>
     37#endif
     38
    3539namespace JSC {
    3640
    3741LLVMInitializerFunction getLLVMInitializerFunction(bool verbose)
    3842{
     43#if PLATFORM(GTK)
     44#if ENABLE(DEVELOPER_MODE)
     45    LLVMInitializerFunction function = getLLVMInitializerFunctionPOSIX("libllvmForJSC.so", verbose);
     46    if (function)
     47        return function;
     48#endif
     49    static const char* libllvmForJSCInstalledPath = LIBDIR G_DIR_SEPARATOR_S "javascriptcoregtk-" WEBKITGTK_API_VERSION_STRING G_DIR_SEPARATOR_S;
     50    GUniquePtr<char> libllvmForJSCFilename(g_build_filename(libllvmForJSCInstalledPath, "libllvmForJSC.so", nullptr));
     51    return getLLVMInitializerFunctionPOSIX(libllvmForJSCFilename.get(), verbose);
     52#else
    3953    return getLLVMInitializerFunctionPOSIX("libllvmForJSC.so", verbose);
     54#endif
    4055}
    4156
  • trunk/Source/cmake/FindLLVM.cmake

    r191889 r192469  
    88#  LLVM_STATIC_LIBRARIES - list of paths for the static llvm libraries.
    99
    10 find_program(LLVM_CONFIG_EXE NAMES "llvm-config")
    1110
    12 execute_process(COMMAND ${LLVM_CONFIG_EXE} --version OUTPUT_VARIABLE LLVM_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE)
     11foreach (_program_name llvm-config llvm-config-3.7 llvm-config-3.6 llvm-config-3.5)
     12    find_program(LLVM_CONFIG_EXE NAMES ${_program_name})
     13    if (LLVM_CONFIG_EXE)
     14        execute_process(COMMAND ${LLVM_CONFIG_EXE} --version OUTPUT_VARIABLE LLVM_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE)
     15        if ("${LLVM_VERSION}" VERSION_LESS "${LLVM_FIND_VERSION}")
     16            unset(LLVM_CONFIG_EXE CACHE)
     17        else ()
     18            break ()
     19        endif ()
     20    endif ()
     21endforeach ()
     22
    1323execute_process(COMMAND ${LLVM_CONFIG_EXE} --includedir OUTPUT_VARIABLE LLVM_INCLUDE_DIRS OUTPUT_STRIP_TRAILING_WHITESPACE)
    1424execute_process(COMMAND ${LLVM_CONFIG_EXE} --libfiles OUTPUT_VARIABLE LLVM_STATIC_LIBRARIES OUTPUT_STRIP_TRAILING_WHITESPACE)
  • trunk/Source/cmake/OptionsGTK.cmake

    r192095 r192469  
    6767endif ()
    6868
     69if (WTF_CPU_X86_64)
     70    set(ENABLE_FTL_DEFAULT ON)
     71else ()
     72    set(ENABLE_FTL_DEFAULT OFF)
     73endif ()
     74
    6975WEBKIT_OPTION_DEFINE(ENABLE_GLES2 "Whether to enable OpenGL ES 2.0." PUBLIC ${ENABLE_GLES2_DEFAULT})
    7076WEBKIT_OPTION_DEFINE(ENABLE_GTKDOC "Whether or not to use generate gtkdoc." PUBLIC OFF)
     
    120126WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_CREDENTIAL_STORAGE PUBLIC ON)
    121127WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_DRAG_SUPPORT PUBLIC ON)
     128WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_FTL_JIT PUBLIC ${ENABLE_FTL_DEFAULT})
    122129WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_GEOLOCATION PUBLIC ON)
    123130WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_ICONDATABASE PUBLIC ON)
     
    249256
    250257if (ENABLE_FTL_JIT)
    251     find_package(LLVM)
    252     if (NOT LLVM_FOUND)
    253         message(FATAL_ERROR "LLVM is needed for ENABLE_FTL_JIT")
    254     endif ()
    255     SET_AND_EXPOSE_TO_BUILD(HAVE_LLVM TRUE)
     258    if (WTF_CPU_X86_64)
     259        find_package(LLVM 3.7)
     260        if (NOT LLVM_FOUND)
     261            message(FATAL_ERROR "LLVM 3.7 is required for ENABLE_FTL_JIT")
     262        endif ()
     263        SET_AND_EXPOSE_TO_BUILD(HAVE_LLVM TRUE)
     264    else ()
     265        message(FATAL_ERROR "FTL is only supported for X86_64")
     266    endif ()
    256267endif ()
    257268
  • trunk/Tools/ChangeLog

    r192463 r192469  
     12015-11-16  Carlos Garcia Campos  <cgarcia@igalia.com>
     2
     3        [GTK] Use FTL by default when LLVM 3.7 is available
     4        https://bugs.webkit.org/show_bug.cgi?id=142128
     5
     6        Reviewed by Csaba Osztrogonác.
     7
     8        * Scripts/run-javascriptcore-tests: Enable FTL for GTK+ port when
     9        architecture is x86_64.
     10        * Scripts/update-webkit-libs-jhbuild:
     11        (cleanJhbuild): Remove also the separate Build directory used by
     12        GTK+ port now.
     13        * Scripts/webkitdirs.pm:
     14        (isX86_64):
     15        * Scripts/webkitperl/FeatureList.pm: Enable FTL by default for
     16        GTK+ port when architecture is x86_64.
     17        * gtk/jhbuild-optional.modules: Remove llvm.
     18        * gtk/jhbuild.modules: Add llvm 3.7 and include it as dependecy
     19        only when architecture is x86_64.
     20        * gtk/jhbuildrc: Set a buildroot to use a separate build
     21        directory. LLVM 3.7 fails to build if configure script is run from
     22        source dir. Since it's not possible to use a separate build dir
     23        only for llvm, we do it now globally. Modules not supporting non
     24        source build dirs are marked in the moduleset. Also set x86_64
     25        condition when the architecture is x86_64.
     26        * gtk/patches/llvm-elf-add-stackmaps-arm64.patch: Removed.
     27        * gtk/patches/llvm-elf-add-stackmaps.patch: Removed.
     28        * gtk/patches/llvm-elf-allow-fde-references-outside-the-2gb-range-arm64.patch: Removed.
     29        * gtk/patches/llvm-elf-allow-fde-references-outside-the-2gb-range.patch: Removed.
     30        * jhbuild/jhbuild-wrapper: Use a newer jhbuild version to be able
     31        to use conditions.
     32
    1332015-11-15  Commit Queue  <commit-queue@webkit.org>
    234
  • trunk/Tools/Scripts/run-javascriptcore-tests

    r192371 r192469  
    6363my $gmallocDefaultPath = "/usr/lib/libgmalloc.dylib";
    6464
    65 my $enableFTL = isAppleMacWebKit();
     65my $enableFTL = isAppleMacWebKit() || (isGtk() && isX86_64());
    6666my $createTarball = 0;
    6767my $remoteHost = 0;
  • trunk/Tools/Scripts/update-webkit-libs-jhbuild

    r191784 r192469  
    123123        die "Cleaning jhbuild sources failed!";
    124124    }
     125
     126    if (isGtk()) {
     127        # GTK+ uses a separate build directory.
     128        system("rm -rf $jhbuildPath/Build");
     129    }
    125130}
    126131
  • trunk/Tools/Scripts/webkitdirs.pm

    r192371 r192469  
    11581158}
    11591159
     1160sub isX86_64()
     1161{
     1162    return (architecture() eq "x86_64") || 0;
     1163}
     1164
    11601165sub isCrossCompilation()
    11611166{
  • trunk/Tools/Scripts/webkitperl/FeatureList.pm

    r192093 r192469  
    459459
    460460    { option => "ftl-jit", desc => "Toggle FTLJIT support",
    461       define => "ENABLE_FTL_JIT", default => 0, value => \$ftlJITSupport },
     461      define => "ENABLE_FTL_JIT", default => (isGtk() && isX86_64()), value => \$ftlJITSupport },
    462462);
    463463
  • trunk/Tools/gtk/jhbuild-optional.modules

    r186655 r192469  
    1010  <repository type="tarball" name="ftp.gnome.org"
    1111      href="http://ftp.gnome.org"/>
    12   <repository type="tarball" name="llvm.org"
    13       href="http://llvm.org"/>
    1412
    1513  <autotools id="libsecret" autogen-sh="configure">
     
    4543  </autotools>
    4644
    47   <autotools id="llvm"
    48              autogenargs="--enable-optimized --disable-terminfo --disable-zlib --enable-targets=host --disable-backtraces --disable-crash-overrides --disable-expensive-checks --disable-debug-runtime --disable-assertions --enable-shared">
    49     <branch repo="llvm.org"
    50             module="/releases/3.5.0/llvm-3.5.0.src.tar.xz" version="3.5.0" checkoutdir="llvm-3.5.0"
    51             hash="sha256:28e199f368ef0a4666708f31c7991ad3bcc3a578342b0306526dd35f07595c03">
    52       <patch file="llvm-elf-allow-fde-references-outside-the-2gb-range.patch" strip="1"/>
    53       <patch file="llvm-elf-allow-fde-references-outside-the-2gb-range-arm64.patch" strip="1"/>
    54       <patch file="llvm-elf-add-stackmaps.patch" strip="1"/>
    55       <patch file="llvm-elf-add-stackmaps-arm64.patch" strip="1"/>
    56     </branch>
    57   </autotools>
    58 
    5945</moduleset>
  • trunk/Tools/gtk/jhbuild.modules

    r191583 r192469  
    3434      <dep package="openwebrtc"/>
    3535      <dep package="libseccomp"/>
     36      <if condition-set="x86_64">
     37        <dep package="llvm"/>
     38      </if>
    3639    </dependencies>
    3740  </metamodule>
     
    6467  <repository type="tarball" name="people.freedesktop.org"
    6568      href="http://people.freedesktop.org"/>
     69  <repository type="tarball" name="llvm.org"
     70      href="http://llvm.org"/>
    6671
    6772  <autotools id="cairo"
     
    8792  </autotools>
    8893
    89   <autotools id="fonts"
     94  <autotools id="fonts" supports-non-srcdir-builds="no"
    9095             skip-autogen="true">
    9196    <branch repo="github.com" module="mrobinson/webkitgtk-test-fonts.git" checkoutdir="webkitgtk-test-fonts" tag="0.0.5"/>
    9297  </autotools>
    9398
    94   <autotools id="dicts"
     99  <autotools id="dicts" supports-non-srcdir-builds="no"
    95100             skip-autogen="true">
    96101    <branch repo="github.com" module="mrobinson/webkitgtk-test-dicts.git" checkoutdir="webkitgtk-test-dicts" tag="0.0.1"/>
     
    123128  </autotools>
    124129
    125   <autotools id="libseccomp" autogen-sh="./autogen.sh; ./configure">
     130  <autotools id="libseccomp" supports-non-srcdir-builds="no" autogen-sh="./autogen.sh; ./configure">
    126131    <branch repo="github.com" module="seccomp/libseccomp.git" tag="v2.2.3"/>
    127132  </autotools>
     
    223228  </autotools>
    224229
    225   <autotools id="gnome-icon-theme-symbolic" autogen-sh="configure">
     230  <autotools id="gnome-icon-theme-symbolic" supports-non-srcdir-builds="no" autogen-sh="configure">
    226231    <dependencies>
    227232      <dep package="gtk+"/>
     
    276281  </autotools>
    277282
    278   <autotools id="libxml2"
     283  <autotools id="libxml2" supports-non-srcdir-builds="no"
    279284             autogen-sh="./autogen.sh; ./configure --with-python=no">
    280285    <branch module="/sources/libxml2-2.9.1.tar.gz" version="2.9.1"
     
    372377  </autotools>
    373378
    374   <autotools id="libusrsctp" autogen-sh="./bootstrap; ./configure --disable-warnings-as-errors">
     379  <autotools id="libusrsctp" supports-non-srcdir-builds="no" autogen-sh="./bootstrap; ./configure --disable-warnings-as-errors">
    375380    <branch repo="github.com" module="sctplab/usrsctp.git" checkoutdir="usrsctp" tag="078ff3252f73327e0ac11d6fd5eff62011f6646e"/>
    376381   </autotools>
    377382
    378    <autotools id="gst-plugins-openwebrtc" supports-parallel-builds="no" autogen-sh="./autogen.sh; ./configure">
     383   <autotools id="gst-plugins-openwebrtc" supports-parallel-builds="no" supports-non-srcdir-builds="no" autogen-sh="./autogen.sh; ./configure">
    379384     <dependencies>
    380385       <dep package="gst-plugins-base"/>
     
    384389   </autotools>
    385390
    386    <autotools id="libnice">
     391   <autotools id="libnice" supports-non-srcdir-builds="no">
    387392    <dependencies>
    388393      <dep package="gstreamer"/>
     
    399404  </autotools>
    400405
     406  <autotools id="llvm"
     407             autogenargs="--enable-optimized --disable-terminfo --disable-zlib --enable-targets=host --disable-backtraces --disable-crash-overrides --disable-expensive-checks --disable-debug-runtime --disable-assertions --enable-shared">
     408    <branch repo="llvm.org"
     409            module="/releases/3.7.0/llvm-3.7.0.src.tar.xz" version="3.7.0" checkoutdir="llvm-3.7.0"
     410            hash="sha256:ab45895f9dcdad1e140a3a79fd709f64b05ad7364e308c0e582c5b02e9cc3153"/>
     411  </autotools>
     412
    401413  <!-- Dependencies listed below this point are not thought to affect test results, and are only
    402414       included because they themselves depend on other dependencies built by jhbuild. -->
  • trunk/Tools/gtk/jhbuildrc

    r172830 r192469  
    1818import sys
    1919import os
     20import platform
    2021
    2122sys.path.insert(0, os.path.join(os.path.dirname(__file__), "../jhbuild") )
     
    3435autogenargs='--enable-introspection'
    3536
     37# LLVM requires that builddir != srcdir, and it's not possible to do that in jhbuild only
     38# for a module, so we do it here globally since it's a good idea for all other modules as well.
     39buildroot = os.path.join(os.path.dirname(checkoutroot), "Build")
     40
    3641if use_lib64:
    3742    os.environ['LLVMPIPE_LIBGL_PATH'] = os.path.abspath(os.path.join(checkoutroot, 'Mesa', 'lib64', 'gallium'))
    3843else:
    3944    os.environ['LLVMPIPE_LIBGL_PATH'] = os.path.abspath(os.path.join(checkoutroot, 'Mesa', 'lib', 'gallium'))
     45
     46if 'x86_64' in platform.machine():
     47    conditions.add('x86_64')
  • trunk/Tools/jhbuild/jhbuild-wrapper

    r190622 r192469  
    2525import sys
    2626
    27 jhbuild_revision = 'c0cb46177d79189ffe0f760703c732f1c7ea8b29'
     27jhbuild_revision = '3.12.0'
    2828
    2929def determine_platform():
Note: See TracChangeset for help on using the changeset viewer.