Ignore:
Timestamp:
Dec 5, 2007, 6:31:41 PM (17 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/API/JSObjectRef.cpp

    r27763 r28468  
    3737#include "JSGlobalObject.h"
    3838
     39#include "PropertyNameArray.h"
     40#include "function.h"
     41#include "function_object.h"
    3942#include "identifier.h"
    40 #include "function.h"
    4143#include "internal.h"
    4244#include "object.h"
    43 #include "PropertyNameArray.h"
     45#include "object_object.h"
    4446
    4547using namespace KJS;
     
    7476
    7577    if (!jsClass)
    76         return toRef(new JSObject(exec->lexicalInterpreter()->builtinObjectPrototype())); // slightly more efficient
     78        return toRef(new JSObject(exec->lexicalGlobalObject()->objectPrototype())); // slightly more efficient
    7779
    7880    JSValue* jsPrototype = jsClass->prototype(ctx);
    7981    if (!jsPrototype)
    80         jsPrototype = exec->lexicalInterpreter()->builtinObjectPrototype();
     82        jsPrototype = exec->lexicalGlobalObject()->objectPrototype();
    8183
    8284    return toRef(new JSCallbackObject<JSObject>(exec, jsClass, jsPrototype, data));
     
    99101    JSValue* jsPrototype = jsClass
    100102        ? jsClass->prototype(ctx)
    101         : exec->dynamicInterpreter()->builtinObjectPrototype();
     103        : exec->dynamicGlobalObject()->objectPrototype();
    102104   
    103105    JSObject* constructor = new JSCallbackConstructor(exec, jsClass, callAsConstructor);
     
    121123    args.append(jsString(UString(bodyRep)));
    122124
    123     JSObject* result = exec->dynamicInterpreter()->builtinFunction()->construct(exec, args, nameID, UString(sourceURLRep), startingLineNumber);
     125    JSObject* result = exec->dynamicGlobalObject()->functionConstructor()->construct(exec, args, nameID, UString(sourceURLRep), startingLineNumber);
    124126    if (exec->hadException()) {
    125127        if (exception)
     
    275277
    276278    if (!jsThisObject)
    277         jsThisObject = exec->dynamicInterpreter()->globalObject();
     279        jsThisObject = exec->dynamicGlobalObject();
    278280   
    279281    List argList;
Note: See TracChangeset for help on using the changeset viewer.