Diff
Modified: trunk/Source/_javascript_Core/ChangeLog (95510 => 95511)
--- trunk/Source/_javascript_Core/ChangeLog 2011-09-20 03:35:49 UTC (rev 95510)
+++ trunk/Source/_javascript_Core/ChangeLog 2011-09-20 03:55:29 UTC (rev 95511)
@@ -1,5 +1,39 @@
2011-09-19 Geoffrey Garen <[email protected]>
+ 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):
+
+2011-09-19 Geoffrey Garen <[email protected]>
+
Removed ENABLE_JSC_MULTIPLE_THREADS and related #ifdefs.
https://bugs.webkit.org/show_bug.cgi?id=68422
Modified: trunk/Source/_javascript_Core/wtf/CryptographicallyRandomNumber.cpp (95510 => 95511)
--- trunk/Source/_javascript_Core/wtf/CryptographicallyRandomNumber.cpp 2011-09-20 03:35:49 UTC (rev 95510)
+++ trunk/Source/_javascript_Core/wtf/CryptographicallyRandomNumber.cpp 2011-09-20 03:55:29 UTC (rev 95511)
@@ -65,9 +65,7 @@
ARC4Stream m_stream;
int m_count;
-#if ENABLE(WTF_MULTIPLE_THREADS)
Mutex m_mutex;
-#endif
};
ARC4Stream::ARC4Stream()
@@ -139,9 +137,7 @@
uint32_t ARC4RandomNumberGenerator::randomNumber()
{
-#if ENABLE(WTF_MULTIPLE_THREADS)
MutexLocker locker(m_mutex);
-#endif
m_count -= 4;
stirIfNeeded();
@@ -150,9 +146,7 @@
void ARC4RandomNumberGenerator::randomValues(void* buffer, size_t length)
{
-#if ENABLE(WTF_MULTIPLE_THREADS)
MutexLocker locker(m_mutex);
-#endif
unsigned char* result = reinterpret_cast<unsigned char*>(buffer);
stirIfNeeded();
Modified: trunk/Source/_javascript_Core/wtf/FastMalloc.cpp (95510 => 95511)
--- trunk/Source/_javascript_Core/wtf/FastMalloc.cpp 2011-09-20 03:35:49 UTC (rev 95510)
+++ trunk/Source/_javascript_Core/wtf/FastMalloc.cpp 2011-09-20 03:55:29 UTC (rev 95511)
@@ -79,14 +79,13 @@
#include "Assertions.h"
#include <limits>
-#if ENABLE(WTF_MULTIPLE_THREADS)
#if OS(WINDOWS) && PLATFORM(CHROMIUM) || OS(WINCE) && PLATFORM(WIN)
#include <windows.h>
#else
#include <pthread.h>
#endif // OS(WINDOWS) && PLATFORM(CHROMIUM) || OS(WINCE) && PLATFORM(WIN)
-#endif
#include <wtf/StdLibExtras.h>
+#include <string.h>
#ifndef NO_TCMALLOC_SAMPLES
#ifdef WTF_CHANGES
@@ -106,7 +105,6 @@
#ifndef NDEBUG
namespace WTF {
-#if ENABLE(WTF_MULTIPLE_THREADS)
#if OS(WINDOWS) && PLATFORM(CHROMIUM) || OS(WINCE) && PLATFORM(WIN)
// TLS_OUT_OF_INDEXES is not defined on WinCE.
@@ -171,30 +169,10 @@
pthread_setspecific(isForbiddenKey, 0);
}
#endif // OS(WINDOWS) && PLATFORM(CHROMIUM) || OS(WINCE) && PLATFORM(WIN)
-#else
-static bool staticIsForbidden;
-static bool isForbidden()
-{
- return staticIsForbidden;
-}
-
-void fastMallocForbid()
-{
- staticIsForbidden = true;
-}
-
-void fastMallocAllow()
-{
- staticIsForbidden = false;
-}
-#endif // ENABLE(WTF_MULTIPLE_THREADS)
-
} // namespace WTF
#endif // NDEBUG
-#include <string.h>
-
namespace WTF {
Modified: trunk/Source/_javascript_Core/wtf/Platform.h (95510 => 95511)
--- trunk/Source/_javascript_Core/wtf/Platform.h 2011-09-20 03:35:49 UTC (rev 95510)
+++ trunk/Source/_javascript_Core/wtf/Platform.h 2011-09-20 03:55:29 UTC (rev 95511)
@@ -508,10 +508,6 @@
#define WTF_USE_PTHREAD_BASED_QT 1
#endif
-#if !defined(ENABLE_WTF_MULTIPLE_THREADS)
-#define ENABLE_WTF_MULTIPLE_THREADS 1
-#endif
-
/* On Windows, use QueryPerformanceCounter by default */
#if OS(WINDOWS)
#define WTF_USE_QUERY_PERFORMANCE_COUNTER 1
Modified: trunk/Source/_javascript_Core/wtf/RandomNumber.cpp (95510 => 95511)
--- trunk/Source/_javascript_Core/wtf/RandomNumber.cpp 2011-09-20 03:35:49 UTC (rev 95510)
+++ trunk/Source/_javascript_Core/wtf/RandomNumber.cpp 2011-09-20 03:55:29 UTC (rev 95511)
@@ -61,14 +61,6 @@
// that might not be cryptographically secure. Ideally, most ports would
// define USE(OS_RANDOMNESS).
-#if !ENABLE(WTF_MULTIPLE_THREADS)
- static bool s_initialized = false;
- if (!s_initialized) {
- initializeRandomNumberGenerator();
- s_initialized = true;
- }
-#endif
-
#if USE(MERSENNE_TWISTER_19937)
return genrand_res53();
#elif PLATFORM(BREWMP)
Modified: trunk/Source/_javascript_Core/wtf/RefCountedLeakCounter.cpp (95510 => 95511)
--- trunk/Source/_javascript_Core/wtf/RefCountedLeakCounter.cpp 2011-09-20 03:35:49 UTC (rev 95510)
+++ trunk/Source/_javascript_Core/wtf/RefCountedLeakCounter.cpp 2011-09-20 03:55:29 UTC (rev 95511)
@@ -79,20 +79,12 @@
void RefCountedLeakCounter::increment()
{
-#if ENABLE(WTF_MULTIPLE_THREADS)
atomicIncrement(&m_count);
-#else
- ++m_count;
-#endif
}
void RefCountedLeakCounter::decrement()
{
-#if ENABLE(WTF_MULTIPLE_THREADS)
atomicDecrement(&m_count);
-#else
- --m_count;
-#endif
}
#endif
Modified: trunk/Source/_javascript_Core/wtf/ThreadingPthreads.cpp (95510 => 95511)
--- trunk/Source/_javascript_Core/wtf/ThreadingPthreads.cpp 2011-09-20 03:35:49 UTC (rev 95510)
+++ trunk/Source/_javascript_Core/wtf/ThreadingPthreads.cpp 2011-09-20 03:55:29 UTC (rev 95511)
@@ -83,10 +83,8 @@
initializeRandomNumberGenerator();
ThreadIdentifierData::initializeOnce();
wtfThreadData();
-#if ENABLE(WTF_MULTIPLE_THREADS)
s_dtoaP5Mutex = new Mutex;
initializeDates();
-#endif
}
void lockAtomicallyInitializedStaticMutex()
Modified: trunk/Source/_javascript_Core/wtf/ThreadingWin.cpp (95510 => 95511)
--- trunk/Source/_javascript_Core/wtf/ThreadingWin.cpp 2011-09-20 03:35:49 UTC (rev 95510)
+++ trunk/Source/_javascript_Core/wtf/ThreadingWin.cpp 2011-09-20 03:55:29 UTC (rev 95511)
@@ -172,11 +172,8 @@
threadMapMutex();
initializeRandomNumberGenerator();
wtfThreadData();
-#if ENABLE(WTF_MULTIPLE_THREADS)
s_dtoaP5Mutex = new Mutex;
initializeDates();
-#endif
-
}
static HashMap<DWORD, HANDLE>& threadMap()
Modified: trunk/Source/_javascript_Core/wtf/dtoa.cpp (95510 => 95511)
--- trunk/Source/_javascript_Core/wtf/dtoa.cpp 2011-09-20 03:35:49 UTC (rev 95510)
+++ trunk/Source/_javascript_Core/wtf/dtoa.cpp 2011-09-20 03:55:29 UTC (rev 95511)
@@ -90,9 +90,7 @@
namespace WTF {
-#if ENABLE(WTF_MULTIPLE_THREADS)
Mutex* s_dtoaP5Mutex;
-#endif
typedef union {
double d;
@@ -435,9 +433,7 @@
if (!(k >>= 2))
return;
-#if ENABLE(WTF_MULTIPLE_THREADS)
s_dtoaP5Mutex->lock();
-#endif
P5Node* p5 = p5s;
if (!p5) {
@@ -450,9 +446,7 @@
}
int p5sCountLocal = p5sCount;
-#if ENABLE(WTF_MULTIPLE_THREADS)
s_dtoaP5Mutex->unlock();
-#endif
int p5sUsed = 0;
for (;;) {
@@ -463,9 +457,7 @@
break;
if (++p5sUsed == p5sCountLocal) {
-#if ENABLE(WTF_MULTIPLE_THREADS)
s_dtoaP5Mutex->lock();
-#endif
if (p5sUsed == p5sCount) {
ASSERT(!p5->next);
p5->next = new P5Node;
@@ -476,9 +468,7 @@
}
p5sCountLocal = p5sCount;
-#if ENABLE(WTF_MULTIPLE_THREADS)
s_dtoaP5Mutex->unlock();
-#endif
}
p5 = p5->next;
}
Modified: trunk/Source/_javascript_Core/wtf/gtk/ThreadingGtk.cpp (95510 => 95511)
--- trunk/Source/_javascript_Core/wtf/gtk/ThreadingGtk.cpp 2011-09-20 03:35:49 UTC (rev 95510)
+++ trunk/Source/_javascript_Core/wtf/gtk/ThreadingGtk.cpp 2011-09-20 03:55:29 UTC (rev 95511)
@@ -70,10 +70,8 @@
threadMapMutex();
initializeRandomNumberGenerator();
wtfThreadData();
-#if ENABLE(WTF_MULTIPLE_THREADS)
s_dtoaP5Mutex = new Mutex;
initializeDates();
-#endif
}
}
Modified: trunk/Source/_javascript_Core/wtf/qt/ThreadingQt.cpp (95510 => 95511)
--- trunk/Source/_javascript_Core/wtf/qt/ThreadingQt.cpp 2011-09-20 03:35:49 UTC (rev 95510)
+++ trunk/Source/_javascript_Core/wtf/qt/ThreadingQt.cpp 2011-09-20 03:55:29 UTC (rev 95511)
@@ -149,11 +149,8 @@
threadMapMutex();
initializeRandomNumberGenerator();
wtfThreadData();
-#if ENABLE(WTF_MULTIPLE_THREADS)
s_dtoaP5Mutex = new Mutex;
initializeDates();
-#endif
-
}
}