Title: [187555] trunk
Revision
187555
Author
[email protected]
Date
2015-07-29 13:30:08 -0700 (Wed, 29 Jul 2015)

Log Message

Remove native call inlining
https://bugs.webkit.org/show_bug.cgi?id=147417

.:

Rubber-stamped by Filip Pizlo.

* Source/cmake/OptionsEfl.cmake:
* Source/cmake/WebKitFeatures.cmake:

Source/_javascript_Core:

Rubber Stamped by Filip Pizlo.


* CMakeLists.txt:
* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects): Deleted.
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::handleCall): Deleted.
* dfg/DFGClobberize.h:
(JSC::DFG::clobberize): Deleted.
* dfg/DFGDoesGC.cpp:
(JSC::DFG::doesGC): Deleted.
* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode): Deleted.
* dfg/DFGNode.h:
(JSC::DFG::Node::hasHeapPrediction): Deleted.
(JSC::DFG::Node::hasCellOperand): Deleted.
* dfg/DFGNodeType.h:
* dfg/DFGPredictionPropagationPhase.cpp:
(JSC::DFG::PredictionPropagationPhase::propagate): Deleted.
* dfg/DFGSafeToExecute.h:
(JSC::DFG::safeToExecute): Deleted.
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile): Deleted.
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile): Deleted.
* ftl/FTLCapabilities.cpp:
(JSC::FTL::canCompile): Deleted.
* ftl/FTLLowerDFGToLLVM.cpp:
(JSC::FTL::DFG::LowerDFGToLLVM::lower): Deleted.
(JSC::FTL::DFG::LowerDFGToLLVM::compileNode): Deleted.
(JSC::FTL::DFG::LowerDFGToLLVM::compileNativeCallOrConstruct): Deleted.
(JSC::FTL::DFG::LowerDFGToLLVM::getFunctionBySymbol): Deleted.
(JSC::FTL::DFG::LowerDFGToLLVM::getModuleByPathForSymbol): Deleted.
(JSC::FTL::DFG::LowerDFGToLLVM::didOverflowStack): Deleted.
* ftl/FTLState.cpp:
(JSC::FTL::State::State): Deleted.
* ftl/FTLState.h:
* runtime/BundlePath.cpp: Removed.
(JSC::bundlePath): Deleted.
* runtime/JSDataViewPrototype.cpp:
(JSC::getData):
(JSC::setData):
* runtime/Options.h:

Source/WTF:

Rubber-stamped by Filip Pizlo.

* wtf/Platform.h:

Modified Paths

Removed Paths

Diff

Modified: trunk/ChangeLog (187554 => 187555)


--- trunk/ChangeLog	2015-07-29 20:10:54 UTC (rev 187554)
+++ trunk/ChangeLog	2015-07-29 20:30:08 UTC (rev 187555)
@@ -1,3 +1,13 @@
+2015-07-29  Basile Clement  <[email protected]>
+
+        Remove native call inlining
+        https://bugs.webkit.org/show_bug.cgi?id=147417
+
+        Rubber-stamped by Filip Pizlo.
+
+        * Source/cmake/OptionsEfl.cmake:
+        * Source/cmake/WebKitFeatures.cmake:
+
 2015-07-28  Yusuke Suzuki  <[email protected]>
 
         [ES6] Add ENABLE_ES6_MODULES compile time flag with the default value "false"

Modified: trunk/Source/_javascript_Core/CMakeLists.txt (187554 => 187555)


--- trunk/Source/_javascript_Core/CMakeLists.txt	2015-07-29 20:10:54 UTC (rev 187554)
+++ trunk/Source/_javascript_Core/CMakeLists.txt	2015-07-29 20:30:08 UTC (rev 187555)
@@ -434,7 +434,6 @@
     runtime/BooleanConstructor.cpp
     runtime/BooleanObject.cpp
     runtime/BooleanPrototype.cpp
-    runtime/BundlePath.cpp
     runtime/CallData.cpp
     runtime/ClonedArguments.cpp
     runtime/CodeCache.cpp
@@ -809,43 +808,6 @@
         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("${_javascript_Core_INCLUDE_DIRECTORIES}" " -I" JSC_INCLUDES)
