Title: [185379] trunk/Source/_javascript_Core
Revision
185379
Author
[email protected]
Date
2015-06-09 14:20:08 -0700 (Tue, 09 Jun 2015)

Log Message

FunctionExecutable::isCompiling() is weird and wrong.
<https://webkit.org/b/145689>

Reviewed by Geoffrey Garen.

Remove FunctionExecutable::isCompiling() and the clearCodeIfNotCompiling() style
functions that called it before throwing away code.

isCompiling() would consider the executable to be "compiling" if it had a CodeBlock
but no JITCode. In practice, every executable gets a JITCode at the same time as it
gets a CodeBlock, by way of prepareForExecutionImpl().

* debugger/Debugger.cpp:
* heap/Heap.cpp:
(JSC::Heap::deleteAllCompiledCode):
(JSC::Heap::deleteAllUnlinkedFunctionCode):
* inspector/agents/InspectorRuntimeAgent.cpp:
(Inspector::TypeRecompiler::visit):
* runtime/Executable.cpp:
(JSC::FunctionExecutable::clearUnlinkedCodeForRecompilation):
(JSC::FunctionExecutable::clearCodeIfNotCompiling): Deleted.
(JSC::FunctionExecutable::clearUnlinkedCodeForRecompilationIfNotCompiling): Deleted.
* runtime/Executable.h:
* runtime/VM.cpp:
(JSC::StackPreservingRecompiler::visit):

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (185378 => 185379)


--- trunk/Source/_javascript_Core/ChangeLog	2015-06-09 21:19:19 UTC (rev 185378)
+++ trunk/Source/_javascript_Core/ChangeLog	2015-06-09 21:20:08 UTC (rev 185379)
@@ -1,3 +1,31 @@
+2015-06-09  Andreas Kling  <[email protected]>
+
+        FunctionExecutable::isCompiling() is weird and wrong.
+        <https://webkit.org/b/145689>
+
+        Reviewed by Geoffrey Garen.
+
+        Remove FunctionExecutable::isCompiling() and the clearCodeIfNotCompiling() style
+        functions that called it before throwing away code.
+
+        isCompiling() would consider the executable to be "compiling" if it had a CodeBlock
+        but no JITCode. In practice, every executable gets a JITCode at the same time as it
+        gets a CodeBlock, by way of prepareForExecutionImpl().
+
+        * debugger/Debugger.cpp:
+        * heap/Heap.cpp:
+        (JSC::Heap::deleteAllCompiledCode):
+        (JSC::Heap::deleteAllUnlinkedFunctionCode):
+        * inspector/agents/InspectorRuntimeAgent.cpp:
+        (Inspector::TypeRecompiler::visit):
+        * runtime/Executable.cpp:
+        (JSC::FunctionExecutable::clearUnlinkedCodeForRecompilation):
+        (JSC::FunctionExecutable::clearCodeIfNotCompiling): Deleted.
+        (JSC::FunctionExecutable::clearUnlinkedCodeForRecompilationIfNotCompiling): Deleted.
+        * runtime/Executable.h:
+        * runtime/VM.cpp:
+        (JSC::StackPreservingRecompiler::visit):
+
 2015-06-09  Yusuke Suzuki  <[email protected]>
 
         Introduce getter definition into static hash tables and use it for getters in RegExp.prototype.

Modified: trunk/Source/_javascript_Core/debugger/Debugger.cpp (185378 => 185379)


--- trunk/Source/_javascript_Core/debugger/Debugger.cpp	2015-06-09 21:19:19 UTC (rev 185378)
+++ trunk/Source/_javascript_Core/debugger/Debugger.cpp	2015-06-09 21:20:08 UTC (rev 185379)
@@ -88,8 +88,8 @@
         return;
 
     ExecState* exec = function->scope()->globalObject()->JSGlobalObject::globalExec();
-    executable->clearCodeIfNotCompiling();
-    executable->clearUnlinkedCodeForRecompilationIfNotCompiling();
+    executable->clearCode();
+    executable->clearUnlinkedCodeForRecompilation();
     if (m_debugger == function->scope()->globalObject()->debugger())
         m_sourceProviders.add(executable->source().provider(), exec);
 }

Modified: trunk/Source/_javascript_Core/heap/Heap.cpp (185378 => 185379)


--- trunk/Source/_javascript_Core/heap/Heap.cpp	2015-06-09 21:19:19 UTC (rev 185378)
+++ trunk/Source/_javascript_Core/heap/Heap.cpp	2015-06-09 21:20:08 UTC (rev 185379)
@@ -926,7 +926,7 @@
     for (ExecutableBase* current : m_compiledCode) {
         if (!current->isFunctionExecutable())
             continue;
-        static_cast<FunctionExecutable*>(current)->clearCodeIfNotCompiling();
+        static_cast<FunctionExecutable*>(current)->clearCode();
     }
 
     ASSERT(m_operationInProgress == FullCollection || m_operationInProgress == NoOperation);
