Show
Ignore:
Timestamp:
08/01/08 14:47:24 (5 months ago)
Author:
sroret
Message:

merge with webkit revision 35510

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/JavaScriptCore/kjs/collector.cpp

    r424 r427  
    2525#include "ExecState.h" 
    2626#include "JSGlobalObject.h" 
    27 #include "JSLock.h" 
    2827#include "JSString.h" 
    2928#include "JSValue.h" 
     
    185184static void freeHeap(CollectorHeap*); 
    186185 
    187 #if USE(MULTIPLE_THREADS) 
     186#if ENABLE(JSC_MULTIPLE_THREADS) 
    188187 
    189188#if PLATFORM(DARWIN) 
     
    220219Heap::Heap(JSGlobalData* globalData) 
    221220    : m_markListSet(0) 
    222 #if USE(MULTIPLE_THREADS) 
     221#if ENABLE(JSC_MULTIPLE_THREADS) 
    223222    , m_registeredThreads(0) 
    224223#endif 
    225224    , m_globalData(globalData) 
    226225{ 
    227 #if USE(MULTIPLE_THREADS) 
     226#if ENABLE(JSC_MULTIPLE_THREADS) 
    228227    int error = pthread_key_create(&m_currentThreadRegistrar, unregisterThread); 
    229228    if (error) 
     
    237236Heap::~Heap() 
    238237{ 
    239     JSLock lock(false); 
    240  
    241238    delete m_markListSet; 
    242239    sweep<PrimaryHeap>(); 
     
    248245    freeHeap(&numberHeap); 
    249246 
    250 #if USE(MULTIPLE_THREADS) 
     247#if ENABLE(JSC_MULTIPLE_THREADS) 
    251248#ifndef NDEBUG 
    252249    int error = 
     
    283280#else 
    284281 
    285 #if USE(MULTIPLE_THREADS) 
     282#if ENABLE(JSC_MULTIPLE_THREADS) 
    286283#error Need to initialize pagesize safely. 
    287284#endif 
     
    375372 
    376373    CollectorHeap& heap = heapType == PrimaryHeap ? primaryHeap : numberHeap; 
    377     ASSERT(JSLock::lockCount() > 0); 
    378     ASSERT(JSLock::currentThreadIsHoldingLock()); 
    379374    ASSERT(s <= HeapConstants<heapType>::cellSize); 
    380375    UNUSED_PARAM(s); // s is now only used for the above assert 
     
    563558} 
    564559 
    565 #if USE(MULTIPLE_THREADS) 
     560#if ENABLE(JSC_MULTIPLE_THREADS) 
    566561 
    567562static inline PlatformThread getCurrentPlatformThread() 
     
    624619} 
    625620 
    626 #else // USE(MULTIPLE_THREADS) 
     621#else // ENABLE(JSC_MULTIPLE_THREADS) 
    627622 
    628623void Heap::registerThread() 
     
    715710} 
    716711 
    717 #if USE(MULTIPLE_THREADS) 
     712#if ENABLE(JSC_MULTIPLE_THREADS) 
    718713 
    719714static inline void suspendThread(const PlatformThread& platformThread) 
     
    882877    markCurrentThreadConservatively(); 
    883878 
    884 #if USE(MULTIPLE_THREADS) 
     879#if ENABLE(JSC_MULTIPLE_THREADS) 
    885880 
    886881    if (m_currentThreadRegistrar) { 
     
    910905{ 
    911906    // 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 supposed 
     907    // Clients that use context from a single context group from multiple threads are supposed 
    913908    // to do explicit locking. WebCore violates this contract in Database code, 
    914909    // which calls gcUnprotect from a secondary thread. 
     
    920915{ 
    921916    ASSERT(k); 
    922     ASSERT(JSLock::currentThreadIsHoldingLock() || !m_globalData->isSharedInstance); 
    923917 
    924918    if (JSImmediate::isImmediate(k)) 
     
    937931{ 
    938932    ASSERT(k); 
    939     ASSERT(JSLock::currentThreadIsHoldingLock() || !m_globalData->isSharedInstance); 
    940933 
    941934    if (JSImmediate::isImmediate(k)) 
     
    10751068bool Heap::collect() 
    10761069{ 
    1077 #ifndef NDEBUG 
    1078     if (m_globalData->isSharedInstance) { 
    1079         ASSERT(JSLock::lockCount() > 0); 
    1080         ASSERT(JSLock::currentThreadIsHoldingLock()); 
    1081     } 
    1082 #endif 
    1083  
    10841070    ASSERT((primaryHeap.operationInProgress == NoOperation) | (numberHeap.operationInProgress == NoOperation)); 
    10851071    if ((primaryHeap.operationInProgress != NoOperation) | (numberHeap.operationInProgress != NoOperation))