Changeset 95510 in webkit


Ignore:
Timestamp:
Sep 19, 2011 8:35:49 PM (13 years ago)
Author:
ggaren@apple.com
Message:

Removed ENABLE_JSC_MULTIPLE_THREADS and related #ifdefs.
https://bugs.webkit.org/show_bug.cgi?id=68422

As discussed on webkit-dev. All ports build with threads enabled in JSC now.

This may break WinCE and other ports that have not built and tested with
this configuration. I've filed bugs for port maintainers. It's time for
WebKit to move forward.

Reviewed by Sam Weinig.

  • API/APIShims.h:

(JSC::APIEntryShimWithoutLock::APIEntryShimWithoutLock):

  • API/JSContextRef.cpp:
  • heap/MachineStackMarker.cpp:

(JSC::MachineThreads::MachineThreads):
(JSC::MachineThreads::~MachineThreads):
(JSC::MachineThreads::gatherConservativeRoots):

  • heap/MachineStackMarker.h:
  • runtime/InitializeThreading.cpp:

(JSC::initializeThreadingOnce):
(JSC::initializeThreading):

  • runtime/JSGlobalData.cpp:

(JSC::JSGlobalData::sharedInstance):

  • runtime/JSGlobalData.h:

(JSC::JSGlobalData::makeUsableFromMultipleThreads):

  • runtime/JSLock.cpp:
  • runtime/Structure.cpp:
  • wtf/Platform.h:
Location:
trunk/Source/JavaScriptCore
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/API/APIShims.h

    r80995 r95510  
    4141    {
    4242        UNUSED_PARAM(registerThread);
    43 #if ENABLE(JSC_MULTIPLE_THREADS)
    4443        if (registerThread)
    4544            globalData->heap.machineThreads().addCurrentThread();
    46 #endif
    4745        m_globalData->heap.activityCallback()->synchronize();
    4846        m_globalData->timeoutChecker.start();
  • trunk/Source/JavaScriptCore/API/JSContextRef.cpp

    r94599 r95510  
    9393    APIEntryShim entryShim(globalData.get(), false);
    9494
    95 #if ENABLE(JSC_MULTIPLE_THREADS)
    9695    globalData->makeUsableFromMultipleThreads();
    97 #endif
    9896
    9997    if (!globalObjectClass) {
  • trunk/Source/JavaScriptCore/ChangeLog

    r95507 r95510  
     12011-09-19  Geoffrey Garen  <ggaren@apple.com>
     2
     3        Removed ENABLE_JSC_MULTIPLE_THREADS and related #ifdefs.
     4        https://bugs.webkit.org/show_bug.cgi?id=68422
     5       
     6        As discussed on webkit-dev. All ports build with threads enabled in JSC now.
     7       
     8        This may break WinCE and other ports that have not built and tested with
     9        this configuration. I've filed bugs for port maintainers. It's time for
     10        WebKit to move forward.
     11
     12        Reviewed by Sam Weinig.
     13
     14        * API/APIShims.h:
     15        (JSC::APIEntryShimWithoutLock::APIEntryShimWithoutLock):
     16        * API/JSContextRef.cpp:
     17        * heap/MachineStackMarker.cpp:
     18        (JSC::MachineThreads::MachineThreads):
     19        (JSC::MachineThreads::~MachineThreads):
     20        (JSC::MachineThreads::gatherConservativeRoots):
     21        * heap/MachineStackMarker.h:
     22        * runtime/InitializeThreading.cpp:
     23        (JSC::initializeThreadingOnce):
     24        (JSC::initializeThreading):
     25        * runtime/JSGlobalData.cpp:
     26        (JSC::JSGlobalData::sharedInstance):
     27        * runtime/JSGlobalData.h:
     28        (JSC::JSGlobalData::makeUsableFromMultipleThreads):
     29        * runtime/JSLock.cpp:
     30        * runtime/Structure.cpp:
     31        * wtf/Platform.h:
     32
    1332011-09-19  Sheriff Bot  <webkit.review.bot@gmail.com>
    234
  • trunk/Source/JavaScriptCore/heap/MachineStackMarker.cpp

    r95498 r95510  
    7777#endif
    7878
    79 #if ENABLE(JSC_MULTIPLE_THREADS) && USE(PTHREADS) && !OS(WINDOWS) && !OS(DARWIN)
     79#if USE(PTHREADS) && !OS(WINDOWS) && !OS(DARWIN)
    8080#include <signal.h>
    8181#endif
     
    9898#endif
    9999}
    100 
    101 #if ENABLE(JSC_MULTIPLE_THREADS)
    102100
    103101#if OS(DARWIN)
     
    146144};
    147145
    148 #endif
    149 
    150146MachineThreads::MachineThreads(Heap* heap)
    151147    : m_heap(heap)
    152 #if ENABLE(JSC_MULTIPLE_THREADS)
    153148    , m_registeredThreads(0)
    154149    , m_threadSpecific(0)
    155 #endif
    156150{
    157151}
     
    159153MachineThreads::~MachineThreads()
    160154{
    161 #if ENABLE(JSC_MULTIPLE_THREADS)
    162155    if (m_threadSpecific) {
    163156        int error = pthread_key_delete(m_threadSpecific);
     
    171164        t = next;
    172165    }
    173 #endif
    174 }
    175 
    176 #if ENABLE(JSC_MULTIPLE_THREADS)
     166}
    177167
    178168static inline PlatformThread getCurrentPlatformThread()
     
    244234}
    245235
    246 #endif
    247 
    248236#if COMPILER(GCC)
    249237#define REGISTER_BUFFER_ALIGNMENT __attribute__ ((aligned (sizeof(void*))))
     
    275263    conservativeRoots.add(stackBegin, stackEnd);
    276264}
    277 
    278 #if ENABLE(JSC_MULTIPLE_THREADS)
    279265
    280266static inline void suspendThread(const PlatformThread& platformThread)
     
    483469}
    484470
    485 #endif
    486 
    487471void MachineThreads::gatherConservativeRoots(ConservativeRoots& conservativeRoots, void* stackCurrent)
    488472{
    489473    gatherFromCurrentThread(conservativeRoots, stackCurrent);
    490 
    491 #if ENABLE(JSC_MULTIPLE_THREADS)
    492474
    493475    if (m_threadSpecific) {
     
    511493#endif
    512494    }
    513 #endif
    514495}
    515496
  • trunk/Source/JavaScriptCore/heap/MachineStackMarker.h

    r83506 r95510  
    2323#define MachineThreads_h
    2424
     25#include <pthread.h>
    2526#include <wtf/Noncopyable.h>
    2627#include <wtf/ThreadingPrimitives.h>
    27 
    28 #if ENABLE(JSC_MULTIPLE_THREADS)
    29 #include <pthread.h>
    30 #endif
    3128
    3229namespace JSC {
     
    4340        void gatherConservativeRoots(ConservativeRoots&, void* stackCurrent);
    4441
    45 #if ENABLE(JSC_MULTIPLE_THREADS)
    4642        void makeUsableFromMultipleThreads();
    4743        void addCurrentThread(); // Only needs to be called by clients that can use the same heap from multiple threads.
    48 #endif
    4944
    5045    private:
    5146        void gatherFromCurrentThread(ConservativeRoots&, void* stackCurrent);
    5247
    53 #if ENABLE(JSC_MULTIPLE_THREADS)
    5448        class Thread;
    5549
     
    5852
    5953        void gatherFromOtherThread(ConservativeRoots&, Thread*);
    60 #endif
    6154
    6255        Heap* m_heap;
    63 
    64 #if ENABLE(JSC_MULTIPLE_THREADS)
    6556        Mutex m_registeredThreadsMutex;
    6657        Thread* m_registeredThreads;
    6758        pthread_key_t m_threadSpecific;
    68 #endif
    6959    };
    7060
  • trunk/Source/JavaScriptCore/runtime/InitializeThreading.cpp

    r94952 r95510  
    4545namespace JSC {
    4646
    47 #if OS(DARWIN) && ENABLE(JSC_MULTIPLE_THREADS)
     47#if OS(DARWIN)
    4848static pthread_once_t initializeThreadingKeyOnce = PTHREAD_ONCE_INIT;
    4949#endif
     
    6060    ExecutableAllocator::initializeAllocator();
    6161#endif
    62 #if ENABLE(JSC_MULTIPLE_THREADS)
    6362    RegisterFile::initializeThreading();
    64 #endif
    6563}
    6664
    6765void initializeThreading()
    6866{
    69 #if OS(DARWIN) && ENABLE(JSC_MULTIPLE_THREADS)
     67#if OS(DARWIN)
    7068    pthread_once(&initializeThreadingKeyOnce, initializeThreadingOnce);
    7169#else
  • trunk/Source/JavaScriptCore/runtime/JSGlobalData.cpp

    r95507 r95510  
    5151#include "Nodes.h"
    5252#include "Parser.h"
     53#if ENABLE(REGEXP_TRACING)
     54#include "RegExp.h"
     55#endif
    5356#include "RegExpCache.h"
    5457#include "RegExpObject.h"
    5558#include "StrictEvalActivation.h"
     59#include <wtf/Threading.h>
    5660#include <wtf/WTFThreadData.h>
    57 #if ENABLE(REGEXP_TRACING)
    58 #include "RegExp.h"
    59 #endif
    60 
    61 
    62 #if ENABLE(JSC_MULTIPLE_THREADS)
    63 #include <wtf/Threading.h>
    64 #endif
    65 
    6661#if PLATFORM(MAC)
    6762#include <CoreFoundation/CoreFoundation.h>
     
    388383    if (!instance) {
    389384        instance = adoptRef(new JSGlobalData(APIShared, ThreadStackTypeSmall, SmallHeap)).leakRef();
    390 #if ENABLE(JSC_MULTIPLE_THREADS)
    391385        instance->makeUsableFromMultipleThreads();
    392 #endif
    393386    }
    394387    return *instance;
  • trunk/Source/JavaScriptCore/runtime/JSGlobalData.h

    r95310 r95510  
    130130        ~JSGlobalData();
    131131
    132 #if ENABLE(JSC_MULTIPLE_THREADS)
    133         // Will start tracking threads that use the heap, which is resource-heavy.
    134132        void makeUsableFromMultipleThreads() { heap.machineThreads().makeUsableFromMultipleThreads(); }
    135 #endif
    136133
    137134        GlobalDataType globalDataType;
  • trunk/Source/JavaScriptCore/runtime/JSLock.cpp

    r81040 r95510  
    3636// automatically protected against concurrent access from multiple threads.
    3737// So it's safe to disable it on non-mac platforms where we don't have native pthreads.
    38 #if ENABLE(JSC_MULTIPLE_THREADS) && (OS(DARWIN) || USE(PTHREADS))
     38#if (OS(DARWIN) || USE(PTHREADS))
    3939
    4040// Acquire this mutex before accessing lock-related data.
     
    214214}
    215215
    216 #else // ENABLE(JSC_MULTIPLE_THREADS) && (OS(DARWIN) || USE(PTHREADS))
     216#else // (OS(DARWIN) || USE(PTHREADS))
    217217
    218218JSLock::JSLock(ExecState*)
     
    261261}
    262262
    263 #endif // ENABLE(JSC_MULTIPLE_THREADS) && (OS(DARWIN) || USE(PTHREADS))
     263#endif // (OS(DARWIN) || USE(PTHREADS))
    264264
    265265} // namespace JSC
  • trunk/Source/JavaScriptCore/runtime/Structure.cpp

    r95340 r95510  
    3535#include <wtf/RefCountedLeakCounter.h>
    3636#include <wtf/RefPtr.h>
    37 
    38 #if ENABLE(JSC_MULTIPLE_THREADS)
    3937#include <wtf/Threading.h>
    40 #endif
    4138
    4239#define DUMP_STRUCTURE_ID_STATISTICS 0
  • trunk/Source/JavaScriptCore/wtf/Platform.h

    r95498 r95510  
    509509#endif
    510510
    511 #if !defined(ENABLE_JSC_MULTIPLE_THREADS)
    512 #define ENABLE_JSC_MULTIPLE_THREADS 1
    513 #endif
    514 
    515511#if !defined(ENABLE_WTF_MULTIPLE_THREADS)
    516512#define ENABLE_WTF_MULTIPLE_THREADS 1
     
    10451041
    10461042#if !defined(ENABLE_LAZY_BLOCK_FREEING)
    1047 #if ENABLE(JSC_MULTIPLE_THREADS)
    10481043#define ENABLE_LAZY_BLOCK_FREEING 1
    1049 #endif
    10501044#endif
    10511045
Note: See TracChangeset for help on using the changeset viewer.