@@ -939,7 +939,7 @@
     for (ExecutableBase* current : m_compiledCode) {
         if (!current->isFunctionExecutable())
             continue;
-        static_cast<FunctionExecutable*>(current)->clearUnlinkedCodeForRecompilationIfNotCompiling();
+        static_cast<FunctionExecutable*>(current)->clearUnlinkedCodeForRecompilation();
     }
 }
 

Modified: trunk/Source/_javascript_Core/inspector/agents/InspectorRuntimeAgent.cpp (185378 => 185379)


--- trunk/Source/_javascript_Core/inspector/agents/InspectorRuntimeAgent.cpp	2015-06-09 21:19:19 UTC (rev 185378)
+++ trunk/Source/_javascript_Core/inspector/agents/InspectorRuntimeAgent.cpp	2015-06-09 21:20:08 UTC (rev 185379)
@@ -315,8 +315,8 @@
             return;
 
         FunctionExecutable* executable = jsCast<FunctionExecutable*>(cell);
-        executable->clearCodeIfNotCompiling();
-        executable->clearUnlinkedCodeForRecompilationIfNotCompiling();
+        executable->clearCode();
+        executable->clearUnlinkedCodeForRecompilation();
     }
     inline IterationStatus operator()(JSCell* cell)
     {

Modified: trunk/Source/_javascript_Core/runtime/Executable.cpp (185378 => 185379)


--- trunk/Source/_javascript_Core/runtime/Executable.cpp	2015-06-09 21:19:19 UTC (rev 185378)
+++ trunk/Source/_javascript_Core/runtime/Executable.cpp	2015-06-09 21:20:08 UTC (rev 185379)
@@ -580,17 +580,8 @@
     return codeBlockFor(kind)->symbolTable();
 }
 
-void FunctionExecutable::clearCodeIfNotCompiling()
+void FunctionExecutable::clearUnlinkedCodeForRecompilation()
 {
-    if (isCompiling())
-        return;
-    clearCode();
-}
-
-void FunctionExecutable::clearUnlinkedCodeForRecompilationIfNotCompiling()
-{
-    if (isCompiling())
-        return;
     m_unlinkedExecutable->clearCodeForRecompilation();
 }
 

Modified: trunk/Source/_javascript_Core/runtime/Executable.h (185378 => 185379)


--- trunk/Source/_javascript_Core/runtime/Executable.h	2015-06-09 21:19:19 UTC (rev 185378)
+++ trunk/Source/_javascript_Core/runtime/Executable.h	2015-06-09 21:20:08 UTC (rev 185379)
@@ -637,8 +637,7 @@
     size_t parameterCount() const { return m_unlinkedExecutable->parameterCount(); } // Excluding 'this'!
     SymbolTable* symbolTable(CodeSpecializationKind);
 
-    void clearCodeIfNotCompiling();
-    void clearUnlinkedCodeForRecompilationIfNotCompiling();
+    void clearUnlinkedCodeForRecompilation();
     static void visitChildren(JSCell*, SlotVisitor&);
     static Structure* createStructure(VM& vm, JSGlobalObject* globalObject, JSValue proto)
     {
@@ -669,17 +668,6 @@
     
     void finishCreation(VM&);
 
-    bool isCompiling()
-    {
-#if ENABLE(JIT)
-        if (!m_jitCodeForCall && m_codeBlockForCall)
-            return true;
-        if (!m_jitCodeForConstruct && m_codeBlockForConstruct)
-            return true;
-#endif
-        return false;
-    }
-
     friend class ScriptExecutable;
     
     WriteBarrier<UnlinkedFunctionExecutable> m_unlinkedExecutable;

Modified: trunk/Source/_javascript_Core/runtime/VM.cpp (185378 => 185379)


--- trunk/Source/_javascript_Core/runtime/VM.cpp	2015-06-09 21:19:19 UTC (rev 185378)
+++ trunk/Source/_javascript_Core/runtime/VM.cpp	2015-06-09 21:20:08 UTC (rev 185379)
@@ -504,7 +504,7 @@
         FunctionExecutable* executable = jsCast<FunctionExecutable*>(cell);
         if (currentlyExecutingFunctions.contains(executable))
             return;
-        executable->clearCodeIfNotCompiling();
+        executable->clearCode();
     }
     IterationStatus operator()(JSCell* cell)
     {
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to