Changeset 88083 in webkit
- Timestamp:
- Jun 3, 2011 5:43:42 PM (13 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r88082 r88083 1 2011-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 1 24 2011-06-03 Oliver Hunt <oliver@apple.com> 2 25 -
trunk/Source/JavaScriptCore/KeywordLookupGenerator.py
r88076 r88083 164 164 def printAsC(self): 165 165 print("namespace JSC {") 166 print("static inlinebool isIdentPart(int c);")166 print("static ALWAYS_INLINE bool isIdentPart(int c);") 167 167 # max length + 1 so we don't need to do any bounds checking at all 168 168 print("static const int maxTokenLength = %d;" % (self.maxLength() + 1)) -
trunk/Source/JavaScriptCore/parser/JSParser.cpp
r87177 r88083 100 100 }; 101 101 102 void next(unsigned lexType = 0)102 ALWAYS_INLINE void next(unsigned lexType = 0) 103 103 { 104 104 m_lastLine = m_token.m_info.line; … … 108 108 } 109 109 110 bool nextTokenIsColon()110 ALWAYS_INLINE bool nextTokenIsColon() 111 111 { 112 112 return m_lexer->nextTokenIsColon(); 113 113 } 114 114 115 bool consume(JSTokenType expected, unsigned flags = 0)115 ALWAYS_INLINE bool consume(JSTokenType expected, unsigned flags = 0) 116 116 { 117 117 bool result = m_token.m_type == expected; … … 121 121 } 122 122 123 bool match(JSTokenType expected)123 ALWAYS_INLINE bool match(JSTokenType expected) 124 124 { 125 125 return m_token.m_type == expected; 126 126 } 127 127 128 int tokenStart()128 ALWAYS_INLINE int tokenStart() 129 129 { 130 130 return m_token.m_info.startOffset; 131 131 } 132 132 133 int tokenLine()133 ALWAYS_INLINE int tokenLine() 134 134 { 135 135 return m_token.m_info.line; 136 136 } 137 137 138 int tokenEnd()138 ALWAYS_INLINE int tokenEnd() 139 139 { 140 140 return m_token.m_info.endOffset; -
trunk/Source/JavaScriptCore/parser/Lexer.cpp
r88082 r88083 358 358 } 359 359 360 static inlinebool isIdentPart(int c)360 static ALWAYS_INLINE bool isIdentPart(int c) 361 361 { 362 362 // 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.