Rolling out r180602, r180608, r180613, r180617, r180671.
authormark.lam@apple.com <mark.lam@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 26 Feb 2015 19:44:08 +0000 (19:44 +0000)
committermark.lam@apple.com <mark.lam@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 26 Feb 2015 19:44:08 +0000 (19:44 +0000)
<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/JavaScriptCore:

* 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:

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

LayoutTests/ChangeLog
LayoutTests/platform/efl/TestExpectations
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/heap/Heap.cpp
Source/JavaScriptCore/heap/Heap.h
Source/JavaScriptCore/heap/MachineStackMarker.cpp
Source/JavaScriptCore/heap/MachineStackMarker.h
Source/JavaScriptCore/runtime/JSLock.cpp
Source/WebCore/ChangeLog
Source/WebCore/bindings/js/JSDOMWindowBase.cpp

index 623657f..585a3c5 100644 (file)
@@ -1,3 +1,17 @@
+2015-02-26  Mark Lam  <mark.lam@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  <mmaxfield@apple.com>
 
         Parsing support for -webkit-trailing-word
index 0fe4634..e3cf1a1 100644 (file)
@@ -810,9 +810,9 @@ webkit.org/b/124925 fast/css/hover-display-block-none.html [ Failure Pass ]
 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-query-usage.html
 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 @@ webkit.org/b/141896 fast/borders/border-radius-on-html.html [ ImageOnlyFailure ]
 # 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 ]
index 3efe75b..3f7bac8 100644 (file)
@@ -1,3 +1,29 @@
+2015-02-26  Mark Lam  <mark.lam@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  <mmaxfield@apple.com>
 
         [Mac] [iOS] Parsing support for -apple-trailing-word
index 33fa5e5..4fcce70 100644 (file)
@@ -311,6 +311,7 @@ Heap::Heap(VM* vm, HeapType heapType)
     , 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 @@ Heap::~Heap()
 {
 }
 
-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 @@ void Heap::gatherStackRoots(ConservativeRoots& roots, void** dummy, MachineThrea
 {
     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)
index e3ef8a9..b2299f0 100644 (file)
@@ -119,7 +119,7 @@ public:
 
     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 @@ private:
     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;
index 0042293..2f1571e 100644 (file)
@@ -115,16 +115,27 @@ public:
     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 @@ static inline bool equalThread(const PlatformThread& first, const PlatformThread
 #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);
index f12cb8d..ae8a9e0 100644 (file)
@@ -33,19 +33,18 @@ namespace JSC {
     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 @@ namespace JSC {
         Mutex m_registeredThreadsMutex;
         Thread* m_registeredThreads;
         WTF::ThreadSpecificKey m_threadSpecific;
+#if !ASSERT_DISABLED
+        Heap* m_heap;
+#endif
     };
 
 } // namespace JSC
index 5f2ecab..568e746 100644 (file)
@@ -144,7 +144,7 @@ void JSLock::didAcquireLock()
     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()
index 8bcda73..39aa9de 100644 (file)
@@ -1,3 +1,18 @@
+2015-02-26  Mark Lam  <mark.lam@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  <mmaxfield@apple.com>
 
         [Mac] [iOS] Parsing support for -apple-trailing-word
index 037d919..bc02b15 100644 (file)
@@ -212,7 +212,7 @@ VM& JSDOMWindowBase::commonVM()
         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);
     }