Changeset 248529 in webkit


Ignore:
Timestamp:
Aug 12, 2019 9:06:02 AM (5 years ago)
Author:
Chris Dumez
Message:

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

Location:
trunk/Source
Files:
1 deleted
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r248525 r248529  
     12019-08-12  Chris Dumez  <cdumez@apple.com>
     2
     3        Unreviewed, rolling out r248525.
     4
     5        Revert new threading assertions while I work on fixing the
     6        issues they exposed
     7
     8        Reverted changeset:
     9
     10        "Add threading assertions to RefCounted"
     11        https://bugs.webkit.org/show_bug.cgi?id=200507
     12        https://trac.webkit.org/changeset/248525
     13
    1142019-08-11  Chris Dumez  <cdumez@apple.com>
    215
  • trunk/Source/JavaScriptCore/dfg/DFGPlan.cpp

    r248525 r248529  
    151151{
    152152    RELEASE_ASSERT(m_codeBlock->alternative()->jitCode());
    153     m_inlineCallFrames->disableThreadingChecks();
    154153}
    155154
  • trunk/Source/WTF/ChangeLog

    r248525 r248529  
     12019-08-12  Chris Dumez  <cdumez@apple.com>
     2
     3        Unreviewed, rolling out r248525.
     4
     5        Revert new threading assertions while I work on fixing the
     6        issues they exposed
     7
     8        Reverted changeset:
     9
     10        "Add threading assertions to RefCounted"
     11        https://bugs.webkit.org/show_bug.cgi?id=200507
     12        https://trac.webkit.org/changeset/248525
     13
    1142019-08-11  Chris Dumez  <cdumez@apple.com>
    215
  • trunk/Source/WTF/WTF.xcodeproj/project.pbxproj

    r248525 r248529  
    6262                3337DB9CE743410FAF076E17 /* StackTrace.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 313EDEC9778E49C9BEA91CFC /* StackTrace.cpp */; };
    6363                4427C5AA21F6D6C300A612A4 /* ASCIICType.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4427C5A921F6D6C300A612A4 /* ASCIICType.cpp */; };
    64                 46BEB6EB22FFE24900269867 /* RefCounted.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46BEB6E922FFDDD500269867 /* RefCounted.cpp */; };
    6564                50DE35F5215BB01500B979C7 /* ExternalStringImpl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50DE35F3215BB01500B979C7 /* ExternalStringImpl.cpp */; };
    6665                515F794E1CFC9F4A00CCED93 /* CrossThreadCopier.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 515F794B1CFC9F4A00CCED93 /* CrossThreadCopier.cpp */; };
     
    346345                4427C5A921F6D6C300A612A4 /* ASCIICType.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ASCIICType.cpp; sourceTree = "<group>"; };
    347346                46BA9EAB1F4CD61E009A2BBC /* CompletionHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CompletionHandler.h; sourceTree = "<group>"; };
    348                 46BEB6E922FFDDD500269867 /* RefCounted.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = RefCounted.cpp; sourceTree = "<group>"; };
    349347                50DE35F3215BB01500B979C7 /* ExternalStringImpl.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ExternalStringImpl.cpp; sourceTree = "<group>"; };
    350348                50DE35F4215BB01500B979C7 /* ExternalStringImpl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ExternalStringImpl.h; sourceTree = "<group>"; };
     
    11101108                                A8A472FE151A825B004123FF /* RedBlackTree.h */,
    11111109                                26299B6D17A9E5B800ADEBE5 /* Ref.h */,
    1112                                 46BEB6E922FFDDD500269867 /* RefCounted.cpp */,
    11131110                                A8A472FF151A825B004123FF /* RefCounted.h */,
    11141111                                A8A47300151A825B004123FF /* RefCountedArray.h */,
     
    16041601                                A8A47414151A825B004123FF /* RandomNumber.cpp in Sources */,
    16051602                                0FEC3C5E1F368A9700F59B6C /* ReadWriteLock.cpp in Sources */,
    1606                                 46BEB6EB22FFE24900269867 /* RefCounted.cpp in Sources */,
    16071603                                A8A4741A151A825B004123FF /* RefCountedLeakCounter.cpp in Sources */,
    16081604                                E392FA2722E92BFF00ECDC73 /* ResourceUsageCocoa.cpp in Sources */,
  • trunk/Source/WTF/wtf/CMakeLists.txt

    r248525 r248529  
    394394    RandomNumber.cpp
    395395    ReadWriteLock.cpp
    396     RefCounted.cpp
    397396    RefCountedLeakCounter.cpp
    398397    RunLoop.cpp
  • trunk/Source/WTF/wtf/RefCounted.h

    r248525 r248529  
    2323#include <wtf/Assertions.h>
    2424#include <wtf/FastMalloc.h>
    25 #include <wtf/MainThread.h>
    2625#include <wtf/Noncopyable.h>
    2726
     
    4140    void ref() const
    4241    {
    43 #if !ASSERT_DISABLED
    44         if (m_isOwnedByMainThread != isMainThread() && hasOneRef())
    45             m_isOwnedByMainThread = isMainThread(); // Likely ownership transfer.
    46 
    47         // If you hit this assertion, it means that the RefCounted object was ref'd or deref'd
    48         // concurrent from several threads, which is not safe. You should either subclass
    49         // ThreadSafeRefCounted instead, or make sure to always ref / deref from the same thread.
    50         ASSERT_WITH_MESSAGE(!areThreadingCheckedEnabled() || m_isOwnedByMainThread == isMainThread(), "Should not be ref'd / deref'd concurrently from several threads");
    51 #endif
    52 
    5342#if CHECK_REF_COUNTED_LIFECYCLE
    5443        ASSERT_WITH_SECURITY_IMPLICATION(!m_deletionHasBegun);
     
    8069    }
    8170
    82     // Please only call this method if you really know that what you're doing is safe (e.g.
    83     // locking at call sites).
    84     void disableThreadingChecks()
    85     {
    86 #if !ASSERT_DISABLED
    87         m_areThreadingChecksEnabled = false;
    88 #endif
    89     }
    90 
    91     static void enableThreadingChecksGlobally()
    92     {
    93 #if !ASSERT_DISABLED
    94         areThreadingChecksEnabledGlobally = true;
    95 #endif
    96     }
    97 
    9871protected:
    9972    RefCountedBase()
    10073        : m_refCount(1)
    101 #if !ASSERT_DISABLED
    102         , m_isOwnedByMainThread(isMainThread())
    103 #endif
    10474#if CHECK_REF_COUNTED_LIFECYCLE
    10575        , m_deletionHasBegun(false)
     
    10878    {
    10979    }
    110 
    111 #if !ASSERT_DISABLED
    112     bool areThreadingCheckedEnabled() const
    113     {
    114         return areThreadingChecksEnabledGlobally && m_areThreadingChecksEnabled;
    115     }
    116 #endif
    11780
    11881    ~RefCountedBase()
     
    12790    bool derefBase() const
    12891    {
    129 #if !ASSERT_DISABLED
    130         if (m_isOwnedByMainThread != isMainThread() && hasOneRef())
    131             m_isOwnedByMainThread = isMainThread(); // Likely ownership transfer.
    132 
    133         // If you hit this assertion, it means that the RefCounted object was ref'd or deref'd
    134         // concurrent from several threads, which is not safe. You should either subclass
    135         // ThreadSafeRefCounted instead, or make sure to always ref / deref from the same thread.
    136         ASSERT_WITH_MESSAGE(!areThreadingCheckedEnabled() || m_isOwnedByMainThread == isMainThread(), "Should not be ref'd / deref'd concurrently from several threads");
    137 #endif
    138 
    13992#if CHECK_REF_COUNTED_LIFECYCLE
    14093        ASSERT_WITH_SECURITY_IMPLICATION(!m_deletionHasBegun);
     
    168121
    169122    mutable unsigned m_refCount;
    170 #if !ASSERT_DISABLED
    171     mutable bool m_isOwnedByMainThread;
    172     bool m_areThreadingChecksEnabled { true };
    173     WTF_EXPORT_PRIVATE static bool areThreadingChecksEnabledGlobally;
    174 #endif
    175123#if CHECK_REF_COUNTED_LIFECYCLE
    176124    mutable bool m_deletionHasBegun;
  • trunk/Source/WTF/wtf/SizeLimits.cpp

    r248525 r248529  
    4646    bool b;
    4747    bool c;
    48     bool d;
    49     bool e;
    5048    // The debug version may get bigger.
    5149};
  • trunk/Source/WebKit/ChangeLog

    r248526 r248529  
     12019-08-12  Chris Dumez  <cdumez@apple.com>
     2
     3        Unreviewed, rolling out r248525.
     4
     5        Revert new threading assertions while I work on fixing the
     6        issues they exposed
     7
     8        Reverted changeset:
     9
     10        "Add threading assertions to RefCounted"
     11        https://bugs.webkit.org/show_bug.cgi?id=200507
     12        https://trac.webkit.org/changeset/248525
     13
    1142019-08-12  Youenn Fablet  <youenn@apple.com>
    215
  • trunk/Source/WebKit/Shared/AuxiliaryProcess.cpp

    r248525 r248529  
    6161void AuxiliaryProcess::initialize(const AuxiliaryProcessInitializationParameters& parameters)
    6262{
    63     WTF::RefCountedBase::enableThreadingChecksGlobally();
    64 
    6563    RELEASE_ASSERT_WITH_MESSAGE(parameters.processIdentifier, "Unable to initialize child process without a WebCore process identifier");
    6664    Process::setIdentifier(*parameters.processIdentifier);
  • trunk/Source/WebKit/Shared/Cocoa/WebKit2InitializeCocoa.mm

    r248525 r248529  
    3232#import <mutex>
    3333#import <wtf/MainThread.h>
    34 #import <wtf/RefCounted.h>
    3534#import <wtf/RunLoop.h>
    3635
     
    5150    JSC::initializeThreading();
    5251    RunLoop::initializeMainRunLoop();
    53 
    54     WTF::RefCountedBase::enableThreadingChecksGlobally();
    5552
    5653#if !LOG_DISABLED || !RELEASE_LOG_DISABLED
  • trunk/Source/WebKit/Shared/WebKit2Initialize.cpp

    r248525 r248529  
    3131#include <WebCore/LogInitialization.h>
    3232#include <wtf/MainThread.h>
    33 #include <wtf/RefCounted.h>
    3433#include <wtf/RunLoop.h>
    3534
     
    4342    RunLoop::initializeMainRunLoop();
    4443
    45     WTF::RefCountedBase::enableThreadingChecksGlobally();
    46 
    4744#if !LOG_DISABLED || !RELEASE_LOG_DISABLED
    4845    WebCore::initializeLogChannelsIfNecessary();
  • trunk/Source/WebKitLegacy/mac/ChangeLog

    r248526 r248529  
     12019-08-12  Chris Dumez  <cdumez@apple.com>
     2
     3        Unreviewed, rolling out r248525.
     4
     5        Revert new threading assertions while I work on fixing the
     6        issues they exposed
     7
     8        Reverted changeset:
     9
     10        "Add threading assertions to RefCounted"
     11        https://bugs.webkit.org/show_bug.cgi?id=200507
     12        https://trac.webkit.org/changeset/248525
     13
    1142019-08-12  Youenn Fablet  <youenn@apple.com>
    215
  • trunk/Source/WebKitLegacy/mac/WebView/WebView.mm

    r248525 r248529  
    54175417#endif
    54185418
    5419     WTF::RefCountedBase::enableThreadingChecksGlobally();
    5420 
    54215419    WTF::setProcessPrivileges(allPrivileges());
    54225420    WebCore::NetworkStorageSession::permitProcessToUseCookieAPI(true);
Note: See TracChangeset for help on using the changeset viewer.