Changeset 48315 in webkit for trunk/JavaScriptCore


Ignore:
Timestamp:
Sep 11, 2009, 2:34:55 PM (16 years ago)
Author:
[email protected]
Message:

Reviewed by Geoff Garen.

https://bugs.webkit.org/show_bug.cgi?id=29207
Add checks for using WebCore JS context on secondary threads

Location:
trunk/JavaScriptCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/ChangeLog

    r48300 r48315  
     12009-09-11  Alexey Proskuryakov  <[email protected]>
     2
     3        Reviewed by Geoff Garen.
     4
     5        https://bugs.webkit.org/show_bug.cgi?id=29207
     6        Add checks for using WebCore JS context on secondary threads
     7
     8        * runtime/JSGlobalData.cpp: (JSC::JSGlobalData::JSGlobalData):
     9        * runtime/JSGlobalData.h:
     10        Added a new mainThreadOnly flag that WebCore would set.
     11
     12        * runtime/Collector.cpp: (JSC::Heap::registerThread): JSC API methods always call this,
     13        so this is a good place to check that the API isn't used form a wrong thread.
     14
    1152009-09-11  Jocelyn Turcotte  <[email protected]>
    216
  • trunk/JavaScriptCore/runtime/Collector.cpp

    r48068 r48315  
    652652void Heap::registerThread()
    653653{
     654    ASSERT(!m_globalData->mainThreadOnly || isMainThread());
     655
    654656    if (!m_currentThreadRegistrar || pthread_getspecific(m_currentThreadRegistrar))
    655657        return;
  • trunk/JavaScriptCore/runtime/JSGlobalData.cpp

    r47738 r48315  
    148148    , firstStringifierToMark(0)
    149149    , markStack(vptrSet.jsArrayVPtr)
     150#ifndef NDEBUG
     151    , mainThreadOnly(false)
     152#endif
    150153{
    151154#if PLATFORM(MAC)
  • trunk/JavaScriptCore/runtime/JSGlobalData.h

    r47622 r48315  
    151151
    152152        MarkStack markStack;
     153
     154#ifndef NDEBUG
     155        bool mainThreadOnly;
     156#endif
     157
    153158    private:
    154159        JSGlobalData(bool isShared, const VPtrSet&);
Note: See TracChangeset for help on using the changeset viewer.