Ignore:
Timestamp:
Sep 5, 2008, 9:58:40 PM (17 years ago)
Author:
Darin Adler
Message:

2008-09-05 Darin Adler <Darin Adler>

Reviewed by Geoff Garen.

1.007x as fast on SunSpider overall
1.167x as fast on SunSpider string/fasta

  • JavaScriptCore.exp: Updated.
  • kjs/SmallStrings.cpp: (KJS::SmallStrings::singleCharacterStringRep): Added.
  • kjs/SmallStrings.h: Added singleCharacterStringRep for clients that need just a UString, not a JSString.
  • kjs/identifier.cpp: (KJS::Identifier::add): Added special cases for single character strings so that the UString::Rep that ends up in the identifier table is the one from the single-character string optimization; otherwise we end up having to look it up in the identifier table over and over again. (KJS::Identifier::addSlowCase): Ditto. (KJS::Identifier::checkSameIdentifierTable): Made this function an empty inline in release builds so that callers don't have to put #ifndef NDEBUG at each call site.
  • kjs/identifier.h: (KJS::Identifier::add): Removed #ifndef NDEBUG around the calls to checkSameIdentifierTable. (KJS::Identifier::checkSameIdentifierTable): Added. Empty inline version for NDEBUG builds.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/kjs/SmallStrings.cpp

    r36006 r36124  
    102102}
    103103
     104UString::Rep* SmallStrings::singleCharacterStringRep(unsigned char character)
     105{
     106    if (!m_storage)
     107        m_storage.set(new SmallStringsStorage);
     108    return m_storage->rep(character);
    104109}
     110
     111}
Note: See TracChangeset for help on using the changeset viewer.