Ignore:
Timestamp:
Dec 5, 2007, 6:31:41 PM (18 years ago)
Author:
[email protected]
Message:

JavaScriptCore:

Reviewed by Darin Adler.

Third step in refactoring JSGlobalObject: Moved data members and
functions accessing data members from Interpreter to JSGlobalObject.
Changed Interpreter member functions to static functions.


This resolves a bug in global object bootstrapping, where the global
ExecState could be used when uninitialized.


This is a big change, but it's mostly code motion and renaming.


Layout and JS tests, and testjsglue and testapi, pass. SunSpider reports
a .7% regression, but Shark sees no difference related to this patch,
and SunSpider reported a .7% speedup from an earlier step in this
refactoring, so I think it's fair to call that a wash.

JavaScriptGlue:

Reviewed by Darin Adler.

Third step in refactoring JSGlobalObject: Moved data members and data
member access from Interpreter to JSGlobalObject. Replaced JSInterpreter
subclass with JSGlobalObject subclass.


  • JSRun.cpp: (JSRun::JSRun): (JSRun::Evaluate): (JSRun::CheckSyntax):
  • JSRun.h: (JSGlueGlobalObject::JSGlueGlobalObject):
  • JSUtils.cpp: (KJSValueToCFTypeInternal):
  • JSValueWrapper.cpp: (getThreadGlobalExecState):

WebCore:

Reviewed by Darin Adler.

Third step in refactoring JSGlobalObject: Moved data members and data
member access from Interpreter to JSGlobalObject. Changed Interpreter
member functions to static functions. Same for the subclass,
ScriptInterpreter.


This is a big change, but it's mostly code motion and renaming.

WebKit/mac:

Reviewed by Darin Adler.

Third step in refactoring JSGlobalObject: Moved data members and data
member access from Interpreter to JSGlobalObject.


  • WebView/WebFrame.mm: (-[WebFrame _attachScriptDebugger]):

WebKit/win:

Reviewed by Darin Adler.

Third step in refactoring JSGlobalObject: Moved data members and data
member access from Interpreter to JSGlobalObject.


  • WebFrame.cpp: (WebFrame::globalContext): (WebFrame::attachScriptDebugger): (WebFrame::windowObjectCleared):
  • WebScriptDebugger.cpp: (WebScriptDebugger::WebScriptDebugger):
File:
1 edited

