Ignore:
Timestamp:
May 2, 2008, 3:07:53 AM (17 years ago)
Author:
[email protected]
Message:

Reviewed by Geoffrey Garen.

https://bugs.webkit.org/show_bug.cgi?id=18826
Make JavaScript heap per-thread

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/kjs/function_object.cpp

    r32652 r32807  
    4545FunctionPrototype::FunctionPrototype(ExecState* exec)
    4646{
    47     putDirect(exec->propertyNames().length, jsNumber(0), DontDelete | ReadOnly | DontEnum);
    48 
    49     putDirectFunction(new PrototypeFunction(exec, this, 0, exec->propertyNames().toString, functionProtoFuncToString), DontEnum);
    50     putDirectFunction(new PrototypeFunction(exec, this, 2, exec->propertyNames().apply, functionProtoFuncApply), DontEnum);
    51     putDirectFunction(new PrototypeFunction(exec, this, 1, exec->propertyNames().call, functionProtoFuncCall), DontEnum);
     47    putDirect(exec->propertyNames().length, jsNumber(exec, 0), DontDelete | ReadOnly | DontEnum);
     48
     49    putDirectFunction(new (exec) PrototypeFunction(exec, this, 0, exec->propertyNames().toString, functionProtoFuncToString), DontEnum);
     50    putDirectFunction(new (exec) PrototypeFunction(exec, this, 2, exec->propertyNames().apply, functionProtoFuncApply), DontEnum);
     51    putDirectFunction(new (exec) PrototypeFunction(exec, this, 1, exec->propertyNames().call, functionProtoFuncCall), DontEnum);
    5252}
    5353
     
    7171    if (thisObj->inherits(&FunctionImp::info)) {
    7272        FunctionImp* fi = static_cast<FunctionImp*>(thisObj);
    73         return jsString("function " + fi->functionName().ustring() + "(" + fi->body->paramString() + ") " + fi->body->toString());
    74     }
    75 
    76     return jsString("function " + static_cast<InternalFunctionImp*>(thisObj)->functionName().ustring() + "() {\n    [native code]\n}");
     73        return jsString(exec, "function " + fi->functionName().ustring() + "(" + fi->body->paramString() + ") " + fi->body->toString());
     74    }
     75
     76    return jsString(exec, "function " + static_cast<InternalFunctionImp*>(thisObj)->functionName().ustring() + "() {\n    [native code]\n}");
    7777}
    7878
     
    134134
    135135    // Number of arguments for constructor
    136     putDirect(exec->propertyNames().length, jsNumber(1), ReadOnly | DontDelete | DontEnum);
     136    putDirect(exec->propertyNames().length, jsNumber(exec, 1), ReadOnly | DontDelete | DontEnum);
    137137}
    138138
     
    169169    Debugger* dbg = exec->dynamicGlobalObject()->debugger();
    170170    if (dbg && !dbg->sourceParsed(exec, sourceId, UString(), body, lineNumber, errLine, errMsg))
    171         return new JSObject();
     171        return new (exec) JSObject();
    172172
    173173    // No program node == syntax error - throw a syntax error
     
    180180    scopeChain.push(exec->lexicalGlobalObject());
    181181
    182     FunctionImp* fimp = new FunctionImp(exec, functionName, functionBody.get(), scopeChain);
     182    FunctionImp* fimp = new (exec) FunctionImp(exec, functionName, functionBody.get(), scopeChain);
    183183
    184184    // parse parameter list. throw syntax error on illegal identifiers
Note: See TracChangeset for help on using the changeset viewer.