Changeset 35853 in webkit for trunk/JavaScriptCore/kjs/collector.cpp
- Timestamp:
- Aug 20, 2008, 12:23:06 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/kjs/collector.cpp
r35830 r35853 25 25 #include "ExecState.h" 26 26 #include "JSGlobalObject.h" 27 #include "JSLock.h" 27 28 #include "JSString.h" 28 29 #include "JSValue.h" … … 135 136 Heap::~Heap() 136 137 { 138 JSLock lock(false); 139 137 140 // The global object is not GC protected at this point, so sweeping may delete it (and thus the global data) 138 141 // before other objects that may use the global data. … … 274 277 275 278 CollectorHeap& heap = heapType == PrimaryHeap ? primaryHeap : numberHeap; 279 ASSERT(JSLock::lockCount() > 0); 280 ASSERT(JSLock::currentThreadIsHoldingLock()); 276 281 ASSERT(s <= HeapConstants<heapType>::cellSize); 277 282 UNUSED_PARAM(s); // s is now only used for the above assert … … 778 783 { 779 784 // Most clients do not need to call this, with the notable exception of WebCore. 780 // Clients that use context from a single context group from multiple threads are supposed785 // Clients that use shared heap have JSLock protection, while others are supposed 781 786 // to do explicit locking. WebCore violates this contract in Database code, 782 787 // which calls gcUnprotect from a secondary thread. … … 788 793 { 789 794 ASSERT(k); 795 ASSERT(JSLock::currentThreadIsHoldingLock() || !m_globalData->isSharedInstance); 790 796 791 797 if (JSImmediate::isImmediate(k)) … … 804 810 { 805 811 ASSERT(k); 812 ASSERT(JSLock::currentThreadIsHoldingLock() || !m_globalData->isSharedInstance); 806 813 807 814 if (JSImmediate::isImmediate(k)) … … 941 948 bool Heap::collect() 942 949 { 950 #ifndef NDEBUG 951 if (m_globalData->isSharedInstance) { 952 ASSERT(JSLock::lockCount() > 0); 953 ASSERT(JSLock::currentThreadIsHoldingLock()); 954 } 955 #endif 956 943 957 ASSERT((primaryHeap.operationInProgress == NoOperation) | (numberHeap.operationInProgress == NoOperation)); 944 958 if ((primaryHeap.operationInProgress != NoOperation) | (numberHeap.operationInProgress != NoOperation))
Note:
See TracChangeset
for help on using the changeset viewer.