Changeset 427 for trunk/JavaScriptCore/kjs/collector.cpp
- Timestamp:
- 08/01/08 14:47:24 (5 months ago)
- Files:
-
- trunk/JavaScriptCore/kjs/collector.cpp (modified) (15 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/JavaScriptCore/kjs/collector.cpp
r424 r427 25 25 #include "ExecState.h" 26 26 #include "JSGlobalObject.h" 27 #include "JSLock.h"28 27 #include "JSString.h" 29 28 #include "JSValue.h" … … 185 184 static void freeHeap(CollectorHeap*); 186 185 187 #if USE(MULTIPLE_THREADS)186 #if ENABLE(JSC_MULTIPLE_THREADS) 188 187 189 188 #if PLATFORM(DARWIN) … … 220 219 Heap::Heap(JSGlobalData* globalData) 221 220 : m_markListSet(0) 222 #if USE(MULTIPLE_THREADS)221 #if ENABLE(JSC_MULTIPLE_THREADS) 223 222 , m_registeredThreads(0) 224 223 #endif 225 224 , m_globalData(globalData) 226 225 { 227 #if USE(MULTIPLE_THREADS)226 #if ENABLE(JSC_MULTIPLE_THREADS) 228 227 int error = pthread_key_create(&m_currentThreadRegistrar, unregisterThread); 229 228 if (error) … … 237 236 Heap::~Heap() 238 237 { 239 JSLock lock(false);240 241 238 delete m_markListSet; 242 239 sweep<PrimaryHeap>(); … … 248 245 freeHeap(&numberHeap); 249 246 250 #if USE(MULTIPLE_THREADS)247 #if ENABLE(JSC_MULTIPLE_THREADS) 251 248 #ifndef NDEBUG 252 249 int error = … … 283 280 #else 284 281 285 #if USE(MULTIPLE_THREADS)282 #if ENABLE(JSC_MULTIPLE_THREADS) 286 283 #error Need to initialize pagesize safely. 287 284 #endif … … 375 372 376 373 CollectorHeap& heap = heapType == PrimaryHeap ? primaryHeap : numberHeap; 377 ASSERT(JSLock::lockCount() > 0);378 ASSERT(JSLock::currentThreadIsHoldingLock());379 374 ASSERT(s <= HeapConstants<heapType>::cellSize); 380 375 UNUSED_PARAM(s); // s is now only used for the above assert … … 563 558 } 564 559 565 #if USE(MULTIPLE_THREADS)560 #if ENABLE(JSC_MULTIPLE_THREADS) 566 561 567 562 static inline PlatformThread getCurrentPlatformThread() … … 624 619 } 625 620 626 #else // USE(MULTIPLE_THREADS)621 #else // ENABLE(JSC_MULTIPLE_THREADS) 627 622 628 623 void Heap::registerThread() … … 715 710 } 716 711 717 #if USE(MULTIPLE_THREADS)712 #if ENABLE(JSC_MULTIPLE_THREADS) 718 713 719 714 static inline void suspendThread(const PlatformThread& platformThread) … … 882 877 markCurrentThreadConservatively(); 883 878 884 #if USE(MULTIPLE_THREADS)879 #if ENABLE(JSC_MULTIPLE_THREADS) 885 880 886 881 if (m_currentThreadRegistrar) { … … 910 905 { 911 906 // Most clients do not need to call this, with the notable exception of WebCore. 912 // Clients that use shared heap have JSLock protection, while others are supposed907 // Clients that use context from a single context group from multiple threads are supposed 913 908 // to do explicit locking. WebCore violates this contract in Database code, 914 909 // which calls gcUnprotect from a secondary thread. … … 920 915 { 921 916 ASSERT(k); 922 ASSERT(JSLock::currentThreadIsHoldingLock() || !m_globalData->isSharedInstance);923 917 924 918 if (JSImmediate::isImmediate(k)) … … 937 931 { 938 932 ASSERT(k); 939 ASSERT(JSLock::currentThreadIsHoldingLock() || !m_globalData->isSharedInstance);940 933 941 934 if (JSImmediate::isImmediate(k)) … … 1075 1068 bool Heap::collect() 1076 1069 { 1077 #ifndef NDEBUG1078 if (m_globalData->isSharedInstance) {1079 ASSERT(JSLock::lockCount() > 0);1080 ASSERT(JSLock::currentThreadIsHoldingLock());1081 }1082 #endif1083 1084 1070 ASSERT((primaryHeap.operationInProgress == NoOperation) | (numberHeap.operationInProgress == NoOperation)); 1085 1071 if ((primaryHeap.operationInProgress != NoOperation) | (numberHeap.operationInProgress != NoOperation))