-
-        set(LLVM_BITCODE_FILES)
-
-        foreach (_file ${_javascript_Core_RUNTIME_SOURCES})
-            get_filename_component(_name ${_file} NAME_WE)
-            add_custom_command(
-                OUTPUT ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/runtime/${_name}.bc
-                COMMAND ${PYTHON_EXECUTABLE} ${_javascript_CORE_DIR}/create-llvm-ir-from-source-file.py ${_file} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ${CLANG_EXE} "${JSC_INCLUDES}"
-                WORKING_DIRECTORY "${_javascript_CORE_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 ${_javascript_CORE_DIR}/create-symbol-table-index.py
-            DEPENDS ${LLVM_BITCODE_FILES}
-            COMMAND ${PYTHON_EXECUTABLE} ${_javascript_CORE_DIR}/create-symbol-table-index.py ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ${_javascript_CORE_DIR} ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR} ${LLVM_BINS}
-            WORKING_DIRECTORY "${_javascript_CORE_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" -Wl,--version-script=${_javascript_CORE_DIR}/llvm/library/libllvmForJSC.version)

Modified: trunk/Source/_javascript_Core/ChangeLog (187554 => 187555)


--- trunk/Source/_javascript_Core/ChangeLog	2015-07-29 20:10:54 UTC (rev 187554)
+++ trunk/Source/_javascript_Core/ChangeLog	2015-07-29 20:30:08 UTC (rev 187555)
@@ -1,5 +1,54 @@
 2015-07-29  Basile Clement  <[email protected]>
 
+        Remove native call inlining
+        https://bugs.webkit.org/show_bug.cgi?id=147417
+
+        Rubber Stamped by Filip Pizlo.
+
+        * CMakeLists.txt:
+        * dfg/DFGAbstractInterpreterInlines.h:
+        (JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects): Deleted.
+        * dfg/DFGByteCodeParser.cpp:
+        (JSC::DFG::ByteCodeParser::handleCall): Deleted.
+        * dfg/DFGClobberize.h:
+        (JSC::DFG::clobberize): Deleted.
+        * dfg/DFGDoesGC.cpp:
+        (JSC::DFG::doesGC): Deleted.
+        * dfg/DFGFixupPhase.cpp:
+        (JSC::DFG::FixupPhase::fixupNode): Deleted.
+        * dfg/DFGNode.h:
+        (JSC::DFG::Node::hasHeapPrediction): Deleted.
+        (JSC::DFG::Node::hasCellOperand): Deleted.
+        * dfg/DFGNodeType.h:
+        * dfg/DFGPredictionPropagationPhase.cpp:
+        (JSC::DFG::PredictionPropagationPhase::propagate): Deleted.
+        * dfg/DFGSafeToExecute.h:
+        (JSC::DFG::safeToExecute): Deleted.
+        * dfg/DFGSpeculativeJIT32_64.cpp:
+        (JSC::DFG::SpeculativeJIT::compile): Deleted.
+        * dfg/DFGSpeculativeJIT64.cpp:
+        (JSC::DFG::SpeculativeJIT::compile): Deleted.
+        * ftl/FTLCapabilities.cpp:
+        (JSC::FTL::canCompile): Deleted.
+        * ftl/FTLLowerDFGToLLVM.cpp:
+        (JSC::FTL::DFG::LowerDFGToLLVM::lower): Deleted.
+        (JSC::FTL::DFG::LowerDFGToLLVM::compileNode): Deleted.
+        (JSC::FTL::DFG::LowerDFGToLLVM::compileNativeCallOrConstruct): Deleted.
+        (JSC::FTL::DFG::LowerDFGToLLVM::getFunctionBySymbol): Deleted.
+        (JSC::FTL::DFG::LowerDFGToLLVM::getModuleByPathForSymbol): Deleted.
+        (JSC::FTL::DFG::LowerDFGToLLVM::didOverflowStack): Deleted.
+        * ftl/FTLState.cpp:
+        (JSC::FTL::State::State): Deleted.
+        * ftl/FTLState.h:
+        * runtime/BundlePath.cpp: Removed.
+        (JSC::bundlePath): Deleted.
+        * runtime/JSDataViewPrototype.cpp:
+        (JSC::getData):
+        (JSC::setData):
+        * runtime/Options.h:
+
+2015-07-29  Basile Clement  <[email protected]>
+
         Unreviewed, skipping a test that is too complex for its own good
         https://bugs.webkit.org/show_bug.cgi?id=147167
 

Modified: trunk/Source/_javascript_Core/dfg/DFGAbstractInterpreterInlines.h (187554 => 187555)


--- trunk/Source/_javascript_Core/dfg/DFGAbstractInterpreterInlines.h	2015-07-29 20:10:54 UTC (rev 187554)
+++ trunk/Source/_javascript_Core/dfg/DFGAbstractInterpreterInlines.h	2015-07-29 20:30:08 UTC (rev 187555)
@@ -2319,8 +2319,6 @@
             
     case Call:
     case Construct:
-    case NativeCall:
-    case NativeConstruct:
     case CallVarargs:
     case CallForwardVarargs:
     case ConstructVarargs:

Modified: trunk/Source/_javascript_Core/dfg/DFGByteCodeParser.cpp (187554 => 187555)


