Title: [168497] trunk/Source
Revision
168497
Author
fpi...@apple.com
Date
2014-05-08 14:51:03 -0700 (Thu, 08 May 2014)

Log Message

deleteAllCompiledCode() shouldn't use the suspension worklist
https://bugs.webkit.org/show_bug.cgi?id=132708

Reviewed by Mark Hahnenberg.

* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::setOptimizationThresholdBasedOnCompilationResult):
* dfg/DFGPlan.cpp:
(JSC::DFG::Plan::isStillValid):
* heap/Heap.cpp:
(JSC::Heap::deleteAllCompiledCode):

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (168496 => 168497)


--- trunk/Source/_javascript_Core/ChangeLog	2014-05-08 21:29:47 UTC (rev 168496)
+++ trunk/Source/_javascript_Core/ChangeLog	2014-05-08 21:51:03 UTC (rev 168497)
@@ -1,5 +1,19 @@
 2014-05-08  Filip Pizlo  <fpi...@apple.com>
 
+        deleteAllCompiledCode() shouldn't use the suspension worklist
+        https://bugs.webkit.org/show_bug.cgi?id=132708
+
+        Reviewed by Mark Hahnenberg.
+
+        * bytecode/CodeBlock.cpp:
+        (JSC::CodeBlock::setOptimizationThresholdBasedOnCompilationResult):
+        * dfg/DFGPlan.cpp:
+        (JSC::DFG::Plan::isStillValid):
+        * heap/Heap.cpp:
+        (JSC::Heap::deleteAllCompiledCode):
+
+2014-05-08  Filip Pizlo  <fpi...@apple.com>
+
         SSA conversion should delete PhantomLocals for captured variables
         https://bugs.webkit.org/show_bug.cgi?id=132693
 

Modified: trunk/Source/_javascript_Core/bytecode/CodeBlock.cpp (168496 => 168497)


--- trunk/Source/_javascript_Core/bytecode/CodeBlock.cpp	2014-05-08 21:29:47 UTC (rev 168496)
+++ trunk/Source/_javascript_Core/bytecode/CodeBlock.cpp	2014-05-08 21:51:03 UTC (rev 168497)
@@ -3112,8 +3112,22 @@
 #if ENABLE(DFG_JIT)
 void CodeBlock::setOptimizationThresholdBasedOnCompilationResult(CompilationResult result)
 {
-    RELEASE_ASSERT(jitType() == JITCode::BaselineJIT);
-    RELEASE_ASSERT((result == CompilationSuccessful) == (replacement() != this));
+    JITCode::JITType type = jitType();
+    if (type != JITCode::BaselineJIT) {
+        dataLog(*this, ": expected to have baseline code but have ", type, "\n");
+        RELEASE_ASSERT_NOT_REACHED();
+    }
+    
+    CodeBlock* theReplacement = replacement();
+    if ((result == CompilationSuccessful) != (theReplacement != this)) {
+        dataLog(*this, ": we have result = ", result, " but ");
+        if (theReplacement == this)
+            dataLog("we are our own replacement.\n");
+        else
+            dataLog("our replacement is ", pointerDump(theReplacement), "\n");
+        RELEASE_ASSERT_NOT_REACHED();
+    }
+    
     switch (result) {
     case CompilationSuccessful:
         RELEASE_ASSERT(JITCode::isOptimizingJIT(replacement()->jitType()));
@@ -3136,6 +3150,8 @@
         optimizeAfterWarmUp();
         return;
     }
+    
+    dataLog("Unrecognized result: ", static_cast<int>(result), "\n");
     RELEASE_ASSERT_NOT_REACHED();
 }
 

Modified: trunk/Source/_javascript_Core/dfg/DFGPlan.cpp (168496 => 168497)


--- trunk/Source/_javascript_Core/dfg/DFGPlan.cpp	2014-05-08 21:29:47 UTC (rev 168496)
+++ trunk/Source/_javascript_Core/dfg/DFGPlan.cpp	2014-05-08 21:51:03 UTC (rev 168497)
@@ -386,6 +386,10 @@
     CodeBlock* replacement = codeBlock->replacement();
     if (!replacement)
         return false;
+    // FIXME: This is almost certainly not necessary. There's no way for the baseline
+    // code to be replaced during a compilation, except if we delete the plan, in which
+    // case we wouldn't be here.
+    // https://bugs.webkit.org/show_bug.cgi?id=132707
     if (codeBlock->alternative() != replacement->baselineVersion())
         return false;
     if (!watchpoints.areStillValid())

Modified: trunk/Source/_javascript_Core/heap/Heap.cpp (168496 => 168497)


--- trunk/Source/_javascript_Core/heap/Heap.cpp	2014-05-08 21:29:47 UTC (rev 168496)
+++ trunk/Source/_javascript_Core/heap/Heap.cpp	2014-05-08 21:51:03 UTC (rev 168497)
@@ -886,9 +886,11 @@
     // means that we are running some hot JS code right now. Maybe causing
     // recompilations isn't a good idea.
 #if ENABLE(DFG_JIT)
-    for (auto worklist : m_suspendedCompilerWorklists) {
-        if (worklist->isActiveForVM(*vm()))
-            return;
+    for (unsigned i = DFG::numberOfWorklists(); i--;) {
+        if (DFG::Worklist* worklist = DFG::worklistForIndexOrNull(i)) {
+            if (worklist->isActiveForVM(*vm()))
+                return;
+        }
     }
 #endif // ENABLE(DFG_JIT)
 

Modified: trunk/Source/WebKit2/WebProcess/cocoa/WebProcessCocoa.mm (168496 => 168497)


--- trunk/Source/WebKit2/WebProcess/cocoa/WebProcessCocoa.mm	2014-05-08 21:29:47 UTC (rev 168496)
+++ trunk/Source/WebKit2/WebProcess/cocoa/WebProcessCocoa.mm	2014-05-08 21:51:03 UTC (rev 168497)
@@ -192,13 +192,6 @@
     m_shouldForceScreenFontSubstitution = parameters.shouldForceScreenFontSubstitution;
     Font::setDefaultTypesettingFeatures(parameters.shouldEnableKerningAndLigaturesByDefault ? Kerning | Ligatures : 0);
 
-    if (!JSC::Options::useJITWasOverridden())
-        JSC::Options::useJIT() = parameters.shouldEnableJIT;
-#if ENABLE(FTL_JIT)
-    if (!JSC::Options::useFTLJITWasOverridden())
-        JSC::Options::useFTLJIT() = parameters.shouldEnableFTLJIT;
-#endif
-
     setEnhancedAccessibility(parameters.accessibilityEnhancedUserInterfaceEnabled);
 
 #if USE(APPKIT)
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to