Changeset 35442 in webkit for trunk/JavaScriptCore/API/APICast.h


Ignore:
Timestamp:
Jul 29, 2008, 11:05:11 PM (17 years ago)
Author:
[email protected]
Message:

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().
  • 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.
File:
1 edited

Legend:

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

    r33979 r35442  
    3838}
    3939
     40typedef const struct OpaqueJSContextGroup* JSContextGroupRef;
    4041typedef const struct OpaqueJSContext* JSContextRef;
    4142typedef struct OpaqueJSContext* JSGlobalContextRef;
     
    7576{
    7677    return reinterpret_cast<KJS::PropertyNameArray*>(a);
     78}
     79
     80inline KJS::JSGlobalData* toJS(JSContextGroupRef g)
     81{
     82    return reinterpret_cast<KJS::JSGlobalData*>(const_cast<OpaqueJSContextGroup*>(g));
    7783}
    7884
     
    117123}
    118124
     125inline JSContextGroupRef toRef(KJS::JSGlobalData* g)
     126{
     127    return reinterpret_cast<JSContextGroupRef>(g);
     128}
     129
    119130#endif // APICast_h
Note: See TracChangeset for help on using the changeset viewer.