Changeset 43144 in webkit for trunk/JavaScriptCore/wtf/Vector.h


Ignore:
Timestamp:
May 2, 2009, 4:33:56 AM (16 years ago)
Author:
[email protected]
Message:

2009-05-02 Maciej Stachowiak <[email protected]>

Reviewed by Cameron Zwarich.

  • speed up the lexer in various ways

~2% command-line SunSpider speedup

  • parser/Lexer.cpp: (JSC::Lexer::setCode): Moved below shift() so it can inline. (JSC::Lexer::scanRegExp): Use resize(0) instead of clear() on Vectors, since the intent here is not to free the underlying buffer. (JSC::Lexer::lex): ditto; also, change the loop logic a bit for the main lexing loop to avoid branching on !m_done twice per iteration. Now we only check it once. (JSC::Lexer::shift): Make this ALWAYS_INLINE and tag an unusual branch as UNLIKELY
  • parser/Lexer.h: (JSC::Lexer::makeIdentifier): force to be ALWAYS_INLINE
  • wtf/Vector.h: (WTF::::append): force to be ALWAYS_INLINE (may have helped in ways other than parsing but it wasn't getting inlined in a hot code path in the lexer)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/wtf/Vector.h

    r42643 r43144  
    791791
    792792    template<typename T, size_t inlineCapacity> template<typename U>
    793     inline void Vector<T, inlineCapacity>::append(const U& val)
     793    ALWAYS_INLINE void Vector<T, inlineCapacity>::append(const U& val)
    794794    {
    795795        const U* ptr = &val;
Note: See TracChangeset for help on using the changeset viewer.