Reviewed by Geoff Garen.
authorap@webkit.org <ap@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 30 Jul 2008 06:05:11 +0000 (06:05 +0000)
committerap@webkit.org <ap@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 30 Jul 2008 06:05:11 +0000 (06:05 +0000)
commit67d8443ae9f89edd26b51d63b8bf89eaccf96255
tree8ddccde31a2827c9e4b03c8b51d31bbfc2dc9dbe
parent8d07085ec9747c29d1274ce9ecbb3de1be670c3b
    Reviewed by Geoff Garen.

        Implement JSContextGroup APIs to make concurrent execution possible for
        JavaScriptCore clients.

        This changes the behavior of JSGlobalContextCreate(), so that it now uses a private context
        group for each context, making JSlock implicit locking unnecessary.

        * API/JSContextRef.h:
        * API/JSContextRef.cpp:
        (JSContextGroupCreate):
        (JSContextGroupRetain):
        (JSContextGroupRelease):
        (JSGlobalContextCreate):
        (JSGlobalContextCreateInGroup):
        (JSGlobalContextRelease):
        (JSContextGetGroup):
        Added new methods. JSGlobalContextCreate() calls JSGlobalContextCreateInGroup() now.

        * API/APICast.h: (toJS): (toRef): Added converters for JSContextGroupRef.
        * API/JSBase.cpp: (JSGarbageCollect): JSGarbageCollect(0) is now a no-op, and the passed in
        context is actually used.

        * API/JSBase.h: Aded a typedef for JSContextGroupRef. Updated documentation for
        JSGarbageCollect().

        * JavaScriptCore.exp: Removed JSGlobalData::sharedInstance().

        * kjs/JSGlobalData.cpp:
        * kjs/JSGlobalData.h:
        Removed support for JSGlobalData shared instance. JSGlobalData::isSharedInstance member
        variable still remains, to be deleted in a followup patch.

        * kjs/JSLock.cpp: (KJS::JSLock::JSLock): Disabled JSLock, to be deleted in a follow-up patch.

        * kjs/collector.cpp:
        (KJS::Heap::markOtherThreadConservatively): Removed an assertion that referenced
        JSGlobalData::sharedInstance.

        * kjs/collector.h: Made Heap destructor public, so that JSContextRelease can use it.

JavaScriptGlue:
        * JSRun.cpp:
        (JSRun::JSRun):
        * JSUtils.cpp:
        (getThreadGlobalExecState):
        Changed JavaScriptGlue to use a JSGlobalData of its own, now that there is no shared
        instance.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@35442 268f45cc-cd09-0410-ab3c-d52691b4dbfc
15 files changed:
JavaScriptCore/API/APICast.h
JavaScriptCore/API/JSBase.cpp
JavaScriptCore/API/JSBase.h
JavaScriptCore/API/JSContextRef.cpp
JavaScriptCore/API/JSContextRef.h
JavaScriptCore/ChangeLog
JavaScriptCore/JavaScriptCore.exp
JavaScriptCore/kjs/JSGlobalData.cpp
JavaScriptCore/kjs/JSGlobalData.h
JavaScriptCore/kjs/JSLock.cpp
JavaScriptCore/kjs/collector.cpp
JavaScriptCore/kjs/collector.h
JavaScriptGlue/ChangeLog
JavaScriptGlue/JSRun.cpp
JavaScriptGlue/JSUtils.cpp