Title: [148488] trunk/Source/WTF
- Revision
- 148488
- Author
- rn...@webkit.org
- Date
- 2013-04-15 19:55:44 -0700 (Mon, 15 Apr 2013)
Log Message
Unreviewed, rolling out r148462.
http://trac.webkit.org/changeset/148462
https://bugs.webkit.org/show_bug.cgi?id=114658
Broke Windows builds (Requested by rniwa on #webkit).
* wtf/FastMalloc.cpp:
(WTF):
(WTF::setThreadHeap):
(WTF::TCMalloc_ThreadCache::GetThreadHeap):
(WTF::TCMalloc_ThreadCache::InitTSD):
* wtf/ThreadSpecificWin.cpp:
(WTF::destructorsList):
(WTF::destructorsMutex):
(WTF::threadSpecificKeyCreate):
(WTF::threadSpecificKeyDelete):
Modified Paths
Diff
Modified: trunk/Source/WTF/ChangeLog (148487 => 148488)
--- trunk/Source/WTF/ChangeLog 2013-04-16 02:52:00 UTC (rev 148487)
+++ trunk/Source/WTF/ChangeLog 2013-04-16 02:55:44 UTC (rev 148488)
@@ -1,3 +1,22 @@
+2013-04-15 Commit Queue <rn...@webkit.org>
+
+ Unreviewed, rolling out r148462.
+ http://trac.webkit.org/changeset/148462
+ https://bugs.webkit.org/show_bug.cgi?id=114658
+
+ Broke Windows builds (Requested by rniwa on #webkit).
+
+ * wtf/FastMalloc.cpp:
+ (WTF):
+ (WTF::setThreadHeap):
+ (WTF::TCMalloc_ThreadCache::GetThreadHeap):
+ (WTF::TCMalloc_ThreadCache::InitTSD):
+ * wtf/ThreadSpecificWin.cpp:
+ (WTF::destructorsList):
+ (WTF::destructorsMutex):
+ (WTF::threadSpecificKeyCreate):
+ (WTF::threadSpecificKeyDelete):
+
2013-04-15 Julien Brianceau <jbrianc...@nds.com>
LLInt SH4 backend implementation
Modified: trunk/Source/WTF/wtf/FastMalloc.cpp (148487 => 148488)
--- trunk/Source/WTF/wtf/FastMalloc.cpp 2013-04-16 02:52:00 UTC (rev 148487)
+++ trunk/Source/WTF/wtf/FastMalloc.cpp 2013-04-16 02:55:44 UTC (rev 148488)
@@ -428,7 +428,6 @@
#include "TCPageMap.h"
#include "TCSpinLock.h"
#include "TCSystemAlloc.h"
-#include "ThreadSpecific.h"
#include <algorithm>
#include <pthread.h>
#include <stdarg.h>
@@ -2842,8 +2841,11 @@
#if USE(PTHREAD_GETSPECIFIC_DIRECT)
static const pthread_key_t heap_key = __PTK_FRAMEWORK_JAVASCRIPTCORE_KEY0;
#else
-static ThreadSpecificKey heap_key;
+static pthread_key_t heap_key;
#endif
+#if OS(WINDOWS)
+DWORD tlsIndex = TLS_OUT_OF_INDEXES;
+#endif
static ALWAYS_INLINE void setThreadHeap(TCMalloc_ThreadCache* heap)
{
@@ -2854,12 +2856,12 @@
CRASH();
#endif
-#if OS(DARWIN)
// Still do pthread_setspecific even if there's an alternate form
// of thread-local storage in use, to benefit from the delete callback.
pthread_setspecific(heap_key, heap);
-#else
- threadSpecificSet(heap_key, heap);
+
+#if OS(WINDOWS)
+ TlsSetValue(tlsIndex, heap);
#endif
}
@@ -3405,10 +3407,10 @@
// __thread is faster, but only when the kernel supports it
if (KernelSupportsTLS())
return threadlocal_heap;
-#elif OS(DARWIN)
+#elif OS(WINDOWS)
+ return static_cast<TCMalloc_ThreadCache*>(TlsGetValue(tlsIndex));
+#else
return static_cast<TCMalloc_ThreadCache*>(pthread_getspecific(heap_key));
-#else
- return static_cast<TCMalloc_ThreadCache*>(threadSpecificGet(heap_key));
#endif
}
@@ -3437,8 +3439,11 @@
#if USE(PTHREAD_GETSPECIFIC_DIRECT)
pthread_key_init_np(heap_key, DestroyThreadCache);
#else
- threadSpecificKeyCreate(&heap_key, DestroyThreadCache);
+ pthread_key_create(&heap_key, DestroyThreadCache);
#endif
+#if OS(WINDOWS)
+ tlsIndex = TlsAlloc();
+#endif
tsd_inited = true;
#if !OS(WINDOWS)
Modified: trunk/Source/WTF/wtf/ThreadSpecificWin.cpp (148487 => 148488)
--- trunk/Source/WTF/wtf/ThreadSpecificWin.cpp 2013-04-16 02:52:00 UTC (rev 148487)
+++ trunk/Source/WTF/wtf/ThreadSpecificWin.cpp 2013-04-16 02:55:44 UTC (rev 148488)
@@ -34,13 +34,13 @@
static DoublyLinkedList<PlatformThreadSpecificKey>& destructorsList()
{
- static DoublyLinkedList<PlatformThreadSpecificKey> staticList;
+ DEFINE_STATIC_LOCAL(DoublyLinkedList<PlatformThreadSpecificKey>, staticList, ());
return staticList;
}
static Mutex& destructorsMutex()
{
- static Mutex staticMutex;
+ DEFINE_STATIC_LOCAL(Mutex, staticMutex, ());
return staticMutex;
}
@@ -91,9 +91,7 @@
void threadSpecificKeyCreate(ThreadSpecificKey* key, void (*destructor)(void *))
{
- // Use the original malloc() instead of fastMalloc() to use this function in FastMalloc code.
- *key = static_cast<PlatformThreadSpecificKey*>(::malloc(sizeof(PlatformThreadSpecificKey)));
- new (*key) PlatformThreadSpecificKey(destructor);
+ *key = new PlatformThreadSpecificKey(destructor);
MutexLocker locker(destructorsMutex());
destructorsList().push(*key);
@@ -103,8 +101,7 @@
{
MutexLocker locker(destructorsMutex());
destructorsList().remove(key);
- key->~PlatformThreadSpecificKey();
- ::free(key);
+ delete key;
}
void threadSpecificSet(ThreadSpecificKey key, void* data)
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes