Ignore:
Timestamp:
Dec 2, 2007, 11:43:29 PM (17 years ago)
Author:
[email protected]
Message:

JavaScriptCore:

Reviewed by Eric Seidel.

Second step in refactoring JSGlobalObject: moved virtual functions from
Interpreter to JSGlobalObject.


Layout and JS tests pass. SunSpider reports a .7% speedup -- don't
believe his lies.

JavaScriptGlue:

Reviewed by Eric Seidel.

Updated to match the JavaScriptCore change to move virtual methods from
Interpreter to JSGlobalObject.


  • JSRun.cpp:
  • JSRun.h:
  • JSValueWrapper.cpp: (getThreadGlobalExecState):
  • JavaScriptGlue.cpp: (JSRunCopyGlobalObject): (JSRunEvaluate):

WebCore:

Reviewed by Eric Seidel.

Updated to match the JavaScriptCore change to move virtual methods from
Interpreter to JSGlobalObject.


Moved virtual ScriptInterpreter functions to Window.

WebKit/mac:

Reviewed by Eric Seidel.

Updated to match the JavaScriptCore change to move virtual methods from
Interpreter to JSGlobalObject.

  • WebView/WebFrame.mm: (-[WebFrame globalContext]): Use the toRef function instead of manually casting.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/kjs/interpreter.h

    r28309 r28328  
    7979  class Interpreter {
    8080    friend class Collector;
     81    friend class JSGlobalObject;
     82
    8183  public:
    8284    /**
     
    8587     */
    8688    Interpreter();
    87    
    88     virtual ~Interpreter(); // only deref should delete us
     89    ~Interpreter();
    8990
    9091    /**
     
    117118     */
    118119    JSGlobalObject* globalObject() const;
    119 
    120     /**
    121      * Returns the execution state object which can be used to execute
    122      * scripts using this interpreter at a the "global" level, i.e. one
    123      * with a execution context that has the global object as the "this"
    124      * value, and who's scope chain contains only the global object.
    125      *
    126      * Note: this pointer remains constant for the life of the interpreter
    127      * and should not be manually deleted.
    128      *
    129      * @return The interpreter global execution state object
    130      */
    131     virtual ExecState *globalExec();
    132120
    133121    /**
     
    281269    CompatMode compatMode() const { return m_compatMode; }
    282270   
    283     /**
    284      * Run the garbage collection. Returns true when at least one object
    285      * was collected; false otherwise.
    286      */
    287     static bool collect();
    288 
    289     /**
    290      * Called during the mark phase of the garbage collector. Subclasses
    291      * implementing custom mark methods must make sure to chain to this one.
    292      */
    293     virtual void mark();
    294 
    295271    static bool shouldPrintExceptions();
    296272    static void setShouldPrintExceptions(bool);
     
    299275    void restoreBuiltins (const SavedBuiltins&);
    300276   
    301     /**
    302      * Determine if the it is 'safe' to execute code in the target interpreter from an
    303      * object that originated in this interpreter.  This check is used to enforce WebCore
    304      * cross frame security rules.  In particular, attempts to access 'bound' objects are
    305      * not allowed unless isSafeScript returns true.
    306      */
    307     virtual bool isSafeScript(const Interpreter*) { return true; }
    308  
    309277    // Chained list of interpreters (ring)
    310278    static Interpreter* firstInterpreter() { return s_hook; }
     
    325293    bool timedOut();
    326294   
     295    ExecState m_globalExec; // This is temporarily public to help with bootstrapping.
     296
    327297protected:
    328     virtual bool shouldInterruptScript() const { return true; }
    329 
    330298    unsigned m_timeoutTime;
    331299
     
    345313    ExecState* m_currentExec;
    346314    JSGlobalObject* m_globalObject;
    347     ExecState m_globalExec;
    348315
    349316    // Chained list of interpreters (ring) - for collector
Note: See TracChangeset for help on using the changeset viewer.