Changeset 85253 in webkit
- Timestamp:
- Apr 28, 2011 4:04:45 PM (13 years ago)
- Location:
- trunk/Source
- Files:
-
- 3 deleted
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r85249 r85253 1 2011-04-28 Sheriff Bot <webkit.review.bot@gmail.com> 2 3 Unreviewed, rolling out r85233 and r85235. 4 http://trac.webkit.org/changeset/85233 5 http://trac.webkit.org/changeset/85235 6 https://bugs.webkit.org/show_bug.cgi?id=59754 7 8 Causes issues with jsc. (Requested by dave_levin on #webkit). 9 10 * GNUmakefile.list.am: 11 * JavaScriptCore.gypi: 12 * JavaScriptCore.vcproj/WTF/WTF.vcproj: 13 * JavaScriptCore.xcodeproj/project.pbxproj: 14 * jit/ExecutableAllocator.h: 15 (JSC::ExecutablePool::ExecutablePool): 16 * parser/SourceProvider.h: 17 (JSC::SourceProvider::SourceProvider): 18 * runtime/RegExp.cpp: 19 (JSC::RegExp::RegExp): 20 * wtf/CMakeLists.txt: 21 * wtf/RefCounted.h: 22 (WTF::RefCountedBase::ref): 23 (WTF::RefCountedBase::hasOneRef): 24 (WTF::RefCountedBase::refCount): 25 (WTF::RefCountedBase::derefBase): 26 * wtf/SizeLimits.cpp: 27 * wtf/ThreadRestrictionVerifier.h: Removed. 28 * wtf/text/CString.h: 29 (WTF::CStringBuffer::CStringBuffer): 30 1 31 2011-04-28 Gavin Barraclough <barraclough@apple.com> 2 32 -
trunk/Source/JavaScriptCore/GNUmakefile.list.am
r85233 r85253 531 531 Source/JavaScriptCore/wtf/ThreadIdentifierDataPthreads.cpp \ 532 532 Source/JavaScriptCore/wtf/ThreadIdentifierDataPthreads.h \ 533 Source/JavaScriptCore/wtf/ThreadRestrictionVerifier.h \534 533 Source/JavaScriptCore/wtf/Threading.cpp \ 535 534 Source/JavaScriptCore/wtf/Threading.h \ -
trunk/Source/JavaScriptCore/JavaScriptCore.gypi
r85233 r85253 204 204 'wtf/ThreadSafeRefCounted.h', 205 205 'wtf/ThreadSpecific.h', 206 'wtf/ThreadRestrictionVerifier.h',207 206 'wtf/Threading.h', 208 207 'wtf/ThreadingPrimitives.h', -
trunk/Source/JavaScriptCore/JavaScriptCore.vcproj/WTF/WTF.vcproj
r85233 r85253 1002 1002 </File> 1003 1003 <File 1004 RelativePath="..\..\wtf\ThreadRestrictionVerifier.h"1005 >1006 </File>1007 <File1008 1004 RelativePath="..\..\wtf\ThreadSafeRefCounted.h" 1009 1005 > -
trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
r85249 r85253 45 45 0B330C270F38C62300692DE3 /* TypeTraits.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0B330C260F38C62300692DE3 /* TypeTraits.cpp */; }; 46 46 0B4D7E630F319AC800AD7E58 /* TypeTraits.h in Headers */ = {isa = PBXBuildFile; fileRef = 0B4D7E620F319AC800AD7E58 /* TypeTraits.h */; settings = {ATTRIBUTES = (Private, ); }; }; 47 0BAC94A01338728400CF135B /* ThreadRestrictionVerifier.h in Headers */ = {isa = PBXBuildFile; fileRef = 0BAC949E1338728400CF135B /* ThreadRestrictionVerifier.h */; settings = {ATTRIBUTES = (Private, ); }; };48 47 0BDFFAE00FC6192900D69EF4 /* CrossThreadRefCounted.h in Headers */ = {isa = PBXBuildFile; fileRef = 0BDFFAD40FC6171000D69EF4 /* CrossThreadRefCounted.h */; settings = {ATTRIBUTES = (Private, ); }; }; 49 48 0BDFFAE10FC6193100D69EF4 /* OwnFastMallocPtr.h in Headers */ = {isa = PBXBuildFile; fileRef = 0BDFFAD10FC616EC00D69EF4 /* OwnFastMallocPtr.h */; settings = {ATTRIBUTES = (Private, ); }; }; … … 709 708 0B330C260F38C62300692DE3 /* TypeTraits.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TypeTraits.cpp; sourceTree = "<group>"; }; 710 709 0B4D7E620F319AC800AD7E58 /* TypeTraits.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TypeTraits.h; sourceTree = "<group>"; }; 711 0BAC949E1338728400CF135B /* ThreadRestrictionVerifier.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ThreadRestrictionVerifier.h; sourceTree = "<group>"; };712 710 0BDFFAD10FC616EC00D69EF4 /* OwnFastMallocPtr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OwnFastMallocPtr.h; sourceTree = "<group>"; }; 713 711 0BDFFAD40FC6171000D69EF4 /* CrossThreadRefCounted.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CrossThreadRefCounted.h; sourceTree = "<group>"; }; … … 1631 1629 A1D764511354448B00C5C7C0 /* Alignment.h */, 1632 1630 A7C40C07130B057D00D002A1 /* BlockStack.h */, 1631 A7C40C08130B057D00D002A1 /* SentinelLinkedList.h */, 1632 A7C40C09130B057D00D002A1 /* SinglyLinkedList.h */, 1633 1633 5135FAD512D26856003C083B /* Decoder.h */, 1634 1634 5135FAD612D26856003C083B /* Encoder.h */, … … 1728 1728 76FB9F1012E851960051A2EB /* SHA1.cpp */, 1729 1729 76FB9F0E12E851860051A2EB /* SHA1.h */, 1730 A7C40C08130B057D00D002A1 /* SentinelLinkedList.h */,1731 A7C40C09130B057D00D002A1 /* SinglyLinkedList.h */,1732 1730 0BF28A2811A33DC300638F84 /* SizeLimits.cpp */, 1733 1731 86D87DA512BC4B14008E73A1 /* StackBounds.cpp */, … … 1751 1749 BC5F7BBD11823B590052C02C /* ThreadSafeRefCounted.h */, 1752 1750 E1B7C8BD0DA3A3360074B0DC /* ThreadSpecific.h */, 1753 0BAC949E1338728400CF135B /* ThreadRestrictionVerifier.h */,1754 1751 0B330C260F38C62300692DE3 /* TypeTraits.cpp */, 1755 1752 0B4D7E620F319AC800AD7E58 /* TypeTraits.h */, … … 2537 2534 BC18C4700E16F5CD00B34460 /* Threading.h in Headers */, 2538 2535 BC5F7BBF11823B590052C02C /* ThreadingPrimitives.h in Headers */, 2539 0BAC94A01338728400CF135B /* ThreadRestrictionVerifier.h in Headers */,2540 2536 BC5F7BC011823B590052C02C /* ThreadSafeRefCounted.h in Headers */, 2541 2537 BC18C4710E16F5CD00B34460 /* ThreadSpecific.h in Headers */, -
trunk/Source/JavaScriptCore/jit/ExecutableAllocator.h
r85233 r85253 351 351 CRASH(); // Failed to allocate 352 352 m_end = m_freePtr + allocSize; 353 deprecatedTurnOffVerifier();354 353 } 355 354 -
trunk/Source/JavaScriptCore/parser/SourceProvider.h
r85233 r85253 47 47 , m_cacheOwned(!cache) 48 48 { 49 deprecatedTurnOffVerifier();50 49 } 51 50 virtual ~SourceProvider() -
trunk/Source/JavaScriptCore/runtime/RegExp.cpp
r85233 r85253 86 86 { 87 87 m_state = compile(globalData); 88 deprecatedTurnOffVerifier();89 88 } 90 89 -
trunk/Source/JavaScriptCore/wtf/CMakeLists.txt
r85233 r85253 43 43 MessageQueue.h 44 44 NonCopyingSort.h 45 ThreadRestrictionVerifier.h46 45 Noncopyable.h 47 46 NotFound.h -
trunk/Source/JavaScriptCore/wtf/RefCounted.h
r85235 r85253 24 24 #include "Assertions.h" 25 25 #include "FastAllocBase.h" 26 #include "ThreadRestrictionVerifier.h"27 26 #include "Noncopyable.h" 28 #include "OwnPtr.h"29 #include "UnusedParam.h"30 27 31 28 namespace WTF { … … 38 35 void ref() 39 36 { 40 #ifndef NDEBUG41 // Start thread verification as soon as the ref count gets to 2. This42 // heuristic reflects the fact that items are often created on one thread43 // and then given to another thread to be used.44 // FIXME: Make this restriction tigher. Especially as we move to more45 // common methods for sharing items across threads like CrossThreadCopier.h46 // We should be able to add a "detachFromThread" method to make this explicit.47 if (m_refCount == 1)48 m_verifier.setShared(true);49 #endif50 // If this assert fires, it either indicates a thread safety issue or51 // that the verification needs to change. See ThreadRestrictionVerifier for52 // the different modes.53 ASSERT(m_verifier.isSafeToUse());54 37 ASSERT(!m_deletionHasBegun); 55 38 ASSERT(!m_adoptionIsRequired); … … 59 42 bool hasOneRef() const 60 43 { 61 ASSERT(m_verifier.isSafeToUse());62 44 ASSERT(!m_deletionHasBegun); 63 45 return m_refCount == 1; … … 66 48 int refCount() const 67 49 { 68 ASSERT(m_verifier.isSafeToUse());69 50 return m_refCount; 70 }71 72 void setMutexForVerifier(Mutex&);73 74 // Turns off verification. Use of this method is discouraged (instead extend75 // ThreadRestrictionVerifier to verify your case).76 // FIXME: remove this method.77 void deprecatedTurnOffVerifier()78 {79 #ifndef NDEBUG80 m_verifier.turnOffVerification();81 #endif82 51 } 83 52 … … 116 85 bool derefBase() 117 86 { 118 ASSERT(m_verifier.isSafeToUse());119 87 ASSERT(!m_deletionHasBegun); 120 88 ASSERT(!m_adoptionIsRequired); … … 129 97 130 98 --m_refCount; 131 #ifndef NDEBUG132 // Stop thread verification when the ref goes to 1 because it133 // is safe to be passed to another thread at this point.134 if (m_refCount == 1)135 m_verifier.setShared(false);136 #endif137 99 return false; 138 100 } … … 156 118 bool m_deletionHasBegun; 157 119 bool m_adoptionIsRequired; 158 ThreadRestrictionVerifier m_verifier;159 120 #endif 160 121 }; … … 204 165 }; 205 166 206 #ifdef NDEBUG207 inline void RefCountedBase::setMutexForVerifier(Mutex&) { }208 #else209 inline void RefCountedBase::setMutexForVerifier(Mutex& mutex)210 {211 m_verifier.setMutexMode(mutex);212 }213 #endif214 215 167 } // namespace WTF 216 168 -
trunk/Source/JavaScriptCore/wtf/SizeLimits.cpp
r85233 r85253 37 37 #include <wtf/RefCounted.h> 38 38 #include <wtf/RefPtr.h> 39 #include <wtf/ThreadRestrictionVerifier.h>40 39 #include <wtf/Vector.h> 41 40 … … 43 42 44 43 #ifndef NDEBUG 45 struct SameSizeAsRefCounted { 46 int a; 47 bool b; 48 bool c; 49 ThreadRestrictionVerifier d; 50 // The debug version may get bigger. 51 }; 44 struct StructWithIntAndTwoBools { int a; bool b; bool c; }; 45 static const size_t refCountedExtraDebugSize = sizeof(StructWithIntAndTwoBools) - sizeof(int); 52 46 #else 53 struct SameSizeAsRefCounted { 54 int a; 55 // Don't add anything here because this should stay small. 56 }; 47 static const size_t refCountedExtraDebugSize = 0; 57 48 #endif 58 49 59 50 COMPILE_ASSERT(sizeof(OwnPtr<int>) == sizeof(int*), OwnPtr_should_stay_small); 60 51 COMPILE_ASSERT(sizeof(PassRefPtr<RefCounted<int> >) == sizeof(int*), PassRefPtr_should_stay_small); 61 COMPILE_ASSERT(sizeof(RefCounted<int>) == sizeof( SameSizeAsRefCounted), RefCounted_should_stay_small);62 COMPILE_ASSERT(sizeof(RefCountedCustomAllocated<int>) == sizeof( SameSizeAsRefCounted), RefCountedCustomAllocated_should_stay_small);52 COMPILE_ASSERT(sizeof(RefCounted<int>) == sizeof(int) + refCountedExtraDebugSize, RefCounted_should_stay_small); 53 COMPILE_ASSERT(sizeof(RefCountedCustomAllocated<int>) == sizeof(int) + refCountedExtraDebugSize, RefCountedCustomAllocated_should_stay_small); 63 54 COMPILE_ASSERT(sizeof(RefPtr<RefCounted<int> >) == sizeof(int*), RefPtr_should_stay_small); 64 55 COMPILE_ASSERT(sizeof(Vector<int>) == 3 * sizeof(int*), Vector_should_stay_small); -
trunk/Source/JavaScriptCore/wtf/text/CString.h
r85233 r85253 42 42 43 43 static PassRefPtr<CStringBuffer> create(size_t length) { return adoptRef(new CStringBuffer(length)); } 44 CStringBuffer(size_t length) : m_vector(length) { deprecatedTurnOffVerifier();}44 CStringBuffer(size_t length) : m_vector(length) { } 45 45 char* mutableData() { return m_vector.data(); } 46 46 -
trunk/Source/JavaScriptGlue/ChangeLog
r85233 r85253 1 2011-04-28 Sheriff Bot <webkit.review.bot@gmail.com> 2 3 Unreviewed, rolling out r85233 and r85235. 4 http://trac.webkit.org/changeset/85233 5 http://trac.webkit.org/changeset/85235 6 https://bugs.webkit.org/show_bug.cgi?id=59754 7 8 Causes issues with jsc. (Requested by dave_levin on #webkit). 9 10 * ForwardingHeaders/wtf/ThreadRestrictionVerifier.h: Removed. 11 1 12 2011-04-04 David Levin <levin@chromium.org> 2 13 -
trunk/Source/WebCore/ChangeLog
r85244 r85253 1 2011-04-28 Sheriff Bot <webkit.review.bot@gmail.com> 2 3 Unreviewed, rolling out r85233 and r85235. 4 http://trac.webkit.org/changeset/85233 5 http://trac.webkit.org/changeset/85235 6 https://bugs.webkit.org/show_bug.cgi?id=59754 7 8 Causes issues with jsc. (Requested by dave_levin on #webkit). 9 10 * ForwardingHeaders/wtf/ThreadRestrictionVerifier.h: Removed. 11 * loader/icon/IconDatabase.cpp: 12 (WebCore::IconDatabase::defaultIcon): 13 (WebCore::IconDatabase::setIconDataForIconURL): 14 (WebCore::IconDatabase::getOrCreateIconRecord): 15 (WebCore::IconDatabase::readFromDatabase): 16 1 17 2011-04-28 Jay Civelli <jcivelli@chromium.org> 2 18 -
trunk/Source/WebCore/loader/icon/IconDatabase.cpp
r85233 r85253 388 388 if (!m_defaultIconRecord) { 389 389 m_defaultIconRecord = IconRecord::create("urlIcon"); 390 m_defaultIconRecord->setMutexForVerifier(m_urlAndIconLock);391 390 loadDefaultIconRecord(m_defaultIconRecord.get()); 392 391 } … … 519 518 520 519 RefPtr<SharedBuffer> data = dataOriginal ? dataOriginal->copy() : PassRefPtr<SharedBuffer>(0); 521 if (data)522 data->setMutexForVerifier(m_urlAndIconLock);523 520 String iconURL = iconURLOriginal.crossThreadString(); 524 521 … … 882 879 883 880 RefPtr<IconRecord> newIcon = IconRecord::create(iconURL); 884 newIcon->setMutexForVerifier(m_urlAndIconLock);885 881 m_iconURLToRecordMap.set(iconURL, newIcon.get()); 886 882 … … 1484 1480 didAnyWork = true; 1485 1481 RefPtr<SharedBuffer> imageData = getImageDataForIconURLFromSQLDatabase(icons[i]->iconURL()); 1486 imageData->setMutexForVerifier(m_urlAndIconLock);1487 1482 1488 1483 // Verify this icon still wants to be read from disk
Note: See TracChangeset
for help on using the changeset viewer.