Ignore:
Timestamp:
Nov 16, 2007, 2:43:36 PM (18 years ago)
Author:
[email protected]
Message:

2007-11-16 Mark Rowe <[email protected]>

Reviewed by Eric.

Replace strings, identifier, buffer8 and buffer16 members of Lexer with vectors.
SunSpider claims this is a 0.7% speedup.

  • kjs/lexer.cpp: (KJS::Lexer::Lexer): (KJS::Lexer::lex): (KJS::Lexer::record8): (KJS::Lexer::record16): (KJS::Lexer::scanRegExp): (KJS::Lexer::clear): (KJS::Lexer::makeIdentifier): (KJS::Lexer::makeUString):
  • kjs/lexer.h:
  • kjs/ustring.cpp: (KJS::UString::UString): Add a convenience constructor that takes a const Vector<UChar>&.
  • kjs/ustring.h:
File:
1 edited

Legend:

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

    r27842 r27859  
    459459    m_rep = Rep::create(c, length);
    460460}
     461
     462UString::UString(const Vector<UChar>& buffer)
     463{
     464    if (!buffer.size())
     465        m_rep = &Rep::empty;
     466    else
     467        m_rep = Rep::createCopying(buffer.data(), buffer.size());
     468}
     469
    461470
    462471UString::UString(const UString &a, const UString &b)
Note: See TracChangeset for help on using the changeset viewer.