Remove the unused *Executable::unlinkCalls() and CodeBlock::unlinkCalls()
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 26 Aug 2015 18:34:38 +0000 (18:34 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 26 Aug 2015 18:34:38 +0000 (18:34 +0000)
https://bugs.webkit.org/show_bug.cgi?id=148469

Patch by Sukolsak Sakshuwong <sukolsak@gmail.com> on 2015-08-26
Reviewed by Geoffrey Garen.

We use CodeBlock::unlinkIncomingCalls() to unlink calls.
(...)Executable::unlinkCalls() and CodeBlock::unlinkCalls() are no longer used.

* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::unlinkCalls): Deleted.
* bytecode/CodeBlock.h:
* runtime/Executable.cpp:
(JSC::EvalExecutable::unlinkCalls): Deleted.
(JSC::ProgramExecutable::unlinkCalls): Deleted.
(JSC::FunctionExecutable::unlinkCalls): Deleted.
* runtime/Executable.h:
(JSC::ScriptExecutable::unlinkCalls): Deleted.

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

Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/bytecode/CodeBlock.cpp
Source/JavaScriptCore/bytecode/CodeBlock.h
Source/JavaScriptCore/runtime/Executable.cpp
Source/JavaScriptCore/runtime/Executable.h

index a4ced7b..88763f3 100644 (file)
@@ -1,3 +1,23 @@
+2015-08-26  Sukolsak Sakshuwong  <sukolsak@gmail.com>
+
+        Remove the unused *Executable::unlinkCalls() and CodeBlock::unlinkCalls()
+        https://bugs.webkit.org/show_bug.cgi?id=148469
+
+        Reviewed by Geoffrey Garen.
+
+        We use CodeBlock::unlinkIncomingCalls() to unlink calls.
+        (...)Executable::unlinkCalls() and CodeBlock::unlinkCalls() are no longer used.
+
+        * bytecode/CodeBlock.cpp:
+        (JSC::CodeBlock::unlinkCalls): Deleted.
+        * bytecode/CodeBlock.h:
+        * runtime/Executable.cpp:
+        (JSC::EvalExecutable::unlinkCalls): Deleted.
+        (JSC::ProgramExecutable::unlinkCalls): Deleted.
+        (JSC::FunctionExecutable::unlinkCalls): Deleted.
+        * runtime/Executable.h:
+        (JSC::ScriptExecutable::unlinkCalls): Deleted.
+
 2015-08-25  Brian Burg  <bburg@apple.com>
 
         Web Inspector: no need to allocate protocolErrors array for every dispatched backend command
index d031ea9..20c147a 100644 (file)
@@ -2973,27 +2973,6 @@ void CodeBlock::shrinkToFit(ShrinkMode shrinkMode)
 }
 
 #if ENABLE(JIT)
-void CodeBlock::unlinkCalls()
-{
-    if (!!m_alternative)
-        m_alternative->unlinkCalls();
-    for (size_t i = 0; i < m_llintCallLinkInfos.size(); ++i) {
-        if (m_llintCallLinkInfos[i].isLinked())
-            m_llintCallLinkInfos[i].unlink();
-    }
-    if (m_callLinkInfos.isEmpty())
-        return;
-    if (!m_vm->canUseJIT())
-        return;
-    RepatchBuffer repatchBuffer(this);
-    for (auto iter = m_callLinkInfos.begin(); !!iter; ++iter) {
-        CallLinkInfo& info = **iter;
-        if (!info.isLinked())
-            continue;
-        info.unlink(repatchBuffer);
-    }
-}
-
 void CodeBlock::linkIncomingCall(ExecState* callerFrame, CallLinkInfo* incoming)
 {
     noticeIncomingCall(callerFrame);
index 0b97e23..9499405 100644 (file)
@@ -230,8 +230,6 @@ public:
     void unlinkIncomingCalls();
 
 #if ENABLE(JIT)
-    void unlinkCalls();
-        
     void linkIncomingCall(ExecState* callerFrame, CallLinkInfo*);
     void linkIncomingPolymorphicCall(ExecState* callerFrame, PolymorphicCallNode*);
 #endif // ENABLE(JIT)
index 5ffb8db..1b9a73d 100644 (file)
@@ -442,16 +442,6 @@ void EvalExecutable::visitChildren(JSCell* cell, SlotVisitor& visitor)
     visitor.append(&thisObject->m_unlinkedEvalCodeBlock);
 }
 
