Fix FTL Native Inlining for EFL
authordbatyai.u-szeged@partner.samsung.com <dbatyai.u-szeged@partner.samsung.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 21 Oct 2014 10:18:13 +0000 (10:18 +0000)
committerdbatyai.u-szeged@partner.samsung.com <dbatyai.u-szeged@partner.samsung.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 21 Oct 2014 10:18:13 +0000 (10:18 +0000)
https://bugs.webkit.org/show_bug.cgi?id=137774

Reviewed by Michael Saboff.

.:

Updated CMake for FTL Native Inlining.

* CMakeLists.txt:
* Source/cmake/FindClang.cmake: Added.
* Source/cmake/OptionsEfl.cmake:
* Source/cmakeconfig.h.cmake:

Source/JavaScriptCore:

Added required functionality for Native Inlining to EFL, and fixed a bug/typo in the original code,
which caused incorrect memory allocation.

* CMakeLists.txt:
* create-llvm-ir-from-source-file.py: Added.
* create-symbol-table-index.py: Added.
* ftl/FTLLowerDFGToLLVM.cpp:
(JSC::FTL::LowerDFGToLLVM::lower):
(JSC::FTL::LowerDFGToLLVM::getModuleByPathForSymbol):
(JSC::FTL::LowerDFGToLLVM::exitValueForAvailability):
(JSC::FTL::LowerDFGToLLVM::exitValueForNode):
* runtime/BundlePath.cpp: Added.
(JSC::bundlePath):
* runtime/JSDataViewPrototype.cpp:
(JSC::getData):
(JSC::setData):
* runtime/MathObject.cpp:

Source/WTF:

Updated guard definition for Native Inlining, and added an attribute define for marking functions
that should not be left out of the symbol table.

* wtf/Platform.h:

Tools:

Added Clang as an optional module to jhbuild.

* efl/jhbuild.modules:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@174940 268f45cc-cd09-0410-ab3c-d52691b4dbfc

17 files changed:
CMakeLists.txt
ChangeLog
Source/JavaScriptCore/CMakeLists.txt
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/create-llvm-ir-from-source-file.py [new file with mode: 0644]
Source/JavaScriptCore/create-symbol-table-index.py [new file with mode: 0755]
Source/JavaScriptCore/ftl/FTLLowerDFGToLLVM.cpp
Source/JavaScriptCore/runtime/BundlePath.cpp [new file with mode: 0644]
Source/JavaScriptCore/runtime/JSDataViewPrototype.cpp
Source/JavaScriptCore/runtime/MathObject.cpp
Source/WTF/ChangeLog
Source/WTF/wtf/Platform.h
Source/cmake/FindClang.cmake [new file with mode: 0644]
Source/cmake/OptionsEfl.cmake
Source/cmakeconfig.h.cmake
Tools/ChangeLog
Tools/efl/jhbuild.modules

index e3926cd..e772e97 100644 (file)
@@ -131,11 +131,7 @@ if (SHARED_CORE)
     set(JavaScriptCore_LIBRARY_TYPE SHARED)
     set(WebCore_LIBRARY_TYPE SHARED)
 else ()
-    if (${PORT} STREQUAL GTK)
-        set(JavaScriptCore_LIBRARY_TYPE SHARED)
-    else ()
-        set(JavaScriptCore_LIBRARY_TYPE STATIC)
-    endif ()
+    set(JavaScriptCore_LIBRARY_TYPE SHARED)
     set(WebCore_LIBRARY_TYPE STATIC)
 endif ()
 
index bc9091d..bd87df1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2014-10-21  Dániel Bátyai  <dbatyai.u-szeged@partner.samsung.com>
+
+        Fix FTL Native Inlining for EFL
+        https://bugs.webkit.org/show_bug.cgi?id=137774
+
+        Reviewed by Michael Saboff.
+
+        Updated CMake for FTL Native Inlining.
+
+        * CMakeLists.txt:
+        * Source/cmake/FindClang.cmake: Added.
+        * Source/cmake/OptionsEfl.cmake:
+        * Source/cmakeconfig.h.cmake:
+
 2014-10-20  Joseph Pecoraro  <pecoraro@apple.com>
 
         Web Inspector: Generate all Inspector domains together in JavaScriptCore
