Changeset 2851 in webkit for trunk/JavaScriptCore/kjs/nodes.cpp


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

    r2847 r2851  
    206206Value ThisNode::evaluate(ExecState *exec)
    207207{
    208   return exec->context().thisValue();
     208  return exec->context().imp()->thisValue();
    209209}
    210210
     
    219219Reference ResolveNode::evaluateReference(ExecState *exec)
    220220{
    221   ScopeChain chain = exec->context().scopeChain();
     221  ScopeChain chain = exec->context().imp()->scopeChain();
    222222
    223223  while (!chain.isEmpty()) {
     
    16331633Value VarDeclNode::evaluate(ExecState *exec)
    16341634{
    1635   Object variable = Object::dynamicCast(exec->context().variableObject());
     1635  Object variable = Object::dynamicCast(exec->context().imp()->variableObject());
    16361636
    16371637  Value val;
     
    16571657void VarDeclNode::processVarDecls(ExecState *exec)
    16581658{
    1659   Object variable = exec->context().variableObject();
     1659  Object variable = exec->context().imp()->variableObject();
    16601660  variable.put(exec,ident, Undefined(), DontDelete);
    16611661}
     
    27802780void FuncDeclNode::processFuncDecl(ExecState *exec)
    27812781{
    2782   const ScopeChain sc = exec->context().imp()->scopeChain();
    2783 
    27842782  // TODO: let this be an object with [[Class]] property "Function"
    2785   FunctionImp *fimp = new DeclaredFunctionImp(exec, ident, body, sc);
     2783  FunctionImp *fimp = new DeclaredFunctionImp(exec, ident, body, exec->context().imp()->scopeChain());
    27862784  Object func(fimp); // protect from GC
    27872785
     
    28352833Value FuncExprNode::evaluate(ExecState *exec)
    28362834{
    2837   const ScopeChain sc = exec->context().scopeChain();
    2838   FunctionImp *fimp = new DeclaredFunctionImp(exec, Identifier::null, body, sc);
     2835  FunctionImp *fimp = new DeclaredFunctionImp(exec, Identifier::null, body, exec->context().imp()->scopeChain());
    28392836  Value ret(fimp);
    28402837  List empty;
Note: See TracChangeset for help on using the changeset viewer.