Changeset 88083 in webkit


Ignore:
Timestamp:
Jun 3, 2011 5:43:42 PM (13 years ago)
Author:
oliver@apple.com
Message:

2011-06-03 Oliver Hunt <oliver@apple.com>

Reviewed by Gavin Barraclough.

GCC not inlining some functions that it really should be
https://bugs.webkit.org/show_bug.cgi?id=62075

Add ALWAYS_INLINE to a number of parsing and lexing functions
that should always be inlined. This gets us ~1.4% on my ad hoc
parser test.

  • KeywordLookupGenerator.py:
  • parser/JSParser.cpp: (JSC::JSParser::next): (JSC::JSParser::nextTokenIsColon): (JSC::JSParser::consume): (JSC::JSParser::match): (JSC::JSParser::tokenStart): (JSC::JSParser::tokenLine): (JSC::JSParser::tokenEnd):
  • parser/Lexer.cpp: (JSC::isIdentPart):
Location:
trunk/Source/JavaScriptCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r88082 r88083  
     12011-06-03  Oliver Hunt  <oliver@apple.com>
     2
     3        Reviewed by Gavin Barraclough.
     4
     5        GCC not inlining some functions that it really should be
     6        https://bugs.webkit.org/show_bug.cgi?id=62075
     7
     8        Add ALWAYS_INLINE to a number of parsing and lexing functions
     9        that should always be inlined.  This gets us ~1.4% on my ad hoc
     10        parser test.
     11
     12        * KeywordLookupGenerator.py:
     13        * parser/JSParser.cpp:
     14        (JSC::JSParser::next):
     15        (JSC::JSParser::nextTokenIsColon):
     16        (JSC::JSParser::consume):
     17        (JSC::JSParser::match):
     18        (JSC::JSParser::tokenStart):
     19        (JSC::JSParser::tokenLine):
     20        (JSC::JSParser::tokenEnd):
     21        * parser/Lexer.cpp:
     22        (JSC::isIdentPart):
     23
    1242011-06-03  Oliver Hunt  <oliver@apple.com>
    225
  • trunk/Source/JavaScriptCore/KeywordLookupGenerator.py

    r88076 r88083  
    164164    def printAsC(self):
    165165        print("namespace JSC {")
    166         print("static inline bool isIdentPart(int c);")
     166        print("static ALWAYS_INLINE bool isIdentPart(int c);")
    167167        # max length + 1 so we don't need to do any bounds checking at all
    168168        print("static const int maxTokenLength = %d;" % (self.maxLength() + 1))
  • trunk/Source/JavaScriptCore/parser/JSParser.cpp

    r87177 r88083  
    100100    };
    101101   
    102     void next(unsigned lexType = 0)
     102    ALWAYS_INLINE void next(unsigned lexType = 0)
    103103    {
    104104        m_lastLine = m_token.m_info.line;
     
    108108    }
    109109   
    110     bool nextTokenIsColon()
     110    ALWAYS_INLINE bool nextTokenIsColon()
    111111    {
    112112        return m_lexer->nextTokenIsColon();
    113113    }
    114114
    115     bool consume(JSTokenType expected, unsigned flags = 0)
     115    ALWAYS_INLINE bool consume(JSTokenType expected, unsigned flags = 0)
    116116    {
    117117        bool result = m_token.m_type == expected;
     
    121121    }
    122122
    123     bool match(JSTokenType expected)
     123    ALWAYS_INLINE bool match(JSTokenType expected)
    124124    {
    125125        return m_token.m_type == expected;
    126126    }
    127127
    128     int tokenStart()
     128    ALWAYS_INLINE int tokenStart()
    129129    {
    130130        return m_token.m_info.startOffset;
    131131    }
    132132
    133     int tokenLine()
     133    ALWAYS_INLINE int tokenLine()
    134134    {
    135135        return m_token.m_info.line;
    136136    }
    137137
    138     int tokenEnd()
     138    ALWAYS_INLINE int tokenEnd()
    139139    {
    140140        return m_token.m_info.endOffset;
  • trunk/Source/JavaScriptCore/parser/Lexer.cpp

    r88082 r88083  
    358358}
    359359
    360 static inline bool isIdentPart(int c)
     360static ALWAYS_INLINE bool isIdentPart(int c)
    361361{
    362362    // Character types are divided into two groups depending on whether they can be part of an
Note: See TracChangeset for help on using the changeset viewer.