Ignore:
Timestamp:
Nov 20, 2008, 2:27:34 PM (17 years ago)
Author:
[email protected]
Message:

2008-11-20 Sam Weinig <[email protected]>

Reviewed by Geoffrey Garen.

Speedup the lexer to offset coming re-parsing patch.

  • .6% progression on Sunspider.
  • bytecompiler/SegmentedVector.h: (JSC::SegmentedVector::shrink): Fixed bug where m_size would not be set when shrinking to 0.
  • parser/Lexer.cpp: (JSC::Lexer::Lexer): (JSC::Lexer::isIdentStart): Use isASCIIAlpha and isASCII to avoid going into ICU in the common cases. (JSC::Lexer::isIdentPart): Use isASCIIAlphanumeric and isASCII to avoid going into ICU in the common cases (JSC::isDecimalDigit): Use version in ASCIICType.h. Inlining it was a regression. (JSC::Lexer::isHexDigit): Ditto. (JSC::Lexer::isOctalDigit): Ditto. (JSC::Lexer::clear): Resize the m_identifiers SegmentedVector to initial capacity
  • parser/Lexer.h: Remove unused m_strings vector. Make m_identifiers a SegmentedVector<Identifier> to avoid allocating a new Identifier* for each identifier found. The SegmentedVector is need so we can passes references to the Identifier to the parser, which remain valid even when the vector is resized. (JSC::Lexer::makeIdentifier): Inline and return a reference to the added Identifier.
File:
1 edited

Legend:

Unmodified
Added
Removed
Note: See TracChangeset for help on using the changeset viewer.