Title: [180690] trunk
Revision
180690
Author
mark....@apple.com
Date
2015-02-26 11:44:08 -0800 (Thu, 26 Feb 2015)

Log Message

Rolling out r180602, r180608, r180613, r180617, r180671.
<https://webkit.org/b/141990>

Not reviewed.

The r180602 solution does result in more work for GC when worker
threads are in use.  Filip is uncomfortable with that.
The EFL and GTK ports also seem to be unhappy with this change.
Rolling out while we investigate.

Source/_javascript_Core:

* heap/Heap.cpp:
(JSC::Heap::Heap):
(JSC::Heap::gatherStackRoots):
(JSC::Heap::machineThreads): Deleted.
* heap/Heap.h:
(JSC::Heap::machineThreads):
* heap/MachineStackMarker.cpp:
(JSC::MachineThreads::MachineThreads):
(JSC::MachineThreads::~MachineThreads):
(JSC::MachineThreads::addCurrentThread):
* heap/MachineStackMarker.h:
* runtime/JSLock.cpp:
(JSC::JSLock::didAcquireLock):

Source/WebCore:

* bindings/js/JSDOMWindowBase.cpp:
(WebCore::JSDOMWindowBase::commonVM):

LayoutTests:

* platform/efl/TestExpectations:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (180689 => 180690)


--- trunk/LayoutTests/ChangeLog	2015-02-26 19:39:11 UTC (rev 180689)
+++ trunk/LayoutTests/ChangeLog	2015-02-26 19:44:08 UTC (rev 180690)
@@ -1,3 +1,17 @@
+2015-02-26  Mark Lam  <mark....@apple.com>
+
+        Rolling out r180602, r180608, r180613, r180617, r180671.
+        <https://webkit.org/b/141990>
+
+        Not reviewed.
+
+        The r180602 solution does result in more work for GC when worker
+        threads are in use.  Filip is uncomfortable with that.
+        The EFL and GTK ports also seem to be unhappy with this change.
+        Rolling out while we investigate.
+
+        * platform/efl/TestExpectations:
+
 2015-02-26  Myles C. Maxfield  <mmaxfi...@apple.com>
 
         Parsing support for -webkit-trailing-word

Modified: trunk/LayoutTests/platform/efl/TestExpectations (180689 => 180690)


--- trunk/LayoutTests/platform/efl/TestExpectations	2015-02-26 19:39:11 UTC (rev 180689)
+++ trunk/LayoutTests/platform/efl/TestExpectations	2015-02-26 19:44:08 UTC (rev 180690)
@@ -810,9 +810,9 @@
 webkit.org/b/124926 fast/events/popup-allowed-from-gesture-initiated-event.html [ Failure Pass ]
 
 # Fail after r139145 on MAC, EFL, QT, GTK.
-# webkit.org/b/106415 fast/workers/worker-close-more.html [ Timeout ]
-# webkit.org/b/106415 fast/workers/worker-document-leak.html [ Pass Failure ]
-# webkit.org/b/106415 fast/workers/worker-lifecycle.html [ Pass Failure ]
+webkit.org/b/106415 fast/workers/worker-close-more.html [ Timeout ]
+webkit.org/b/106415 fast/workers/worker-document-leak.html [ Pass Failure ]
+webkit.org/b/106415 fast/workers/worker-lifecycle.html [ Pass Failure ]
 
 webkit.org/b/124929 http/tests/w3c/webperf/approved/navigation-timing/html/test_timing_attributes_order.html [ Failure Pass ]
 
@@ -981,7 +981,7 @@
 webkit.org/b/106507 storage/storageinfo-request-quota.html
 webkit.org/b/106507 storage/storagequota-query-usage.html
 webkit.org/b/106507 storage/storagequota-request-quota.html
