Changeset 1837 in webkit for trunk/JavaScriptCore/kjs/nodes.h


Ignore:
Timestamp:
Aug 16, 2002, 12:43:56 AM (23 years ago)
Author:
mjs
Message:

Phase 1 of optimization to stop allocating references through the
collector. This step clearly splits evaluating to a reference and
evaluating to a value, and moves all of the reference-specific
operations from Value to Reference. A special ConstReference class
helps out for the one case where you need special reference
operations if the result is a reference, and not otherwise.

Also, Reference now inherits privately from Value, and there is a
new ReferenceList class that inherits privately from List, so the
uses of Reference and Value are now completely orthogonal. This
means that as the next step, their implementations can be
completely disentangled.

This step has no actual performance impact.

  • kjs/collector.cpp: (Collector::collect):
  • kjs/nodes.cpp: (Node::evaluateReference): (ResolveNode::evaluate): (ResolveNode::evaluateReference): (ElementNode::evaluate): (PropertyValueNode::evaluate): (AccessorNode1::evaluate): (AccessorNode1::evaluateReference): (AccessorNode2::evaluate): (AccessorNode2::evaluateReference): (ArgumentListNode::evaluateList): (NewExprNode::evaluate): (FunctionCallNode::evaluate): (PostfixNode::evaluate): (DeleteNode::evaluate): (VoidNode::evaluate): (TypeOfNode::evaluate): (PrefixNode::evaluate): (UnaryPlusNode::evaluate): (NegateNode::evaluate): (BitwiseNotNode::evaluate): (LogicalNotNode::evaluate): (MultNode::evaluate): (AddNode::evaluate): (ShiftNode::evaluate): (RelationalNode::evaluate): (EqualNode::evaluate): (BitOperNode::evaluate): (BinaryLogicalNode::evaluate): (ConditionalNode::evaluate): (AssignNode::evaluate): (CommaNode::evaluate): (VarDeclNode::evaluate): (ExprStatementNode::execute): (IfNode::execute): (DoWhileNode::execute): (WhileNode::execute): (ForNode::execute): (ForInNode::execute): (ReturnNode::execute): (WithNode::execute): (CaseClauseNode::evaluate): (SwitchNode::execute): (ThrowNode::execute):
  • kjs/nodes.h:
  • kjs/types.cpp: (ConstReference::ConstReference):
  • kjs/types.h:
  • kjs/value.h:
File:
1 edited

Legend:

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

    r1799 r1837  
    7676    virtual ~Node();
    7777    virtual Value evaluate(ExecState *exec) = 0;
     78    virtual Reference evaluateReference(ExecState *exec);
    7879    UString toString() const;
    7980    virtual void streamTo(SourceStream &s) const = 0;
     
    186187    ResolveNode(const UString *s) : ident(*s) { }
    187188    Value evaluate(ExecState *exec);
     189    virtual Reference evaluateReference(ExecState *exec);
    188190    virtual void streamTo(SourceStream &s) const;
    189191  private:
     
    285287    virtual bool deref();
    286288    Value evaluate(ExecState *exec);
     289    virtual Reference evaluateReference(ExecState *exec);
    287290    virtual void streamTo(SourceStream &s) const;
    288291  private:
     
    297300    virtual bool deref();
    298301    Value evaluate(ExecState *exec);
     302    virtual Reference evaluateReference(ExecState *exec);
    299303    virtual void streamTo(SourceStream &s) const;
    300304  private:
Note: See TracChangeset for help on using the changeset viewer.