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


Ignore:
Timestamp:
Nov 18, 2002, 5:01:16 PM (23 years ago)
Author:
mjs
Message:

JavaScriptCore:

Partway to removing Value from List. Created a marking List
variant, used it in place of ListImp.

  • kjs/internal.h: Removed List stuff.
  • kjs/internal.cpp: (InterpreterImp::mark): Call appropriate List method to do marking of empty ListImp.
  • kjs/object.h:
  • kjs/object.cpp: Use marking List instead of ListImp *.
  • kjs/types.h:
  • kjs/types.cpp: (List::List): New boolean needsMarking parameter. (List::operator=): Perform trickery related to needsMarking. (List::~List): Likewise. (List::mark): Mark the ListImp. (List::markEmptyList): (ListImp::*): Moved here fron internal.cpp, they will be integrated into the relevant List methods soon.

WebCore:

  • force-js-clean-timestamp: Rebuild for JSC changes.
File:
1 edited

Legend:

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

    r2256 r2741  
    139139  inline Number::Number(NumberImp *imp) : Value(imp) { }
    140140
    141   // ---------------------------------------------------------------------------
    142   //                            Internal type impls
    143   // ---------------------------------------------------------------------------
    144 
    145   /**
    146    * @internal
    147    */
    148   class ListNode {
    149     friend class List;
    150     friend class ListImp;
    151     friend class ListIterator;
    152     ListNode(Value val, ListNode *p, ListNode *n)
    153       : member(val.imp()), prev(p), next(n) {};
    154     ValueImp *member;
    155     ListNode *prev, *next;
    156   };
    157 
    158   class ListImp : public ValueImp {
    159     friend class ListIterator;
    160     friend class List;
    161     friend class InterpreterImp;
    162     friend class ObjectImp;
    163   private:
    164     ListImp();
    165     ~ListImp();
    166 
    167     Type type() const { return ListType; }
    168 
    169     virtual void mark();
    170 
    171     Value toPrimitive(ExecState *exec, Type preferred = UnspecifiedType) const;
    172     bool toBoolean(ExecState *exec) const;
    173     double toNumber(ExecState *exec) const;
    174     UString toString(ExecState *exec) const;
    175     Object toObject(ExecState *exec) const;
    176 
    177     void append(const Value& val);
    178     void prepend(const Value& val);
    179     void appendList(const List& lst);
    180     void prependList(const List& lst);
    181     void removeFirst();
    182     void removeLast();
    183     void remove(const Value &val);
    184     void clear();
    185     ListImp *copy() const;
    186     ListIterator begin() const { return ListIterator(hook->next); }
    187     ListIterator end() const { return ListIterator(hook); }
    188     //    bool isEmpty() const { return (hook->prev == hook); }
    189     bool isEmpty() const;
    190     int size() const;
    191     Value at(int i) const;
    192     Value operator[](int i) const { return at(i); }
    193     static ListImp* empty();
    194 
    195 #ifdef KJS_DEBUG_MEM
    196     static int count;
    197 #endif
    198   private:
    199     void erase(ListNode *n);
    200     ListNode *hook;
    201     static ListImp *emptyList;
    202   };
    203  
    204   inline List::List(ListImp *imp) : Value(imp) { }
    205 
    206141  /**
    207142   * @short The "label set" in Ecma-262 spec
Note: See TracChangeset for help on using the changeset viewer.