-# webkit.org/b/106507 fast/workers/worker-storagequota-query-usage.html
+webkit.org/b/106507 fast/workers/worker-storagequota-query-usage.html
 
 # JSC does not support setIsolatedWorldSecurityOrigin.
 webkit.org/b/61540 http/tests/security/isolatedWorld/cross-origin-xhr.html [ Timeout ]
@@ -2096,6 +2096,3 @@
 # Need to investigate why these security tests have been failed since r144338.
 webkit.org/b/141958 http/tests/security/XFrameOptions/x-frame-options-deny-multiple-clients.html [ Failure ]
 webkit.org/b/141958 http/tests/security/cross-frame-access-callback-explicit-domain-ALLOW.html [ Failure ]
-
-# [EFL][GTK] REGRESSION(180602): It made fast/workers test timeout
-webkit.org/b/142041 fast/workers [ Skip ]

Modified: trunk/Source/_javascript_Core/ChangeLog (180689 => 180690)


--- trunk/Source/_javascript_Core/ChangeLog	2015-02-26 19:39:11 UTC (rev 180689)
+++ trunk/Source/_javascript_Core/ChangeLog	2015-02-26 19:44:08 UTC (rev 180690)
@@ -1,3 +1,29 @@
+2015-02-26  Mark Lam  <mark....@apple.com>
+
+        Rolling out r180602, r180608, r180613, r180617, r180671.
+        <https://webkit.org/b/141990>
+
+        Not reviewed.
+
+        The r180602 solution does result in more work for GC when worker
+        threads are in use.  Filip is uncomfortable with that.
+        The EFL and GTK ports also seem to be unhappy with this change.
+        Rolling out while we investigate.
+
+        * heap/Heap.cpp:
+        (JSC::Heap::Heap):
+        (JSC::Heap::gatherStackRoots):
+        (JSC::Heap::machineThreads): Deleted.
+        * heap/Heap.h:
+        (JSC::Heap::machineThreads):
+        * heap/MachineStackMarker.cpp:
+        (JSC::MachineThreads::MachineThreads):
+        (JSC::MachineThreads::~MachineThreads):
+        (JSC::MachineThreads::addCurrentThread):
+        * heap/MachineStackMarker.h:
+        * runtime/JSLock.cpp:
+        (JSC::JSLock::didAcquireLock):
+
 2015-02-26  Myles C. Maxfield  <mmaxfi...@apple.com>
 
         [Mac] [iOS] Parsing support for -apple-trailing-word

Modified: trunk/Source/_javascript_Core/heap/Heap.cpp (180689 => 180690)


--- trunk/Source/_javascript_Core/heap/Heap.cpp	2015-02-26 19:39:11 UTC (rev 180689)
+++ trunk/Source/_javascript_Core/heap/Heap.cpp	2015-02-26 19:44:08 UTC (rev 180690)
@@ -311,6 +311,7 @@
     , m_objectSpace(this)
     , m_storageSpace(this)
     , m_extraMemoryUsage(0)
+    , m_machineThreads(this)
     , m_sharedData(vm)
     , m_slotVisitor(m_sharedData)
     , m_copyVisitor(m_sharedData)
@@ -348,18 +349,6 @@
 {
 }
 
