Ignore:
Timestamp:
Jul 14, 2008, 4:28:57 AM (17 years ago)
Author:
[email protected]
Message:

Reviewed by Geoff Garen.

Eliminate per-thread JavaScript global data instance support and make arbitrary
global data/global object combinations possible.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/API/JSContextRef.cpp

    r34947 r35159  
    4444    JSLock lock(true);
    4545
     46    JSGlobalData* sharedGlobalData = &JSGlobalData::sharedInstance();
     47
    4648    if (!globalObjectClass) {
    47         JSGlobalObject* globalObject = new (JSGlobalObject::Shared) JSGlobalObject;
     49        JSGlobalObject* globalObject = new (sharedGlobalData) JSGlobalObject;
    4850        return JSGlobalContextRetain(toGlobalRef(globalObject->globalExec()));
    4951    }
    5052
    51     JSGlobalObject* globalObject = new (JSGlobalObject::Shared) JSCallbackObject<JSGlobalObject>(globalObjectClass);
     53    JSGlobalObject* globalObject = new (sharedGlobalData) JSCallbackObject<JSGlobalObject>(globalObjectClass);
    5254    JSGlobalContextRef ctx = toGlobalRef(globalObject->globalExec());
    5355    JSValue* prototype = globalObjectClass->prototype(ctx);
     
    6163{
    6264    ExecState* exec = toJS(ctx);
     65    exec->globalData().heap->registerThread();
    6366    JSLock lock(exec);
     67
    6468    gcProtect(exec->dynamicGlobalObject());
    6569    return ctx;
     
    7074    ExecState* exec = toJS(ctx);
    7175    JSLock lock(exec);
     76
    7277    gcUnprotect(exec->dynamicGlobalObject());
    7378}
     
    7681{
    7782    ExecState* exec = toJS(ctx);
     83    exec->globalData().heap->registerThread();
    7884
    7985    // It is necessary to call toThisObject to get the wrapper object when used with WebCore.
Note: See TracChangeset for help on using the changeset viewer.