--- trunk/Source/_javascript_Core/dfg/DFGByteCodeParser.cpp	2015-07-29 20:10:54 UTC (rev 187554)
+++ trunk/Source/_javascript_Core/dfg/DFGByteCodeParser.cpp	2015-07-29 20:30:08 UTC (rev 187555)
@@ -1066,25 +1066,6 @@
         return;
     }
     
-#if ENABLE(FTL_NATIVE_CALL_INLINING)
-    if (isFTL(m_graph.m_plan.mode) && Options::optimizeNativeCalls() && callLinkStatus.size() == 1 && !callLinkStatus.couldTakeSlowPath()) {
-        CallVariant callee = callLinkStatus[0];
-        JSFunction* function = callee.function();
-        CodeSpecializationKind specializationKind = InlineCallFrame::specializationKindFor(kind);
-        if (function && function->isHostFunction()) {
-            emitFunctionChecks(callee, callTarget, virtualRegisterForArgument(0, registerOffset));
-            callOpInfo = OpInfo(m_graph.freeze(function));
-
-            if (op == Call)
-                op = NativeCall;
-            else {
-                ASSERT(op == Construct);
-                op = NativeConstruct;
-            }
-        }
-    }
-#endif
-    
     addCall(result, op, callOpInfo, callTarget, argumentCountIncludingThis, registerOffset, prediction);
 }
 

Modified: trunk/Source/_javascript_Core/dfg/DFGClobberize.h (187554 => 187555)


--- trunk/Source/_javascript_Core/dfg/DFGClobberize.h	2015-07-29 20:10:54 UTC (rev 187554)
+++ trunk/Source/_javascript_Core/dfg/DFGClobberize.h	2015-07-29 20:30:08 UTC (rev 187555)
@@ -377,8 +377,6 @@
     case ArrayPop:
     case Call:
     case Construct:
-    case NativeCall:
-    case NativeConstruct:
     case CallVarargs:
     case CallForwardVarargs:
     case ConstructVarargs:

Modified: trunk/Source/_javascript_Core/dfg/DFGDoesGC.cpp (187554 => 187555)


--- trunk/Source/_javascript_Core/dfg/DFGDoesGC.cpp	2015-07-29 20:10:54 UTC (rev 187554)
+++ trunk/Source/_javascript_Core/dfg/DFGDoesGC.cpp	2015-07-29 20:30:08 UTC (rev 187555)
@@ -123,8 +123,6 @@
     case LoadVarargs:
     case CallForwardVarargs:
     case ConstructForwardVarargs:
-    case NativeCall:
-    case NativeConstruct:
     case Breakpoint:
     case ProfileWillCall:
     case ProfileDidCall:

Modified: trunk/Source/_javascript_Core/dfg/DFGFixupPhase.cpp (187554 => 187555)


--- trunk/Source/_javascript_Core/dfg/DFGFixupPhase.cpp	2015-07-29 20:10:54 UTC (rev 187554)
+++ trunk/Source/_javascript_Core/dfg/DFGFixupPhase.cpp	2015-07-29 20:30:08 UTC (rev 187555)
@@ -1285,8 +1285,6 @@
         case ConstructForwardVarargs:
         case LoadVarargs:
         case ProfileControlFlow:
-        case NativeCall:
-        case NativeConstruct:
         case NewObject:
         case NewArrayBuffer:
         case NewRegexp:

Modified: trunk/Source/_javascript_Core/dfg/DFGNode.h (187554 => 187555)


--- trunk/Source/_javascript_Core/dfg/DFGNode.h	2015-07-29 20:10:54 UTC (rev 187554)
+++ trunk/Source/_javascript_Core/dfg/DFGNode.h	2015-07-29 20:30:08 UTC (rev 187555)
@@ -1252,8 +1252,6 @@
         case CallVarargs:
         case ConstructVarargs:
         case CallForwardVarargs:
-        case NativeCall:
-        case NativeConstruct:
         case GetByOffset:
         case MultiGetByOffset:
         case GetClosureVar:
@@ -1285,8 +1283,6 @@
     {
         switch (op()) {
         case CheckCell:
-        case NativeConstruct:
-        case NativeCall:
         case NewFunction:
         case CreateActivation:
         case MaterializeCreateActivation:

Modified: trunk/Source/_javascript_Core/dfg/DFGNodeType.h (187554 => 187555)


--- trunk/Source/_javascript_Core/dfg/DFGNodeType.h	2015-07-29 20:10:54 UTC (rev 187554)
+++ trunk/Source/_javascript_Core/dfg/DFGNodeType.h	2015-07-29 20:30:08 UTC (rev 187555)
@@ -239,8 +239,6 @@
     macro(CallForwardVarargs, NodeResultJS | NodeMustGenerate) \
     macro(ConstructVarargs, NodeResultJS | NodeMustGenerate) \
     macro(ConstructForwardVarargs, NodeResultJS | NodeMustGenerate) \
-    macro(NativeCall, NodeResultJS | NodeMustGenerate | NodeHasVarArgs) \
-    macro(NativeConstruct, NodeResultJS | NodeMustGenerate | NodeHasVarArgs) \
     \
     /* Allocations. */\
     macro(NewObject, NodeResultJS) \

Modified: trunk/Source/_javascript_Core/dfg/DFGPredictionPropagationPhase.cpp (187554 => 187555)


--- trunk/Source/_javascript_Core/dfg/DFGPredictionPropagationPhase.cpp	2015-07-29 20:10:54 UTC (rev 187554)
+++ trunk/Source/_javascript_Core/dfg/DFGPredictionPropagationPhase.cpp	2015-07-29 20:30:08 UTC (rev 187555)
@@ -199,8 +199,6 @@
         case ConstructVarargs:
         case CallForwardVarargs:
         case ConstructForwardVarargs:
-        case NativeCall:
-        case NativeConstruct:
         case GetGlobalVar:
         case GetClosureVar:
         case GetFromArguments: {

Modified: trunk/Source/_javascript_Core/dfg/DFGSafeToExecute.h (187554 => 187555)


--- trunk/Source/_javascript_Core/dfg/DFGSafeToExecute.h	2015-07-29 20:10:54 UTC (rev 187554)
+++ trunk/Source/_javascript_Core/dfg/DFGSafeToExecute.h	2015-07-29 20:30:08 UTC (rev 187555)
@@ -292,10 +292,6 @@
     case ForwardVarargs:
         return true;
 
-    case NativeCall:
-    case NativeConstruct:
-        return false; // TODO: add a check for already checked.  https://bugs.webkit.org/show_bug.cgi?id=133769
-
     case BottomValue:
         // If in doubt, assume that this isn't safe to execute, just because we have no way of
         // compiling this node.

Modified: trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT32_64.cpp (187554 => 187555)


--- trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT32_64.cpp	2015-07-29 20:10:54 UTC (rev 187554)
+++ trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT32_64.cpp	2015-07-29 20:30:08 UTC (rev 187555)
@@ -4686,8 +4686,6 @@
     case ArithIMul:
     case MultiGetByOffset:
     case MultiPutByOffset:
-    case NativeCall:
-    case NativeConstruct:
     case CheckBadCell:
     case BottomValue:
     case PhantomNewObject:

Modified: trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT64.cpp (187554 => 187555)


--- trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT64.cpp	2015-07-29 20:10:54 UTC (rev 187554)
+++ trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT64.cpp	2015-07-29 20:30:08 UTC (rev 187555)
@@ -4748,8 +4748,6 @@
         break;
 #endif // ENABLE(FTL_JIT)
 
-    case NativeCall:
-    case NativeConstruct:    
     case LastNodeType:
     case Phi:
     case Upsilon:

Modified: trunk/Source/_javascript_Core/ftl/FTLCapabilities.cpp (187554 => 187555)


--- trunk/Source/_javascript_Core/ftl/FTLCapabilities.cpp	2015-07-29 20:10:54 UTC (rev 187554)
+++ trunk/Source/_javascript_Core/ftl/FTLCapabilities.cpp	2015-07-29 20:30:08 UTC (rev 187555)
@@ -131,8 +131,6 @@
     case ConstructVarargs:
     case ConstructForwardVarargs:
     case LoadVarargs:
-    case NativeCall:
-    case NativeConstruct:
     case ValueToInt32:
     case Branch:
     case LogicalNot:

Modified: trunk/Source/_javascript_Core/ftl/FTLLowerDFGToLLVM.cpp (187554 => 187555)


--- trunk/Source/_javascript_Core/ftl/FTLLowerDFGToLLVM.cpp	2015-07-29 20:10:54 UTC (rev 187554)
+++ trunk/Source/_javascript_Core/ftl/FTLLowerDFGToLLVM.cpp	2015-07-29 20:30:08 UTC (rev 187555)
@@ -56,10 +56,6 @@
 #include <unordered_set>
 #include <wtf/ProcessID.h>
 
-#if ENABLE(FTL_NATIVE_CALL_INLINING)
-#include "BundlePath.h"
-#endif
-
 namespace JSC { namespace FTL {
 
 using namespace DFG;
@@ -158,29 +154,6 @@
 
         auto preOrder = m_graph.blocksInPreOrder();
 
-        int maxNumberOfArguments = -1;
-        for (BasicBlock* block : preOrder) {
-            for (unsigned nodeIndex = block->size(); nodeIndex--; ) {
-                Node* node = block->at(nodeIndex);
-                switch (node->op()) {
-                case NativeCall:
-                case NativeConstruct: {
-                    int numArgs = node->numChildren();
-                    if (numArgs > maxNumberOfArguments)
-                        maxNumberOfArguments = numArgs;
-                    break;
-                }
-                default:
-                    break;
-                }
-            }
-        }
-        
-        if (maxNumberOfArguments >= 0) {
-            m_execState = m_out.alloca(arrayType(m_out.int64, JSStack::CallFrameHeaderSize + maxNumberOfArguments));
-            m_execStorage = m_out.ptrToInt(m_execState, m_out.intPtr);        
-        }
-
         LValue capturedAlloca = m_out.alloca(arrayType(m_out.int64, m_graph.m_nextMachineLocal));
         
         m_captured = m_out.add(
@@ -757,12 +730,6 @@
         case ForwardVarargs:
             compileForwardVarargs();
             break;
-#if ENABLE(FTL_NATIVE_CALL_INLINING)
-        case NativeCall:
-        case NativeConstruct:
-            compileNativeCallOrConstruct();
-            break;
-#endif
         case Jump:
             compileJump();
             break;
@@ -4271,54 +4238,7 @@
     {
         setBoolean(m_out.bitNot(boolify(m_node->child1())));
     }
-#if ENABLE(FTL_NATIVE_CALL_INLINING)
-    void compileNativeCallOrConstruct() 
-    {
-        int numPassedArgs = m_node->numChildren() - 1;
-        int numArgs = numPassedArgs;
 
-        JSFunction* knownFunction = m_node->castOperand<JSFunction*>();
-        NativeFunction function = knownFunction->nativeFunction();
-
-        Dl_info info;
-        if (!dladdr((void*)function, &info))
-            ASSERT(false); // if we couldn't find the native function this doesn't bode well.
-
-        LValue callee = getFunctionBySymbol(info.dli_sname);
-
-        bool notInlinable;
-        if ((notInlinable = !callee))
-            callee = m_out.operation(function);
-
-        m_out.storePtr(m_callFrame, m_execStorage, m_heaps.CallFrame_callerFrame);
-        m_out.storePtr(constNull(m_out.intPtr), addressFor(m_execStorage, JSStack::CodeBlock));
-        m_out.storePtr(weakPointer(knownFunction), addressFor(m_execStorage, JSStack::Callee));
-
-        m_out.store64(m_out.constInt64(numArgs), addressFor(m_execStorage, JSStack::ArgumentCount));
-
-        for (int i = 0; i < numPassedArgs; ++i) {
-            m_out.storePtr(lowJSValue(m_graph.varArgChild(m_node, 1 + i)),
-                addressFor(m_execStorage, JSStack::ThisArgument, i * sizeof(Register)));
-        }
-
-        LValue calleeCallFrame = m_out.address(m_execState, m_heaps.CallFrame_callerFrame).value();
-        m_out.storePtr(m_out.ptrToInt(calleeCallFrame, m_out.intPtr), m_out.absolute(&vm().topCallFrame));
-
-        LType typeCalleeArg;
-        getParamTypes(getElementType(typeOf(callee)), &typeCalleeArg);
-
-        LValue argument = notInlinable 
-            ? m_out.ptrToInt(calleeCallFrame, typeCalleeArg) 
-            : m_out.bitCast(calleeCallFrame, typeCalleeArg);
-        LValue call = vmCall(callee, argument);
-
-        if (verboseCompilationEnabled())
-            dataLog("Native calling: ", info.dli_sname, "\n");
-
-        setJSValue(call);
-    }
-#endif
-
     void compileCallOrConstruct()
     {
         int numPassedArgs = m_node->numChildren() - 1;
@@ -5448,123 +5368,6 @@
         setJSValue(activation);
     }
 
-#if ENABLE(FTL_NATIVE_CALL_INLINING)
-    LValue getFunctionBySymbol(const CString symbol)
-    {
-        if (!m_ftlState.symbolTable.contains(symbol)) 
-            return nullptr;
-        if (!getModuleByPathForSymbol(m_ftlState.symbolTable.get(symbol), symbol))
-            return nullptr;
-        return getNamedFunction(m_ftlState.module, symbol.data());
-    }
-
-    bool getModuleByPathForSymbol(const CString path, const CString symbol)
-    {
-        if (m_ftlState.nativeLoadedLibraries.contains(path)) {
-            LValue function = getNamedFunction(m_ftlState.module, symbol.data());
-            if (!isInlinableSize(function)) {
-                // We had no choice but to compile this function, but don't try to inline it ever again.
-                m_ftlState.symbolTable.remove(symbol);
-                return false;
-            }
-            return true;
-        }
-
-        LMemoryBuffer memBuf;
-        
-        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;
-        
-        if (createMemoryBufferWithContentsOfFile(actualPath.data(), &memBuf, &outMsg)) {
-            if (Options::verboseFTLFailure())
-                dataLog("Failed to load module at ", actualPath, "\n for symbol ", symbol, "\nERROR: ", outMsg, "\n");
-            disposeMessage(outMsg);
-            return false;
-        }
-
-        LModule module;
-
-        if (parseBitcodeInContext(m_ftlState.context, memBuf, &module, &outMsg)) {
-            if (Options::verboseFTLFailure())
-                dataLog("Failed to parse module at ", actualPath, "\n for symbol ", symbol, "\nERROR: ", outMsg, "\n");
-            disposeMemoryBuffer(memBuf);
-            disposeMessage(outMsg);
-            return false;
-        }
-
-        disposeMemoryBuffer(memBuf);
-
-        if (LValue function = getNamedFunction(m_ftlState.module, symbol.data())) {
-            if (!isInlinableSize(function)) {
-                m_ftlState.symbolTable.remove(symbol);
-                disposeModule(module);
-                return false;
-            }
-        }
-
-        Vector<CString> namedFunctions;
-        for (LValue function = getFirstFunction(module); function; function = getNextFunction(function)) {
-            CString functionName(getValueName(function));
-            namedFunctions.append(functionName);
-            
-            for (LBasicBlock basicBlock = getFirstBasicBlock(function); basicBlock; basicBlock = getNextBasicBlock(basicBlock)) {
-                for (LValue instruction = getFirstInstruction(basicBlock); instruction; instruction = getNextInstruction(instruction)) {
-                    setMetadata(instruction, m_tbaaKind, nullptr);
-                    setMetadata(instruction, m_tbaaStructKind, nullptr);
-                }
-            }
-        }
-
-        Vector<CString> namedGlobals;
-        for (LValue global = getFirstGlobal(module); global; global = getNextGlobal(global)) {
-            CString globalName(getValueName(global));
-            namedGlobals.append(globalName);
-        }
-
-        if (linkModules(m_ftlState.module, module, LLVMLinkerDestroySource, &outMsg)) {
-            if (Options::verboseFTLFailure())
-                dataLog("Failed to link module at ", actualPath, "\n for symbol ", symbol, "\nERROR: ", outMsg, "\n");
-            disposeMessage(outMsg);
-            return false;
-        }
-        
-        for (CString* symbol = namedFunctions.begin(); symbol != namedFunctions.end(); ++symbol) {
-            LValue function = getNamedFunction(m_ftlState.module, symbol->data());
-            LLVMLinkage linkage = getLinkage(function);
-            if (linkage != LLVMInternalLinkage && linkage != LLVMPrivateLinkage)
-                setVisibility(function, LLVMHiddenVisibility);
-            if (!isDeclaration(function)) {
-                setLinkage(function, LLVMPrivateLinkage);
-                setLinkage(function, LLVMAvailableExternallyLinkage);
-
-                if (ASSERT_DISABLED)
-                    removeFunctionAttr(function, LLVMStackProtectAttribute);
-            }
-        }
-
-        for (CString* symbol = namedGlobals.begin(); symbol != namedGlobals.end(); ++symbol) {
-            LValue global = getNamedGlobal(m_ftlState.module, symbol->data());
-            LLVMLinkage linkage = getLinkage(global);
-            if (linkage != LLVMInternalLinkage && linkage != LLVMPrivateLinkage)
-                setVisibility(global, LLVMHiddenVisibility);
-            if (!isDeclaration(global))
-                setLinkage(global, LLVMPrivateLinkage);
-        }
-
-        m_ftlState.nativeLoadedLibraries.add(path);
-        return true;
-    }
-#endif
-
     bool isInlinableSize(LValue function)
     {
         size_t instructionCount = 0;
@@ -5600,8 +5403,6 @@
                 case PutById:
                 case Call:
                 case Construct:
-                case NativeCall:
-                case NativeConstruct:
                     return m_out.below(
                         m_callFrame,
                         m_out.loadPtr(
@@ -8658,8 +8459,6 @@
     LBasicBlock m_handleExceptions;
     HashMap<BasicBlock*, LBasicBlock> m_blocks;
     
-    LValue m_execState;
-    LValue m_execStorage;
     LValue m_callFrame;
     LValue m_captured;
     LValue m_tagTypeNumber;

Modified: trunk/Source/_javascript_Core/ftl/FTLState.cpp (187554 => 187555)


--- trunk/Source/_javascript_Core/ftl/FTLState.cpp	2015-07-29 20:10:54 UTC (rev 187554)
+++ trunk/Source/_javascript_Core/ftl/FTLState.cpp	2015-07-29 20:30:08 UTC (rev 187555)
@@ -35,10 +35,6 @@
 #include <llvm/InitializeLLVM.h>
 #include <stdio.h>
 
-#if ENABLE(FTL_NATIVE_CALL_INLINING)
-#include "InlineRuntimeSymbolTable.h"
-#endif
-
 namespace JSC { namespace FTL {
 
 using namespace DFG;
@@ -56,14 +52,6 @@
     , unwindDataSection(0)
     , unwindDataSectionSize(0)
 {
-
-#if ENABLE(FTL_NATIVE_CALL_INLINING)
-#define SYMBOL_TABLE_ADD(symbol, file) \
-    symbolTable.fastAdd(symbol, file);
-    FOR_EACH_LIBRARY_SYMBOL(SYMBOL_TABLE_ADD)
-#undef SYMBOL_TABLE_ADD
-#endif
-    
     switch (graph.m_plan.mode) {
     case FTLMode: {
         jitCode = adoptRef(new JITCode());

Modified: trunk/Source/_javascript_Core/ftl/FTLState.h (187554 => 187555)


--- trunk/Source/_javascript_Core/ftl/FTLState.h	2015-07-29 20:10:54 UTC (rev 187554)
+++ trunk/Source/_javascript_Core/ftl/FTLState.h	2015-07-29 20:30:08 UTC (rev 187555)
@@ -89,10 +89,6 @@
     void dumpState(LModule, const char* when);
 
     HashSet<CString> nativeLoadedLibraries;
-
-#if ENABLE(FTL_NATIVE_CALL_INLINING)
-    HashMap<CString, CString> symbolTable;
-#endif
 };
 
 } } // namespace JSC::FTL

Deleted: trunk/Source/_javascript_Core/runtime/BundlePath.cpp (187554 => 187555)


--- trunk/Source/_javascript_Core/runtime/BundlePath.cpp	2015-07-29 20:10:54 UTC (rev 187554)
+++ trunk/Source/_javascript_Core/runtime/BundlePath.cpp	2015-07-29 20:30:08 UTC (rev 187555)
@@ -1,52 +0,0 @@
-/*
- * 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"
-
-#if ENABLE(FTL_NATIVE_CALL_INLINING)
-
-#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
-
-#endif // FTL_NATIVE_CALL_INLINING

Modified: trunk/Source/_javascript_Core/runtime/JSDataViewPrototype.cpp (187554 => 187555)


--- trunk/Source/_javascript_Core/runtime/JSDataViewPrototype.cpp	2015-07-29 20:10:54 UTC (rev 187554)
+++ trunk/Source/_javascript_Core/runtime/JSDataViewPrototype.cpp	2015-07-29 20:30:08 UTC (rev 187555)
@@ -115,7 +115,7 @@
 }
 
 template<typename Adaptor>
-EncodedJSValue ATTR_USED getData(ExecState* exec)
+EncodedJSValue getData(ExecState* exec)
 {
     JSDataView* dataView = jsDynamicCast<JSDataView*>(exec->thisValue());
     if (!dataView)
@@ -160,7 +160,7 @@
 }
 
 template<typename Adaptor>
-EncodedJSValue ATTR_USED setData(ExecState* exec)
+EncodedJSValue setData(ExecState* exec)
 {
     JSDataView* dataView = jsDynamicCast<JSDataView*>(exec->thisValue());
     if (!dataView)

Modified: trunk/Source/_javascript_Core/runtime/Options.h (187554 => 187555)


--- trunk/Source/_javascript_Core/runtime/Options.h	2015-07-29 20:10:54 UTC (rev 187554)
+++ trunk/Source/_javascript_Core/runtime/Options.h	2015-07-29 20:30:08 UTC (rev 187555)
@@ -188,7 +188,6 @@
     v(unsigned, maxPolymorphicCallVariantsForInlining, 5, nullptr) \
     v(unsigned, frequentCallThreshold, 2, nullptr) \
     v(double, minimumCallToKnownRate, 0.51, nullptr) \
-    v(bool, optimizeNativeCalls, false, nullptr) \
     v(bool, enableMovHintRemoval, true, nullptr) \
     v(bool, enableObjectAllocationSinking, true, nullptr) \
     \

Modified: trunk/Source/WTF/ChangeLog (187554 => 187555)


--- trunk/Source/WTF/ChangeLog	2015-07-29 20:10:54 UTC (rev 187554)
+++ trunk/Source/WTF/ChangeLog	2015-07-29 20:30:08 UTC (rev 187555)
@@ -1,3 +1,12 @@
+2015-07-29  Basile Clement  <[email protected]>
+
+        Remove native call inlining
+        https://bugs.webkit.org/show_bug.cgi?id=147417
+
+        Rubber-stamped by Filip Pizlo.
+
+        * wtf/Platform.h:
+
 2015-07-28  Yusuke Suzuki  <[email protected]>
 
         [ES6] Add ENABLE_ES6_MODULES compile time flag with the default value "false"

Modified: trunk/Source/WTF/wtf/Platform.h (187554 => 187555)


--- trunk/Source/WTF/wtf/Platform.h	2015-07-29 20:10:54 UTC (rev 187554)
+++ trunk/Source/WTF/wtf/Platform.h	2015-07-29 20:30:08 UTC (rev 187555)
@@ -784,17 +784,6 @@
 #define ENABLE_FTL_JIT 0
 #endif
 
-#if !defined(ENABLE_FTL_NATIVE_CALL_INLINING)
-#define ENABLE_FTL_NATIVE_CALL_INLINING 0
-#endif
-
-/* Used to make GCC's optimization not throw away a symbol that we would need for native inlining */
-#if ENABLE(FTL_NATIVE_CALL_INLINING) && COMPILER(GCC) && !COMPILER(CLANG)
-#define ATTR_USED __attribute__ ((used))
-#else
-#define ATTR_USED
-#endif
-
 /* Generational collector for JSC */
 #if !defined(ENABLE_GGC)
 #if CPU(X86_64) || CPU(X86) || CPU(ARM64) || CPU(ARM)

Modified: trunk/Source/cmake/OptionsEfl.cmake (187554 => 187555)


--- trunk/Source/cmake/OptionsEfl.cmake	2015-07-29 20:10:54 UTC (rev 187554)
+++ trunk/Source/cmake/OptionsEfl.cmake	2015-07-29 20:30:08 UTC (rev 187555)
@@ -282,9 +282,6 @@
         message(FATAL_ERROR "FTL JIT is only available on X86_64 and AArch64 architectures.")
     endif ()
     SET_AND_EXPOSE_TO_BUILD(HAVE_LLVM TRUE)
-    if (ENABLE_FTL_NATIVE_CALL_INLINING)
-        find_package(Clang REQUIRED)
-    endif ()
 endif ()
 
 if (ENABLE_SUBTLE_CRYPTO)

Modified: trunk/Source/cmake/WebKitFeatures.cmake (187554 => 187555)


--- trunk/Source/cmake/WebKitFeatures.cmake	2015-07-29 20:10:54 UTC (rev 187554)
+++ trunk/Source/cmake/WebKitFeatures.cmake	2015-07-29 20:30:08 UTC (rev 187555)
@@ -80,7 +80,6 @@
     WEBKIT_OPTION_DEFINE(ENABLE_FONT_LOAD_EVENTS "Toggle Font Load Events support" PRIVATE OFF)
     WEBKIT_OPTION_DEFINE(ENABLE_FTPDIR "Toggle FTP directory support" PRIVATE ON)
     WEBKIT_OPTION_DEFINE(ENABLE_FTL_JIT "Toggle FTL support for JSC" PRIVATE OFF)
-    WEBKIT_OPTION_DEFINE(ENABLE_FTL_NATIVE_CALL_INLINING "Toggle native call inlining for FTL" PRIVATE OFF)
     WEBKIT_OPTION_DEFINE(ENABLE_FULLSCREEN_API "Toggle Fullscreen API support" PRIVATE OFF)
     WEBKIT_OPTION_DEFINE(ENABLE_GAMEPAD "Toggle Gamepad support" PRIVATE OFF)
     WEBKIT_OPTION_DEFINE(ENABLE_GAMEPAD_DEPRECATED "Toggle deprecated Gamepad support" PRIVATE OFF)
@@ -175,7 +174,6 @@
 
     WEBKIT_OPTION_DEPEND(ENABLE_ENCRYPTED_MEDIA_V2 ENABLE_VIDEO)
     WEBKIT_OPTION_DEPEND(ENABLE_DFG_JIT ENABLE_JIT)
-    WEBKIT_OPTION_DEPEND(ENABLE_FTL_NATIVE_CALL_INLINING ENABLE_FTL_JIT)
     WEBKIT_OPTION_DEPEND(ENABLE_FTL_JIT ENABLE_DFG_JIT)
     WEBKIT_OPTION_DEPEND(ENABLE_MEDIA_CONTROLS_SCRIPT ENABLE_VIDEO)
     WEBKIT_OPTION_DEPEND(ENABLE_VIDEO_TRACK ENABLE_VIDEO)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to