Title: [95510] trunk/Source/_javascript_Core
Revision
95510
Author
[email protected]
Date
2011-09-19 20:35:49 -0700 (Mon, 19 Sep 2011)

Log 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:

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/API/APIShims.h (95509 => 95510)


--- trunk/Source/_javascript_Core/API/APIShims.h	2011-09-20 02:48:04 UTC (rev 95509)
+++ trunk/Source/_javascript_Core/API/APIShims.h	2011-09-20 03:35:49 UTC (rev 95510)
@@ -40,10 +40,8 @@
         , m_entryIdentifierTable(wtfThreadData().setCurrentIdentifierTable(globalData->identifierTable))
     {
         UNUSED_PARAM(registerThread);
-#if ENABLE(JSC_MULTIPLE_THREADS)
         if (registerThread)
             globalData->heap.machineThreads().addCurrentThread();
-#endif
         m_globalData->heap.activityCallback()->synchronize();
         m_globalData->timeoutChecker.start();
     }

Modified: trunk/Source/_javascript_Core/API/JSContextRef.cpp (95509 => 95510)


--- trunk/Source/_javascript_Core/API/JSContextRef.cpp	2011-09-20 02:48:04 UTC (rev 95509)
+++ trunk/Source/_javascript_Core/API/JSContextRef.cpp	2011-09-20 03:35:49 UTC (rev 95510)
@@ -92,9 +92,7 @@
 
     APIEntryShim entryShim(globalData.get(), false);
 
-#if ENABLE(JSC_MULTIPLE_THREADS)
     globalData->makeUsableFromMultipleThreads();
-#endif
 
     if (!globalObjectClass) {
         JSGlobalObject* globalObject = JSGlobalObject::create(*globalData, JSGlobalObject::createStructure(*globalData, jsNull()));

Modified: trunk/Source/_javascript_Core/ChangeLog (95509 => 95510)


--- trunk/Source/_javascript_Core/ChangeLog	2011-09-20 02:48:04 UTC (rev 95509)
+++ trunk/Source/_javascript_Core/ChangeLog	2011-09-20 03:35:49 UTC (rev 95510)
@@ -1,3 +1,35 @@
+2011-09-19  Geoffrey Garen  <[email protected]>
+
+        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:
+
 2011-09-19  Sheriff Bot  <[email protected]>
 
         Unreviewed, rolling out r95493 and r95496.

Modified: trunk/Source/_javascript_Core/heap/MachineStackMarker.cpp (95509 => 95510)


--- trunk/Source/_javascript_Core/heap/MachineStackMarker.cpp	2011-09-20 02:48:04 UTC (rev 95509)
+++ trunk/Source/_javascript_Core/heap/MachineStackMarker.cpp	2011-09-20 03:35:49 UTC (rev 95510)
@@ -76,7 +76,7 @@
 #include <errno.h>
 #endif
 
-#if ENABLE(JSC_MULTIPLE_THREADS) && USE(PTHREADS) && !OS(WINDOWS) && !OS(DARWIN)
+#if USE(PTHREADS) && !OS(WINDOWS) && !OS(DARWIN)
 #include <signal.h>
 #endif
 
@@ -98,8 +98,6 @@
 #endif
 }
 
-#if ENABLE(JSC_MULTIPLE_THREADS)
-
 #if OS(DARWIN)
 typedef mach_port_t PlatformThread;
 #elif OS(WINDOWS)
@@ -145,20 +143,15 @@
     void* stackBase;
 };
 
-#endif
-
 MachineThreads::MachineThreads(Heap* heap)
     : m_heap(heap)
-#if ENABLE(JSC_MULTIPLE_THREADS)
     , m_registeredThreads(0)
     , m_threadSpecific(0)
-#endif
 {
 }
 
 MachineThreads::~MachineThreads()
 {
-#if ENABLE(JSC_MULTIPLE_THREADS)
     if (m_threadSpecific) {
         int error = pthread_key_delete(m_threadSpecific);
         ASSERT_UNUSED(error, !error);
@@ -170,11 +163,8 @@
         delete t;
         t = next;
     }
-#endif
 }
 
-#if ENABLE(JSC_MULTIPLE_THREADS)
-
 static inline PlatformThread getCurrentPlatformThread()
 {
 #if OS(DARWIN)
@@ -243,8 +233,6 @@
     }
 }
 
-#endif
-
 #if COMPILER(GCC)
 #define REGISTER_BUFFER_ALIGNMENT __attribute__ ((aligned (sizeof(void*))))
 #else
@@ -275,8 +263,6 @@
     conservativeRoots.add(stackBegin, stackEnd);
 }
 
-#if ENABLE(JSC_MULTIPLE_THREADS)
-
 static inline void suspendThread(const PlatformThread& platformThread)
 {
 #if OS(DARWIN)
@@ -482,14 +468,10 @@
     freePlatformThreadRegisters(regs);
 }
 
