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


Ignore:
Timestamp:
Nov 22, 2002, 1:04:55 AM (23 years ago)
Author:
darin
Message:

JavaScriptCore:

  • change ScopeChain to be a singly linked list shares tails, gives 11% gain on iBench
  • kjs/context.h: (ContextImp::pushScope): Make inline, use push instead of prepend, and pass imp pointer. (ContextImp::popScope): Make inline, use pop instead of removeFirst.
  • kjs/function.cpp: (DeclaredFunctionImp::DeclaredFunctionImp): No need to copy.
  • kjs/function_object.cpp: (FunctionObjectImp::construct): Use push instead of prepend, and pass imp pointer.
  • kjs/internal.cpp: (ContextImp::ContextImp): Use clear, push instead of prepend, and pass imp pointers.
  • kjs/nodes.cpp: (ResolveNode::evaluateReference): Use isEmpty, pop, and top instead of ScopeChainIterator.
  • kjs/object.h: Change _scope to be a NoRefScopeChain.
  • kjs/object.cpp: No need to initialize _scope any more, since it's not a NoRefScopeChain.
  • kjs/scope_chain.h: Rewrite, different implementation and interface.
  • kjs/scope_chain.cpp: More of the same.

WebCore:

  • khtml/ecma/kjs_dom.cpp: (DOMNode::pushEventHandlerScope): Change to push handlers on an existing scope chain rather than returning one. Name change too.
  • khtml/ecma/kjs_dom.h: More of the same.
  • khtml/ecma/kjs_html.cpp: (KJS::HTMLElement::pushEventHandlerScope): And here.
  • khtml/ecma/kjs_html.h: And here.
  • khtml/ecma/kjs_events.cpp: (JSEventListener::handleEvent): Use the pushEventHandlerScope function, and also don't worry about optimizing the "no change" case, because that already works pretty efficiently.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/kjs/nodes.cpp

    r2821 r2824  
    219219Reference ResolveNode::evaluateReference(ExecState *exec)
    220220{
    221   const ScopeChain chain = exec->context().scopeChain();
    222   ScopeChainIterator scope = chain.begin();
    223 
    224   while (scope != chain.end()) {
    225     ObjectImp *o = static_cast<ObjectImp*>((*scope).imp());
     221  ScopeChain chain = exec->context().scopeChain();
     222
     223  while (!chain.isEmpty()) {
     224    ObjectImp *o = chain.top();
    226225
    227226    //cout << "Resolve: looking at '" << ident.ascii() << "'"
     
    232231      return Reference(o, ident);
    233232    }
    234     scope++;
     233   
     234    chain.pop();
    235235  }
    236236
Note: See TracChangeset for help on using the changeset viewer.