Unreviewed, rolling out r248525.
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 12 Aug 2019 16:06:02 +0000 (16:06 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 12 Aug 2019 16:06:02 +0000 (16:06 +0000)
Revert new threading assertions while I work on fixing the
issues they exposed

Reverted changeset:

"Add threading assertions to RefCounted"
https://bugs.webkit.org/show_bug.cgi?id=200507
https://trac.webkit.org/changeset/248525

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

14 files changed:
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/dfg/DFGPlan.cpp
Source/WTF/ChangeLog
Source/WTF/WTF.xcodeproj/project.pbxproj
Source/WTF/wtf/CMakeLists.txt
Source/WTF/wtf/RefCounted.cpp [deleted file]
Source/WTF/wtf/RefCounted.h
Source/WTF/wtf/SizeLimits.cpp
Source/WebKit/ChangeLog
Source/WebKit/Shared/AuxiliaryProcess.cpp
Source/WebKit/Shared/Cocoa/WebKit2InitializeCocoa.mm
Source/WebKit/Shared/WebKit2Initialize.cpp
Source/WebKitLegacy/mac/ChangeLog
Source/WebKitLegacy/mac/WebView/WebView.mm

index 76161a2..4d737fb 100644 (file)
@@ -1,3 +1,16 @@
+2019-08-12  Chris Dumez  <cdumez@apple.com>
+
+        Unreviewed, rolling out r248525.
+
+        Revert new threading assertions while I work on fixing the
+        issues they exposed
+
+        Reverted changeset:
+
+        "Add threading assertions to RefCounted"
+        https://bugs.webkit.org/show_bug.cgi?id=200507
+        https://trac.webkit.org/changeset/248525
+
 2019-08-11  Chris Dumez  <cdumez@apple.com>
 
         Add threading assertions to RefCounted
index 4dbcee8..e413ea4 100644 (file)
@@ -150,7 +150,6 @@ Plan::Plan(CodeBlock* passedCodeBlock, CodeBlock* profiledDFGCodeBlock,
     , m_stage(Preparing)
 {
     RELEASE_ASSERT(m_codeBlock->alternative()->jitCode());
-    m_inlineCallFrames->disableThreadingChecks();
 }
 
 Plan::~Plan()
index 857752c..6ecdd23 100644 (file)
@@ -1,3 +1,16 @@
+2019-08-12  Chris Dumez  <cdumez@apple.com>
+
+        Unreviewed, rolling out r248525.
+
+        Revert new threading assertions while I work on fixing the
+        issues they exposed
+
+        Reverted changeset:
+
+        "Add threading assertions to RefCounted"
+        https://bugs.webkit.org/show_bug.cgi?id=200507
+        https://trac.webkit.org/changeset/248525
+
 2019-08-11  Chris Dumez  <cdumez@apple.com>
 
         Add threading assertions to RefCounted
index b973150..9ef5683 100644 (file)
@@ -61,7 +61,6 @@
                2CDED0F318115C85004DBA70 /* RunLoop.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2CDED0F118115C85004DBA70 /* RunLoop.cpp */; };
                3337DB9CE743410FAF076E17 /* StackTrace.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 313EDEC9778E49C9BEA91CFC /* StackTrace.cpp */; };
                4427C5AA21F6D6C300A612A4 /* ASCIICType.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4427C5A921F6D6C300A612A4 /* ASCIICType.cpp */; };
-               46BEB6EB22FFE24900269867 /* RefCounted.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46BEB6E922FFDDD500269867 /* RefCounted.cpp */; };
                50DE35F5215BB01500B979C7 /* ExternalStringImpl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50DE35F3215BB01500B979C7 /* ExternalStringImpl.cpp */; };
                515F794E1CFC9F4A00CCED93 /* CrossThreadCopier.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 515F794B1CFC9F4A00CCED93 /* CrossThreadCopier.cpp */; };
                517F82D71FD22F3000DA3DEA /* CrossThreadTaskHandler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 517F82D51FD22F2F00DA3DEA /* CrossThreadTaskHandler.cpp */; };
                430B47871AAAAC1A001223DA /* StringCommon.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StringCommon.h; sourceTree = "<group>"; };
                4427C5A921F6D6C300A612A4 /* ASCIICType.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ASCIICType.cpp; sourceTree = "<group>"; };
                46BA9EAB1F4CD61E009A2BBC /* CompletionHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CompletionHandler.h; sourceTree = "<group>"; };
-               46BEB6E922FFDDD500269867 /* RefCounted.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = RefCounted.cpp; sourceTree = "<group>"; };
                50DE35F3215BB01500B979C7 /* ExternalStringImpl.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ExternalStringImpl.cpp; sourceTree = "<group>"; };
                50DE35F4215BB01500B979C7 /* ExternalStringImpl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ExternalStringImpl.h; sourceTree = "<group>"; };
                513E170A1CD7D5BF00E3650B /* LoggingAccumulator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LoggingAccumulator.h; sourceTree = "<group>"; };
                                0FDE87F61DFD07CC0064C390 /* RecursiveLockAdapter.h */,
                                A8A472FE151A825B004123FF /* RedBlackTree.h */,
                                26299B6D17A9E5B800ADEBE5 /* Ref.h */,