-#endif
-
 void MachineThreads::gatherConservativeRoots(ConservativeRoots& conservativeRoots, void* stackCurrent)
 {
     gatherFromCurrentThread(conservativeRoots, stackCurrent);
 
-#if ENABLE(JSC_MULTIPLE_THREADS)
-
     if (m_threadSpecific) {
 
         MutexLocker lock(m_registeredThreadsMutex);
@@ -510,7 +492,6 @@
         fastMallocAllow();
 #endif
     }
-#endif
 }
 
 } // namespace JSC

Modified: trunk/Source/_javascript_Core/heap/MachineStackMarker.h (95509 => 95510)


--- trunk/Source/_javascript_Core/heap/MachineStackMarker.h	2011-09-20 02:48:04 UTC (rev 95509)
+++ trunk/Source/_javascript_Core/heap/MachineStackMarker.h	2011-09-20 03:35:49 UTC (rev 95510)
@@ -22,13 +22,10 @@
 #ifndef MachineThreads_h
 #define MachineThreads_h
 
+#include <pthread.h>
 #include <wtf/Noncopyable.h>
 #include <wtf/ThreadingPrimitives.h>
 
-#if ENABLE(JSC_MULTIPLE_THREADS)
-#include <pthread.h>
-#endif
-
 namespace JSC {
 
     class Heap;
@@ -42,30 +39,23 @@
 
         void gatherConservativeRoots(ConservativeRoots&, void* stackCurrent);
 
-#if ENABLE(JSC_MULTIPLE_THREADS)
         void makeUsableFromMultipleThreads();
         void addCurrentThread(); // Only needs to be called by clients that can use the same heap from multiple threads.
-#endif
 
     private:
         void gatherFromCurrentThread(ConservativeRoots&, void* stackCurrent);
 
-#if ENABLE(JSC_MULTIPLE_THREADS)
         class Thread;
 
         static void removeThread(void*);
         void removeCurrentThread();
 
         void gatherFromOtherThread(ConservativeRoots&, Thread*);
-#endif
 
         Heap* m_heap;
-
-#if ENABLE(JSC_MULTIPLE_THREADS)
         Mutex m_registeredThreadsMutex;
         Thread* m_registeredThreads;
         pthread_key_t m_threadSpecific;
-#endif
     };
 
 } // namespace JSC

Modified: trunk/Source/_javascript_Core/runtime/InitializeThreading.cpp (95509 => 95510)


--- trunk/Source/_javascript_Core/runtime/InitializeThreading.cpp	2011-09-20 02:48:04 UTC (rev 95509)
+++ trunk/Source/_javascript_Core/runtime/InitializeThreading.cpp	2011-09-20 03:35:49 UTC (rev 95510)
@@ -44,7 +44,7 @@
 
 namespace JSC {
 
-#if OS(DARWIN) && ENABLE(JSC_MULTIPLE_THREADS)
+#if OS(DARWIN)
 static pthread_once_t initializeThreadingKeyOnce = PTHREAD_ONCE_INIT;
 #endif
 
@@ -59,14 +59,12 @@
 #if ENABLE(JIT) && ENABLE(ASSEMBLER)
     ExecutableAllocator::initializeAllocator();
 #endif
-#if ENABLE(JSC_MULTIPLE_THREADS)
     RegisterFile::initializeThreading();
-#endif
 }
 
 void initializeThreading()
 {
-#if OS(DARWIN) && ENABLE(JSC_MULTIPLE_THREADS)
+#if OS(DARWIN)
     pthread_once(&initializeThreadingKeyOnce, initializeThreadingOnce);
 #else
     static bool initializedThreading = false;

Modified: trunk/Source/_javascript_Core/runtime/JSGlobalData.cpp (95509 => 95510)


--- trunk/Source/_javascript_Core/runtime/JSGlobalData.cpp	2011-09-20 02:48:04 UTC (rev 95509)
+++ trunk/Source/_javascript_Core/runtime/JSGlobalData.cpp	2011-09-20 03:35:49 UTC (rev 95510)
@@ -50,19 +50,14 @@
 #include "Lookup.h"
 #include "Nodes.h"
 #include "Parser.h"
-#include "RegExpCache.h"
-#include "RegExpObject.h"
-#include "StrictEvalActivation.h"
-#include <wtf/WTFThreadData.h>
 #if ENABLE(REGEXP_TRACING)
 #include "RegExp.h"
 #endif
-
-
-#if ENABLE(JSC_MULTIPLE_THREADS)
+#include "RegExpCache.h"
+#include "RegExpObject.h"
+#include "StrictEvalActivation.h"
 #include <wtf/Threading.h>
-#endif
-
+#include <wtf/WTFThreadData.h>
 #if PLATFORM(MAC)
 #include <CoreFoundation/CoreFoundation.h>
 #endif
@@ -387,9 +382,7 @@
     JSGlobalData*& instance = sharedInstanceInternal();
     if (!instance) {
         instance = adoptRef(new JSGlobalData(APIShared, ThreadStackTypeSmall, SmallHeap)).leakRef();
-#if ENABLE(JSC_MULTIPLE_THREADS)
         instance->makeUsableFromMultipleThreads();
-#endif
     }
     return *instance;
 }

