Changeset 1850 in webkit for trunk/JavaScriptCore/kjs/internal.h


Ignore:
Timestamp:
Aug 16, 2002, 12:07:48 PM (23 years ago)
Author:
mjs
Message:

Final step of the Reference change. Completely separate Reference
from Value, and eliminate ReferenceImp.

18% speedup on cvs-js-performance test.

  • kjs/internal.cpp, kjs/internal.h: Remove ReferenceImp.
  • kjs/nodes.cpp: (Node::evaluateReference): Use Reference::makeValueReference(), not ConstReference.
  • kjs/reference.cpp: (Reference::Reference): New implementation, handles both regular and value references. (Reference::makeValueReference): Incorporate functionality of ConstReference into this class. (Reference::getBase): New implementation (incorporates error vase for value references). (Reference::getPropertyName): New implementation (incorporates error case for value references). (Reference::putValue): New implementation (incorporates error case for value references). (Reference::deleteValue): New implementation (incorporates error case for value references). (Reference::getValue): New implementation (incorporates special case for value references). (Reference::isMutable): New implementation.
  • kjs/reference.h: New implementation that merges ReferenceImp into the stack object.
  • kjs/value.h, kjs/value.cpp: Removed all reference-related method.
File:
1 edited

Legend:

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

    r1824 r1850  
    143143  // ---------------------------------------------------------------------------
    144144
    145   class ReferenceImp : public ValueImp {
    146   public:
    147     ReferenceImp(const Value& v, const UString& p);
    148     ReferenceImp(const Value& v, unsigned p);
    149     virtual void mark();
    150 
    151     Value toPrimitive(ExecState *exec, Type preferred = UnspecifiedType) const;
    152     bool toBoolean(ExecState *exec) const;
    153     double toNumber(ExecState *exec) const;
    154     UString toString(ExecState *exec) const;
    155     Object toObject(ExecState *exec) const;
    156 
    157     Value getBase(ExecState *) const { return Value(base); }
    158     UString getPropertyName(ExecState *) const;
    159     Value getValue(ExecState *exec) const;
    160     void putValue(ExecState *exec, const Value& w);
    161     bool deleteValue(ExecState *exec);
    162 
    163     Type type() const { return ReferenceType; }
    164 
    165   private:
    166     ValueImp *base;
    167     bool propertyNameIsNumber;
    168     unsigned propertyNameAsNumber;
    169     mutable UString prop;
    170   };
    171  
    172   inline Reference::Reference(ReferenceImp *imp) : Value(imp) { }
    173 
    174145  class CompletionImp : public ValueImp {
    175146  public:
Note: See TracChangeset for help on using the changeset viewer.