-MachineThreads& Heap::machineThreads()
-{
-    static std::once_flag initializeMachineThreadsOnceFlag;
-    static MachineThreads* machineThreads = nullptr;
-
-    std::call_once(initializeMachineThreadsOnceFlag, [] {
-        machineThreads = new MachineThreads();
-    });
-
-    return *machineThreads;
-}
-    
 bool Heap::isPagedOut(double deadline)
 {
     return m_objectSpace.isPagedOut(deadline) || m_storageSpace.isPagedOut(deadline);
@@ -598,7 +587,7 @@
 {
     GCPHASE(GatherStackRoots);
     m_jitStubRoutines.clearMarks();
-    machineThreads().gatherConservativeRoots(roots, m_jitStubRoutines, m_codeBlocks, dummy, registers);
+    m_machineThreads.gatherConservativeRoots(roots, m_jitStubRoutines, m_codeBlocks, dummy, registers);
 }
 
 void Heap::gatherJSStackRoots(ConservativeRoots& roots)

Modified: trunk/Source/_javascript_Core/heap/Heap.h (180689 => 180690)


--- trunk/Source/_javascript_Core/heap/Heap.h	2015-02-26 19:39:11 UTC (rev 180689)
+++ trunk/Source/_javascript_Core/heap/Heap.h	2015-02-26 19:44:08 UTC (rev 180690)
@@ -119,7 +119,7 @@
 
     VM* vm() const { return m_vm; }
     MarkedSpace& objectSpace() { return m_objectSpace; }
-    JS_EXPORT_PRIVATE static MachineThreads& machineThreads();
+    MachineThreads& machineThreads() { return m_machineThreads; }
 
     const SlotVisitor& slotVisitor() const { return m_slotVisitor; }
 
@@ -355,6 +355,8 @@
     Vector<Vector<ValueStringPair, 0, UnsafeVectorOverflow>*> m_tempSortingVectors;
     std::unique_ptr<HashSet<MarkedArgumentBuffer*>> m_markListSet;
 
+    MachineThreads m_machineThreads;
+    
     GCThreadSharedData m_sharedData;
     SlotVisitor m_slotVisitor;
     CopyVisitor m_copyVisitor;

Modified: trunk/Source/_javascript_Core/heap/MachineStackMarker.cpp (180689 => 180690)


--- trunk/Source/_javascript_Core/heap/MachineStackMarker.cpp	2015-02-26 19:39:11 UTC (rev 180689)
+++ trunk/Source/_javascript_Core/heap/MachineStackMarker.cpp	2015-02-26 19:44:08 UTC (rev 180690)
@@ -115,16 +115,27 @@
     void* stackBase;
 };
 
-MachineThreads::MachineThreads()
+MachineThreads::MachineThreads(Heap* heap)
     : m_registeredThreads(0)
     , m_threadSpecific(0)
+#if !ASSERT_DISABLED
+    , m_heap(heap)
+#endif
 {
+    UNUSED_PARAM(heap);
     threadSpecificKeyCreate(&m_threadSpecific, removeThread);
 }
 
-NO_RETURN_DUE_TO_CRASH MachineThreads::~MachineThreads()
+MachineThreads::~MachineThreads()
 {
-    RELEASE_ASSERT_NOT_REACHED();
+    threadSpecificKeyDelete(m_threadSpecific);
+
+    MutexLocker registeredThreadsLock(m_registeredThreadsMutex);
+    for (Thread* t = m_registeredThreads; t;) {
+        Thread* next = t->next;
+        delete t;
+        t = next;
+    }
 }
 
 static inline PlatformThread getCurrentPlatformThread()
@@ -149,9 +160,9 @@
 #endif
 }
 
