Ignore:
Timestamp:
Jun 26, 2008, 11:59:26 AM (17 years ago)
Author:
[email protected]
Message:

Reviewed by Maciej.

Make JSGlobalData per-thread.

No change on SunSpider total.

  • wtf/ThreadSpecific.h: Re-enabled the actual implementation.
  • kjs/JSGlobalObject.cpp: (KJS::JSGlobalObject::~JSGlobalObject): Re-added a JSLock-related assertion. We'll probably want to preserve these somehow to keep legacy behavior in working condition. (KJS::JSGlobalObject::init): Initialize globalData pointer earlier, so that it is ready when updating JSGlobalObject linked list.
  • kjs/JSGlobalObject.h: (KJS::JSGlobalObject::head): Changed head() to be non-static, and to use JSGlobalData associated with the current object.
  • kjs/InitializeThreading.cpp: (KJS::initializeThreadingOnce): Removed a no longer needed Heap::registerAsMainThread() call.
  • kjs/JSGlobalData.h: Removed a lying lie comment - parserObjectExtraRefCounts is not transient, and while newParserObjects may conceptually be such, there is still some node manipulation going on outside Parser::parse which touches it.
  • kjs/JSGlobalData.cpp: (KJS::JSGlobalData::~JSGlobalData): Delete recently added members. (KJS::JSGlobalData::sharedInstance): Actually use a separate instance.
  • kjs/collector.cpp: (KJS::Heap::Heap): (KJS::Heap::~Heap): Added a destructor, which unconditionally deletes everything. (KJS::Heap::sweep): Removed code related to "collect on main thread only" logic. (KJS::Heap::collect): Ditto. (KJS::Heap::globalObjectCount): Explicitly use per-thread instance of JSGlobalObject linked list now that JSGlobalObject::head() is not static. Curently, WebCoreStatistics methods only work with the main thread currently anyway. (KJS::Heap::protectedGlobalObjectCount): Ditto.
  • kjs/collector.h: Removed code related to "collect on main thread only" logic.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/wtf/ThreadSpecific.h

    r34380 r34810  
    5353    void static destroy(void* ptr);
    5454
    55 #if 0 // FIXME: Temporary disabled until the rest of multithreading support is in.
    5655#if USE(PTHREADS) || PLATFORM(WIN)
    5756    struct Data : Noncopyable {
     
    6463    pthread_key_t m_key;
    6564#endif
    66 
    67 #else // Temporary stub implementation.
    68     T m_data;
    69 #endif
    7065};
    71 
    72 #if 0 // FIXME: Temporary disabled until the rest of multithreading support is in.
    7366
    7467#if USE(PTHREADS) || PLATFORM(WIN)
     
    112105#endif
    113106
    114 #else // Temporary stub implementation.
    115 
    116 template<typename T>
    117 inline ThreadSpecific<T>::ThreadSpecific()
    118     : m_data()
    119 {
    120 }
    121 
    122 template<typename T>
    123 inline ThreadSpecific<T>::~ThreadSpecific()
    124 {
    125 }
    126 
    127 template<typename T>
    128 inline T* ThreadSpecific<T>::get()
    129 {
    130     return &m_data;
    131 }
    132 
    133 template<typename T>
    134 inline void ThreadSpecific<T>::set(T*)
    135 {
    136 }
    137 
    138 #endif
    139 
    140107template<typename T>
    141108inline ThreadSpecific<T>::operator T*()
Note: See TracChangeset for help on using the changeset viewer.