Ignore:
Timestamp:
Jun 19, 2008, 10:29:29 AM (17 years ago)
Author:
[email protected]
Message:

Reviewed by Darin.

Prepare JavaScript heap for being per-thread.

File:
1 edited

Legend:

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

    r34607 r34659  
    7575
    7676    if (!jsClass)
    77         return toRef(new JSObject(exec->lexicalGlobalObject()->objectPrototype())); // slightly more efficient
     77        return toRef(new (exec) JSObject(exec->lexicalGlobalObject()->objectPrototype())); // slightly more efficient
    7878
    7979    JSValue* jsPrototype = jsClass->prototype(ctx);
     
    8181        jsPrototype = exec->lexicalGlobalObject()->objectPrototype();
    8282
    83     return toRef(new JSCallbackObject<JSObject>(exec, jsClass, jsPrototype, data));
     83    return toRef(new (exec) JSCallbackObject<JSObject>(exec, jsClass, jsPrototype, data));
    8484}
    8585
     
    9090    Identifier nameID = name ? Identifier(exec, toJS(name)) : Identifier(exec, "anonymous");
    9191   
    92     return toRef(new JSCallbackFunction(exec, callAsFunction, nameID));
     92    return toRef(new (exec) JSCallbackFunction(exec, callAsFunction, nameID));
    9393}
    9494
     
    102102        : exec->dynamicGlobalObject()->objectPrototype();
    103103   
    104     JSCallbackConstructor* constructor = new JSCallbackConstructor(exec, jsClass, callAsConstructor);
     104    JSCallbackConstructor* constructor = new (exec) JSCallbackConstructor(exec, jsClass, callAsConstructor);
    105105    constructor->putDirect(exec->propertyNames().prototype, jsPrototype, DontEnum | DontDelete | ReadOnly);
    106106    return toRef(constructor);
     
    119119    ArgList args;
    120120    for (unsigned i = 0; i < parameterCount; i++)
    121         args.append(jsString(UString(toJS(parameterNames[i]))));
    122     args.append(jsString(UString(bodyRep)));
     121        args.append(jsString(exec, UString(toJS(parameterNames[i]))));
     122    args.append(jsString(exec, UString(bodyRep)));
    123123
    124124    JSObject* result = exec->dynamicGlobalObject()->functionConstructor()->construct(exec, args, nameID, UString(sourceURLRep), startingLineNumber);
Note: See TracChangeset for help on using the changeset viewer.