Ignore:
Timestamp:
Mar 18, 2008, 9:23:21 PM (17 years ago)
Author:
Darin Adler
Message:

JavaScriptCore:

2008-03-18 Darin Adler <Darin Adler>

Reviewed by Maciej.

  • Speed up JavaScript built-in properties by changing the hash table to take advantage of the identifier objects

5% speedup for Acid3 test 26

  • JavaScriptCore.exp: Updated.
  • kjs/create_hash_table: Compute size of hash table large enough so that there are no collisions, but don't generate the hash table.
  • kjs/identifier.h: Made the add function that returns a PassRefPtr public.
  • kjs/lexer.cpp: (KJS::Lexer::lex): Updated for change to HashTable interface.
  • kjs/lookup.cpp: (KJS::HashTable::changeKeysToIdentifiers): Added. Finds the identifier for each property so the equality comparision can be done with pointer comparision.
  • kjs/lookup.h: Made the key be a union of char* with UString::Rep* so it can hold identifiers. Added a keysAreIdentifiers flag to the HashTable. Changed the Lookup functions to be member functions of HashTable instead.
  • kjs/object.cpp: (KJS::JSObject::deleteProperty): Update for change to HashTable. (KJS::JSObject::findPropertyHashEntry): Ditto. (KJS::JSObject::getPropertyAttributes): Ditto. (KJS::JSObject::getPropertyNames): Ditto.

WebCore:

2008-03-18 Darin Adler <Darin Adler>

Reviewed by Maciej.

  • Speed up JavaScript built-in properties by changing the hash table to take advantage of the identifier objects

5% speedup for Acid3 test 26

  • bindings/js/JSDOMWindowBase.cpp: (WebCore::JSDOMWindowBase::getOwnPropertySlot): Update for change to HashTable. (WebCore::JSDOMWindowBase::put): Ditto.
  • bindings/js/JSDOMWindowCustom.cpp: (WebCore::JSDOMWindow::customGetOwnPropertySlot): Ditto.
  • bindings/js/JSHTMLInputElementBase.cpp: (WebCore::JSHTMLInputElementBase::getOwnPropertySlot): Ditto.
  • bindings/js/JSHistoryCustom.cpp: (WebCore::JSHistory::customGetOwnPropertySlot): Ditto.
  • bindings/js/JSLocation.cpp: (WebCore::JSLocation::customGetOwnPropertySlot): Ditto. (WebCore::JSLocation::put): Ditto.
  • bindings/js/kjs_binding.cpp: (WebCore::nonCachingStaticFunctionGetter): Ditto.
  • bindings/scripts/CodeGeneratorJS.pm: Same changes as in the create_hash_table script.
File:
1 edited

Legend:

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

    r27206 r31147  
    6262        friend bool operator==(const Identifier&, const char*);
    6363   
    64         static void remove(UString::Rep* );
     64        static void remove(UString::Rep*);
    6565
    6666        static bool equal(const UString::Rep*, const char*);
    6767        static bool equal(const UString::Rep*, const UChar*, int length);
    6868        static bool equal(const UString::Rep*, const UString::Rep*);
     69
     70        static PassRefPtr<UString::Rep> add(const char*);
    6971
    7072    private:
     
    7678            { return equal(a._ustring.rep(), b); }
    7779       
    78         static PassRefPtr<UString::Rep> add(const char*);
    7980        static PassRefPtr<UString::Rep> add(const UChar*, int length);
    8081        static PassRefPtr<UString::Rep> add(UString::Rep* r)
Note: See TracChangeset for help on using the changeset viewer.