Modified: trunk/Source/_javascript_Core/runtime/JSGlobalData.h (95509 => 95510)


--- trunk/Source/_javascript_Core/runtime/JSGlobalData.h	2011-09-20 02:48:04 UTC (rev 95509)
+++ trunk/Source/_javascript_Core/runtime/JSGlobalData.h	2011-09-20 03:35:49 UTC (rev 95510)
@@ -129,10 +129,7 @@
         static PassRefPtr<JSGlobalData> createContextGroup(ThreadStackType, HeapSize = SmallHeap);
         ~JSGlobalData();
 
-#if ENABLE(JSC_MULTIPLE_THREADS)
-        // Will start tracking threads that use the heap, which is resource-heavy.
         void makeUsableFromMultipleThreads() { heap.machineThreads().makeUsableFromMultipleThreads(); }
-#endif
 
         GlobalDataType globalDataType;
         ClientData* clientData;

Modified: trunk/Source/_javascript_Core/runtime/JSLock.cpp (95509 => 95510)


--- trunk/Source/_javascript_Core/runtime/JSLock.cpp	2011-09-20 02:48:04 UTC (rev 95509)
+++ trunk/Source/_javascript_Core/runtime/JSLock.cpp	2011-09-20 03:35:49 UTC (rev 95510)
@@ -35,7 +35,7 @@
 // JSLock is only needed to support an obsolete execution model where _javascript_Core
 // automatically protected against concurrent access from multiple threads.
 // So it's safe to disable it on non-mac platforms where we don't have native pthreads.
-#if ENABLE(JSC_MULTIPLE_THREADS) && (OS(DARWIN) || USE(PTHREADS))
+#if (OS(DARWIN) || USE(PTHREADS))
 
 // Acquire this mutex before accessing lock-related data.
 static pthread_mutex_t JSMutex = PTHREAD_MUTEX_INITIALIZER;
@@ -213,7 +213,7 @@
     --lockDropDepth;
 }
 
-#else // ENABLE(JSC_MULTIPLE_THREADS) && (OS(DARWIN) || USE(PTHREADS))
+#else // (OS(DARWIN) || USE(PTHREADS))
 
 JSLock::JSLock(ExecState*)
     : m_lockBehavior(SilenceAssertionsOnly)
@@ -260,6 +260,6 @@
 {
 }
 
-#endif // ENABLE(JSC_MULTIPLE_THREADS) && (OS(DARWIN) || USE(PTHREADS))
+#endif // (OS(DARWIN) || USE(PTHREADS))
 
 } // namespace JSC

Modified: trunk/Source/_javascript_Core/runtime/Structure.cpp (95509 => 95510)


--- trunk/Source/_javascript_Core/runtime/Structure.cpp	2011-09-20 02:48:04 UTC (rev 95509)
+++ trunk/Source/_javascript_Core/runtime/Structure.cpp	2011-09-20 03:35:49 UTC (rev 95510)
@@ -34,10 +34,7 @@
 #include "StructureChain.h"
 #include <wtf/RefCountedLeakCounter.h>
 #include <wtf/RefPtr.h>
-
-#if ENABLE(JSC_MULTIPLE_THREADS)
 #include <wtf/Threading.h>
-#endif
 
 #define DUMP_STRUCTURE_ID_STATISTICS 0
 

Modified: trunk/Source/_javascript_Core/wtf/Platform.h (95509 => 95510)


--- trunk/Source/_javascript_Core/wtf/Platform.h	2011-09-20 02:48:04 UTC (rev 95509)
+++ trunk/Source/_javascript_Core/wtf/Platform.h	2011-09-20 03:35:49 UTC (rev 95510)
@@ -508,10 +508,6 @@
 #define WTF_USE_PTHREAD_BASED_QT 1
 #endif
 
-#if !defined(ENABLE_JSC_MULTIPLE_THREADS)
-#define ENABLE_JSC_MULTIPLE_THREADS 1
-#endif
-
 #if !defined(ENABLE_WTF_MULTIPLE_THREADS)
 #define ENABLE_WTF_MULTIPLE_THREADS 1
 #endif
@@ -1044,10 +1040,8 @@
 #endif
 
 #if !defined(ENABLE_LAZY_BLOCK_FREEING)
-#if ENABLE(JSC_MULTIPLE_THREADS)
 #define ENABLE_LAZY_BLOCK_FREEING 1
 #endif
-#endif
 
 #ifndef ENABLE_LARGE_HEAP
 #if CPU(X86) || CPU(X86_64)
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to