Ignore:
Timestamp:
Nov 24, 2002, 2:37:44 PM (23 years ago)
Author:
darin
Message:

JavaScriptCore:

  • changed ScopeChain to not ref each item in the chain, and use marking instead; gains 1% on JavaScript iBench
  • kjs/context.h: Return chain by reference.
  • kjs/internal.cpp: (ContextImp::mark): Mark the scope chain.
  • kjs/interpreter.cpp: (Context::scopeChain): Return chain by reference.
  • kjs/interpreter.h: Make some Context methods inline.
  • kjs/nodes.cpp: (ThisNode::evaluate): Get at ContextImp directly. (ResolveNode::evaluateReference): Ditto. (VarDeclNode::evaluate): Ditto. (VarDeclNode::processVarDecls): Ditto. (FuncDeclNode::processFuncDecl): Pass ScopeChain directly to avoid copying. (FuncExprNode::evaluate): Ditto.
  • kjs/object.cpp: Make scope and setScope inline.
  • kjs/object.h: Make scope return a chain by reference. Make scope and setScope both be inline. Use a normal ScopeChain instead of NoRefScopeChain since they are now one and the same.
  • kjs/scope_chain.cpp: Remove all the code to ref and deref objects. Merge NoRefScopeChain in with ScopeChain since they both work this way now.
  • kjs/scope_chain.h: Remove NoRefScopeChain and simplify the ref counts. Make more functions inline.

WebCore:

  • force-js-clean-timestamp: Touch for ScopeChain change.
File:
1 edited

Legend:

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

    r2821 r2851  
    5454  class Context {
    5555  public:
    56     Context(ContextImp *);
    57     Context(const Context &c);
    58     Context& operator=(const Context &c);
    59     virtual ~Context();
    60 
    61     bool isNull() const;
    62     ContextImp *imp() const;
     56    Context(ContextImp *i) : rep(i) { }
     57
     58    ContextImp *imp() const { return rep; }
    6359
    6460    /**
     
    6965     * @return The execution context's scope chain
    7066     */
    71     const ScopeChain scopeChain() const;
     67    const ScopeChain &scopeChain() const;
    7268
    7369    /**
     
    105101     */
    106102    const Context callingContext() const;
     103
    107104  private:
    108105    ContextImp *rep;
     
    380377     * @return The current execution state context
    381378     */
    382     const Context context() const { return _context; }
     379    Context context() const { return _context; }
    383380
    384381    void setException(const Value &e) { _exception = e; }
Note: See TracChangeset for help on using the changeset viewer.