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.cpp

    r2821 r2851  
    4242// ------------------------------ Context --------------------------------------
    4343
    44 Context::Context(ContextImp *c)
    45 {
    46   rep = c;
    47 }
    48 
    49 Context::Context(const Context &c)
    50 {
    51   rep = c.rep;
    52 }
    53 
    54 Context& Context::operator=(const Context &c)
    55 {
    56   rep = c.rep;
    57   return *this;
    58 }
    59 
    60 Context::~Context()
    61 {
    62 }
    63 
    64 bool Context::isNull() const
    65 {
    66   return (rep == 0);
    67 }
    68 
    69 ContextImp *Context::imp() const
    70 {
    71   return rep;
    72 }
    73 
    74 const ScopeChain Context::scopeChain() const
     44const ScopeChain &Context::scopeChain() const
    7545{
    7646  return rep->scopeChain();
Note: See TracChangeset for help on using the changeset viewer.