-void MachineThreads::addCurrentThread(VM* vm)
+void MachineThreads::addCurrentThread()
 {
-    ASSERT_UNUSED(vm, !vm->hasExclusiveThread() || vm->exclusiveThread() == std::this_thread::get_id());
+    ASSERT(!m_heap->vm()->hasExclusiveThread() || m_heap->vm()->exclusiveThread() == std::this_thread::get_id());
 
     if (threadSpecificGet(m_threadSpecific)) {
         ASSERT(threadSpecificGet(m_threadSpecific) == this);

Modified: trunk/Source/_javascript_Core/heap/MachineStackMarker.h (180689 => 180690)


--- trunk/Source/_javascript_Core/heap/MachineStackMarker.h	2015-02-26 19:39:11 UTC (rev 180689)
+++ trunk/Source/_javascript_Core/heap/MachineStackMarker.h	2015-02-26 19:44:08 UTC (rev 180690)
@@ -33,19 +33,18 @@
     class ConservativeRoots;
     class Heap;
     class JITStubRoutineSet;
-    class VM;
 
     class MachineThreads {
         WTF_MAKE_NONCOPYABLE(MachineThreads);
     public:
         typedef jmp_buf RegisterState;
 
-        MachineThreads();
-        NO_RETURN_DUE_TO_CRASH ~MachineThreads();
+        MachineThreads(Heap*);
+        ~MachineThreads();
 
         void gatherConservativeRoots(ConservativeRoots&, JITStubRoutineSet&, CodeBlockSet&, void* stackCurrent, RegisterState& registers);
 
-        JS_EXPORT_PRIVATE void addCurrentThread(VM*); // Only needs to be called by clients that can use the same heap from multiple threads.
+        JS_EXPORT_PRIVATE void addCurrentThread(); // Only needs to be called by clients that can use the same heap from multiple threads.
 
     private:
         class Thread;
@@ -61,6 +60,9 @@
         Mutex m_registeredThreadsMutex;
         Thread* m_registeredThreads;
         WTF::ThreadSpecificKey m_threadSpecific;
+#if !ASSERT_DISABLED
+        Heap* m_heap;
+#endif
     };
 
 } // namespace JSC

Modified: trunk/Source/_javascript_Core/runtime/JSLock.cpp (180689 => 180690)


--- trunk/Source/_javascript_Core/runtime/JSLock.cpp	2015-02-26 19:39:11 UTC (rev 180689)
+++ trunk/Source/_javascript_Core/runtime/JSLock.cpp	2015-02-26 19:44:08 UTC (rev 180690)
@@ -144,7 +144,7 @@
     m_entryAtomicStringTable = threadData.setCurrentAtomicStringTable(m_vm->atomicStringTable());
     ASSERT(m_entryAtomicStringTable);
 
-    m_vm->heap.machineThreads().addCurrentThread(m_vm);
+    m_vm->heap.machineThreads().addCurrentThread();
 }
 
 void JSLock::unlock()

Modified: trunk/Source/WebCore/ChangeLog (180689 => 180690)


--- trunk/Source/WebCore/ChangeLog	2015-02-26 19:39:11 UTC (rev 180689)
+++ trunk/Source/WebCore/ChangeLog	2015-02-26 19:44:08 UTC (rev 180690)
@@ -1,3 +1,18 @@
+2015-02-26  Mark Lam  <mark....@apple.com>
+
+        Rolling out r180602, r180608, r180613, r180617, r180671.
+        <https://webkit.org/b/141990>
+
+        Not reviewed.
+
+        The r180602 solution does result in more work for GC when worker
+        threads are in use.  Filip is uncomfortable with that.
+        The EFL and GTK ports also seem to be unhappy with this change.
+        Rolling out while we investigate.
+
+        * bindings/js/JSDOMWindowBase.cpp:
+        (WebCore::JSDOMWindowBase::commonVM):
+
 2015-02-26  Myles C. Maxfield  <mmaxfi...@apple.com>
 
         [Mac] [iOS] Parsing support for -apple-trailing-word

Modified: trunk/Source/WebCore/bindings/js/JSDOMWindowBase.cpp (180689 => 180690)


--- trunk/Source/WebCore/bindings/js/JSDOMWindowBase.cpp	2015-02-26 19:39:11 UTC (rev 180689)
+++ trunk/Source/WebCore/bindings/js/JSDOMWindowBase.cpp	2015-02-26 19:44:08 UTC (rev 180690)
@@ -212,7 +212,7 @@
         vm->heap.setEdenActivityCallback(vm->heap.fullActivityCallback());
 #endif
         vm->heap.setIncrementalSweeper(std::make_unique<WebSafeIncrementalSweeper>(&vm->heap));
-        vm->heap.machineThreads().addCurrentThread(vm);
+        vm->heap.machineThreads().addCurrentThread();
 #endif
         initNormalWorldClientData(vm);
     }
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to