Changeset 95511 in webkit


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

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

As discussed on webkit-dev. All ports build with threads enabled in WTF 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 Mark Rowe.

  • wtf/CryptographicallyRandomNumber.cpp:

(WTF::ARC4Stream::ARC4RandomNumberGenerator::randomNumber):
(WTF::ARC4Stream::ARC4RandomNumberGenerator::randomValues):

  • wtf/FastMalloc.cpp:
  • wtf/Platform.h:
  • wtf/RandomNumber.cpp:

(WTF::randomNumber):

  • wtf/RefCountedLeakCounter.cpp:

(WTF::RefCountedLeakCounter::increment):
(WTF::RefCountedLeakCounter::decrement):

  • wtf/ThreadingPthreads.cpp:

(WTF::initializeThreading):

  • wtf/ThreadingWin.cpp:

(WTF::initializeThreading):

  • wtf/dtoa.cpp:

(WTF::pow5mult):

  • wtf/gtk/ThreadingGtk.cpp:

(WTF::initializeThreading):

  • wtf/qt/ThreadingQt.cpp:

(WTF::initializeThreading):

Location:
trunk/Source/JavaScriptCore
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r95510 r95511  
     12011-09-19  Geoffrey Garen  <ggaren@apple.com>
     2
     3        Removed ENABLE_WTF_MULTIPLE_THREADS and related #ifdefs
     4        https://bugs.webkit.org/show_bug.cgi?id=68423
     5
     6        As discussed on webkit-dev. All ports build with threads enabled in WTF 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 Mark Rowe.
     13
     14        * wtf/CryptographicallyRandomNumber.cpp:
     15        (WTF::ARC4Stream::ARC4RandomNumberGenerator::randomNumber):
     16        (WTF::ARC4Stream::ARC4RandomNumberGenerator::randomValues):
     17        * wtf/FastMalloc.cpp:
     18        * wtf/Platform.h:
     19        * wtf/RandomNumber.cpp:
     20        (WTF::randomNumber):
     21        * wtf/RefCountedLeakCounter.cpp:
     22        (WTF::RefCountedLeakCounter::increment):
     23        (WTF::RefCountedLeakCounter::decrement):
     24        * wtf/ThreadingPthreads.cpp:
     25        (WTF::initializeThreading):
     26        * wtf/ThreadingWin.cpp:
     27        (WTF::initializeThreading):
     28        * wtf/dtoa.cpp:
     29        (WTF::pow5mult):
     30        * wtf/gtk/ThreadingGtk.cpp:
     31        (WTF::initializeThreading):
     32        * wtf/qt/ThreadingQt.cpp:
     33        (WTF::initializeThreading):
     34
    1352011-09-19  Geoffrey Garen  <ggaren@apple.com>
    236
  • trunk/Source/JavaScriptCore/wtf/CryptographicallyRandomNumber.cpp

    r92068 r95511  
    6666    ARC4Stream m_stream;
    6767    int m_count;
    68 #if ENABLE(WTF_MULTIPLE_THREADS)
    6968    Mutex m_mutex;
    70 #endif
    7169};
    7270
     
    140138uint32_t ARC4RandomNumberGenerator::randomNumber()
    141139{
    142 #if ENABLE(WTF_MULTIPLE_THREADS)
    143140    MutexLocker locker(m_mutex);
    144 #endif
    145141
    146142    m_count -= 4;
     
    151147void ARC4RandomNumberGenerator::randomValues(void* buffer, size_t length)
    152148{
    153 #if ENABLE(WTF_MULTIPLE_THREADS)
    154149    MutexLocker locker(m_mutex);
    155 #endif
    156150
    157151    unsigned char* result = reinterpret_cast<unsigned char*>(buffer);
  • trunk/Source/JavaScriptCore/wtf/FastMalloc.cpp

    r94952 r95511  
    8080#include "Assertions.h"
    8181#include <limits>
    82 #if ENABLE(WTF_MULTIPLE_THREADS)
    8382#if OS(WINDOWS) && PLATFORM(CHROMIUM) || OS(WINCE) && PLATFORM(WIN)
    8483#include <windows.h>
     
    8685#include <pthread.h>
    8786#endif // OS(WINDOWS) && PLATFORM(CHROMIUM) || OS(WINCE) && PLATFORM(WIN)
    88 #endif
    8987#include <wtf/StdLibExtras.h>
     88#include <string.h>
    9089
    9190#ifndef NO_TCMALLOC_SAMPLES
     
    107106namespace WTF {
    108107
    109 #if ENABLE(WTF_MULTIPLE_THREADS)
    110108#if OS(WINDOWS) && PLATFORM(CHROMIUM) || OS(WINCE) && PLATFORM(WIN)
    111109
     
    172170}
    173171#endif // OS(WINDOWS) && PLATFORM(CHROMIUM) || OS(WINCE) && PLATFORM(WIN)
    174 #else
    175 
    176 static bool staticIsForbidden;
    177 static bool isForbidden()
    178 {
    179     return staticIsForbidden;
    180 }
    181 
    182 void fastMallocForbid()
    183 {
    184     staticIsForbidden = true;
    185 }
    186 
    187 void fastMallocAllow()
    188 {
    189     staticIsForbidden = false;
    190 }
    191 #endif // ENABLE(WTF_MULTIPLE_THREADS)
    192172
    193173} // namespace WTF
    194174#endif // NDEBUG
    195 
    196 #include <string.h>
    197175
    198176namespace WTF {
  • trunk/Source/JavaScriptCore/wtf/Platform.h

    r95510 r95511  
    509509#endif
    510510
    511 #if !defined(ENABLE_WTF_MULTIPLE_THREADS)
    512 #define ENABLE_WTF_MULTIPLE_THREADS 1
    513 #endif
    514 
    515511/* On Windows, use QueryPerformanceCounter by default */
    516512#if OS(WINDOWS)
  • trunk/Source/JavaScriptCore/wtf/RandomNumber.cpp

    r84466 r95511  
    6262    // define USE(OS_RANDOMNESS).
    6363
    64 #if !ENABLE(WTF_MULTIPLE_THREADS)
    65     static bool s_initialized = false;
    66     if (!s_initialized) {
    67         initializeRandomNumberGenerator();
    68         s_initialized = true;
    69     }
    70 #endif
    71 
    7264#if USE(MERSENNE_TWISTER_19937)
    7365    return genrand_res53();
  • trunk/Source/JavaScriptCore/wtf/RefCountedLeakCounter.cpp

    r84466 r95511  
    8080void RefCountedLeakCounter::increment()
    8181{
    82 #if ENABLE(WTF_MULTIPLE_THREADS)
    8382    atomicIncrement(&m_count);
    84 #else
    85     ++m_count;
    86 #endif
    8783}
    8884
    8985void RefCountedLeakCounter::decrement()
    9086{
    91 #if ENABLE(WTF_MULTIPLE_THREADS)
    9287    atomicDecrement(&m_count);
    93 #else
    94     --m_count;
    95 #endif
    9688}
    9789
  • trunk/Source/JavaScriptCore/wtf/ThreadingPthreads.cpp

    r94452 r95511  
    8484    ThreadIdentifierData::initializeOnce();
    8585    wtfThreadData();
    86 #if ENABLE(WTF_MULTIPLE_THREADS)
    8786    s_dtoaP5Mutex = new Mutex;
    8887    initializeDates();
    89 #endif
    9088}
    9189
  • trunk/Source/JavaScriptCore/wtf/ThreadingWin.cpp

    r94452 r95511  
    173173    initializeRandomNumberGenerator();
    174174    wtfThreadData();
    175 #if ENABLE(WTF_MULTIPLE_THREADS)
    176175    s_dtoaP5Mutex = new Mutex;
    177176    initializeDates();
    178 #endif
    179 
    180177}
    181178
  • trunk/Source/JavaScriptCore/wtf/dtoa.cpp

    r94452 r95511  
    9191namespace WTF {
    9292
    93 #if ENABLE(WTF_MULTIPLE_THREADS)
    9493Mutex* s_dtoaP5Mutex;
    95 #endif
    9694
    9795typedef union {
     
    436434        return;
    437435
    438 #if ENABLE(WTF_MULTIPLE_THREADS)
    439436    s_dtoaP5Mutex->lock();
    440 #endif
    441437    P5Node* p5 = p5s;
    442438
     
    451447
    452448    int p5sCountLocal = p5sCount;
    453 #if ENABLE(WTF_MULTIPLE_THREADS)
    454449    s_dtoaP5Mutex->unlock();
    455 #endif
    456450    int p5sUsed = 0;
    457451
     
    464458
    465459        if (++p5sUsed == p5sCountLocal) {
    466 #if ENABLE(WTF_MULTIPLE_THREADS)
    467460            s_dtoaP5Mutex->lock();
    468 #endif
    469461            if (p5sUsed == p5sCount) {
    470462                ASSERT(!p5->next);
     
    477469
    478470            p5sCountLocal = p5sCount;
    479 #if ENABLE(WTF_MULTIPLE_THREADS)
    480471            s_dtoaP5Mutex->unlock();
    481 #endif
    482472        }
    483473        p5 = p5->next;
  • trunk/Source/JavaScriptCore/wtf/gtk/ThreadingGtk.cpp

    r93004 r95511  
    7171        initializeRandomNumberGenerator();
    7272        wtfThreadData();
    73 #if ENABLE(WTF_MULTIPLE_THREADS)
    7473        s_dtoaP5Mutex = new Mutex;
    7574        initializeDates();
    76 #endif
    7775    }
    7876}
  • trunk/Source/JavaScriptCore/wtf/qt/ThreadingQt.cpp

    r94890 r95511  
    150150        initializeRandomNumberGenerator();
    151151        wtfThreadData();
    152 #if ENABLE(WTF_MULTIPLE_THREADS)
    153152        s_dtoaP5Mutex = new Mutex;
    154153        initializeDates();
    155 #endif
    156 
    157154    }
    158155}
Note: See TracChangeset for help on using the changeset viewer.