Legend:

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

    r27608 r28468  
    226226JSValue* ArrayProtoFuncConcat::callAsFunction(ExecState* exec, JSObject* thisObj, const List& args)
    227227{
    228     JSObject* arr = static_cast<JSObject*>(exec->lexicalInterpreter()->builtinArray()->construct(exec, List::empty()));
     228    JSObject* arr = static_cast<JSObject*>(exec->lexicalGlobalObject()->arrayConstructor()->construct(exec, List::empty()));
    229229    int n = 0;
    230230    JSValue *curArg = thisObj;
     
    334334
    335335    // We return a new array
    336     JSObject *resObj = static_cast<JSObject *>(exec->lexicalInterpreter()->builtinArray()->construct(exec,List::empty()));
     336    JSObject *resObj = static_cast<JSObject *>(exec->lexicalGlobalObject()->arrayConstructor()->construct(exec,List::empty()));
    337337    JSValue* result = resObj;
    338338    double begin = args[0]->toInteger(exec);
     
    421421                l.append(jObj);
    422422                l.append(minObj);
    423                 cmp = sortFunction->call(exec, exec->dynamicInterpreter()->globalObject(), l)->toNumber(exec);
     423                cmp = sortFunction->call(exec, exec->dynamicGlobalObject(), l)->toNumber(exec);
    424424            } else {
    425425              cmp = (jObj->toString(exec) < minObj->toString(exec)) ? -1 : 1;
     
    450450{
    451451    // 15.4.4.12 - oh boy this is huge
    452     JSObject *resObj = static_cast<JSObject *>(exec->lexicalInterpreter()->builtinArray()->construct(exec, List::empty()));
     452    JSObject *resObj = static_cast<JSObject *>(exec->lexicalGlobalObject()->arrayConstructor()->construct(exec, List::empty()));
    453453    JSValue* result = resObj;
    454454    unsigned length = thisObj->get(exec, exec->propertyNames().length)->toUInt32(exec);
     
    527527        return throwError(exec, TypeError);
    528528   
    529     JSObject *applyThis = args[1]->isUndefinedOrNull() ? exec->dynamicInterpreter()->globalObject() :  args[1]->toObject(exec);
    530     JSObject *resultArray = static_cast<JSObject*>(exec->lexicalInterpreter()->builtinArray()->construct(exec, List::empty()));
     529    JSObject *applyThis = args[1]->isUndefinedOrNull() ? exec->dynamicGlobalObject() :  args[1]->toObject(exec);
     530    JSObject *resultArray = static_cast<JSObject*>(exec->lexicalGlobalObject()->arrayConstructor()->construct(exec, List::empty()));
    531531
    532532    unsigned filterIndex = 0;
     
    560560        return throwError(exec, TypeError);
    561561   
    562     JSObject *applyThis = args[1]->isUndefinedOrNull() ? exec->dynamicInterpreter()->globalObject() :  args[1]->toObject(exec);
     562    JSObject *applyThis = args[1]->isUndefinedOrNull() ? exec->dynamicGlobalObject() :  args[1]->toObject(exec);
    563563
    564564    unsigned length = thisObj->get(exec, exec->propertyNames().length)->toUInt32(exec);
     
    566566    List mapArgs;
    567567    mapArgs.append(jsNumber(length));
    568     JSObject* resultArray = static_cast<JSObject*>(exec->lexicalInterpreter()->builtinArray()->construct(exec, mapArgs));
     568    JSObject* resultArray = static_cast<JSObject*>(exec->lexicalGlobalObject()->arrayConstructor()->construct(exec, mapArgs));
    569569
    570570    for (unsigned k = 0; k < length && !exec->hadException(); ++k) {
     
    600600        return throwError(exec, TypeError);
    601601   
    602     JSObject *applyThis = args[1]->isUndefinedOrNull() ? exec->dynamicInterpreter()->globalObject() :  args[1]->toObject(exec);
     602    JSObject *applyThis = args[1]->isUndefinedOrNull() ? exec->dynamicGlobalObject() :  args[1]->toObject(exec);
    603603   
    604604    JSValue* result = jsBoolean(true);
     
    635635        return throwError(exec, TypeError);
    636636
    637     JSObject* applyThis = args[1]->isUndefinedOrNull() ? exec->dynamicInterpreter()->globalObject() :  args[1]->toObject(exec);
     637    JSObject* applyThis = args[1]->isUndefinedOrNull() ? exec->dynamicGlobalObject() :  args[1]->toObject(exec);
    638638
    639639    unsigned length = thisObj->get(exec, exec->propertyNames().length)->toUInt32(exec);
     
    660660        return throwError(exec, TypeError);
    661661
    662     JSObject* applyThis = args[1]->isUndefinedOrNull() ? exec->dynamicInterpreter()->globalObject() :  args[1]->toObject(exec);
     662    JSObject* applyThis = args[1]->isUndefinedOrNull() ? exec->dynamicGlobalObject() :  args[1]->toObject(exec);
    663663
    664664    JSValue* result = jsBoolean(false);
     
    770770    if (n != args[0]->toNumber(exec))
    771771      return throwError(exec, RangeError, "Array size is not a small enough positive integer.");
    772     return new ArrayInstance(exec->lexicalInterpreter()->builtinArrayPrototype(), n);
     772    return new ArrayInstance(exec->lexicalGlobalObject()->arrayPrototype(), n);
    773773  }
    774774
    775775  // otherwise the array is constructed with the arguments in it
    776   return new ArrayInstance(exec->lexicalInterpreter()->builtinArrayPrototype(), args);
     776  return new ArrayInstance(exec->lexicalGlobalObject()->arrayPrototype(), args);
    777777}
    778778
Note: See TracChangeset for help on using the changeset viewer.