index af5900a..8287e7e 100644 (file)
@@ -383,6 +383,18 @@ set(JavaScriptCore_SOURCES
     profiler/ProfilerOriginStack.cpp
     profiler/ProfilerProfiledBytecodes.cpp
 
+    tools/CodeProfile.cpp
+    tools/CodeProfiling.cpp
+
+    yarr/RegularExpression.cpp
+    yarr/YarrCanonicalizeUCS2.cpp
+    yarr/YarrInterpreter.cpp
+    yarr/YarrJIT.cpp
+    yarr/YarrPattern.cpp
+    yarr/YarrSyntaxChecker.cpp
+)
+
+set(JavaScriptCore_RUNTIME_SOURCES
     runtime/ArgList.cpp
     runtime/Arguments.cpp
     runtime/ArgumentsIteratorConstructor.cpp
@@ -397,6 +409,7 @@ set(JavaScriptCore_SOURCES
     runtime/BooleanConstructor.cpp
     runtime/BooleanObject.cpp
     runtime/BooleanPrototype.cpp
+    runtime/BundlePath.cpp
     runtime/CallData.cpp
     runtime/CodeCache.cpp
     runtime/CodeSpecializationKind.cpp
@@ -410,7 +423,6 @@ set(JavaScriptCore_SOURCES
     runtime/ConstructData.cpp
     runtime/CustomGetterSetter.cpp
     runtime/DataView.cpp
-    runtime/DataView.h
     runtime/DateConstructor.cpp
     runtime/DateConversion.cpp
     runtime/DateInstance.cpp
@@ -549,16 +561,10 @@ set(JavaScriptCore_SOURCES
     runtime/WeakMapConstructor.cpp
     runtime/WeakMapData.cpp
     runtime/WeakMapPrototype.cpp
+)
 
-    tools/CodeProfile.cpp
-    tools/CodeProfiling.cpp
-
-    yarr/RegularExpression.cpp
-    yarr/YarrCanonicalizeUCS2.cpp
-    yarr/YarrInterpreter.cpp
-    yarr/YarrJIT.cpp
-    yarr/YarrPattern.cpp
-    yarr/YarrSyntaxChecker.cpp
+list(APPEND JavaScriptCore_SOURCES
+    ${JavaScriptCore_RUNTIME_SOURCES}
 )
 
 set(JavaScriptCore_LUT_FILES
@@ -755,6 +761,43 @@ if (ENABLE_FTL_JIT)
         COMMAND ${CMAKE_COMMAND} -E touch ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/WebKitLLVMLibraryToken.h
         VERBATIM)
 
+    if (ENABLE_FTL_NATIVE_CALL_INLINING)
+        function(JOIN VALUES GLUE OUTPUT)
+            string(REPLACE ";" "${GLUE}" _TMP_STR "${VALUES}")
+            set(${OUTPUT} "${_TMP_STR}" PARENT_SCOPE)
+        endfunction()
+
+        JOIN("${JavaScriptCore_INCLUDE_DIRECTORIES}" " -I" JSC_INCLUDES)
+
+        set(LLVM_BITCODE_FILES)
+
+        foreach (_file ${JavaScriptCore_RUNTIME_SOURCES})
+            get_filename_component(_name ${_file} NAME_WE)
+            add_custom_command(
+                OUTPUT ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/runtime/${_name}.bc
+                COMMAND ${PYTHON_EXECUTABLE} ${JAVASCRIPTCORE_DIR}/create-llvm-ir-from-source-file.py ${_file} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ${CLANG_EXE} "${JSC_INCLUDES}"
+                WORKING_DIRECTORY "${JAVASCRIPTCORE_DIR}"
+                VERBATIM)
+
+            ADD_SOURCE_DEPENDENCIES(${CMAKE_CURRENT_SOURCE_DIR}/ftl/FTLState.cpp ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/runtime/${_name}.bc)
+            list(APPEND LLVM_BITCODE_FILES
+                ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/runtime/${_name}.bc
+            )
+        endforeach ()
+
+        get_filename_component(LLVM_BINS ${LLVM_CONFIG_EXE} PATH)
+
+        add_custom_command(
+            OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InlineRuntimeSymbolTable.h
+            MAIN_DEPENDENCY ${JAVASCRIPTCORE_DIR}/create-symbol-table-index.py
+            DEPENDS ${LLVM_BITCODE_FILES}
+            COMMAND ${PYTHON_EXECUTABLE} ${JAVASCRIPTCORE_DIR}/create-symbol-table-index.py ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ${JAVASCRIPTCORE_DIR} ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR} ${LLVM_BINS}
+            WORKING_DIRECTORY "${JAVASCRIPTCORE_DIR}"
+            VERBATIM)
+
+        ADD_SOURCE_DEPENDENCIES(${CMAKE_CURRENT_SOURCE_DIR}/ftl/FTLState.cpp ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InlineRuntimeSymbolTable.h)
+    endif ()
+
     WEBKIT_WRAP_SOURCELIST(${llvmForJSC_SOURCES})
     add_library(llvmForJSC SHARED ${llvmForJSC_SOURCES} ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/WebKitLLVMLibraryToken.h)
     target_link_libraries(llvmForJSC ${LLVM_STATIC_LIBRARIES} "pthread" "dl")
index e25a32d..7a5b908 100644 (file)
@@ -1,3 +1,28 @@
+2014-10-21  Dániel Bátyai  <dbatyai.u-szeged@partner.samsung.com>
+
+        Fix FTL Native Inlining for EFL
+        https://bugs.webkit.org/show_bug.cgi?id=137774
+
+        Reviewed by Michael Saboff.
+
+        Added required functionality for Native Inlining to EFL, and fixed a bug/typo in the original code,
+        which caused incorrect memory allocation.
+
+        * CMakeLists.txt:
+        * create-llvm-ir-from-source-file.py: Added.
+        * create-symbol-table-index.py: Added.
+        * ftl/FTLLowerDFGToLLVM.cpp:
+        (JSC::FTL::LowerDFGToLLVM::lower):
+        (JSC::FTL::LowerDFGToLLVM::getModuleByPathForSymbol):
+        (JSC::FTL::LowerDFGToLLVM::exitValueForAvailability):
+        (JSC::FTL::LowerDFGToLLVM::exitValueForNode):
+        * runtime/BundlePath.cpp: Added.
+        (JSC::bundlePath):
+        * runtime/JSDataViewPrototype.cpp:
+        (JSC::getData):
+        (JSC::setData):
+        * runtime/MathObject.cpp:
+
 2014-10-21  Milan Crha  <mcrha@redhat.com>
 
         Move JSC::MacroAssemblerX86Common::s_sse2CheckState definition to MacroAssemblerX86Common.cpp.
diff --git a/Source/JavaScriptCore/create-llvm-ir-from-source-file.py b/Source/JavaScriptCore/create-llvm-ir-from-source-file.py
new file mode 100644 (file)
index 0000000..ec29195
--- /dev/null
@@ -0,0 +1,15 @@
+import os
+import subprocess
+import sys
+
+JSC_SOURCE = sys.argv[1]
+RUNTIME_INSTALL_DIR = sys.argv[2]
+CLANG_EXE = sys.argv[3]
+INCLUDE_DIRS = "-I%s" % sys.argv[4]
+
+try:
+    os.mkdir(os.path.join(RUNTIME_INSTALL_DIR, "runtime"))
+except OSError:
+    pass
+
+subprocess.call([CLANG_EXE, "-emit-llvm", "-O3", "-std=c++11", "-fno-exceptions", "-fno-strict-aliasing", "-fno-rtti", "-ffunction-sections", "-fdata-sections", "-fno-rtti", "-fno-omit-frame-pointer", "-fPIC", "-DWTF_PLATFORM_EFL=1", "-o", os.path.join(RUNTIME_INSTALL_DIR, os.path.splitext(JSC_SOURCE)[0] + ".bc"), "-c", JSC_SOURCE] + INCLUDE_DIRS.split())
diff --git a/Source/JavaScriptCore/create-symbol-table-index.py b/Source/JavaScriptCore/create-symbol-table-index.py
new file mode 100755 (executable)
index 0000000..ff09a40
--- /dev/null
@@ -0,0 +1,81 @@
+#!/usr/bin/python
+
+import glob
+import os
+import subprocess
+import sys
+import shutil
+import re
+from sets import Set
+from operator import itemgetter
+
+print("Building Index Table")
+
+RUNTIME_INSTALL_DIR = sys.argv[1]
+JSC_DIR = sys.argv[2]
+DERIVED_SOURCES_DIR = sys.argv[3]
+LLVM_BINS = sys.argv[4]
+
+try:
+    os.mkdir(os.path.join(RUNTIME_INSTALL_DIR, "runtime"))
+except OSError:
+    pass
+
+symbol_table_location = os.path.join(RUNTIME_INSTALL_DIR, "runtime", "Runtime.symtbl")
+
+symbol_table = {}
+
+symbol_table_is_out_of_date = False
+
+symbol_table_modification_time = 0
+
+if os.path.isfile(symbol_table_location):
+    symbol_table_modification_time = os.path.getmtime(symbol_table_location)
+
+file_suffix = "bc"
+file_suffix_length = len(file_suffix)
+
+tested_symbols_location = os.path.join(JSC_DIR, "tested-symbols.symlst")
+include_symbol_table_location = os.path.join(DERIVED_SOURCES_DIR, "InlineRuntimeSymbolTable.h")
+
+tested_symbols = Set([])
+
+if os.path.isfile(tested_symbols_location):
+    with open(tested_symbols_location, 'r') as file:
+        print("Loading tested symbols")
+        for line in file:
+            tested_symbols.add(line[:-1])
+
+for bitcode_file in glob.iglob(os.path.join(RUNTIME_INSTALL_DIR, "runtime", "*." + file_suffix)):
+    bitcode_basename = os.path.basename(bitcode_file)
+
+    print("Appending symbols from " + bitcode_basename)
+    lines = subprocess.check_output([os.path.join(LLVM_BINS, "llvm-nm"), "--defined-only", bitcode_file]).splitlines()
+
+    for line in lines:
+        symbol = line.split()[1]
+        if (symbol[:1] == "_" and symbol[-3:] != ".eh" and (("_" + symbol in tested_symbols) or ("_" + symbol[:7] + "L" + symbol[7:] in tested_symbols))):
+            symbol_table[symbol] = bitcode_basename
+
+if os.path.isfile(symbol_table_location):
+    with open(symbol_table_location, 'r') as file:
+        print("Loading symbol table")
+        for line in file:
+            symbol, _, location = line[:-1].partition(" ")
+            # don't overwrite new symbols with old locations
+            if not symbol in symbol_table:
+                symbol_table[symbol] = location
+
+symbol_list = symbol_table.items()
+
+print("Writing symbol table: " + symbol_table_location)
+print("Writing inline file: " + include_symbol_table_location)
+
+with open(symbol_table_location, "w") as symbol_file:
+    with open(include_symbol_table_location, "w") as include_file:
+        include_file.write("#define FOR_EACH_LIBRARY_SYMBOL(macro)")
+        for symbol, location in symbol_list:
+            symbol_file.write("{} {}\n".format(symbol, location))
+            include_file.write(" \\\nmacro(\"{}\", \"{}\")".format(symbol, location))
+        include_file.write("\n")
+print("Done")
index 663b337..b3b5a63 100644 (file)
@@ -155,7 +155,7 @@ public:
                 switch (node->op()) {
                 case NativeCall:
                 case NativeConstruct: {
-                    int numArgs = m_node->numChildren();
+                    int numArgs = node->numChildren();
                     if (numArgs > maxNumberOfArguments)
                         maxNumberOfArguments = numArgs;
                     break;
@@ -4468,9 +4468,13 @@ private:
         
         ASSERT(isX86() || isARM64());
 
+#if PLATFORM(EFL)
+        const CString actualPath = toCString(bundlePath().data(), "/runtime/", path.data());
+#else
         const CString actualPath = toCString(bundlePath().data(), 
             isX86() ? "/Resources/Runtime/x86_64/" : "/Resources/Runtime/arm64/",
             path.data());
+#endif
 
         char* outMsg;
         
@@ -4492,7 +4496,7 @@ private:
         }
 
         disposeMemoryBuffer(memBuf);
-        
+
         if (LValue function = getNamedFunction(m_ftlState.module, symbol.data())) {
             if (!isInlinableSize(function)) {
                 m_ftlState.symbolTable.remove(symbol);
@@ -6626,6 +6630,7 @@ private:
         }
         
         DFG_CRASH(m_graph, m_node, "Invalid flush format");
+        return ExitValue::dead();
     }
     
     ExitValue exitValueForNode(
@@ -6698,6 +6703,7 @@ private:
             return exitArgument(arguments, ValueFormatDouble, value.value());
 
         DFG_CRASH(m_graph, m_node, toCString("Cannot find value for node: ", node).data());
+        return ExitValue::dead();
     }
     
     ExitValue exitArgument(ExitArgumentList& arguments, ValueFormat format, LValue value)
diff --git a/Source/JavaScriptCore/runtime/BundlePath.cpp b/Source/JavaScriptCore/runtime/BundlePath.cpp
new file mode 100644 (file)
index 0000000..8101a50
--- /dev/null
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2014 Samsung Electronics
+ * Copyright (C) 2014 University of Szeged
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "BundlePath.h"
+
+#include <execinfo.h>
+#include <string>
+
+
+namespace JSC {
+
+const CString* constantBundlePath = nullptr;
+
+const CString& bundlePath()
+{
+    if (!constantBundlePath) {
+        std::string programPath(realpath(program_invocation_name, 0));
+        constantBundlePath = new CString(programPath.substr(0, programPath.find_last_of("\\/")).c_str());
+    }
+
+    return *constantBundlePath;
+}
+
+} // namespace JSC
index dd5b44e..4318153 100644 (file)
@@ -115,7 +115,7 @@ bool JSDataViewPrototype::getOwnPropertySlot(
 }
 
 template<typename Adaptor>
-EncodedJSValue getData(ExecState* exec)
+EncodedJSValue ATTR_USED getData(ExecState* exec)
 {
     JSDataView* dataView = jsDynamicCast<JSDataView*>(exec->thisValue());
     if (!dataView)
@@ -160,7 +160,7 @@ EncodedJSValue getData(ExecState* exec)
 }
 
 template<typename Adaptor>
-EncodedJSValue setData(ExecState* exec)
+EncodedJSValue ATTR_USED setData(ExecState* exec)
 {
     JSDataView* dataView = jsDynamicCast<JSDataView*>(exec->thisValue());
     if (!dataView)
index 3773225..64a5a7a 100644 (file)
@@ -35,40 +35,40 @@ namespace JSC {
 
 STATIC_ASSERT_IS_TRIVIALLY_DESTRUCTIBLE(MathObject);
 
-static EncodedJSValue JSC_HOST_CALL mathProtoFuncAbs(ExecState*);
-static EncodedJSValue JSC_HOST_CALL mathProtoFuncACos(ExecState*);
-static EncodedJSValue JSC_HOST_CALL mathProtoFuncACosh(ExecState*);
-static EncodedJSValue JSC_HOST_CALL mathProtoFuncASin(ExecState*);
-static EncodedJSValue JSC_HOST_CALL mathProtoFuncASinh(ExecState*);
-static EncodedJSValue JSC_HOST_CALL mathProtoFuncATan(ExecState*);
-static EncodedJSValue JSC_HOST_CALL mathProtoFuncATanh(ExecState*);
-static EncodedJSValue JSC_HOST_CALL mathProtoFuncATan2(ExecState*);
-static EncodedJSValue JSC_HOST_CALL mathProtoFuncCbrt(ExecState*);
-static EncodedJSValue JSC_HOST_CALL mathProtoFuncCeil(ExecState*);
-static EncodedJSValue JSC_HOST_CALL mathProtoFuncCos(ExecState*);
-static EncodedJSValue JSC_HOST_CALL mathProtoFuncCosh(ExecState*);
-static EncodedJSValue JSC_HOST_CALL mathProtoFuncExp(ExecState*);
-static EncodedJSValue JSC_HOST_CALL mathProtoFuncExpm1(ExecState*);
-static EncodedJSValue JSC_HOST_CALL mathProtoFuncFloor(ExecState*);
-static EncodedJSValue JSC_HOST_CALL mathProtoFuncFround(ExecState*);
-static EncodedJSValue JSC_HOST_CALL mathProtoFuncHypot(ExecState*);
-static EncodedJSValue JSC_HOST_CALL mathProtoFuncLog(ExecState*);
-static EncodedJSValue JSC_HOST_CALL mathProtoFuncLog1p(ExecState*);
-static EncodedJSValue JSC_HOST_CALL mathProtoFuncLog10(ExecState*);
-static EncodedJSValue JSC_HOST_CALL mathProtoFuncLog2(ExecState*);
-static EncodedJSValue JSC_HOST_CALL mathProtoFuncMax(ExecState*);
-static EncodedJSValue JSC_HOST_CALL mathProtoFuncMin(ExecState*);
-static EncodedJSValue JSC_HOST_CALL mathProtoFuncPow(ExecState*);
-static EncodedJSValue JSC_HOST_CALL mathProtoFuncRandom(ExecState*);
-static EncodedJSValue JSC_HOST_CALL mathProtoFuncRound(ExecState*);
-static EncodedJSValue JSC_HOST_CALL mathProtoFuncSign(ExecState*);
-static EncodedJSValue JSC_HOST_CALL mathProtoFuncSin(ExecState*);
-static EncodedJSValue JSC_HOST_CALL mathProtoFuncSinh(ExecState*);
-static EncodedJSValue JSC_HOST_CALL mathProtoFuncSqrt(ExecState*);
-static EncodedJSValue JSC_HOST_CALL mathProtoFuncTan(ExecState*);
-static EncodedJSValue JSC_HOST_CALL mathProtoFuncTanh(ExecState*);
-static EncodedJSValue JSC_HOST_CALL mathProtoFuncTrunc(ExecState*);
-static EncodedJSValue JSC_HOST_CALL mathProtoFuncIMul(ExecState*);
+EncodedJSValue JSC_HOST_CALL mathProtoFuncAbs(ExecState*);
+EncodedJSValue JSC_HOST_CALL mathProtoFuncACos(ExecState*);
+EncodedJSValue JSC_HOST_CALL mathProtoFuncACosh(ExecState*);
+EncodedJSValue JSC_HOST_CALL mathProtoFuncASin(ExecState*);
+EncodedJSValue JSC_HOST_CALL mathProtoFuncASinh(ExecState*);
+EncodedJSValue JSC_HOST_CALL mathProtoFuncATan(ExecState*);
+EncodedJSValue JSC_HOST_CALL mathProtoFuncATanh(ExecState*);
+EncodedJSValue JSC_HOST_CALL mathProtoFuncATan2(ExecState*);
+EncodedJSValue JSC_HOST_CALL mathProtoFuncCbrt(ExecState*);
+EncodedJSValue JSC_HOST_CALL mathProtoFuncCeil(ExecState*);
+EncodedJSValue JSC_HOST_CALL mathProtoFuncCos(ExecState*);
+EncodedJSValue JSC_HOST_CALL mathProtoFuncCosh(ExecState*);
+EncodedJSValue JSC_HOST_CALL mathProtoFuncExp(ExecState*);
+EncodedJSValue JSC_HOST_CALL mathProtoFuncExpm1(ExecState*);
+EncodedJSValue JSC_HOST_CALL mathProtoFuncFloor(ExecState*);
+EncodedJSValue JSC_HOST_CALL mathProtoFuncFround(ExecState*);
+EncodedJSValue JSC_HOST_CALL mathProtoFuncHypot(ExecState*);
+EncodedJSValue JSC_HOST_CALL mathProtoFuncLog(ExecState*);
+EncodedJSValue JSC_HOST_CALL mathProtoFuncLog1p(ExecState*);
+EncodedJSValue JSC_HOST_CALL mathProtoFuncLog10(ExecState*);
+EncodedJSValue JSC_HOST_CALL mathProtoFuncLog2(ExecState*);
+EncodedJSValue JSC_HOST_CALL mathProtoFuncMax(ExecState*);
+EncodedJSValue JSC_HOST_CALL mathProtoFuncMin(ExecState*);
+EncodedJSValue JSC_HOST_CALL mathProtoFuncPow(ExecState*);
+EncodedJSValue JSC_HOST_CALL mathProtoFuncRandom(ExecState*);
+EncodedJSValue JSC_HOST_CALL mathProtoFuncRound(ExecState*);
+EncodedJSValue JSC_HOST_CALL mathProtoFuncSign(ExecState*);
+EncodedJSValue JSC_HOST_CALL mathProtoFuncSin(ExecState*);
+EncodedJSValue JSC_HOST_CALL mathProtoFuncSinh(ExecState*);
+EncodedJSValue JSC_HOST_CALL mathProtoFuncSqrt(ExecState*);
+EncodedJSValue JSC_HOST_CALL mathProtoFuncTan(ExecState*);
+EncodedJSValue JSC_HOST_CALL mathProtoFuncTanh(ExecState*);
+EncodedJSValue JSC_HOST_CALL mathProtoFuncTrunc(ExecState*);
+EncodedJSValue JSC_HOST_CALL mathProtoFuncIMul(ExecState*);
 
 }
 
index 70f7be8..9a9293c 100644 (file)
@@ -1,3 +1,15 @@
+2014-10-21  Dániel Bátyai  <dbatyai.u-szeged@partner.samsung.com>
+
+        Fix FTL Native Inlining for EFL
+        https://bugs.webkit.org/show_bug.cgi?id=137774
+
+        Reviewed by Michael Saboff.
+
+        Updated guard definition for Native Inlining, and added an attribute define for marking functions
+        that should not be left out of the symbol table.
+
+        * wtf/Platform.h:
+
 2014-10-20  Chris Dumez  <cdumez@apple.com>
 
         Use is<>() / downcast<>() for Accessibility objects
index 7712ddb..9068547 100644 (file)
 #define ENABLE_FTL_JIT 0
 #endif
 
+#if !defined(ENABLE_FTL_NATIVE_CALL_INLINING)
 #define ENABLE_FTL_NATIVE_CALL_INLINING 0
+#endif
 
-#if !defined(ENABLE_FTL_NATIVE_CALL_INLINING)
-#if COMPILER(CLANG)
-#define ENABLE_FTL_NATIVE_CALL_INLINING 1
+/* Used to make GCC's optimization not throw away a symbol that we would need for native inlining */
+#if COMPILER(GCC)
+#define ATTR_USED __attribute__ ((used))
 #else
-#define ENABLE_FTL_NATIVE_CALL_INLINING 0
-#endif // COMPILER(CLANG)
-#endif // !defined(ENABLE_FTL_NATIVE_CALL_INLINING)
+#define ATTR_USED
+#endif
 
 /* Generational collector for JSC */
 #if !defined(ENABLE_GGC)
diff --git a/Source/cmake/FindClang.cmake b/Source/cmake/FindClang.cmake
new file mode 100644 (file)
index 0000000..1fc86bb
--- /dev/null
@@ -0,0 +1,16 @@
+#
+# Check for Clang.
+#
+# The following variables are set:
+#  CLANG_EXE
+#  CLANG_VERSION
+
+find_program(CLANG_EXE NAMES "clang")
+
+execute_process(COMMAND ${CLANG_EXE} --version OUTPUT_VARIABLE CLANG_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE)
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(CLANG DEFAULT_MSG
+                                  CLANG_VERSION)
+
+mark_as_advanced(CLANG_VERSION)
index 02aeff9..645b68c 100644 (file)
@@ -306,6 +306,10 @@ endif ()
 if (ENABLE_FTL_JIT)
     find_package(LLVM REQUIRED)
     set(HAVE_LLVM ON)
+    if (ENABLE_FTL_NATIVE_CALL_INLINING)
+        find_package(Clang REQUIRED)
+        add_definitions(-DENABLE_FTL_NATIVE_CALL_INLINING=1)
+    endif ()
 endif ()
 
 # [E]WebKit2 tests need a hint to find out where processes such as WebProcess are located at.
index ca99dec..b240fd9 100644 (file)
@@ -45,6 +45,7 @@
 #cmakedefine01 ENABLE_FIXED_REPORTED_SIZE
 #cmakedefine01 ENABLE_FTPDIR
 #cmakedefine01 ENABLE_FTL_JIT
+#cmakedefine01 ENABLE_FTL_NATIVE_CALL_INLINING
 #cmakedefine01 ENABLE_FONT_LOAD_EVENTS
 #cmakedefine01 ENABLE_FULLSCREEN_API
 #cmakedefine01 ENABLE_GAMEPAD
index 9011aba..c4bfb4f 100644 (file)
@@ -1,3 +1,14 @@
+2014-10-21  Dániel Bátyai  <dbatyai.u-szeged@partner.samsung.com>
+
+        Fix FTL Native Inlining for EFL
+        https://bugs.webkit.org/show_bug.cgi?id=137774
+
+        Reviewed by Michael Saboff.
+
+        Added Clang as an optional module to jhbuild.
+
+        * efl/jhbuild.modules:
+
 2014-10-20  Michael Catanzaro  <mcatanzaro@igalia.com>
 
         Change the default TLS errors policy to WEBKIT_TLS_ERRORS_POLICY_FAIL
index a3065d2..e323414 100644 (file)
@@ -48,7 +48,9 @@
       href="http://gstreamer.freedesktop.org/src/"/>
   <repository type="tarball" name="downloads.sourceforge.net"
       href="http://downloads.sourceforge.net/project/"/>
-  <repository type="git" name="llvm.org"
+  <repository type="svn" name="llvm.org"
+      href="http://llvm.org/svn/llvm-project/"/>
+  <repository type="git" name="llvm-git"
       href="https://github.com/pille5"/>
 
   <autotools id="cairo" autogen-sh="configure"
   <autotools id="llvm"
              autogen-sh="configure"
              autogenargs="--enable-optimized=yes --enable-backtraces=no --enable-targets=x86_64 --enable-zlib=no --enable-terminfo=no --enable-crash-overrides=no --disable-expensive-checks --disable-debug-runtime --disable-assertions">
-    <branch repo="llvm.org" module="llvm.git" revision="FTL_fixes_for_EFL" checkoutdir="llvm" version="r206311"/>
+    <branch repo="llvm-git" module="llvm.git" revision="FTL_fixes_for_EFL" checkoutdir="llvm" version="r206311"/>
+  </autotools>
+
+  <autotools id="clang"
+             skip-autogen="true">
+    <dependencies>
+      <dep package="llvm"/>
+    </dependencies>
+    <branch repo="llvm.org" module="cfe/trunk" version="r206311" revision="206311" checkoutdir="llvm/tools/clang">
+    </branch>
   </autotools>
 
   <autotools id="fontconfig"