Title: [161546] branches/jsCStack/Source/_javascript_Core
Revision
161546
Author
[email protected]
Date
2014-01-08 22:15:23 -0800 (Wed, 08 Jan 2014)

Log Message

FTL should be able to be parallel
https://bugs.webkit.org/show_bug.cgi?id=126679

Not yet reviewed.
        
Fix some bugs that got in the way of saying JSC_numberOfCompilerThreads=7 or some
such.

* bytecode/CodeBlock.h:
(JSC::CodeBlock::livenessAnalysis): This wasn't thread-safe. Now it is.
* dfg/DFGWorklist.cpp:
(JSC::DFG::initializeGlobalWorklistOnce): FTL is now parallelizable.
* llvm/library/LLVMExports.cpp:
(initializeAndGetJSCLLVMAPI): Make LLVM parallelizable.

Modified Paths

Diff

Modified: branches/jsCStack/Source/_javascript_Core/ChangeLog (161545 => 161546)


--- branches/jsCStack/Source/_javascript_Core/ChangeLog	2014-01-09 05:41:53 UTC (rev 161545)
+++ branches/jsCStack/Source/_javascript_Core/ChangeLog	2014-01-09 06:15:23 UTC (rev 161546)
@@ -1,5 +1,22 @@
 2014-01-08  Filip Pizlo  <[email protected]>
 
+        FTL should be able to be parallel
+        https://bugs.webkit.org/show_bug.cgi?id=126679
+
+        Not yet reviewed.
+        
+        Fix some bugs that got in the way of saying JSC_numberOfCompilerThreads=7 or some
+        such.
+
+        * bytecode/CodeBlock.h:
+        (JSC::CodeBlock::livenessAnalysis): This wasn't thread-safe. Now it is.
+        * dfg/DFGWorklist.cpp:
+        (JSC::DFG::initializeGlobalWorklistOnce): FTL is now parallelizable.
+        * llvm/library/LLVMExports.cpp:
+        (initializeAndGetJSCLLVMAPI): Make LLVM parallelizable.
+
+2014-01-08  Filip Pizlo  <[email protected]>
+
         FTL should not use the inputs of an add or sub as the live-at-exit values in an overflow check, if the values aren't live after
         https://bugs.webkit.org/show_bug.cgi?id=126545
 

Modified: branches/jsCStack/Source/_javascript_Core/bytecode/CodeBlock.h (161545 => 161546)


--- branches/jsCStack/Source/_javascript_Core/bytecode/CodeBlock.h	2014-01-09 05:41:53 UTC (rev 161545)
+++ branches/jsCStack/Source/_javascript_Core/bytecode/CodeBlock.h	2014-01-09 06:15:23 UTC (rev 161546)
@@ -695,9 +695,19 @@
 
     BytecodeLivenessAnalysis& livenessAnalysis()
     {
-        if (!m_livenessAnalysis)
-            m_livenessAnalysis = std::make_unique<BytecodeLivenessAnalysis>(this);
-        return *m_livenessAnalysis;
+        {
+            ConcurrentJITLocker locker(m_lock);
+            if (!!m_livenessAnalysis)
+                return *m_livenessAnalysis;
+        }
+        std::unique_ptr<BytecodeLivenessAnalysis> analysis =
+            std::make_unique<BytecodeLivenessAnalysis>(this);
+        {
+            ConcurrentJITLocker locker(m_lock);
+            if (!m_livenessAnalysis)
+                m_livenessAnalysis = std::move(analysis);
+            return *m_livenessAnalysis;
+        }
     }
     
     void validate();

Modified: branches/jsCStack/Source/_javascript_Core/dfg/DFGWorklist.cpp (161545 => 161546)


--- branches/jsCStack/Source/_javascript_Core/dfg/DFGWorklist.cpp	2014-01-09 05:41:53 UTC (rev 161545)
+++ branches/jsCStack/Source/_javascript_Core/dfg/DFGWorklist.cpp	2014-01-09 06:15:23 UTC (rev 161546)
@@ -266,14 +266,7 @@
 
 static void initializeGlobalWorklistOnce()
 {
-    unsigned numberOfThreads;
-    
-    if (Options::useExperimentalFTL())
-        numberOfThreads = 1; // We don't yet use LLVM in a thread-safe way.
-    else
-        numberOfThreads = Options::numberOfCompilerThreads();
-    
-    theGlobalWorklist = Worklist::create(numberOfThreads).leakRef();
+    theGlobalWorklist = Worklist::create(Options::numberOfCompilerThreads()).leakRef();
 }
 
 Worklist* globalWorklist()

Modified: branches/jsCStack/Source/_javascript_Core/llvm/library/LLVMExports.cpp (161545 => 161546)


--- branches/jsCStack/Source/_javascript_Core/llvm/library/LLVMExports.cpp	2014-01-09 05:41:53 UTC (rev 161545)
+++ branches/jsCStack/Source/_javascript_Core/llvm/library/LLVMExports.cpp	2014-01-09 06:15:23 UTC (rev 161546)
@@ -42,6 +42,10 @@
     g_llvmTrapCallback = callback;
     
     LLVMInstallFatalErrorHandler(llvmCrash);
+
+    if (!LLVMStartMultithreaded())
+        callback("Could not start LLVM multithreading");
+    
     LLVMLinkInMCJIT();
     LLVMInitializeNativeTarget();
     LLVMInitializeX86AsmPrinter();
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to