-void EvalExecutable::unlinkCalls()
-{
-#if ENABLE(JIT)
-    if (!m_jitCodeForCall)
-        return;
-    RELEASE_ASSERT(m_evalCodeBlock);
-    m_evalCodeBlock->unlinkCalls();
-#endif
-}
-
 void EvalExecutable::clearCode()
 {
     m_evalCodeBlock = nullptr;
@@ -473,16 +463,6 @@ JSObject* ProgramExecutable::checkSyntax(ExecState* exec)
     return error.toErrorObject(lexicalGlobalObject, m_source);
 }
 
-void ProgramExecutable::unlinkCalls()
-{
-#if ENABLE(JIT)
-    if (!m_jitCodeForCall)
-        return;
-    RELEASE_ASSERT(m_programCodeBlock);
-    m_programCodeBlock->unlinkCalls();
-#endif
-}
-
 JSObject* ProgramExecutable::initializeGlobalProperties(VM& vm, CallFrame* callFrame, JSScope* scope)
 {
     RELEASE_ASSERT(scope);
@@ -569,20 +549,6 @@ void FunctionExecutable::clearCode()
     Base::clearCode();
 }
 
-void FunctionExecutable::unlinkCalls()
-{
-#if ENABLE(JIT)
-    if (!!m_jitCodeForCall) {
-        RELEASE_ASSERT(m_codeBlockForCall);
-        m_codeBlockForCall->unlinkCalls();
-    }
-    if (!!m_jitCodeForConstruct) {
-        RELEASE_ASSERT(m_codeBlockForConstruct);
-        m_codeBlockForConstruct->unlinkCalls();
-    }
-#endif
-}
-
 FunctionExecutable* FunctionExecutable::fromGlobalCode(
     const Identifier& name, ExecState& exec, const SourceCode& source, 
     JSObject*& exception, int overrideLineNumber)
index 0405377..b513547 100644 (file)
@@ -381,8 +381,6 @@ public:
     
     bool* addressOfDidTryToEnterInLoop() { return &m_didTryToEnterInLoop; }
 
-    void unlinkCalls();
-        
     CodeFeatures features() const { return m_features; }
         
     DECLARE_INFO;
@@ -470,8 +468,6 @@ public:
         
     DECLARE_INFO;
 
-    void unlinkCalls();
-
     void clearCode();
 
     ExecutableInfo executableInfo() const { return ExecutableInfo(needsActivation(), usesEval(), isStrictMode(), false, false, ConstructorKind::None, false); }
@@ -525,8 +521,6 @@ public:
     }
         
     DECLARE_INFO;
-        
-    void unlinkCalls();
 
     void clearCode();
 
@@ -656,8 +650,6 @@ public:
     }
 
     DECLARE_INFO;
-        
-    void unlinkCalls();
 
     void clearCode();
     
@@ -694,20 +686,6 @@ inline void ExecutableBase::clearCodeVirtual(ExecutableBase* executable)
     }
 }
 
-inline void ScriptExecutable::unlinkCalls()
-{
-    switch (type()) {
-    case EvalExecutableType:
-        return jsCast<EvalExecutable*>(this)->unlinkCalls();
-    case ProgramExecutableType:
-        return jsCast<ProgramExecutable*>(this)->unlinkCalls();
-    case FunctionExecutableType:
-        return jsCast<FunctionExecutable*>(this)->unlinkCalls();
-    default:
-        RELEASE_ASSERT_NOT_REACHED();
-    }
-}
-
 }
 
 #endif