Changeset 58133 in webkit for trunk/JavaScriptCore/API


Ignore:
Timestamp:
Apr 22, 2010, 5:11:37 PM (15 years ago)
Author:
[email protected]
Message:

https://bugs.webkit.org/show_bug.cgi?id=38006
Change lifetime of JSC::IdentifierTables used by WebCores to match AtomicStringTable

Reviewed by Geoff Garen.

Presently JSC's IdentifierTables are owned by the JSGlobalData. For
JSGlobalData objects created via the API this should continue to be the case,
but for the JSGlobalData objects used by WebCore (the main thread's common
global data, and those for workers) use a IdentifierTable provided (and owned)
by wtfThreadData. This allow the lifetime of these IdentifierTable to match
those of the corresponding AtomicStringTables.

  • API/APIShims.h:

(JSC::APIEntryShim::APIEntryShim):

  • API/JSContextRef.cpp:

(JSContextGroupCreate):

  • runtime/Collector.cpp:

(JSC::Heap::protect):
(JSC::Heap::unprotect):
(JSC::Heap::markRoots):

  • runtime/JSGlobalData.cpp:

(JSC::JSGlobalData::JSGlobalData):
(JSC::JSGlobalData::~JSGlobalData):
(JSC::JSGlobalData::createContextGroup):
(JSC::JSGlobalData::create):
(JSC::JSGlobalData::sharedInstance):

  • runtime/JSGlobalData.h:

(JSC::JSGlobalData::):
(JSC::JSGlobalData::isSharedInstance):

  • runtime/JSLock.cpp:

(JSC::JSLock::JSLock):
(JSC::JSLock::lock):
(JSC::JSLock::unlock):
(JSC::JSLock::DropAllLocks::DropAllLocks):

  • wtf/WTFThreadData.cpp:

(WTF::WTFThreadData::WTFThreadData):
(WTF::WTFThreadData::~WTFThreadData):

Location:
trunk/JavaScriptCore/API
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/API/APIShims.h

    r57879 r58133  
    6767    APIEntryShim(JSGlobalData* globalData, bool registerThread = true)
    6868        : APIEntryShimWithoutLock(globalData, registerThread)
    69         , m_lock(globalData->isSharedInstance ? LockForReal : SilenceAssertionsOnly)
     69        , m_lock(globalData->isSharedInstance() ? LockForReal : SilenceAssertionsOnly)
    7070    {
    7171    }
  • trunk/JavaScriptCore/API/JSContextRef.cpp

    r58012 r58133  
    4747{
    4848    initializeThreading();
    49     return toRef(JSGlobalData::createNonDefault(ThreadStackTypeSmall).releaseRef());
     49    return toRef(JSGlobalData::createContextGroup(ThreadStackTypeSmall).releaseRef());
    5050}
    5151
     
    8585
    8686    JSLock lock(LockForReal);
    87     RefPtr<JSGlobalData> globalData = group ? PassRefPtr<JSGlobalData>(toJS(group)) : JSGlobalData::createNonDefault(ThreadStackTypeSmall);
     87    RefPtr<JSGlobalData> globalData = group ? PassRefPtr<JSGlobalData>(toJS(group)) : JSGlobalData::createContextGroup(ThreadStackTypeSmall);
    8888
    8989    APIEntryShim entryShim(globalData.get(), false);
Note: See TracChangeset for help on using the changeset viewer.