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/kjs/ExecState.h

    r28110 r28468  
    5757    public:
    5858        /**
    59          * Returns the interpreter currently running code
     59         * Returns the global object that was in scope when the current script started executing.
    6060         */
    61         Interpreter* dynamicInterpreter() const { return m_interpreter; }
     61        JSGlobalObject* dynamicGlobalObject() const { return m_globalObject; }
    6262       
    6363        /**
    64          * Returns the interpreter associated with the current scope's global object
     64         * Returns the global object that was in scope when the current body of code was defined.
    6565         */
    66         Interpreter* lexicalInterpreter() const;
     66        JSGlobalObject* lexicalGlobalObject() const;
    6767               
    6868        void setException(JSValue* e) { m_exception = e; }
     
    7979        JSObject* thisValue() const { return m_thisVal; }
    8080       
    81         ExecState* callingExecState() { return m_callingExecState; }
     81        ExecState* callingExecState() { return m_callingExec; }
    8282       
    8383        JSObject* activationObject() { return m_activation; }
     
    9999        bool inSwitch() const { return (m_switchDepth > 0); }
    100100
    101         void setGlobalObject(JSGlobalObject*);
    102        
    103101        void mark();
    104102       
     
    110108        void updateLocalStorage();
    111109   
    112     private:
    113         ExecState(Interpreter* interp, JSGlobalObject* glob, JSObject* thisV,
     110    public:
     111        ExecState(JSGlobalObject* glob, JSObject* thisV,
    114112                  FunctionBodyNode* currentBody, CodeType type = GlobalCode,
    115                   ExecState* callingExecState = 0, FunctionImp* function = 0, const List* args = 0);
     113                  ExecState* callingExecState = 0, ExecState* currentExec = 0,
     114                  FunctionImp* function = 0, const List* args = 0);
    116115        ~ExecState();
    117116
     117    private:
    118118        // ExecStates are always stack-allocated, and the garbage collector
    119119        // marks the stack, so we don't need to protect the objects below from GC.
    120120
    121         Interpreter* m_interpreter;
     121        JSGlobalObject* m_globalObject;
    122122        JSValue* m_exception;
    123123        CommonIdentifiers* m_propertyNames;
    124124
    125         ExecState* m_callingExecState;
    126         ExecState* m_savedExecState;
     125        ExecState* m_callingExec;
     126        ExecState* m_savedExec;
    127127        FunctionBodyNode* m_currentBody;
    128128       
Note: See TracChangeset for help on using the changeset viewer.