Ignore:
Timestamp:
May 25, 2008, 12:15:42 AM (17 years ago)
Author:
[email protected]
Message:

Reviewed by Darin.

Changed regular expression matching result array to be lazily filled, because many callers
only care about it being non-null.

2% improvement on Acid3 test 26.

  • kjs/array_instance.cpp: Added a void* member to ArrayStorage for ArrayInstance subclasses to use.
  • kjs/array_instance.h: (KJS::ArrayInstance::lazyCreationData): (KJS::ArrayInstance::setLazyCreationData): Added methods to access it from subclasses.
  • kjs/regexp_object.cpp: (KJS::RegExpMatchesArray::RegExpMatchesArray): (KJS::RegExpMatchesArray::getOwnPropertySlot): (KJS::RegExpMatchesArray::put): (KJS::RegExpMatchesArray::deleteProperty): (KJS::RegExpMatchesArray::getPropertyNames): (KJS::RegExpMatchesArray::fillArrayInstanceIfNeeded): (KJS::RegExpMatchesArray::~RegExpMatchesArray): (KJS::RegExpObjectImp::arrayOfMatches): RegExpMatchesArray is a subclass of ArrayInstance that isn't filled until accessed for the first time.
File:
1 edited

Legend:

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

    r33967 r34118  
    5454    void sort(ExecState*, JSObject* compareFunction);
    5555
     56  protected:
     57    void* lazyCreationData();
     58    void setLazyCreationData(void*);
     59
    5660  private:
    5761    static JSValue* lengthGetter(ExecState*, JSObject*, const Identifier&, const PropertySlot&);
Note: See TracChangeset for help on using the changeset viewer.