-                               46BEB6E922FFDDD500269867 /* RefCounted.cpp */,
                                A8A472FF151A825B004123FF /* RefCounted.h */,
                                A8A47300151A825B004123FF /* RefCountedArray.h */,
                                A8A47301151A825B004123FF /* RefCountedLeakCounter.cpp */,
                                A3B725EC987446AD93F1A440 /* RandomDevice.cpp in Sources */,
                                A8A47414151A825B004123FF /* RandomNumber.cpp in Sources */,
                                0FEC3C5E1F368A9700F59B6C /* ReadWriteLock.cpp in Sources */,
-                               46BEB6EB22FFE24900269867 /* RefCounted.cpp in Sources */,
                                A8A4741A151A825B004123FF /* RefCountedLeakCounter.cpp in Sources */,
                                E392FA2722E92BFF00ECDC73 /* ResourceUsageCocoa.cpp in Sources */,
                                2CDED0F318115C85004DBA70 /* RunLoop.cpp in Sources */,
index a16baa7..a32e7e2 100644 (file)
@@ -393,7 +393,6 @@ set(WTF_SOURCES
     RandomDevice.cpp
     RandomNumber.cpp
     ReadWriteLock.cpp
-    RefCounted.cpp
     RefCountedLeakCounter.cpp
     RunLoop.cpp
     SHA1.cpp
diff --git a/Source/WTF/wtf/RefCounted.cpp b/Source/WTF/wtf/RefCounted.cpp
deleted file mode 100644 (file)
index 94ee959..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Copyright (C) 2019 Apple Inc. All rights reserved.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB.  If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- *
- */
-
-#include "config.h"
-#include <wtf/RefCounted.h>
-
-namespace WTF {
-
-#if !ASSERT_DISABLED
-bool RefCountedBase::areThreadingChecksEnabledGlobally { false };
-#endif
-
-}
index cbb8d8b..ea9782a 100644 (file)
@@ -22,7 +22,6 @@
 
 #include <wtf/Assertions.h>
 #include <wtf/FastMalloc.h>
-#include <wtf/MainThread.h>
 #include <wtf/Noncopyable.h>
 
 namespace WTF {
@@ -40,16 +39,6 @@ class RefCountedBase {
 public:
     void ref() const
     {
-#if !ASSERT_DISABLED
-        if (m_isOwnedByMainThread != isMainThread() && hasOneRef())
-            m_isOwnedByMainThread = isMainThread(); // Likely ownership transfer.
-
-        // If you hit this assertion, it means that the RefCounted object was ref'd or deref'd
-        // concurrent from several threads, which is not safe. You should either subclass
-        // ThreadSafeRefCounted instead, or make sure to always ref / deref from the same thread.
-        ASSERT_WITH_MESSAGE(!areThreadingCheckedEnabled() || m_isOwnedByMainThread == isMainThread(), "Should not be ref'd / deref'd concurrently from several threads");
-#endif
-
 #if CHECK_REF_COUNTED_LIFECYCLE
         ASSERT_WITH_SECURITY_IMPLICATION(!m_deletionHasBegun);
         ASSERT(!m_adoptionIsRequired);
@@ -79,28 +68,9 @@ public:
 #endif
     }
 
-    // Please only call this method if you really know that what you're doing is safe (e.g.
-    // locking at call sites).
-    void disableThreadingChecks()
-    {
-#if !ASSERT_DISABLED
-        m_areThreadingChecksEnabled = false;
-#endif
-    }
-
-    static void enableThreadingChecksGlobally()
-    {
-#if !ASSERT_DISABLED
-        areThreadingChecksEnabledGlobally = true;
-#endif
-    }
-
 protected:
     RefCountedBase()
         : m_refCount(1)
-#if !ASSERT_DISABLED
-        , m_isOwnedByMainThread(isMainThread())
-#endif
 #if CHECK_REF_COUNTED_LIFECYCLE
         , m_deletionHasBegun(false)
         , m_adoptionIsRequired(true)
@@ -108,13 +78,6 @@ protected:
     {
     }
 
-#if !ASSERT_DISABLED
-    bool areThreadingCheckedEnabled() const
-    {
-        return areThreadingChecksEnabledGlobally && m_areThreadingChecksEnabled;
-    }
-#endif
-
     ~RefCountedBase()
     {
 #if CHECK_REF_COUNTED_LIFECYCLE
@@ -126,16 +89,6 @@ protected:
     // Returns whether the pointer should be freed or not.
     bool derefBase() const
     {
-#if !ASSERT_DISABLED
-        if (m_isOwnedByMainThread != isMainThread() && hasOneRef())
-            m_isOwnedByMainThread = isMainThread(); // Likely ownership transfer.
-
-        // If you hit this assertion, it means that the RefCounted object was ref'd or deref'd
-        // concurrent from several threads, which is not safe. You should either subclass
-        // ThreadSafeRefCounted instead, or make sure to always ref / deref from the same thread.
-        ASSERT_WITH_MESSAGE(!areThreadingCheckedEnabled() || m_isOwnedByMainThread == isMainThread(), "Should not be ref'd / deref'd concurrently from several threads");
-#endif
-
 #if CHECK_REF_COUNTED_LIFECYCLE
         ASSERT_WITH_SECURITY_IMPLICATION(!m_deletionHasBegun);
         ASSERT(!m_adoptionIsRequired);
@@ -167,11 +120,6 @@ private:
 #endif
 
     mutable unsigned m_refCount;
-#if !ASSERT_DISABLED
-    mutable bool m_isOwnedByMainThread;
-    bool m_areThreadingChecksEnabled { true };
-    WTF_EXPORT_PRIVATE static bool areThreadingChecksEnabledGlobally;
-#endif
 #if CHECK_REF_COUNTED_LIFECYCLE
     mutable bool m_deletionHasBegun;
     mutable bool m_adoptionIsRequired;
index 67fa62e..b0ad140 100644 (file)
@@ -45,8 +45,6 @@ struct SameSizeAsRefCounted {
     int a;
     bool b;
     bool c;
-    bool d;
-    bool e;
     // The debug version may get bigger.
 };
 #else
index f54c910..efc068a 100644 (file)
@@ -1,3 +1,16 @@
+2019-08-12  Chris Dumez  <cdumez@apple.com>
+
+        Unreviewed, rolling out r248525.
+
+        Revert new threading assertions while I work on fixing the
+        issues they exposed
+
+        Reverted changeset:
+
+        "Add threading assertions to RefCounted"
+        https://bugs.webkit.org/show_bug.cgi?id=200507
+        https://trac.webkit.org/changeset/248525
+
 2019-08-12  Youenn Fablet  <youenn@apple.com>
 
         Remove IDB-specific quota
index 61272e2..067f708 100644 (file)
@@ -60,8 +60,6 @@ void AuxiliaryProcess::didClose(IPC::Connection&)
 
 void AuxiliaryProcess::initialize(const AuxiliaryProcessInitializationParameters& parameters)
 {
-    WTF::RefCountedBase::enableThreadingChecksGlobally();
-
     RELEASE_ASSERT_WITH_MESSAGE(parameters.processIdentifier, "Unable to initialize child process without a WebCore process identifier");
     Process::setIdentifier(*parameters.processIdentifier);
 
index 1384103..f19ea28 100644 (file)
@@ -31,7 +31,6 @@
 #import <WebCore/LogInitialization.h>
 #import <mutex>
 #import <wtf/MainThread.h>
-#import <wtf/RefCounted.h>
 #import <wtf/RunLoop.h>
 
 #if PLATFORM(IOS_FAMILY)
@@ -51,8 +50,6 @@ static void runInitializationCode(void* = nullptr)
     JSC::initializeThreading();
     RunLoop::initializeMainRunLoop();
 
-    WTF::RefCountedBase::enableThreadingChecksGlobally();
-
 #if !LOG_DISABLED || !RELEASE_LOG_DISABLED
     WebCore::initializeLogChannelsIfNecessary();
     WebKit::initializeLogChannelsIfNecessary();
index 083730d..c855b1f 100644 (file)
@@ -30,7 +30,6 @@
 #include <JavaScriptCore/InitializeThreading.h>
 #include <WebCore/LogInitialization.h>
 #include <wtf/MainThread.h>
-#include <wtf/RefCounted.h>
 #include <wtf/RunLoop.h>
 
 namespace WebKit {
@@ -42,8 +41,6 @@ void InitializeWebKit2()
     JSC::initializeThreading();
     RunLoop::initializeMainRunLoop();
 
-    WTF::RefCountedBase::enableThreadingChecksGlobally();
-
 #if !LOG_DISABLED || !RELEASE_LOG_DISABLED
     WebCore::initializeLogChannelsIfNecessary();
     WebKit::initializeLogChannelsIfNecessary();
index 7f0ef50..3764dce 100644 (file)
@@ -1,3 +1,16 @@
+2019-08-12  Chris Dumez  <cdumez@apple.com>
+
+        Unreviewed, rolling out r248525.
+
+        Revert new threading assertions while I work on fixing the
+        issues they exposed
+
+        Reverted changeset:
+
+        "Add threading assertions to RefCounted"
+        https://bugs.webkit.org/show_bug.cgi?id=200507
+        https://trac.webkit.org/changeset/248525
+
 2019-08-12  Youenn Fablet  <youenn@apple.com>
 
         Remove IDB-specific quota
index bccc64b..54bcd10 100644 (file)
@@ -5416,8 +5416,6 @@ static Vector<String> toStringVector(NSArray* patterns)
     RunLoop::initializeMainRunLoop();
 #endif
 
-    WTF::RefCountedBase::enableThreadingChecksGlobally();
-
     WTF::setProcessPrivileges(allPrivileges());
     WebCore::NetworkStorageSession::permitProcessToUseCookieAPI(true);